Skip to content

Commit dd2a76f

Browse files
Update to new version : 5.1.0.0
1 parent 6df1b45 commit dd2a76f

File tree

667 files changed

+732
-74
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

667 files changed

+732
-74
lines changed

underautomation/fanuc/cgtp/cgtp_client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import typing
2+
from __future__ import annotation
23
from underautomation.fanuc.cgtp.cgtp_client_base import CgtpClientBase
34
from UnderAutomation.Fanuc.Cgtp import CgtpClient as cgtp_client
45

underautomation/fanuc/cgtp/cgtp_client_base.py

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
import typing
2+
from __future__ import annotation
23
from underautomation.fanuc.common.languages import Languages
34
from underautomation.fanuc.cgtp.program_sub_type import ProgramSubType
5+
from underautomation.fanuc.cgtp.io_port_type import IoPortType
6+
from underautomation.fanuc.common.cartesian_position import CartesianPosition
7+
from underautomation.fanuc.common.joints_position import JointsPosition
48
from UnderAutomation.Fanuc.Cgtp import CgtpClientBase as cgtp_client_base
59
from UnderAutomation.Fanuc.Common import Languages as languages
610
from UnderAutomation.Fanuc.Cgtp import ProgramSubType as program_sub_type
11+
from UnderAutomation.Fanuc.Cgtp import IoPortType as io_port_type
712

813
class CgtpClientBase:
914
'''Base implementation for the CGTP Web Server client.'''
@@ -17,7 +22,7 @@ def disconnect(self) -> None:
1722
'''Disconnect from the CGTP Web Server. After calling this method, the client must be reconnected before it can be used again.'''
1823
self._instance.Disconnect()
1924

20-
def abort_task(self, progName: str="None") -> None:
25+
def abort_task(self, progName: str=None) -> None:
2126
'''Abort the task specified by progName. Set to null to abort all user tasks.'''
2227
self._instance.AbortTask(progName)
2328

@@ -80,7 +85,7 @@ def set_program_sub_type(self, progName: str, subType: ProgramSubType) -> None:
8085
'''Set the sub-type of program progName.'''
8186
self._instance.SetProgramSubType(progName, program_sub_type(int(subType)))
8287

83-
def create_program(self, progName: str, owner: str="None", comment: str="None", defaultGroup: int=0, subType: ProgramSubType=ProgramSubType.None) -> None:
88+
def create_program(self, progName: str, owner: str=None, comment: str=None, defaultGroup: int=0, subType: ProgramSubType=ProgramSubType.None_) -> None:
8489
'''Create a new TP program on the controller.
8590
8691
:param progName: New program name
@@ -107,14 +112,42 @@ def pause_all_programs(self) -> None:
107112
'''Pause program execution on the controller.'''
108113
self._instance.PauseAllPrograms()
109114

110-
def read_variable_as_string(self, varName: str, progName: str="None") -> str:
115+
def read_variable_as_string(self, varName: str, progName: str=None) -> str:
111116
'''Read the value of variable varName in program progName.'''
112117
return self._instance.ReadVariableAsString(varName, progName)
113118

114-
def write_variable(self, varName: str, value: str, progName: str="None") -> None:
119+
def write_variable(self, varName: str, value: str, progName: str=None) -> None:
115120
'''Write value to variable varName in program progName.'''
116121
self._instance.WriteVariable(varName, value, progName)
117122

123+
def read_io(self, portType: IoPortType, index: int) -> int:
124+
'''Read the value of I/O port at index of type portType.'''
125+
return self._instance.ReadIo(io_port_type(int(portType)), index)
126+
127+
def write_io(self, portType: IoPortType, index: int, value: int) -> None:
128+
'''Set the value of I/O port at index of type portType.'''
129+
self._instance.WriteIo(io_port_type(int(portType)), index, value)
130+
131+
def get_io_simulation_status(self, portType: IoPortType, index: int) -> bool:
132+
'''Check whether I/O port at index of type portType is simulated.'''
133+
return self._instance.GetIoSimulationStatus(io_port_type(int(portType)), index)
134+
135+
def simulate_io(self, portType: IoPortType, index: int) -> None:
136+
'''Set I/O port at index of type portType to simulated.'''
137+
self._instance.SimulateIo(io_port_type(int(portType)), index)
138+
139+
def unsimulate_io(self, portType: IoPortType, index: int) -> None:
140+
'''Remove simulation from I/O port at index of type portType.'''
141+
self._instance.UnsimulateIo(io_port_type(int(portType)), index)
142+
143+
def read_cartesian_position(self, groupNum: int=1) -> CartesianPosition:
144+
'''Read the current Cartesian position of motion group groupNum.'''
145+
return CartesianPosition(None, None, None, None, None, None, None, self._instance.ReadCartesianPosition(groupNum))
146+
147+
def read_joint_position(self, groupNum: int=1) -> JointsPosition:
148+
'''Read the current joint angles of motion group groupNum.'''
149+
return JointsPosition(None, None, None, None, None, None, None, None, None, self._instance.ReadJointPosition(groupNum))
150+
118151
def list_files(self, pathName: str="MD:") -> typing.List[str]:
119152
'''List files at the specified path on the controller.'''
120153
return self._instance.ListFiles(pathName)

underautomation/fanuc/cgtp/cgtp_exception.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import typing
2+
from __future__ import annotation
23
from UnderAutomation.Fanuc.Cgtp import CgtpException as cgtp_exception
34

45
class CgtpException:

underautomation/fanuc/cgtp/internal/cgtp_client_internal.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import typing
2+
from __future__ import annotation
23
from underautomation.fanuc.cgtp.cgtp_client_base import CgtpClientBase
34
from UnderAutomation.Fanuc.Cgtp.Internal import CgtpClientInternal as cgtp_client_internal
45

underautomation/fanuc/cgtp/internal/cgtp_connect_parameters_base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import typing
2+
from __future__ import annotation
23
from UnderAutomation.Fanuc.Cgtp.Internal import CgtpConnectParametersBase as cgtp_connect_parameters_base
34

45
class CgtpConnectParametersBase:

underautomation/fanuc/cgtp/program_sub_type.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
class ProgramSubType(IntEnum):
44
'''Sub-type of a TP program on the controller.'''
5+
None_ = 0 # No specific sub-type.
56
Job = 1 # Job program.
67
Process = 2 # Process program.
78
Macro = 3 # Macro program.

underautomation/fanuc/common/cartesian_position.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import typing
2+
from __future__ import annotation
23
from underautomation.fanuc.common.configuration import Configuration
34
from underautomation.fanuc.common.xyz_position import XYZPosition
45
from UnderAutomation.Fanuc.Common import CartesianPosition as cartesian_position

underautomation/fanuc/common/cartesian_position_with_tool.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import typing
2+
from __future__ import annotation
23
from underautomation.fanuc.common.cartesian_position import CartesianPosition
34
from UnderAutomation.Fanuc.Common import CartesianPositionWithTool as cartesian_position_with_tool
45

underautomation/fanuc/common/cartesian_position_with_user_frame.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import typing
2+
from __future__ import annotation
23
from underautomation.fanuc.common.cartesian_position_with_tool import CartesianPositionWithTool
34
from UnderAutomation.Fanuc.Common import CartesianPositionWithUserFrame as cartesian_position_with_user_frame
45

underautomation/fanuc/common/cgtp_connect_parameters.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import typing
2+
from __future__ import annotation
23
from underautomation.fanuc.cgtp.internal.cgtp_connect_parameters_base import CgtpConnectParametersBase
34
from UnderAutomation.Fanuc.Common import CgtpConnectParameters as cgtp_connect_parameters
45

0 commit comments

Comments
 (0)