13. Extended Axis

13.1. Setting the 485 Extended Axis Parameters

New in version python: SDK-v2.0.3

Prototype

AuxServoSetParam(servoId,servoCompany,servoModel,servoSoftVersion, servoResolution,axisMechTransRatio)

Description

Setting the 485 extended axis parameters

Mandatory parameters

  • servoId: servo drive ID, range [1-15], corresponds to slave ID;

  • servoCompany: servo drive manufacturer, 1 - Dynatec;

  • servoModel: Servo drive model, 1-FD100-750C;

  • servoSoftVersion: servo drive software version, 1-V1.0;

  • servoResolution: encoder resolution;

  • axisMechTransRatio: mechanical transmission ratio;

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.2. Getting 485 Expansion Axis Configuration Parameters

New in version python: SDK-v2.0.3

Prototype

AuxServoGetParam(servoId)

Description

Get 485 extended axis configuration parameters

Mandatory parameters

  • servoId: servo drive ID, range [1-15], corresponding to slave ID;

Default parameters

NULL

Return Value

  • errorcode Success-0 Failure- errcode.

  • servoCompany: servo drive manufacturer, 1 - Dynatec;

  • servoModel: servo drive model, 1-FD100-750C;

  • servoSoftVersion: servo drive software version, 1-V1.0;

  • servoResolution: encoder resolution;

  • axisMechTransRatio: mechanical transmission ratio;

13.3. Setting the 485 expansion axis enable/disable

New in version python: SDK-v2.0.3

Prototype

AuxServoEnable(servoId,status)

Description

Setting the 485 extension axis to enable/de-enable

Mandatory parameters

  • servoId: servo drive ID, range [1-15], corresponds to slave ID;

  • status: enabling status, 0-de-enabling, 1-enabling;

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.4. Setting the 485 Extended Axis Control Mode

New in version python: SDK-v2.0.3

Prototype

AuxServoSetControlMode(servoId,mode)

Description

Setting the 485 Extended Axis Control Mode

Mandatory parameters

  • servoId: servo drive ID, range [1-15], corresponds to slave ID;

  • mode: control mode, 0-position mode, 1-velocity mode;

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.5. Setting the 485 extended axis target position (position mode)

New in version python: SDK-v2.0.3

Prototype

AuxServoSetTargetPos(servoId,pos,speed)

Description

Setting the 485 extended axis target position (position mode)

Mandatory parameters

  • servoId: servo drive ID, range [1-15], corresponds to slave ID;

  • pos: target position, mm or °;

  • speed: target speed, mm/s or °/s;

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.6. Setting the 485 extended axis target torque (torque mode)-not yet available

New in version python: SDK-v2.0.3

prototype

AuxServoSetTargetTorque(servoId,torque)

Description

Setting the 485 extended axis target torque (torque mode)

Mandatory parameters

  • servoId: servo drive ID, range [1-15], corresponds to slave ID;

  • torque: target moment, Nm;

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.7. Setting the 485 extended axis back to zero

New in version python: SDK-v2.0.3

Prototype

AuxServoHoming(servoId,mode,searchVel,latchVel)

Description

Setting the 485 extension axis back to zero

Mandatory parameters

  • servoId: servo drive ID, range [1-15], corresponds to slave ID;

  • mode: return to zero mode, 1 - return to zero at current position; 2 - return to zero at negative limit; 3 - return to zero at positive limit.

  • searchVel: return-to-zero velocity, mm/s or °/s.

  • latchVel: hoop speed, mm/s or °/s;

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.8. Clearing 485 Expansion Axis Error Messages

New in version python: SDK-v2.0.3

Prototype

AuxServoClearError(servoId)

Description

Clearing 485 Extended Axis Error Message

Mandatory parameters

  • servoId: servo drive ID, range [1-15], corresponding to slave ID;

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.9. Get 485 extended axis servo status

New in version python: SDK-v2.0.3

prototype

AuxServoGetStatus(servoId)

Description

Get 485 extended axis servo status

Mandatory parameters

  • servoId: servo drive ID, range [1-15], corresponding to slave ID;

Default parameters

NULL

Return Value

  • errorcode Success-0 Failure- errcode.

  • servoErrCode: servo drive error code

  • servoState: servo drive state bit0:0-not enabled; 1-enabled; bit1:0-not in motion; 1-being in motion; bit2 0-positive limit not triggered; 1-positive limit triggered; bit3 0-negative limit not triggered; 1-negative limit triggered; bit4 0-positioning not completed; 1-positioning complete; bit5: 0-not zero return; 1 -zero return complete;

  • servoPos: servo current position mm or °;

  • servoSpeed: servo current speed mm/s or °/s;

  • servoTorque: servo current torque Nm;

13.10. Setting the 485 extended axis target speed (velocity mode)

New in version python: SDK-v2.0.3

Prototype

AuxServoSetTargetSpeed(servoId,speed)

Description

Setting the 485 extended axis target speed (velocity mode)

Mandatory parameters

  • servoId: servo drive ID, range [1-15], corresponds to slave ID;

  • speed: target speed, mm/s or °/s;

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.11. Setting the 485 extended axis data axis number in the status feedback

New in version python: SDK-v2.0.3

Prototype

AuxServosetStatusID(servoId)

Description

Sets the 485 extended axis data axis number in status feedback

Mandatory parameters

  • servoId: servo drive ID, range [1-15], corresponding to slave ID;

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.12. Setting the 485 Extended Axis Motion Acceleration and Deceleration Speed

New in version python: SDK-v2.0.5

Prototype

AuxServoSetAcc(acc, dec)

Description

Sets the 485 extended axis motion acceleration and deceleration speeds.

Mandatory parameters

  • acc: 485 extended axis motion acceleration

  • dec: 485 extended axis motion deceleration

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.13. Setting the 485 extended axis emergency stop acceleration and deceleration speeds

New in version python: SDK-v2.0.5

Prototype

AuxServoSetEmergencyStopAcc(acc, dec)

Description

Setting the 485 extended axis emergency stop acceleration and deceleration speed

Mandatory parameters

  • acc: 485 extended axis emergency stop acceleration

  • dec: 485 extended axis emergency stop deceleration

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.14. Get 485 Extended Axis Motion Acceleration and Deceleration

New in version python: SDK-v2.0.5

Prototype

AuxServoGetAcc()

Description

Get 485 extended axis motion plus or minus velocity

Mandatory parameters

NULL

Default parameters

NULL

Return Value

  • errorcode Success-0 Failure- errcode

  • acc: 485 extended axis motion acceleration

  • dec: 485 extended axis motion deceleration

13.15. Get 485 extended axis emergency stop acceleration and deceleration speeds

New in version python: SDK-v2.0.5

Prototype

AuxServoGetEmergencyStopAcc()

Description

Get 485 extended axis emergency stop acceleration and deceleration speed

Mandatory parameters

NULL

Default parameters

NULL

Return Value

  • errorcode Success-0 Failure- errcode

  • acc: 485 extended axis emergency stop acceleration

  • dec: 485 extended axis emergency stop deceleration

13.16. Extended axis control code example

 1from fairino import Robot
 2import time
 3# Establish a connection with the robot controller and return a robot object if the connection is successful
 4robot = Robot.RPC('192.168.58.2')
 5retval = robot.AuxServoSetParam(1, 1, 1, 1, 131072, 15.45)
 6print(f"AuxServoSetParam is: {retval}")
 7servoCompany = 0
 8servoModel = 0
 9servoSoftVersion = 0
10servoResolution = 0
11axisMechTransRatio = 0.0
12retval, servoCompany, servoModel, servoSoftVersion, servoResolution, axisMechTransRatio = robot.AuxServoGetParam(1)
13print(f"servoCompany {servoCompany}\n"
14      f"servoModel {servoModel}\n"
15      f"servoSoftVersion {servoSoftVersion}\n"
16      f"servoResolution {servoResolution}\n"
17      f"axisMechTransRatio {axisMechTransRatio}\n")
18retval = robot.AuxServoSetParam(1, 10, 11, 12, 13, 14)
19print(f"AuxServoSetParam is: {retval}")
20retval, servoCompany, servoModel, servoSoftVersion, servoResolution, axisMechTransRatio = robot.AuxServoGetParam(1)
21print(f"servoCompany {servoCompany}\n"
22      f"servoModel {servoModel}\n"
23      f"servoSoftVersion {servoSoftVersion}\n"
24      f"servoResolution {servoResolution}\n"
25      f"axisMechTransRatio {axisMechTransRatio}\n")
26retval = robot.AuxServoSetParam(1, 1, 1, 1, 131072, 36)
27print(f"AuxServoSetParam is: {retval}")
28time.sleep(3)
29robot.AuxServoSetAcc(3000, 3000)
30robot.AuxServoSetEmergencyStopAcc(5000, 5000)
31time.sleep(1)
32emagacc = 0.0
33emagdec = 0.0
34acc = 0.0
35dec = 0.0
36error,emagacc, emagdec = robot.AuxServoGetEmergencyStopAcc()
37print(f"emergency acc is {emagacc}  dec is {emagdec}")
38error,acc, dec = robot.AuxServoGetAcc()
39print(f"acc is {acc}  dec is {dec}")
40robot.AuxServoSetControlMode(1, 0)
41time.sleep(2)
42retval = robot.AuxServoEnable(1, 0)
43print(f"AuxServoEnable disenable {retval}")
44time.sleep(1)
45servoErrCode = 0
46servoState = 0
47servoPos = 0.0
48servoSpeed = 0.0
49servoTorque = 0.0
50retval, servoErrCode, servoState, servoPos, servoSpeed, servoTorque = robot.AuxServoGetStatus(1)
51print(f"AuxServoGetStatus servoState {servoState}")
52time.sleep(1)
53retval = robot.AuxServoEnable(1, 1)
54print(f"AuxServoEnable enable {retval}")
55time.sleep(1)
56retval, servoErrCode, servoState, servoPos, servoSpeed, servoTorque = robot.AuxServoGetStatus(1)
57print(f"AuxServoGetStatus servoState {servoState}")
58time.sleep(1)
59retval = robot.AuxServoHoming(1, 1, 5, 1,100)
60print(f"AuxServoHoming {retval}")
61time.sleep(3)
62retval = robot.AuxServoSetTargetPos(1, 200, 30,100)
63print(f"AuxServoSetTargetPos {retval}")
64time.sleep(1)
65retval, servoErrCode, servoState, servoPos, servoSpeed, servoTorque = robot.AuxServoGetStatus(1)
66print(f"AuxServoGetStatus servoSpeed {servoSpeed}")
67time.sleep(8)
68robot.AuxServoSetControlMode(1, 1)
69time.sleep(2)
70robot.AuxServoEnable(1, 0)
71time.sleep(1)
72robot.AuxServoEnable(1, 1)
73time.sleep(1)
74robot.AuxServoSetTargetSpeed(1, 100, 80)
75time.sleep(5)
76robot.AuxServoSetTargetSpeed(1, 0, 80)
77robot.CloseRPC()

13.17. Parameter configuration for UDP extended axis communication

New in version python: SDK-v2.1.2

prototype

ExtDevSetUDPComParam(ip, port, period, lossPkgTime, lossPkgNum, disconnectTime, reconnectEnable, reconnectPeriod, reconnectNum, selfConnect)

Description

UDP Extended Axis Communication Parameter Configuration

Mandatory parameters

  • ip: PLC IP address;

  • port: port number;

  • period: communication period (ms, not open yet);

  • lossPkgTime: packet loss detection time (ms);

  • lossPkgNum: number of packets lost;

  • disconnectTime: the length of the communication disconnect confirmation;

  • reconnectEnable: communication disconnection auto reconnect enable 0-not enable 1-enable;

  • reconnectPeriod: reconnect period interval (ms);

  • reconnectNum: number of reconnections

  • selfConnect: Whether the connection is automatically established upon power-off and restart; 0- No connection established; 1- Establish a connection

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.18. Get UDP extended axis communication parameters

New in version python: SDK-v2.0.4

Prototype

ExtDevGetUDPComParam()

Description

Get UDP extended axis communication parameters

Mandatory parameters

NULL

Default parameters

NULL

Return Value

  • Error Code Success-0 Failure- errcode;

  • ip: PLC IP address;

  • port: port number;

  • period: communication period (ms, not open yet);

  • lossPkgTime: packet loss detection time (ms);

  • lossPkgNum: number of packets lost;

  • disconnectTime: the length of the communication disconnect confirmation;

  • reconnectEnable: communication disconnection auto reconnect enable 0-not enable 1-enable;

  • reconnectPeriod: reconnect period interval (ms);

  • reconnectNum: number of reconnections

  • reconnectNum: Number of reconnection attempts

  • selfConnect: Whether to automatically reconnect after control box restart; 0-no reconnection; 1-reconnect

13.19. Load UDP communication

New in version python: SDK-v2.0.4

Prototype

ExtDevLoadUDPDriver()

Description

Load UDP communication

Mandatory parameters

NULL

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.20. Offloading UDP communication

New in version python: SDK-v2.0.4

Prototype

ExtDevUnloadUDPDriver()

Description

Offloading UDP communication

Mandatory parameters

NULL

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.21. UDP Extended Axis Communication Recovery after Abnormal Disconnection

New in version python: SDK-v2.0.4

prototype

ExtDevUDPClientComReset()

Description

UDP Extended Axis Communication Abnormally Disconnected After Restoring Connection

Mandatory parameters

NULL

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.22. UDP extension axis communication is closed after abnormal disconnection.

New in version python: SDK-v2.0.4

Prototype

ExtDevUDPClientComClose()

Description

UDP Extended Axis Communication Abnormal Disconnect Closes Communication

Mandatory parameters

NULL

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.23. UDP Extended Axis Parameter Configuration

New in version python: SDK-v2.0.4

Prototype

ExtAxisParamConfig(axisId, axisType, axisDirection, axisMax, axisMin, axisVel, axisAcc,axisLead, encResolution, axisOffect. axisCompany, axisModel, axisEncType)

Description

UDP Extended Axis Parameter Configuration

Mandatory parameters

  • axisId: axis number [1-4];

  • axisType: extended axis type 0 - translation; 1 - rotation;

  • axisDirection: extended axis direction 0 - forward; 1 - reverse;

  • axisMax: Maximum position of the extended axis in mm;

  • axisMin: Extended axis minimum position in mm;

  • axisVel: speed mm/s;

  • axisAcc: acceleration mm/s2;

  • axisLead: lead in mm;

  • encResolution: encoder resolution;

  • axisOffect: Extended axis offset from the start of the weld;

  • axisCompany: drive manufacturers 1-Hochuan; 2-HuiChuan; 3-Panasonic;

  • axisModel: Drive Model 1-Hochuan-SV-XD3EA040L-E, 2-Hochuan-SV-X2EA150A-A, 1-HuiChuan-SV620PT5R4I, 1-Panasonic-MADLN15SG, 2-Panasonic-MSDLN25SG, 3-Panasonic-MCDLN35SG;

  • axisEncType: encoder type 0-incremental; 1-absolute;

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.24. Setting the extended robot position relative to the extended axis

New in version python: SDK-v2.0.4

Prototype

SetRobotPosToAxis(installType)

Description

Set the position of the extended robot relative to the extended axis

Mandatory parameters

  • installType: 0 - robot mounted on external axis, 1 - robot mounted outside external axis;

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.25. Setting the extended axis system DH parameter configuration

New in version python: SDK-v2.0.4

Prototype

SetAxisDHParaConfig(axisConfig,axisDHd1,axisDHd2,axisDHd3,axisDHd4,axisDHa1,axisDHa2,axisDHa3,axisDHa4)

Description

Sets the extended axis system DH parameter configuration

Mandatory parameters

  • axisConfig: external axis configuration, 0 - single degree of freedom linear slide, 1 - two degree of freedom L-type indexer, 2 - three degree of freedom, 3 - four degree of freedom, 4 - single degree of freedom indexer;

  • axisDHd1: external axis DH parameter d1 mm;

  • axisDHd2: external axis DH parameter d2 mm;

  • axisDHd3: external axis DH parameter d3 mm;

  • axisDHd4: external axis DH parameter d4 mm;

  • axisDHa1: external axis DH parameter a1 mm;

  • axisDHa2: external axis DH parameter a2 mm;

  • axisDHa3: external axis DH parameter a3 mm;

  • axisDHa4: external axis DH parameter a4 mm;

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.26. UDP Extended Axis Enable

New in version python: SDK-v2.0.4

Prototype

ExtAxisServoOn(axisID, status)

description

UDP Extended Axis Enable

Mandatory parameters

  • axisID: axis number [1-4];

  • status: 0-de-enable; 1-enable;

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.27. UDP Extended Axis Zero Return

New in version python: SDK-v2.0.4

Prototype

ExtAxisSetHoming(axisID, mode, searchVel, latchVel)

Description

UDP extended axis back to zero

Mandatory parameters

  • axisID: axis number [1-4];

  • mode: return to zero mode 0 current position return to zero, 1 negative limit return to zero, 2 - positive limit return to zero;

  • searchVel: search velocity (mm/s);

  • latchVel: zeroing hoop speed (mm/s);

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.28. UDP Extended Axis Tap Start

New in version python: SDK-v2.0.4

Prototype

ExtAxisStartJog( axisID, direction, vel, acc, maxDistance)

Description

UDP Extended Axis Tap Start

Mandatory parameters

  • axisID: axis number [1-4];

  • direction: direction of rotation 0 - reverse; 1 - forward;

  • vel: velocity (mm/s);

  • acc: acceleration (mm/s);

  • maxDistance: maximum pointing distance;

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.29. UDP Extended Axis Tap Stop

New in version python: SDK-v2.0.4

Prototype

ExtAxisStopJog(axisID)

Description

UDP Extended Axis Tap Stop

Mandatory parameters

  • axisID: axis number [1-4];

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.30. Example of UDP extension axis configuration and tapping code

 1from fairino import Robot
 2import time
 3# Establish a connection with the robot controller and return a robot object if the connection is successful
 4robot = Robot.RPC('192.168.58.2')
 5rtn = robot.ExtDevSetUDPComParam("192.168.58.88", 2021, 2, 100, 3, 200, 1, 100, 5, 1)
 6print(f"ExtDevSetUDPComParam rtn is {rtn}")
 7ip = ""
 8port = 0
 9period = 0
10lossPkgTime = 0
11lossPkgNum = 0
12disconnectTime = 0
13reconnectEnable = 0
14reconnectPeriod = 0
15reconnectNum = 0
16rtn,[ip, port, period, lossPkgTime, lossPkgNum,disconnectTime, reconnectEnable, reconnectPeriod, reconnectNum] = robot.ExtDevGetUDPComParam()
17param_str = (f"\nip {ip}\nport {port}\nperiod {period}\nlossPkgTime {lossPkgTime}"
18             f"\nlossPkgNum {lossPkgNum}\ndisConntime {disconnectTime}"
19             f"\nreconnecable {reconnectEnable}\nreconnperiod {reconnectPeriod}"
20             f"\nreconnnun {reconnectNum}")
21print(f"ExtDevGetUDPComParam rtn is {rtn}{param_str}")
22robot.ExtDevLoadUDPDriver()
23rtn = robot.ExtAxisServoOn(1, 1)
24print(f"ExtAxisServoOn axis id 1 rtn is {rtn}")
25rtn = robot.ExtAxisServoOn(2, 1)
26print(f"ExtAxisServoOn axis id 2 rtn is {rtn}")
27time.sleep(2)
28robot.ExtAxisSetHoming(1, 0, 10, 2)
29time.sleep(2)
30rtn = robot.ExtAxisSetHoming(2, 0, 10, 2)
31print(f"ExtAxisSetHoming rtn is {rtn}")
32time.sleep(4)
33rtn = robot.SetRobotPosToAxis(1)
34print(f"SetRobotPosToAxis rtn is {rtn}")
35rtn = robot.SetAxisDHParaConfig(10, 20, 0, 0, 0, 0, 0, 0, 0)
36print(f"SetAxisDHParaConfig rtn is {rtn}")
37rtn = robot.ExtAxisParamConfig(1, 1, 1, 1000, -1000, 1000, 1000, 1.905, 262144, 200, 1, 0, 0)
38print(f"ExtAxisParamConfig axis 1 rtn is {rtn}")
39rtn = robot.ExtAxisParamConfig(2, 1, 1, 1000, -1000, 1000, 1000, 4.444, 262144, 200, 1, 0, 0)
40print(f"ExtAxisParamConfig axis 2 rtn is {rtn}")
41time.sleep(3)
42robot.ExtAxisStartJog(1, 0, 10, 10, 30)
43time.sleep(1)
44robot.ExtAxisStopJog(1)
45time.sleep(3)
46robot.ExtAxisServoOn(1, 0)
47time.sleep(3)
48robot.ExtAxisStartJog(2, 0, 10, 10, 30)
49time.sleep(1)
50robot.ExtAxisStopJog(2)
51time.sleep(3)
52robot.ExtAxisServoOn(2, 0)
53robot.ExtDevUnloadUDPDriver()
54robot.CloseRPC()

13.31. Setting the reference point of the extended axis coordinate system - four-point method

New in version python: SDK-v2.0.4

Prototype

ExtAxisSetRefPoint(pointNum)

Description

Setting the reference point of the extended axis coordinate system - four-point method

Mandatory parameters

  • pointNum: point number [1-4];

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.32. Calculating the Extended Axis Coordinate System - Four Point Method

New in version python: SDK-v2.0.4

Prototype

ExtAxisComputeECoordSys()

Description

Calculating Extended Axis Coordinate Systems - Four Point Method

Mandatory parameters

NULL

Default parameters

NULL

Return Value

  • errorcode Success-0 Failure- errcode.

  • coord: extended axis coordinate system values [x,y,z,rx,ry,rz];

13.33. Reference Point Setting for the Shifter Coordinate System - Four-Point Method

New in version python: SDK-v2.0.4

Prototype

PositionorSetRefPoint(pointNum)

Description

Reference Point Setting for the Variable Position Machine Coordinate System - Four Point Method

Mandatory parameters

  • pointNum: point number [1-4];

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.34. Shifter Coordinate System Calculation - Four Point Method

New in version python: SDK-v2.0.4

Prototype

PositionorComputeECoordSys()

Description

Translator Coordinate System Calculation - Four Point Method

Mandatory parameters

NULL

Default parameters

NULL

Return Value

  • errorcode Success-0 Failure- errcode.

  • coord: the value of the coordinate system of the translocator [x,y,z,rx,ry,rz];

13.35. Setting of the calibration reference point in the position in the coordinate system of the end of the translator

New in version python: SDK-v2.0.4

prototype

SetRefPointInExAxisEnd(pos)

Description

Set the calibration reference point to be positioned in the coordinate system of the end of the variator

Mandatory parameters

  • pos: bit position values [x,y,z,rx,ry,rz];

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.36. Applying the Extended Axis Coordinate System

New in version python: SDK-v2.0.4

Prototype

ExtAxisActiveECoordSys(applyAxisId,axisCoordNum,coord,calibFlag)

Description

Apply extended axis coordinate system

Mandatory parameters

  • applyAxisId:Extended Axis Numbering bit0-bit3 corresponds to extended axis numbering 1-4, e.g., if you apply extended axes 1 and 3, it would be 0b 0000 0101, or 5;

  • axisCoordNum: extended axis coordinate system number;

  • coord: coordinate system value [x,y,z,rx,ry,rz];

  • calibFlag: calibration flag 0 - no, 1 - yes;

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.37. Obtain the extended axis coordinate system

New in version python: SDK-v2.1.2

Prototype

ExtAxisGetCoord()

Description

Obtain the extended axis coordinate system

Mandatory parameters

NULL

Default parameters

NULL

Return Value

  • Error Code Success-0 Failure- errcode

  • coord:Extended axis coordinate system

13.38. Extended axis coordinate system calibration code example

 1from fairino import Robot
 2import time
 3# Establish a connection with the robot controller and return a robot object if the connection is successful
 4robot = Robot.RPC('192.168.58.2')
 5rtn = robot.ExtDevSetUDPComParam("192.168.58.88", 2021, 2, 100, 3, 200, 1, 100, 5, 1)
 6print(f"ExtDevSetUDPComParam rtn is {rtn}")
 7rtn,udp_params = robot.ExtDevGetUDPComParam()
 8ip, port, period, lossPkgTime, lossPkgNum, disconnectTime, reconnectEnable, reconnectPeriod, reconnectNum = udp_params
 9patam = (
10    f"\nip {ip}\nport {port}\nperiod {period}\nlossPkgTime {lossPkgTime}\n"
11    f"lossPkgNum {lossPkgNum}\ndisConntime {disconnectTime}\nreconnecable {reconnectEnable}\n"
12    f"reconnperiod {reconnectPeriod}\nreconnnun {reconnectNum}"
13)
14print(f"ExtDevGetUDPComParam rtn is {rtn}{patam}")
15robot.ExtDevLoadUDPDriver()
16rtn = robot.ExtAxisServoOn(1, 1)
17print(f"ExtAxisServoOn axis id 1 rtn is {rtn}")
18rtn = robot.ExtAxisServoOn(2, 1)
19print(f"ExtAxisServoOn axis id 2 rtn is {rtn}")
20time.sleep(2)
21robot.ExtAxisSetHoming(1, 0, 10, 2)
22time.sleep(2)
23rtn = robot.ExtAxisSetHoming(2, 0, 10, 2)
24print(f"ExtAxisSetHoming rtn is {rtn}")
25time.sleep(4)
26rtn = robot.SetRobotPosToAxis(1)
27print(f"SetRobotPosToAxis rtn is {rtn}")
28rtn = robot.SetAxisDHParaConfig(1, 128.5, 206.4, 0, 0, 0, 0, 0, 0)
29print(f"SetAxisDHParaConfig rtn is {rtn}")
30rtn = robot.ExtAxisParamConfig(1, 1, 1, 1000, -1000, 1000, 1000, 1.905, 262144, 200, 1, 0, 0)
31print(f"ExtAxisParamConfig axis 1 rtn is {rtn}")
32rtn = robot.ExtAxisParamConfig(2, 1, 1, 1000, -1000, 1000, 1000, 4.444, 262144, 200, 1, 0, 0)
33print(f"ExtAxisParamConfig axis 2 rtn is {rtn}")
34toolCoord = [0, 0, 210, 0, 0, 0]
35robot.SetToolCoord(1, toolCoord, 0, 0, 1, 0)
36jSafe = [115.193, -96.149, 92.489, -87.068, -89.15, -83.488]
37j1 = [117.559, -92.624, 100.329, -96.909, -94.057, -83.488]
38j2 = [112.239, -90.096, 99.282, -95.909, -89.824, -83.488]
39j3 = [110.839, -83.473, 93.166, -89.22, -90.499, -83.487]
40j4 = [107.935, -83.572, 95.424, -92.873, -87.933, -83.488]
41descSafe = [0.0,0.0,0.0,0.0,0.0,0.0]
42desc1 = [0.0,0.0,0.0,0.0,0.0,0.0]
43desc2 = [0.0,0.0,0.0,0.0,0.0,0.0]
44desc3 = [0.0,0.0,0.0,0.0,0.0,0.0]
45desc4 = [0.0,0.0,0.0,0.0,0.0,0.0]
46exaxisPos = [0.0,0.0,0.0,0.0]
47offdese = [0.0,0.0,0.0,0.0,0.0,0.0]
48error, descSafe = robot.GetForwardKin(jSafe)
49robot.MoveJ(joint_pos=jSafe,tool= 1,user= 0,vel= 100)
50time.sleep(2)
51error, desc1 = robot.GetForwardKin(j1)
52robot.MoveJ(joint_pos=j1,tool= 1,user= 0,vel= 100)
53time.sleep(2)
54actualTCPPos = [0.0,0.0,0.0,0.0,0.0,0.0]
55error, actualTCPPos = robot.GetActualTCPPose(0)
56robot.SetRefPointInExAxisEnd(actualTCPPos)
57rtn = robot.PositionorSetRefPoint(1)
58print(f"PositionorSetRefPoint 1 rtn is {rtn}")
59time.sleep(2)
60robot.MoveJ(joint_pos=jSafe,tool= 1,user= 0,vel= 100)
61robot.ExtAxisStartJog(1, 0, 50, 50, 10)
62time.sleep(1)
63robot.ExtAxisStartJog(2, 0, 50, 50, 10)
64time.sleep(1)
65error, desc2 = robot.GetForwardKin(j2)
66rtn = robot.MoveJ(joint_pos=j2,tool= 1,user= 0,vel= 100)
67rtn = robot.PositionorSetRefPoint(2)
68print(f"PositionorSetRefPoint 2 rtn is {rtn}")
69time.sleep(2)
70robot.MoveJ(joint_pos=jSafe,tool= 1,user= 0,vel= 100)
71robot.ExtAxisStartJog(1, 0, 50, 50, 10)
72time.sleep(1)
73robot.ExtAxisStartJog(2, 0, 50, 50, 10)
74time.sleep(1)
75error, desc3 = robot.GetForwardKin(j3)
76robot.MoveJ(joint_pos=j3,tool= 1,user= 0,vel= 100)
77rtn = robot.PositionorSetRefPoint(3)
78print(f"PositionorSetRefPoint 3 rtn is {rtn}")
79time.sleep(2)
80robot.MoveJ(joint_pos=jSafe,tool= 1,user= 0,vel= 100)
81robot.ExtAxisStartJog(1, 0, 50, 50, 10)
82time.sleep(1)
83robot.ExtAxisStartJog(2, 0, 50, 50, 10)
84time.sleep(1)
85error, desc4 = robot.GetForwardKin(j4)
86robot.MoveJ(joint_pos=j4,tool= 1,user= 0,vel= 100)
87rtn = robot.PositionorSetRefPoint(4)
88print(f"PositionorSetRefPoint 4 rtn is {rtn}")
89time.sleep(2)
90axisCoord = [0.0,0.0,0.0,0.0,0.0,0.0]
91error,axisCoord = robot.PositionorComputeECoordSys()
92robot.MoveJ(joint_pos=jSafe,tool= 1,user= 0,vel= 100)
93print(f"PositionorComputeECoordSys rtn is {axisCoord[0]} {axisCoord[1]} {axisCoord[2]} {axisCoord[3]} {axisCoord[4]} {axisCoord[5]}")
94rtn = robot.ExtAxisActiveECoordSys(3, 1, axisCoord, 1)
95print(f"ExtAxisActiveECoordSys rtn is {rtn}")
96robot.CloseRPC()

13.39. UDP Extended Axis Motion

New in version python: SDK-v2.1.4

Prototype

ExtAxisMove(pos,ovl,blend=-1)

Description

UDP Extended Axis Motion

Mandatory parameters

  • pos=[exaxis[0],exaxis[1],exaxis[2],exaxis[3]]: target position Axis 1 position to Axis 4 position;

  • ovl: percentage of speed

Default parameters

  • blend:Smoothing parameter (mm or ms), -1, waiting for the motion to complete, Default -1

Return Value

Error Code Success-0 Failure- errcode

13.40. UDP Extended axis motion code example

1from fairino import Robot
2import time
3# Establish a connection with the robot controller and return a robot object if the connection is successful
4robot = Robot.RPC('192.168.58.2')
5axisPos = [20,0,0,0]
6robot.ExtAxisMove(axisPos, 50, -1)
7robot.CloseRPC()
8return 0

13.41. UDP extension axes synchronized with robot joint motion

New in version python: SDK-v2.0.4

Prototype

ExtAxisSyncMoveJ(joint_pos,tool,user,exaxis_pos, desc_pos=[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], vel=20.0, acc=0.0, ovl= 100.0, blendT=-1.0, offset_flag=0, offset_pos=[ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0])

Description

UDP extension axis synchronized motion with robot joint motion

Mandatory parameters

  • joint_pos: target joint position in [°];

  • desc_pos: Cartesian position of the target in [mm][°];

  • tool: tool number, [0 to 14]

  • user: artifact number, [0~14]

  • exaxis_pos: external axis 1 position ~ external axis 4 positions

Default Parameters

  • desc_pos: target Cartesian position in [mm][°] Default initial value [0.0,0.0,0.0,0.0,0.0,0.0,0.0], default value calls positive kinematics to solve for the return value.

  • vel: percentage of speed, [0~100] default 20.0;

  • acc: percentage of acceleration, [0~100] not open yet, default 0.0;

  • ovl: velocity scaling factor, [0~100] default 100.0 ;

  • blendT: [-1.0]-motion in place (blocking), [0~500.0]-smoothing time (non-blocking) in [ms] default -1.0;

  • offset_flag: [0] - no offset, [1] - offset in workpiece/base coordinate system, [2] - offset in tool coordinate system Default 0;

  • offset_pos: position offset in [mm][°] default [0.0,0.0,0.0,0.0,0.0,0.0] ;

Return Value

Error Code Success-0 Failure- errcode;

13.42. UDP extension axes synchronized with robot joint motion code example

 1from fairino import Robot
 2# Establish a connection with the robot controller and return a robot object if the connection is successful
 3robot = Robot.RPC('192.168.58.2')
 4# Set the UDP communication parameters and load
 5robot.ExtDevSetUDPComParam("192.168.58.88", 2021, 2, 100, 3, 100, 1, 100, 10)
 6robot.ExtDevLoadUDPDriver()
 7# Set the parameters of the extended axis
 8robot.SetAxisDHParaConfig(4, 200, 200, 0, 0, 0, 0, 0, 0)
 9robot.SetRobotPosToAxis(1)
10robot.ExtAxisParamConfig(1, 0, 1, 100, -100, 10, 10, 12, 131072, 0, 1, 0, 0)
11# Expand the axis to enable and return to zero
12robot.ExtAxisServoOn(1, 0)
13robot.ExtAxisSetHoming(1, 0, 20, 3)
14# Extended axis coordinate system calibration
15pos = []  # Please fill in the specific coordinates
16robot.SetRefPointInExAxisEnd(pos)
17robot.PositionorSetRefPoint(1)  # This operation should be repeated 4 times (using 4 dots)
18error,coord = robot.PositionorComputeECoordSys()
19robot.ExtAxisActiveECoordSys(1, 1, coord, 1)
20# Synchronize the starting and ending points of the movement
21startdescPose = []  # Please fill in the specific coordinates
22startjointPos = []  # Please fill in the specific coordinates
23startexaxisPos = []  # Please fill in the specific coordinates
24enddescPose = []  # Please fill in the specific coordinates
25endjointPos = []  # Please fill in the specific coordinates
26endexaxisPos = []  # Please fill in the specific coordinates
27# Move to the starting point
28robot.ExtAxisMove(startexaxisPos, 20, -1)
29offdese = [0, 0, 0, 0, 0, 0]
30robot.MoveJ(joint_pos=startjointPos,tool= 1,user= 1,vel= 100,acc= 100,ovl= 100,exaxis_pos= startexaxisPos,blendT= 0,offset_flag= 0,offset_pos= offdese)
31robot.ExtAxisSyncMoveJ(endjointPos, enddescPose, 1, 1, endexaxisPos, 100, 100, 100, -1, 0, offdese)
32robot.CloseRPC()

13.43. UDP extension axes synchronized with robot linear motion

New in version python: SDK-v2.1.5

Prototype

ExtAxisSyncMoveL(desc_pos, tool, user, exaxis_pos, joint_pos = [0.0,0.0,0.0,0.0,0.0,0.0,0.0], vel=20.0, acc=0.0, ovl=100.0, blendR=-1.0, search=0, offset_flag= 0, offset_pos=[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],config=-1)

Description

UDP extension axis synchronized motion with robot linear motion

Mandatory parameters

  • desc_pos: target Cartesian position in [mm][°];

  • tool: tool number, [0 to 14];

  • user: artifact number, [0 to 14];

  • exaxis_pos: external axis 1 position ~ external axis 4 positions;

Default Parameters

  • joint_pos: target joint position in [°] Default initial value is [0.0,0.0,0.0,0.0,0.0,0.0,0.0], default value calls inverse kinematics to solve for the return value.

  • vel: percentage of speed, [0~100] default 20.0;

  • acc: percentage of acceleration, [0~100] not open yet, default 0.0;

  • ovl: velocity scaling factor, [0~100] default 100.0;

  • blendR: [-1.0]-motion in place (blocking), [0~500.0]-smoothing time (non-blocking) in [ms] default -1.0;

  • search: [0] - no wire search, [1] - wire search;

  • offset_flag: [0] - no offset, [1] - offset in workpiece/base coordinate system, [2] - offset in tool coordinate system Default 0;

  • offset_pos: position offset in [mm][°] default [0.0,0.0,0.0,0.0,0.0,0.0] ;

  • config: Reverse the joint space configuration, [-1]- calculate based on the current joint position, [0~7]- solve based on the specific joint space configuration, default -1

Return Value

Error Code Success-0 Failure- errcode;

13.44. UDP extension axes synchronized with robot linear motion code example

 1from fairino import Robot
 2# Establish a connection with the robot controller and return a robot object if the connection is successful
 3robot = Robot.RPC('192.168.58.2')
 4# Set the UDP communication parameters and load
 5robot.ExtDevSetUDPComParam("192.168.58.88", 2021, 2, 100, 3, 100, 1, 100, 10)
 6robot.ExtDevLoadUDPDriver()
 7# Set the parameters of the extended axis
 8robot.SetAxisDHParaConfig(4, 200, 200, 0, 0, 0, 0, 0, 0)
 9robot.SetRobotPosToAxis(1)
10robot.ExtAxisParamConfig(1, 0, 1, 100, -100, 10, 10, 12, 131072, 0, 1, 0, 0)
11# Expand the axis to enable and return to zero
12robot.ExtAxisServoOn(1, 0)
13robot.ExtAxisSetHoming(1, 0, 20, 3)
14# Extended axis coordinate system calibration
15pos = []  # Please fill in the coordinates of the marking points
16robot.SetRefPointInExAxisEnd(pos)
17robot.PositionorSetRefPoint(1)  # It needs to be called four times for calibration
18error,coord = robot.PositionorComputeECoordSys()
19robot.ExtAxisActiveECoordSys(1, 1, coord, 1)
20# Synchronize the starting and ending points of the movement
21startdescPose = []  # Please fill in the coordinates of the marking points
22startjointPos = []  # Please fill in the coordinates of the marking points
23startexaxisPos = []  # Please fill in the coordinates of the marking points
24enddescPose = []  # Please fill in the coordinates of the marking points
25endjointPos = []  # Please fill in the coordinates of the marking points
26endexaxisPos = []  # Please fill in the coordinates of the marking points
27# Move to the starting point
28robot.ExtAxisMove(startexaxisPos, 20, -1)
29offdese = [0, 0, 0, 0, 0, 0]
30robot.MoveJ(joint_pos=startjointPos, tool= 1,user= 1,vel= 100,acc= 100,ovl= 100,exaxis_pos= startexaxisPos,blendT= 0)
31# Perform synchronous linear motion
32robot.ExtAxisSyncMoveL(endjointPos, enddescPose, 1, 1, endexaxisPos, 100, 100, 100, 0, 0, offdese)
33robot.CloseRPC()

13.45. UDP extension axes synchronized with robot circular motion

New in version python: SDK-v2.1.5

Prototype

ExtAxisSyncMoveC(desc_pos_p, tool_p, user_p,exaxis_pos_p, desc_pos_t, tool_t, user_t,exaxis_pos_t,joint_pos_p=[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], joint_pos_t=[0.0, 0.0, 0.0, 0.0, 0.0, 0.0],vel_p =20.0, acc_p=100.0, offset_flag_p=0, offset_pos_p =[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], vel_t=20.0, acc_t=100.0, offset_flag_t=0, offset_pos_t=[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], ovl=100.0, blendR=-1.0, config=-1)

Description

UDP extension axis synchronized with robot circular motion

Mandatory parameters

  • desc_pos_p: path point Cartesian position in [mm][°];

  • tool_p: pathpoint tool number, [0~14];

  • user_p: pathpoint artifact number, [0~14];

  • exaxis_pos_p: path point external axis 1 position ~ external axis 4 position Default [0.0,0.0,0.0,0.0];

  • desc_pos_t: Cartesian position of the target point in [mm][°];

  • tool_t: tool number, [0~14];

  • user_t: artifact number, [0~14];

  • exaxis_pos_t: target point external axis 1 position ~ external axis 4 position default [0.0,0.0,0.0,0.0];

Default Parameters

  • joint_pos_p: target joint position in [°] Default initial value is [0.0,0.0,0.0,0.0,0.0,0.0,0.0], default value calls inverse kinematics to solve for the return value.

  • joint_pos_t: target joint position in [°] Default initial value is [0.0,0.0,0.0,0.0,0.0,0.0,0.0], default value calls inverse kinematics to solve for the return value.

  • vel_p: path point velocity percentage, [0~100] default 20.0;

  • acc_p: path point acceleration percentage, [0~100] not open yet, default 0.0;

  • offset_flag_p: whether the path point is offset [0]-no offset, [1]-offset in workpiece/base coordinate system, [2]-offset in tool coordinate system Default 0;

  • offset_pos_p: path point position offset in [mm][°] Default [0.0,0.0,0.0,0.0,0.0,0.0];

  • vel_t: Target point velocity percentage, [0~100] default 20.0;

  • acc_t: target point acceleration percentage, [0~100] Not open yet Default 0.0;

  • offset_flag_t: whether the target point is offset or not [0]-no offset, [1]-offset in workpiece/base coordinate system, [2]-offset in tool coordinate system Default 0;

  • offset_pos_t: target point attitude offset in [mm][°] Default [0.0,0.0,0.0,0.0,0.0,0.0];

  • ovl: velocity scaling factor, [0~100] default 100.0;

  • blendR: [-1.0] - motion in place (blocking), [0~1000] - smoothing radius (non-blocking) in [mm] default -1.0;

  • config: Reverse the joint space configuration, [-1]- calculate based on the current joint position, [0~7]- solve based on the specific joint space configuration, default -1

Return Value

Error Code Success-0 Failure- errcode;

13.46. UDP extension axes synchronized with robot circular motion code example

 1from fairino import Robot
 2# Establish a connection with the robot controller and return a robot object if the connection is successful
 3robot = Robot.RPC('192.168.58.2')
 4# Set the UDP communication parameters and load
 5robot.ExtDevSetUDPComParam("192.168.58.88", 2021, 2, 100, 3, 100, 1, 100, 10)
 6robot.ExtDevLoadUDPDriver()
 7# Set the parameters of the extended axis
 8robot.SetAxisDHParaConfig(4, 200, 200, 0, 0, 0, 0, 0, 0)
 9robot.SetRobotPosToAxis(1)
10robot.ExtAxisParamConfig(1, 0, 1, 100, -100, 10, 10, 12, 131072, 0, 1, 0, 0)
11# Expand the axis to enable and return to zero
12robot.ExtAxisServoOn(1, 0)
13robot.ExtAxisSetHoming(1, 0, 20, 3)
14# Extended axis coordinate system calibration
15pos = []  # Enter the coordinates of the reference point
16robot.SetRefPointInExAxisEnd(pos)
17robot.PositionorSetRefPoint(1)  # Call four times to complete the calibration
18coord = []
19error,coord = robot.PositionorComputeECoordSys()
20robot.ExtAxisActiveECoordSys(1, 1, coord, 1)
21# Synchronous arc starting point, middle point and end point
22startdescPose = []# Input coordinates
23startjointPos = []# Input coordinates
24startexaxisPos =[]  # Enter the coordinates of the extended axis
25middescPose = []# Input the midpoint
26midjointPos = []
27midexaxisPos =[]
28enddescPose = []
29endjointPos = []
30endexaxisPos =[]
31# Move to the starting point
32robot.ExtAxisMove(startexaxisPos, 20, -1)
33offdese = [0, 0, 0, 0, 0, 0]
34robot.MoveJ(joint_pos=startjointPos,tool= 1,user= 1,vel= 100,acc= 100,ovl= 100,exaxis_pos= startexaxisPos,blendT= 0,offset_flag= 0,offset_pos= offdese)
35# Start synchronous circular arc movement
36robot.ExtAxisSyncMoveC(midjointPos,middescPose,1,1,midexaxisPos,
37                       endjointPos,enddescPose,1,1,endexaxisPos,
38                       100,100,0,offdese,
39                       100,100,0,offdese,
40                       100,0)
41robot.CloseRPC()

13.47. Setting the Extended DO

New in version python: SDK-v2.0.4

Prototype

SetAuxDO(DONum,bOpen,smooth,block)

Description

Setting the Extended DO

Mandatory parameters

  • DONum: DO number;

  • bOpen: switch True-Open, False-Off;

  • smooth: smooth or not True - yes, False - no;

  • block: whether to block True - Yes, False - No;

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.48. Setting up Extended AO

New in version python: SDK-v2.0.4

Prototype

SetAuxAO(AONum,value,block)

Description

Setting the Extended AO

Mandatory parameters

  • AONum: AO number;

  • value: analog value [0-4095];

  • block: whether to block True - Yes, False - No;

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.49. Setting the Extended DI Input Filter Time

New in version python: SDK-v2.0.4

Prototype

SetAuxDIFilterTime(filterTime)

Description

Setting the Extended DI Input Filter Time

Mandatory parameters

  • filterTime: filter time (ms);

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.50. Setting the Extended AI Input Filter Time

New in version python: SDK-v2.0.4

Prototype

SetAuxAIFilterTime(AINum,filterTime)

Description

Set the extended AI input filter time

Mandatory parameters

  • AINum: AI number;

  • filterTime: filter time (ms);

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.51. Waiting for extended DI input

New in version python: SDK-v2.0.4

Prototype

WaitAuxDI(DINum,bOpen,time,errorAlarm)

Description

Waiting for extended DI input

Mandatory parameters

  • DINum: DI number;

  • bOpen: switch True-Open, False-Off;

  • time: maximum waiting time (ms);

  • errorAlarm: whether to continue the campaign True-Yes,False-No

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.52. Waiting for extended AI input

New in version python: SDK-v2.0.4

Prototype

WaitAuxAI(,AINum,sign,value,time,errorAlarm)

Description

Waiting for extended AI input

Mandatory parameters

  • AINum: AI number;

  • sign: 0 - greater than; 1 - less than;

  • value: AI value;

  • time: maximum waiting time (ms);

  • errorAlarm: whether to continue the campaign True-Yes,False-No

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.53. Get Extended DI Value

New in version python: SDK-v2.0.4

Prototype

GetAuxDI(DINum,isNoBlock)

Description

Get Extended DI Value

Mandatory parameters

  • DINum: DI number;

  • isNoBlock: whether to block True-blocking false-non-blocking;

Default parameters

NULL

Return Value

  • errorcode Success-0 Failure- errcode;

  • isOpen: 0 - off; 1 - on;

13.54. Get Extended AI Value

New in version python: SDK-v2.0.4

Prototype

GetAuxAI(AINum,isNoBlock)

Description

Get Extended AI Value

Mandatory parameters

  • AINum: AI number;

  • isNoBlock: whether to block True-blocking False-non-blocking

Default parameters

NULL

Return Value

  • errorcode Success-0 Failure- errcode;

  • value: input value;

13.55. Extended IO code examples

 1from fairino import Robot
 2import time
 3# Establish a connection with the robot controller and return a robot object if the connection is successful
 4robot = Robot.RPC('192.168.58.2')
 5for i in range(128):
 6    robot.SetAuxDO(i, True, False, True)
 7    time.sleep(0.1)
 8for i in range(128):
 9    robot.SetAuxDO(i, False, False, True)
10    time.sleep(0.1)
11for i in range(409):
12    value1 = i * 10
13    value2 = 4095 - i * 10
14    robot.SetAuxAO(0, value1, True)
15    robot.SetAuxAO(1, value2, True)
16    robot.SetAuxAO(2, value1, True)
17    robot.SetAuxAO(3, value2, True)
18    time.sleep(0.01)
19robot.SetAuxDIFilterTime(10)
20robot.SetAuxAIFilterTime(0, 10)
21for i in range(20):
22    curValue = False
23    error, curValue = robot.GetAuxDI(i, False)  # 注意:如库内部需引用方式,这里需修改
24    print(f"DI{i}   {curValue}")
25curValue = -1
26for i in range(4):
27    error, curValue = robot.GetAuxAI(i, True)  # 同样注意引用传参问题
28    print(f"AI{i}   {curValue}")
29robot.WaitAuxDI(1, False, 1000, False)
30robot.WaitAuxAI(1, 1, 132, 1000, False)
31robot.CloseRPC()

13.56. Removable Device Enable

New in version python: SDK-v2.0.5

Prototype

TractorEnable(enable)

description

removable device enable

Mandatory parameters

  • enable: enable state, 0-de-enable, 1-enable

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.57. Zeroing of removable units

New in version python: SDK-v2.0.5

Prototype

TractorHoming()

Description

Removable unit back to zero

Mandatory parameters

NULL

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.58. Movable unit linear motion

New in version python: SDK-v2.0.5

Prototype

TractorMoveL(distance, vel)

Description

Movable device linear motion

Mandatory parameters

  • distance: distance of linear movement (mm)

  • vel: percentage of linear motion speed (0-100)

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.59. Movable unit circular motion

New in version python: SDK-v2.0.5

prototype

TractorMoveC(radio, angle, vel)

Description

Movable device circular motion

Mandatory parameters

  • radio: radius of circular motion (mm)

  • angle: angle of circular motion (°)

  • vel: Percentage of speed of circular motion (0-100)

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.60. Stopping motion of movable devices

New in version python: SDK-v2.0.5

Prototype

ProgramStop()

Description

Movable unit stops moving

Mandatory parameters

NULL

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.61. Portable device code example

 1from fairino import Robot
 2# Establish a connection with the robot controller and return a robot object if the connection is successful
 3robot = Robot.RPC('192.168.58.2')
 4robot.ExtDevSetUDPComParam("192.168.58.2", 2021, 2, 50, 5, 50, 1, 50, 10, 1)
 5robot.ExtDevLoadUDPDriver()
 6rtn = robot.ExtAxisServoOn(1, 1)
 7rtn = robot.ExtAxisServoOn(2, 1)
 8time.sleep(2)
 9robot.ExtAxisSetHoming(1, 0, 10, 2)
10time.sleep(2)
11rtn = robot.ExtAxisSetHoming(2, 0, 10, 2)
12time.sleep(4)
13robot.ExtAxisParamConfig(1, 0, 0, 50000, -50000, 1000, 1000, 6.280, 16384, 200, 0, 0, 0)
14robot.ExtAxisParamConfig(2, 0, 0, 50000, -50000, 1000, 1000, 6.280, 16384, 200, 0, 0, 0)
15robot.SetAxisDHParaConfig(5, 0, 0, 0, 0, 0, 0, 0, 0)
16robot.TractorEnable(False)
17time.sleep(2)
18robot.TractorEnable(True)
19time.sleep(2)
20robot.TractorHoming()
21time.sleep(2)
22robot.TractorMoveL(100, 2)
23time.sleep(5)
24robot.TractorStop()
25robot.TractorMoveL(-100, 20)
26time.sleep(5)
27robot.TractorMoveC(300, 90, 20)
28time.sleep(10)
29robot.TractorMoveC(300, -90, 20)
30time.sleep(1)
31robot.CloseRPC()

13.62. Laser sensor recording points

New in version python: SDK-v2.1.4

Prototype

LaserRecordPoint(coordID)

Description

Laser sensor recording points

Mandatory par

  • coordID:Laser sensor coordinate system

Default param

NULL

Return Value

  • Error Code Success-0 Failure- errcode

  • joint:The laser sensor identifies the position of the point joint

  • desc:The laser sensor identifies the Cartesian position of the point

  • exaxis:The laser sensor identifies the extended axis position of the point

13.63. Sample code for laser sensor recording points

New in version python: SDK-v2.1.4

 1from fairino import Robot
 2# Establish a connection with the robot controller and return a robot object if the connection is successful
 3robot = Robot.RPC('192.168.58.2')
 4direction_point = [0, 0, 0]
 5rtn = robot.LaserTrackingSearchStart(2, direction_point, 10, 100, 10000, 2)
 6print(f"LaserTrackingSearchStart rtn is {rtn}")
 7robot.LaserTrackingSearchStop()
 8coord_id = 2
 9rtn, joint, desc, exaxis = robot.LaserRecordPoint(coord_id)
10print(f"rtn is {rtn}")
11print(f"desc_pos:{desc[0]},{desc[1]},{desc[2]},"
12      f"{desc[3]},{desc[4]},{desc[5]}")
13print(f"joint_pos:{joint[0]},{joint[1]},{joint[2]},{joint[3]},{joint[4]},{joint[5]}")
14print(f"exaxis pos is {exaxis[0]} {exaxis[1]} {exaxis[2]} {exaxis[3]}")
15off = [0] * 6
16robot.MoveJ(joint,tool=1,user=0,vel=100,acc=100,ovl=50,exaxis_pos=exaxis,blendT=-1,offset_flag=0,offset_pos=off)
17robot.CloseRPC()

13.64. Set the synchronous movement strategy of the extended axis and the robot

New in version python: SDK-v2.1.5

Prototype

SetExAxisRobotPlan(strategy)

Description

Set the synchronous movement strategy of the extended axis and the robot

Mandatory par

  • strategy:Strategy; 0- Mainly robots; 1- The extended axis is synchronized with the robot

Default param

NULL

Return Value

Error Code Success-0 Failure- errcode

13.65. Code example for setting the synchronous motion strategy of the extended axis and the robot

New in version python: SDK-v2.1.5

 1from fairino import Robot
 2# Establish a connection with the robot controller and return a robot object if the connection is successful
 3robot = Robot.RPC('192.168.58.2')
 4joint_pos1 = [-22.016, -49.217, 124.714, -161.100, -85.108, -0.333]
 5joint_pos2 = [-21.083, -46.613, 110.079, -147.796, -80.757, -0.330]
 6joint_pos3 = [-25.572, -60.090, 135.397, -163.889, -82.489, -0.345]
 7desc_pos1 = [2.637, -0.001, 30.673, 178.786, -4.134, 68.326]
 8desc_pos2 = [213.812, -1.440, 47.311, 177.410, 0.166, 68.946]
 9desc_pos3 = [444.342, -12.723, 82.470, -177.701, -1.325, 65.151]
10epos1 = [0.001, 0.000, 0.000, 0.000]
11epos2 = [299.977, 0.000, 0.000, 0.000]
12epos3 = [399.969, 0.000, 0.000, 0.000]
13offset_pos = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
14rtn = robot.SetExAxisRobotPlan(0)
15print(f"SetExAxisRobotPlan rtn is {rtn}")
16time.sleep(1)
17rtn = robot.ExtAxisSyncMoveL(desc_pos=desc_pos1,tool=1,user=0,vel=100,acc=100,ovl=100,blendR=-1,exaxis_pos=epos1,offset_flag=0,offset_pos=offset_pos)
18print(f"ExtAxisSyncMoveL 1 rtn is {rtn}")
19rtn = robot.ExtAxisSyncMoveL(desc_pos=desc_pos2,tool=1,user=0,vel=100,acc=100,ovl=100,blendR=-1,exaxis_pos=epos2,offset_flag=0,offset_pos=offset_pos)
20print(f"ExtAxisSyncMoveL 2 rtn is {rtn}")
21rtn = robot.ExtAxisSyncMoveL(desc_pos=desc_pos3,tool=1,user=0,vel=100,acc=100,ovl=100,blendR=-1,exaxis_pos=epos3,offset_flag=0,offset_pos=offset_pos)
22print(f"ExtAxisSyncMoveL 3 rtn is {rtn}")
23time.sleep(8)
24robot.CloseRPC()