13. Extended axis

13.1. Set 485 extended axis parameters

New in version C#SDK-v1.0.6.

 1/**
 2* @brief Set 485 extended axis parameters
 3* @param [in] servoId Servo driver ID, range [1-15], corresponding to slave ID
 4* @param [in] servoCompany Servo driver manufacturer, 1-Dynatech
 5* @param [in] servoModel Servo driver model, 1-FD100-750C
 6* @param [in] servoSoftVersion Servo driver software version, 1-V1.0
 7* @param [in] servoResolution Encoder resolution
 8* @param [in] axisMechTransRatio Mechanical transmission ratio
 9* @return Error code
10*/
11int AuxServoSetParam(int servoId, int servoCompany, int servoModel, int servoSoftVersion, int servoResolution, double axisMechTransRatio);

13.2. Get 485 extended axis configuration parameters

New in version C#SDK-v1.0.6.

 1/**
 2* @brief Get 485 extended axis configuration parameters
 3* @param [in] servoId Servo driver ID, range [1-15], corresponding to slave ID
 4* @param [out] servoCompany Servo driver manufacturer, 1-Dynatec
 5* @param [out] servoModel Servo drive model, 1-FD100-750C
 6* @param [out] servoSoftVersion Servo drive software version, 1-V1.0
 7* @param [out] servoResolution Encoder resolution
 8* @param [out] axisMechTransRatio Mechanical transmission ratio
 9* @return Error code
10*/
11int AuxServoGetParam(int servoId, ref int servoCompany, ref int servoModel, ref int servoSoftVersion, ref int servoResolution, ref double axisMechTransRatio);

13.3. Set 485 extended axis enable/disable

New in version C#SDK-v1.0.6.

1* @brief Set 485 extension axis enable/disable
2* @param [in] servoId Servo driver ID, range [1-15], corresponding to slave ID
3* @param [in] status Enable status, 0-disable, 1-enable
4* @return Error code
5*/
6int AuxServoEnable(int servoId, int status);

13.4. Set 485 extension axis control mode

New in version C#SDK-v1.0.6.

1/**
2* @brief Set 485 extension axis control mode
3* @param [in] servoId Servo driver ID, range [1-15], corresponding to slave ID
4* @param [in] mode Control mode, 0-position mode, 1-speed mode
5* @return Error code
6*/
7int AuxServoSetControlMode(int servoId, int mode);

13.5. Set the target position of the 485 extended axis (position mode)

New in version C#SDK-v1.0.6.

1/**
2* @brief Set the target position of the 485 extended axis (position mode)
3* @param [in] servoId Servo driver ID, range [1-15], corresponding to slave ID
4* @param [in] pos Target position, mm or °
5* @param [in] speed Target speed, mm/s or °/s
6* @return Error code
7*/
8int AuxServoSetTargetPos(int servoId, double pos, double speed);

13.6. Set the target speed of the 485 extended axis (speed mode)

New in version C#SDK-v1.0.6.

1/**
2* @brief Set the target speed of the 485 extended axis (speed mode)
3* @param [in] servoId Servo driver ID, range [1-15], corresponding to the slave ID
4* @param [in] speed Target speed, mm/s or °/s
5* @return Error code
6*/
7int AuxServoSetTargetSpeed(int servoId, double speed);

13.7. Set the target torque of the 485 extended axis (torque mode) – Not available yet

New in version C#SDK-v1.0.6.

1/**
2* @brief Set the target torque of the 485 extended axis (torque mode) -- not yet available
3* @param [in] servoId Servo driver ID, range [1-15], corresponding to the slave ID
4* @param [in] torque Target torque, Nm
5* @return Error code
6*/
7int AuxServoSetTargetTorque(int servoId, double torque);

13.8. Set 485 extended axis zero

New in version C#SDK-v1.0.6.

1/**
2* @brief Set 485 extended axis zero
3* @param [in] servoId Servo driver ID, range [1-15], corresponding to slave ID
4* @param [in] mode Home mode, 1-current position home; 2-negative limit home; 3-positive limit home
5* @param [in] searchVel Home speed, mm/s or °/s
6* @param [in] latchVel Latching speed, mm/s or °/s
7* @return Error code
8*/
9int AuxServoHoming(int servoId, int mode, double searchVel, double latchVel);

13.9. Clear 485 extended axis error information

New in version C#SDK-v1.0.6.

1/**
2* @brief Clear 485 extended axis error information
3* @param [in] servoId Servo driver ID, range [1-15], corresponding to slave ID
4* @return Error code
5*/
6int AuxServoClearError(int servoId);

13.10. Get 485 extended axis servo status

New in version C#SDK-v1.0.6.

 1/**
 2* @brief Get the status of the 485 extended axis servo
 3* @param [in] servoId Servo driver ID, range [1-15], corresponding to the slave ID
 4* @param [out] servoErrCode Servo driver error code
 5* @param [out] servoState Servo driver status  bit0: 0-Disabled; 1-Enabled;  bit1: 0-Not moving; 1-Moving;  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 zeroed; 1 - Zeroing complete
 6* @param [out] servoPos Servo current position mm or °
 7* @param [out] servoSpeed Servo current speed mm/s or °/s
 8* @param [out] servoTorque Servo current torque Nm
 9* @return Error code
10*/
11int AuxServoGetStatus(int servoId, ref int servoErrCode, ref int servoState, ref double servoPos, ref double servoSpeed, ref double servoTorque);

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

New in version C#SDK-v1.0.6.

1/**
2* @brief Set the data axis number of the 485 extended axis in the status feedback
3* @param [in] servoId Servo driver ID, range [1-15], corresponding to the slave ID
4* @return Error code
5*/
6int AuxServosetStatusID(int servoId);

13.12. Set the acceleration and deceleration of the 485 extended axis

1/**
2* @brief Set the acceleration and deceleration of the 485 extended axis
3* @param [in] acc 485 extended axis acceleration
4* @param [in] dec 485 extended axis deceleration
5* @return  Error code
6*/
7int AuxServoSetAcc(double acc, double dec);

13.13. Set 485 extended axis emergency stop acceleration and deceleration

1/**
2* @brief Set 485 extended axis emergency stop acceleration and deceleration
3* @param [in] acc 485 extended axis emergency stop acceleration
4* @param [in] dec 485 extended axis emergency stop deceleration
5* @return  Error code
6*/
7int AuxServoSetEmergencyStopAcc(double acc, double dec);

13.14. Get 485 extended axis movement acceleration and deceleration

1/**
2* @brief Get 485 extended axis motion acceleration and deceleration
3* @param [out] acc 485 extended axis motion acceleration
4* @param [out] dec 485 extended axis motion deceleration
5* @return  Error code
6*/
7int AuxServoGetAcc(ref double acc, ref double dec);

13.15. Get 485 extended axis emergency stop acceleration and deceleration

1/**
2* @brief Get 485 extended axis emergency stop acceleration and deceleration
3* @param [out] acc 485 extended axis emergency stop acceleration
4* @param [out] dec 485 extended axis emergency stop deceleration
5* @return  Error code
6*/
7int AuxServoGetEmergencyStopAcc(ref double acc, ref double dec);

13.16. Extended axis control code example

New in version C#SDK-V1.1.3: Web-3.8.2

 1private void button64_Click(object sender, EventArgs e)
 2{
 3    int retval = robot.AuxServoSetParam(1, 1, 1, 1, 131072, 15.45);
 4    Console.WriteLine($"AuxServoSetParam is: {retval}");
 5
 6    int servoCompany = 0;
 7    int servoModel = 0;
 8    int servoSoftVersion = 0;
 9    int servoResolution = 0;
10    double axisMechTransRatio = 0;
11    retval = robot.AuxServoGetParam(1, ref servoCompany, ref servoModel, ref servoSoftVersion, ref servoResolution, ref axisMechTransRatio);
12    Console.WriteLine($"servoCompany {servoCompany}\n" +
13        $"servoModel {servoModel}\n" +
14        $"servoSoftVersion {servoSoftVersion}\n" +
15        $"servoResolution {servoResolution}\n" +
16        $"axisMechTransRatio {axisMechTransRatio}\n");
17
18    retval = robot.AuxServoSetParam(1, 10, 11, 12, 13, 14);
19    Console.WriteLine($"AuxServoSetParam is: {retval}");
20
21    retval = robot.AuxServoGetParam(1, ref servoCompany, ref servoModel, ref servoSoftVersion, ref servoResolution, ref axisMechTransRatio);
22    Console.WriteLine($"servoCompany {servoCompany}\n" +
23        $"servoModel {servoModel}\n" +
24        $"servoSoftVersion {servoSoftVersion}\n" +
25        $"servoResolution {servoResolution}\n" +
26        $"axisMechTransRatio {axisMechTransRatio}\n");
27
28    retval = robot.AuxServoSetParam(1, 1, 1, 1, 131072, 36);
29    Console.WriteLine($"AuxServoSetParam is: {retval}");
30    Thread.Sleep(3000);
31
32    robot.AuxServoSetAcc(3000, 3000);
33    robot.AuxServoSetEmergencyStopAcc(5000, 5000);
34    Thread.Sleep(1000);
35    double emagacc = 0, acc = 0;
36    double emagdec = 0, dec = 0;
37    robot.AuxServoGetEmergencyStopAcc(ref emagacc, ref emagdec);
38    Console.WriteLine($"emergency acc is {emagacc}  dec is {emagdec}");
39    robot.AuxServoGetAcc(ref acc, ref dec);
40    Console.WriteLine($"acc is {acc}  dec is {dec}");
41
42    robot.AuxServoSetControlMode(1, 0);
43    Thread.Sleep(2000);
44
45    retval = robot.AuxServoEnable(1, 0);
46    Console.WriteLine($"AuxServoEnable disenable {retval}");
47    Thread.Sleep(1000);
48    int servoerrcode = 0;
49    int servoErrCode = 0;
50    int servoState = 0;
51    double servoPos = 0;
52    double servoSpeed = 0;
53    double servoTorque = 0;
54    retval = robot.AuxServoGetStatus(1, ref servoErrCode, ref servoState, ref servoPos, ref servoSpeed, ref servoTorque);
55    Console.WriteLine($"AuxServoGetStatus servoState {servoState}");
56    Thread.Sleep(1000);
57
58    retval = robot.AuxServoEnable(1, 1);
59    Console.WriteLine($"AuxServoEnable enable {retval}");
60    Thread.Sleep(1000);
61    retval = robot.AuxServoGetStatus(1, ref servoErrCode, ref servoState, ref servoPos, ref servoSpeed, ref servoTorque);
62    Console.WriteLine($"AuxServoGetStatus servoState {servoState}");
63    Thread.Sleep(1000);
64
65    retval = robot.AuxServoHoming(1, 1, 5, 1);
66    Console.WriteLine($"AuxServoHoming {retval}");
67    Thread.Sleep(3000);
68
69    retval = robot.AuxServoSetTargetPos(1, 200, 30);
70    Console.WriteLine($"AuxServoSetTargetPos {retval}");
71    Thread.Sleep(1000);
72    retval = robot.AuxServoGetStatus(1, ref servoErrCode, ref servoState, ref servoPos, ref servoSpeed, ref servoTorque);
73    Console.WriteLine($"AuxServoGetStatus servoSpeed {servoSpeed}");
74    Thread.Sleep(8000);
75
76    robot.AuxServoSetControlMode(1, 1);
77    Thread.Sleep(2000);
78
79    robot.AuxServoEnable(1, 0);
80    Thread.Sleep(1000);
81    robot.AuxServoEnable(1, 1);
82    Thread.Sleep(1000);
83    robot.AuxServoSetTargetSpeed(1, 100, 80);
84
85    Thread.Sleep(5000);
86    robot.AuxServoSetTargetSpeed(1, 0, 80);
87}

13.17. UDP extended axis communication parameter configuration

New in version C#SDK-V1.1.3: Web-3.8.2

 1/**
 2* @brief UDP extended axis communication parameter configuration
 3* @param [in] ip PLC IP address
 4* @param [in] port  Port number
 5* @param [in] period    Communication cycle (ms, default is 2, do not modify this parameter)
 6* @param [in] lossPkgTime   Packet loss detection time (ms)
 7* @param [in] lossPkgNum    Number of packet losses
 8* @param [in] disconnectTime    Communication disconnection confirmation time
 9* @param [in] reconnectEnable   Enable automatic reconnection after communication disconnect 0-Disabled 1-Enabled
10* @param [in] reconnectPeriod   Reconnection period (ms)
11* @param [in] reconnectNum  Reconnection count
12* @param [in] selfConnect Whether to automatically establish a connection after power failure; 0-Do not establish a connection; 1-Establish a connection
13* @return Error code
14*/
15int ExtDevSetUDPComParam(std::string ip, int port, int period, int lossPkgTime, int lossPkgNum, int disconnectTime, int reconnectEnable, int reconnectPeriod, int reconnectNum, int selfConnect);

13.18. Get UDP Extension Axis Communication Parameter Configuration

New in version C#SDK-v1.0.7.

 1/**
 2* @brief Get UDP extension axis communication parameters
 3* @param [out] ip PLC IP address
 4* @param [out] port Port number
 5* @param [out] period       Communication period (ms, default is 2, do not modify this parameter)
 6* @param [out] lossPkgTime  Packet loss detection time (ms)
 7* @param [out] lossPkgNum   Number of packet losses
 8* @param [out] disconnectTime       Communication disconnection confirmation duration
 9* @param [out] reconnectEnable      Automatic reconnection enable after communication disconnection 0-disable 1-enable
10* @param [out] reconnectPeriod      Reconnection interval (ms)
11* @param [out] reconnectNum Number of reconnection attempts
12* @param [out] selfConnect  Whether to automatically reconnect after control box restart; 0-no reconnection; 1-reconnect
13* @return Error code
14*/
15public int ExtDevGetUDPComParam(ref string ip, ref int port, ref int period, ref int lossPkgTime, ref int lossPkgNum, ref int disconnectTime, ref int reconnectEnable, ref int reconnectPeriod, ref int reconnectNum, ref int selfConnect)

13.19. Load UDP communication

New in version C#SDK-v1.0.7.

1/**
2* @brief Load UDP communication
3* @return Error code
4*/
5int ExtDevLoadUDPDriver();

13.20. Unload UDP communication

New in version C#SDK-v1.0.7.

1/**
2* @brief Unload UDP communication
3* @return Error code
4*/
5int ExtDevUnloadUDPDriver();

13.21. Restore connection after abnormal disconnection of UDP extended axis communication

New in version C#SDK-v1.0.7.

1/**
2* @brief Restore connection after abnormal disconnection of UDP extended axis communication
3* @return Error code
4*/
5int ExtDevUDPClientComReset();

13.22. Close communication after abnormal disconnection of UDP extended axis communication

New in version C#SDK-v1.0.7.

1/**
2* @brief Close communication after abnormal disconnection of UDP extended axis communication
3* @return Error code
4*/
5int ExtDevUDPClientComClose();

13.23. UDP extended axis parameter configuration

New in version C#SDK-v1.0.7.

 1/**
 2* @brief UDP extended axis parameter configuration
 3* @param [in] axisID Axis number
 4* @param [in] axisType Extended axis type 0-translation; 1-rotation
 5* @param [in] axisDirection Extended axis direction 0-forward; 1-backward
 6* @param [in] axisMax Maximum position of the extended axis mm
 7* @param [in] axisMin Minimum position of the extended axis mm
 8* @param [in] axisVel Speed mm/s
 9* @param [in] axisAcc Acceleration mm/s2
10* @param [in] axisLead Lead mm
11* @param [in] encResolution Encoder resolution
12* @param [in] axisOffect Weld start point extension axis offset
13* @param [in] axisCompany Driver manufacturer 1-Hechuan; 2-Huichuan; 3-Panasonic
14* @param [in] axisModel Driver model 1-Hechuan-SV-XD3EA040L-E, 2-Hechuan-SV-X2EA150A-A, 1-Huichuan-SV620PT5R4I,1-Panasonic-MADLN15SG, 2-Panasonic-MSDLN25SG, 3-Panasonic-MCDLN35SG
15* @param [in] axisEncType Encoder type  0-Incremental; 1-Absolute
16* @return Error code
17*/
18int ExtAxisParamConfig(int axisID, int axisType, int axisDirection, double axisMax, double axisMin, double axisVel, double axisAcc, double axisLead, long encResolution, double axisOffect, int axisCompany, int axisModel, int axisEncType);

13.24. Set the installation position of the extended axis

New in version C#SDK-v1.0.7.

1/**
2* @brief Set the installation position of the extended axis
3* @param [in] installType 0-robot installed on external axis, 1-robot installed outside external axis
4* @return Error code
5*/
6int SetRobotPosToAxis(int installType);

13.25. Set extended axis system DH parameter configuration

New in version C#SDK-v1.0.7.

 1/**
 2* @brief Set the DH parameter configuration for the extended axis system
 3* @param [in]  axisConfig External axis configuration, 0-single-degree-of-freedom linear slide rail, 1-two-degree-of-freedom L-type indexer, 2-three-degree-of-freedom, 3-four-degree-of-freedom, 4-single-degree-of-freedom indexer
 4* @param [in]  axisDHd1 External axis DH parameter d1 mm
 5* @param [in]  axisDHd2 External axis DH parameter d2 mm
 6* @param [in]  axisDHd3 External axis DH parameter d3 mm
 7* @param [in]  axisDHd4 External axis DH parameter d4 mm
 8* @param [in]  axisDHa1 External axis DH parameter 11 mm
 9* @param [in]  axisDHa2 External axis DH parameter a2 mm
10* @param [in]  axisDHa3 External axis DH parameter a3 mm
11* @param [in]  axisDHa4 External axis DH parameter a4 mm
12* @return Error code
13*/
14int SetAxisDHParaConfig(int axisConfig, double axisDHd1, double axisDHd2, double axisDHd3, double axisDHd4, double axisDHa1, double axisDHa2, double axisDHa3, double axisDHa4);

13.26. UDP extended axis enable

New in version C#SDK-v1.0.7.

1/**
2* @brief UDP extended axis enable
3* @param [in] axisID Axis number [1-4]
4* @param [in] status 0-disable; 1-enable
5* @return Error code
6*/
7int ExtAxisServoOn(int axisID, int status);

13.27. UDP extended axis reset

New in version C#SDK-v1.0.7.

1/**
2* @brief UDP extended axis zero return
3* @param [in] axisID axis number [1-4]
4* @param [in] mode zero return mode 0-return to current position, 1-return to negative limit, 2-return to positive limit
5* @param [in] searchVel zero search speed (mm/s)
6* @param [in] latchVel Latching speed (mm/s)
7* @return Error code
8*/
9int ExtAxisSetHoming(int axisID, int mode, double searchVel, double latchVel);

13.28. UDP extended axis jog start

New in version C#SDK-v1.0.7.

 1/**
 2* @brief UDP extended axis jog start
 3* @param [in] axisID Axis number [1-4]
 4* @param [in] direction Rotation direction 0-reverse; 1-forward
 5* @param [in] vel Speed (mm/s)
 6* @param [in] acc Acceleration (mm/s2)
 7* @param [in] maxDistance Maximum jog distance
 8* @return Error code
 9*/
10int ExtAxisStartJog(int axisID, int direction, double vel, double acc, double maxDistance);

13.29. UDP extended axis jog stop

New in version C#SDK-v1.0.7.

1/**
2* @brief UDP extended axis jog stop
3* @param [in] axisID axis ID[1-4]
4* @return Error code
5*/
6int ExtAxisStopJog(int axisID);

13.30. UDP extended axis configuration and jog code example

 1private void btnJog_Click(object sender, EventArgs e)
 2{
 3    int rtn = robot.ExtDevSetUDPComParam("192.168.58.88", 2021, 2, 100, 3, 200, 1, 100, 5,1);
 4    Console.WriteLine("ExtDevSetUDPComParam rtn is " + rtn);
 5    string ip = ""; int port = 0; int period = 0; int lossPkgTime = 0; int lossPkgNum = 0; int disconnectTime = 0; int reconnectEnable = 0; int reconnectPeriod = 0; int reconnectNum = 0;
 6    rtn = robot.ExtDevGetUDPComParam(ref ip, ref port, ref period, ref lossPkgTime, ref lossPkgNum, ref disconnectTime, ref reconnectEnable, ref reconnectPeriod, ref reconnectNum);
 7    string param = "\nip " + ip + "\nport " + port.ToString() + "\nperiod  " + period.ToString() + "\nlossPkgTime " + lossPkgTime.ToString() + "\nlossPkgNum  " + lossPkgNum.ToString() + "\ndisConntime  " + disconnectTime.ToString() + "\nreconnecable  " + reconnectEnable.ToString() + "\nreconnperiod  " + reconnectPeriod.ToString() + "\nreconnnun  " + reconnectNum.ToString();
 8    Console.WriteLine("ExtDevGetUDPComParam rtn is " + rtn + param);
 9
10    robot.ExtDevLoadUDPDriver();
11
12    rtn = robot.ExtAxisServoOn(1, 1);
13    Console.WriteLine("ExtAxisServoOn axis id 1 rtn is " + rtn);
14    rtn = robot.ExtAxisServoOn(2, 1);
15    Console.WriteLine("ExtAxisServoOn axis id 2 rtn is " + rtn);
16    Thread.Sleep(2000);
17
18    rtn = robot.ExtAxisSetHoming(1, 0, 10, 2);
19    Console.WriteLine("ExtAxisSetHoming 1 rtnn is  " + rtn);
20    Thread.Sleep(2000);
21    rtn = robot.ExtAxisSetHoming(2, 0, 10, 2);
22    Console.WriteLine("ExtAxisSetHoming 2 rtnn is  " + rtn);
23
24    Thread.Sleep(4000);
25
26    rtn = robot.SetRobotPosToAxis(1);
27    Console.WriteLine("SetRobotPosToAxis rtn is " + rtn);
28    rtn = robot.SetAxisDHParaConfig(10, 20, 0, 0, 0, 0, 0, 0, 0);
29    Console.WriteLine("SetAxisDHParaConfig rtn is " + rtn);
30    rtn = robot.ExtAxisParamConfig(1, 1, 1, 1000, -1000, 1000, 1000, 1.905f, 262144, 200, 1, 0, 0);
31    Console.WriteLine("ExtAxisParamConfig axis 1 rtn is " + rtn);
32    rtn = robot.ExtAxisParamConfig(2, 1, 1, 1000, -1000, 1000, 1000, 4.444f, 262144, 200, 1, 0, 0);
33    Console.WriteLine("ExtAxisParamConfig axis 2 rtn is " + rtn);
34
35    Thread.Sleep(3000);
36    robot.ExtAxisStartJog(1, 0, 10, 10, 30);
37    Thread.Sleep(1000);
38    robot.ExtAxisStopJog(1);
39    Thread.Sleep(3000);
40    robot.ExtAxisServoOn(1, 0);
41
42    Thread.Sleep(3000);
43    robot.ExtAxisStartJog(2, 0, 10, 10, 30);
44    Thread.Sleep(1000);
45    robot.ExtAxisStopJog(2);
46    Thread.Sleep(3000);
47    robot.ExtAxisServoOn(2, 0);
48    Thread.Sleep(3000);
49    robot.ExtDevUnloadUDPDriver();
50}

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

New in version C#SDK-v1.0.7.

1/**
2* @brief Set extended axis coordinate system reference point - four-point method
3* @param [in]  pointNum Point number [1-4]
4* @return Error code
5*/
6int ExtAxisSetRefPoint(int pointNum);

13.32. Calculate extended axis coordinate system - four-point method

New in version C#SDK-v1.0.7.

1/**
2* @brief Calculate extended axis coordinate system - four-point method
3* @param [out]  coord Coordinate system value
4* @return Error code
5*/
6int ExtAxisComputeECoordSys(DescPose& coord);

13.33. Apply extended axis coordinate system

New in version C#SDK-v1.0.7.

1/**
2* @brief Apply extended axis coordinate system
3* @param [in]  applyAxisId Extended axis ID bit0-bit3 correspond to extended axis ID 1-4. For example, if extended axes 1 and 3 are applied, the value is 0b 0000 0101, which is 5
4* @param [in]  axisCoordNum Extended axis coordinate system ID
5* @param [in]  coord Coordinate system value
6* @param [in]  calibFlag Calibration flag 0-no, 1-yes
7* @return Error code
8*/
9int ExtAxisActiveECoordSys(int applyAxisId, int axisCoordNum, DescPose coord, int calibFlag);

13.34. Set the calibration reference point in the end coordinate system of the positioner

New in version C#SDK-v1.0.7.

1/**
2* @brief Set the calibration reference point in the end position coordinate system of the positioner
3* @param [in] pos Position value
4* @return Error code
5*/
6int SetRefPointInExAxisEnd(DescPose pos);

13.35. Set the reference point of the positioner coordinate system

New in version C#SDK-v1.0.7.

1/**
2* @brief Set the reference point in the positioner coordinate system
3* @param [in]  pointNum Point number [1-4]
4* @return Error code
5*/
6int PositionorSetRefPoint(int pointNum);

13.36. Positioner coordinate system calculation - four-point method

New in version C#SDK-v1.0.7.

1/**
2* @brief Positioner coordinate system calculation - four-point method
3* @param [out] coord Coordinate system value
4* @return Error code
5*/
6int PositionorComputeECoordSys(DescPose& coord);

13.37. Get extended axis coordinate system

New in version C#SDK-V1.1.3: Web-3.8.2

1/**
2* @brief Get extended axis coordinate system
3* @param [out] coord Extended axis coordinate system
4* @return Error code
5*/
6int ExtAxisGetCoord(ref DescPose coord);

13.38. Extended axis coordinate system calibration code example

New in version C#SDK-V1.1.3: Web-3.8.2

  1private void button66_Click(object sender, EventArgs e)
  2{
  3    int rtn = robot.ExtDevSetUDPComParam("192.168.58.88", 2021, 2, 100, 3, 200, 1, 100, 5,1);
  4    Console.WriteLine("ExtDevSetUDPComParam rtn is " + rtn);
  5    string ip = ""; int port = 0; int period = 0; int lossPkgTime = 0; int lossPkgNum = 0; int disconnectTime = 0; int reconnectEnable = 0; int reconnectPeriod = 0; int reconnectNum = 0;
  6    rtn = robot.ExtDevGetUDPComParam(ref ip, ref port, ref period, ref lossPkgTime, ref lossPkgNum, ref disconnectTime, ref reconnectEnable, ref reconnectPeriod, ref reconnectNum);
  7    string param = "\nip " + ip + "\nport " + port.ToString() + "\nperiod  " + period.ToString() + "\nlossPkgTime " + lossPkgTime.ToString() + "\nlossPkgNum  " + lossPkgNum.ToString() + "\ndisConntime  " + disconnectTime.ToString() + "\nreconnecable  " + reconnectEnable.ToString() + "\nreconnperiod  " + reconnectPeriod.ToString() + "\nreconnnun  " + reconnectNum.ToString();
  8    Console.WriteLine("ExtDevGetUDPComParam rtn is " + rtn + param);
  9
 10    robot.ExtDevLoadUDPDriver();
 11
 12    rtn = robot.ExtAxisServoOn(1, 1);
 13    Console.WriteLine("ExtAxisServoOn axis id 1 rtn is " + rtn);
 14    rtn = robot.ExtAxisServoOn(2, 1);
 15    Console.WriteLine("ExtAxisServoOn axis id 2 rtn is " + rtn);
 16    Thread.Sleep(2000);
 17
 18    robot.ExtAxisSetHoming(1, 0, 10, 2);
 19    Thread.Sleep(2000);
 20    rtn = robot.ExtAxisSetHoming(2, 0, 10, 2);
 21    Console.WriteLine("ExtAxisSetHoming rtnn is  " + rtn);
 22
 23    Thread.Sleep(4000);
 24
 25    rtn = robot.SetRobotPosToAxis(1);
 26    Console.WriteLine("SetRobotPosToAxis rtn is " + rtn);
 27    rtn = robot.SetAxisDHParaConfig(1, 128.5f, 206.4f, 0, 0, 0, 0, 0, 0);
 28    Console.WriteLine("SetAxisDHParaConfig rtn is " + rtn);
 29    rtn = robot.ExtAxisParamConfig(1, 1, 1, 1000, -1000, 1000, 1000, 1.905f, 262144, 200, 1, 0, 0);
 30    Console.WriteLine("ExtAxisParamConfig axis 1 rtn is " + rtn);
 31    rtn = robot.ExtAxisParamConfig(2, 1, 1, 1000, -1000, 1000, 1000, 4.444f, 262144, 200, 1, 0, 0);
 32    Console.WriteLine("ExtAxisParamConfig axis 1 rtn is " + rtn);
 33
 34    DescPose toolCoord = new DescPose(0, 0, 210, 0, 0, 0);
 35    robot.SetToolCoord(1, toolCoord, 0, 0, 1, 0);
 36
 37    JointPos jSafe = new JointPos(115.193f, -96.149f, 92.489f, -87.068f, -89.15f, -83.488f);
 38    JointPos j1 = new JointPos(117.559f, -92.624f, 100.329f, -96.909f, -94.057f, -83.488f);
 39    JointPos j2 = new JointPos(112.239f, -90.096f, 99.282f, -95.909f, -89.824f, -83.488f);
 40    JointPos j3 = new JointPos(110.839f, -83.473f, 93.166f, -89.22f, -90.499f, -83.487f);
 41    JointPos j4 = new JointPos(107.935f, -83.572f, 95.424f, -92.873f, -87.933f, -83.488f);
 42
 43    DescPose descSafe = new DescPose();
 44    DescPose desc1 = new DescPose();
 45    DescPose desc2 = new DescPose();
 46    DescPose desc3 = new DescPose();
 47    DescPose desc4 = new DescPose();
 48    ExaxisPos exaxisPos = new ExaxisPos(0, 0, 0, 0);
 49    DescPose offdese = new DescPose(0, 0, 0, 0, 0, 0);
 50
 51    robot.GetForwardKin( jSafe,  ref descSafe);
 52    robot.MoveJ( jSafe,  descSafe, 1, 0, 100, 100, 100,  exaxisPos, -1, 0,  offdese);
 53    Thread.Sleep(2000);
 54
 55    robot.GetForwardKin( j1, ref desc1);
 56    robot.MoveJ( j1,  desc1, 1, 0, 100, 100, 100,  exaxisPos, -1, 0,  offdese);
 57    Thread.Sleep(2000);
 58
 59    DescPose actualTCPPos = new DescPose();
 60    robot.GetActualTCPPose(0, ref actualTCPPos);
 61    robot.SetRefPointInExAxisEnd(actualTCPPos);
 62    rtn = robot.PositionorSetRefPoint(1);
 63    Console.WriteLine("PositionorSetRefPoint 1 rtn is " + rtn);
 64    Thread.Sleep(2000);
 65
 66    robot.MoveJ( jSafe,  descSafe, 1, 0, 100, 100, 100,  exaxisPos, -1, 0,  offdese);
 67    robot.ExtAxisStartJog(1, 0, 50, 50, 10);
 68    Thread.Sleep(1000);
 69    robot.ExtAxisStartJog(2, 0, 50, 50, 10);
 70    Thread.Sleep(1000);
 71    robot.GetForwardKin( j2, ref desc2);
 72    rtn = robot.MoveJ( j2,  desc2, 1, 0, 100, 100, 100,  exaxisPos, -1, 0,  offdese);
 73    rtn = robot.PositionorSetRefPoint(2);
 74    Console.WriteLine("PositionorSetRefPoint 2 rtn is " + rtn);
 75    Thread.Sleep(2000);
 76
 77    robot.MoveJ( jSafe,  descSafe, 1, 0, 100, 100, 100,  exaxisPos, -1, 0,  offdese);
 78    robot.ExtAxisStartJog(1, 0, 50, 50, 10);
 79    Thread.Sleep(1000);
 80    robot.ExtAxisStartJog(2, 0, 50, 50, 10);
 81    Thread.Sleep(1000);
 82    robot.GetForwardKin( j3, ref desc3);
 83    robot.MoveJ( j3,  desc3, 1, 0, 100, 100, 100,  exaxisPos, -1, 0,  offdese);
 84    rtn = robot.PositionorSetRefPoint(3);
 85    Console.WriteLine("PositionorSetRefPoint 3 rtn is " + rtn);
 86    Thread.Sleep(2000);
 87
 88    robot.MoveJ( jSafe,  descSafe, 1, 0, 100, 100, 100,  exaxisPos, -1, 0,  offdese);
 89    robot.ExtAxisStartJog(1, 0, 50, 50, 10);
 90    Thread.Sleep(1000);
 91    robot.ExtAxisStartJog(2, 0, 50, 50, 10);
 92    Thread.Sleep(1000);
 93    robot.GetForwardKin(j4, ref desc4);
 94    robot.MoveJ(j4, desc4, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
 95    rtn = robot.PositionorSetRefPoint(4);
 96    Console.WriteLine("PositionorSetRefPoint 4 rtn is " + rtn);
 97    Thread.Sleep(2000);
 98
 99    DescPose axisCoord = new DescPose();
100    robot.PositionorComputeECoordSys(ref axisCoord);
101    robot.MoveJ(jSafe, descSafe, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
102    Console.WriteLine("PositionorComputeECoordSys rtn is {0} {1} {2} {3} {4} {5}", axisCoord.tran.x, axisCoord.tran.y, axisCoord.tran.z, axisCoord.rpy.rx, axisCoord.rpy.ry, axisCoord.rpy.rz);
103    rtn = robot.ExtAxisActiveECoordSys(3, 1, axisCoord, 1);
104    Console.WriteLine("ExtAxisActiveECoordSys rtn is " + rtn);
105}

13.39. Extended axis motion via UDP

New in version C#SDK-V1.1.5: Web-3.8.4

1/**
2* @brief Extended axis motion via UDP
3* @param [in] pos Target position
4* @param [in] ovl Speed percentage
5* @param [in] blend Smoothing parameter (mm or ms)
6* @return Error code
7*/
8int ExtAxisMove(ExaxisPos pos, double ovl, double blend=-1);

13.40. UDP extended axis movement code example

1private void button66_Click(object sender, EventArgs e)
2{
3    ExaxisPos axisPos;
4    axisPos.ePos[0] = 20;
5    axisPos.ePos[1] = 0;
6    axisPos.ePos[2] = 0;
7    axisPos.ePos[3] = 0;
8    robot.ExtAxisMove(axisPos, 50);
9}

13.41. UDP extended axis and robot joint motion synchronization

New in version C#SDK-v1.0.7.

 1/**
 2* @brief UDP extension axis and robot joint motion synchronization
 3* @param [in] joint_pos Target joint position, unit deg
 4* @param [in] desc_pos Target Cartesian pose
 5* @param [in] tool Tool coordinate number, range [0~14]
 6* @param [in] user Workpiece coordinate number, range [0~14]
 7* @param [in] vel Speed percentage, range [0~100]
 8* @param [in] acc Acceleration percentage, range [0~100], not currently available
 9* @param [in] ovl Velocity scaling factor, range [0~100]
10* @param [in] epos Extended axis position, unit mm
11* @param [in] blendT [-1.0]-Move to position (blocked), [0~500.0]-Smooth time (non-blocked), unit ms
12* @param [in] offset_flag 0-no offset, 1-offset relative to base coordinate system/workpiece coordinate system, 2-offset relative to tool coordinate system
13* @param [in] offset_pos Pose offset
14* @return Error code
15*/
16int ExtAxisSyncMoveJ(JointPos joint_pos, DescPose desc_pos, int tool, int user, float vel, float acc, float ovl, ExaxisPos epos, float blendT, byte offset_flag, DescPose offset_pos);

13.42. Code example

 1private void btnSyncMoveJ_Click(object sender, EventArgs e)
 2{
 3    Robot robot = new Robot();
 4    robot.RPC("192.168.58.2");
 5    //1. Calibrate and apply the robot tool coordinate system. You can use the four-point method or six-point method to calibrate and apply the tool coordinate system. The interfaces involved in calibrating the tool coordinate system are as follows:
 6
 7    //    int SetToolPoint(int point_num);  //Set tool reference point - six-point method
 8    //    int ComputeTool(ref DescPose tcp_pose);  //Calculate tool coordinate system
 9    //    int SetTcp4RefPoint(int point_num);    //Set tool reference point - four-point method
10
11    //    int ComputeTcp4(ref DescPose tcp_pose);   // Calculate tool coordinate system - four-point method
12    //    int SetToolCoord(int id, DescPose coord, int type, int install);  // Set application tool coordinate system
13    //    int SetToolList(int id, DescPose coord, int type, int install);   // Set application tool coordinate system list
14
15    //2. Set UDP communication parameters and load UDP communication
16    robot.ExtDevSetUDPComParam("192.168.58.88", 2021, 2, 100, 3, 100, 1, 100, 10);
17    robot.ExtDevLoadUDPDriver();
18    //3. Set extended axis parameters, including extended axis type, extended axis driver parameters, and extended axis DH parameters
19    robot.SetAxisDHParaConfig(4, 200, 200, 0, 0, 0, 0, 0, 0); //Single-axis positioner and DH parameters
20    robot.SetRobotPosToAxis(1);  //Extended axis installation position
21    robot.ExtAxisParamConfig(1, 0, 1, 100, -100, 10, 10, 12, 131072, 0, 1, 0, 0); // Servo drive parameters. In this example, a single-axis positioner is used, so only one drive parameter needs to be set. If you select an extended axis type with multiple axes, each axis must have its drive parameters set.
22    //4. Enable the selected axis and return to zero
23    robot.ExtAxisServoOn(1, 0);
24
25    robot.ExtAxisSetHoming(1, 0, 20, 3);
26    //5. Perform extended axis coordinate system calibration and application (Note: The calibration interfaces for positioners and linear rails are different. The following is the calibration interface for positioners)
27    DescPose pos = new DescPose(/* Enter your calibration point coordinates */);
28
29    robot.SetRefPointInExAxisEnd(pos);
30    robot.PositionorSetRefPoint(1); /* You need to calibrate the extended axis using four points at different positions, so this interface must be called four times to complete the calibration */
31    DescPose coord = new DescPose( );
32    robot.PositionorComputeECoordSys(ref coord); // Calculate the extended axis calibration results
33
34    robot.ExtAxisActiveECoordSys(1, 1, coord, 1);  //Apply the calibration results to the extended axis coordinate system
35    //6. Calibrate the workpiece coordinate system on the extended axis. You need to use the following interfaces
36    //int SetWObjCoordPoint(int point_num);
37
38    //int ComputeWObjCoord(int method, ref DescPose wobj_pose);
39    //int SetWObjCoord(int id, DescPose coord);
40    //int SetWObjList(int id, DescPose coord);
41    //7. Record the starting point of your synchronized joint motion
42
43    DescPose startdescPose = new DescPose(/*Enter your coordinates*/);
44    JointPos startjointPos = new JointPos(/*Enter your coordinates*/);
45    ExaxisPos startexaxisPos = new ExaxisPos(/* Enter your extended axis starting point coordinates */);
46    //8. Record the endpoint coordinates of your synchronized joint motion
47
48    DescPose enddescPose = new DescPose(/*enter your coordinates*/);
49    JointPos endjointPos = new JointPos(/*enter your coordinates*/);
50    ExaxisPos endexaxisPos = new ExaxisPos(/* Enter your extended axis endpoint coordinates */);
51    //9. Write the synchronized motion program
52    //Move to the starting point, assuming the tool coordinate system and workpiece coordinate system are both 1
53    robot.ExtAxisMove(startexaxisPos, 20);
54
55    DescPose offdese = new DescPose(0, 0, 0, 0, 0, 0);
56    robot.MoveJ(startjointPos, startdescPose, 1, 1, 100, 100, 100, startexaxisPos, 0, 0, offdese);
57
58    //Start synchronized movement
59    robot.ExtAxisSyncMoveJ(endjointPos, enddescPose, 1, 1, 100, 100, 100, endexaxisPos, -1, 0, offdese);
60}

13.43. UDP extended axis and robot linear motion synchronization

New in version C#SDK-v1.0.7.

 1/**
 2* @brief UDP extended axis and robot linear motion synchronization
 3* @param [in] joint_pos  Target joint position, unit: deg
 4* @param [in] desc_pos   Target Cartesian pose
 5* @param [in] tool  Tool coordinate number, range[0~14]
 6* @param [in] user  Workpiece coordinate index, range [0~14]
 7* @param [in] vel  Velocity percentage, range [0~100]
 8* @param [in] acc  Acceleration percentage, range [0~100], not currently available
 9* @param [in] ovl  Velocity scaling factor, range [0~100]
10* @param [in] blendR [-1.0]-Move to position (blocked), [0~1000.0]-Smoothing radius
11(non-blocking), unit mm
12* @param [in] epos  Extended axis position, unit mm
13* @param [in] offset_flag  0-no offset, 1-offset relative to base coordinate system/workpiece coordinate system, 2-offset relative to tool coordinate system
14* @param [in] offset_pos  Position offset
15*/
16int ExtAxisSyncMoveL(JointPos joint_pos, DescPose desc_pos, int tool, int user, float vel, float acc, float ovl, float blendR, ExaxisPos epos, int offset_flag, DescPose offset_pos);

13.44. Code example

 1private void btnSyncMoveL_Click(object sender, EventArgs e)
 2{
 3Robot robot = new Robot();
 4robot.RPC("192.168.58.2");
 5
 6//1. Calibrate and apply the robot tool coordinate system. You can use the four-point method or six-point method to calibrate and apply the tool coordinate system. The interfaces involved in calibrating the tool coordinate system are as follows:
 7    //    int SetToolPoint(int point_num);  //Set the tool reference point - six-point method
 8
 9//    int ComputeTool(ref DescPose tcp_pose);  // Calculate tool coordinate system
10    //    int SetTcp4RefPoint(int point_num);    // Set tool reference point - four-point method
11
12//    int ComputeTcp4(ref DescPose tcp_pose);   // Calculate tool coordinate system - four-point method
13    //    int SetToolCoord(int id, DescPose coord, int type, int install);  // Set application tool coordinate system
14//    int SetToolList(int id, DescPose coord, int type, int install);   // Set application tool coordinate system list
15
16//2. Set UDP communication parameters and load UDP communication
17robot.ExtDevSetUDPComParam("192.168.58.88", 2021, 2, 100, 3, 100, 1, 100, 10);
18robot.ExtDevLoadUDPDriver();
19//3. Set extended axis parameters, including extended axis type, extended axis driver parameters, and extended axis DH parameters
20robot.SetAxisDHParaConfig(4, 200, 200, 0, 0, 0, 0, 0, 0); //Single-axis positioner and DH parameters
21robot.SetRobotPosToAxis(1);  // Extended axis installation position
22robot.ExtAxisParamConfig(1, 0, 1, 100, -100, 10, 10, 12, 131072, 0, 1, 0, 0); //Servo drive parameters. In this example, a single-axis positioner is used, so only one drive parameter needs to be set. If you select an extended axis type with multiple axes, each axis must have its drive parameters set.
23//4.Enable the selected axis and set it to home position.
24robot.ExtAxisServoOn(1, 0);
25robot.ExtAxisSetHoming(1, 0, 20, 3);
26//5. Perform extended axis coordinate system calibration and apply
27DescPose pos = new DescPose(/* Enter your calibration point coordinates */);
28robot.SetRefPointInExAxisEnd(pos);
29robot.PositionorSetRefPoint(1); /* You need to calibrate the extended axis using four different points, so you must call this interface four times to complete the calibration */
30
31DescPose coord = new DescPose();
32robot.PositionorComputeECoordSys(ref coord); // Calculate the extended axis calibration results
33robot.ExtAxisActiveECoordSys(1, 1, coord, 1);  //Apply the calibration results to the extended axis coordinate system
34
35DescPose startdescPose = new DescPose(/*Enter your coordinates*/);
36
37JointPos startjointPos = new JointPos(/*Enter your coordinates*/);
38    ExaxisPos startexaxisPos = new ExaxisPos(/* Enter your extended axis starting point coordinates */);
39//8. Record the endpoint coordinates of your synchronized linear motion
40DescPose enddescPose = new DescPose(/*Enter your coordinates*/);
41
42JointPos endjointPos = new JointPos(/*Enter your coordinates*/);
43ExaxisPos endexaxisPos = new ExaxisPos(/* Enter your extended axis endpoint coordinates */);
44//9. Write the synchronized motion program
45//Move to the starting point, assuming that the tool coordinate system and workpiece coordinate system are both 1
46robot.ExtAxisMove(startexaxisPos, 20);
47DescPose offdese = new DescPose(0, 0, 0, 0, 0, 0);
48robot.MoveJ(startjointPos, startdescPose, 1, 1, 100, 100, 100, startexaxisPos, 0, 0, offdese);
49
50//Start synchronized movement
51robot.ExtAxisSyncMoveL(endjointPos, enddescPose, 1, 1, 100, 100, 100, 0, endexaxisPos, 0, offdese);
52}

13.45. UDP extended axis and robot arc motion synchronization

New in version C#SDK-v1.0.7.

 1/**
 2* @brief UDP extended axis and robot arc motion synchronization
 3* @param [in] joint_pos_p  Path point joint position, unit deg
 4* @param [in] desc_pos_p   Path point Cartesian pose
 5* @param [in] ptool  Tool coordinate number, range [0~14]
 6* @param [in] puser  Workpiece coordinate number, range [0~14]
 7* @param [in] pvel  Speed percentage, range[0~100]
 8* @param [in] pacc  Acceleration percentage, range [0~100], not currently available
 9* @param [in] epos_p  Intermediate point extension axis position, unit mm
10* @param [in] poffset_flag  0-no offset, 1-offset relative to base coordinate system/workpiece coordinate system, 2-offset relative to tool coordinate system
11* @param [in] offset_pos_p  Position offset
12* @param [in] joint_pos_t  Target point joint position, unit deg
13* @param [in] desc_pos_t   Target point Cartesian position
14* @param [in] ttool  Tool coordinate number, range [0~14]
15* @param [in] tuser  Workpiece coordinate index, range [0~14]
16* @param [in] tvel  Velocity percentage, range [0~100]
17* @param [in] tacc  Acceleration percentage, range [0~100], not currently available
18* @param [in] epos_t  Extended axis position, unit mm
19* @param [in] toffset_flag  0-no offset, 1-offset relative to base coordinate system/workpiece coordinate system, 2-offset relative to tool coordinate system
20* @param [in] offset_pos_t Pose offset
21* @param [in] ovl Speed scaling factor, range [0~100]
22* @param [in] blendR [-1.0]-Move to position (blocked), [0~1000.0]-Smooth radius (unblocked), unit mm
23* @return Error code
24*/
25int ExtAxisSyncMoveC(JointPos joint_pos_p, DescPose desc_pos_p, int ptool, int puser, float pvel, float pacc, ExaxisPos epos_p, int poffset_flag, DescPose offset_pos_p, JointPos joint_pos_t, DescPose desc_pos_t, int ttool, int tuser, float tvel, float tacc, ExaxisPos epos_t, int toffset_flag, DescPose offset_pos_t, float ovl, float blendR);

13.46. Code example

 1private void btnSyncMoveC_Click(object sender, EventArgs e)
 2{
 3    Robot robot = new Robot();
 4    robot.RPC("192.168.58.2");
 5    //1. Calibrate and apply the robot tool coordinate system. You can use the four-point method or six-point method to calibrate and apply the tool coordinate system. The interfaces involved in calibrating the tool coordinate system are as follows:
 6
 7    //    int SetToolPoint(int point_num);  //Set tool reference point - six-point method
 8    //    int ComputeTool(ref DescPose tcp_pose);  //Compute tool coordinate system
 9    //    int SetTcp4RefPoint(int point_num);    //Set tool reference point - four-point method
10
11    //    int ComputeTcp4(ref DescPose tcp_pose);   // Calculate tool coordinate system - four-point method
12    //    int SetToolCoord(int id, DescPose coord, int type, int install);  // Set application tool coordinate system
13    //    int SetToolList(int id, DescPose coord, int type, int install);   // Set application tool coordinate system list
14
15    //2. Set UDP communication parameters and load UDP communication
16    robot.ExtDevSetUDPComParam("192.168.58.88", 2021, 2, 100, 3, 100, 1, 100, 10);
17    robot.ExtDevLoadUDPDriver();
18
19    //3. Set the extended axis parameters, including extended axis type, extended axis driver parameters, and extended axis DH parameters
20    robot.SetAxisDHParaConfig(4, 200, 200, 0, 0, 0, 0, 0, 0); //Single-axis positioner and DH parameters
21    robot.SetRobotPosToAxis(1);  // Extended axis installation position
22    robot.ExtAxisParamConfig(1, 0, 1, 100, -100, 10, 10, 12, 131072, 0, 1, 0, 0); // Servo drive parameters. In this example, it is a single-axis positioner, so only one drive parameter needs to be set. If you select an extended axis type with multiple axes, each axis must have its drive parameters set
23
24    //4. Enable the selected axis and set it to home position
25    robot.ExtAxisServoOn(1, 0);
26    robot.ExtAxisSetHoming(1, 0, 20, 3);
27    //5. Perform extended axis coordinate system calibration and application
28
29    DescPose pos = new DescPose(/* Enter your calibration point coordinates */);
30    robot.SetRefPointInExAxisEnd(pos);
31    robot.PositionorSetRefPoint(1); /*You need to calibrate the extended axis using four different points, so you need to call this interface four times to complete the calibration */
32    DescPose coord = new DescPose();
33
34    robot.PositionorComputeECoordSys(ref coord); // Calculate the extended axis calibration results
35    robot.ExtAxisActiveECoordSys(1, 1, coord, 1);  // Apply the calibration results to the extended axis coordinate system
36    //6. Calibrate the workpiece coordinate system on the extended axis. You will need the following interfaces
37
38    //int SetWObjCoordPoint(int point_num);
39    //int ComputeWObjCoord(int method, ref DescPose wobj_pose);
40    //int SetWObjCoord(int id, DescPose coord);
41    //int SetWObjList(int id, DescPose coord);
42    //7. Record the starting point of your synchronized arc motion
43
44    DescPose startdescPose = new DescPose(/*Enter your coordinates*/);
45    JointPos startjointPos = new JointPos(/*Enter your coordinates*/);
46    ExaxisPos startexaxisPos = new ExaxisPos(/* Enter your extended axis starting point coordinates */);
47    //8. Record the endpoint coordinates of your synchronized circular arc motion
48
49    DescPose endDescPose = new DescPose(/*Enter your coordinates*/);
50    JointPos endJointPos = new JointPos(/*Enter your coordinates*/);
51
52    ExaxisPos endexaxisPos = new ExaxisPos(/* Enter your extended axis endpoint coordinates */);
53    //8. Record your synchronized arc motion midpoint coordinates
54    DescPose middescPose = new DescPose(/* Enter your coordinates */);
55    JointPos midjointPos = new JointPos(/* Enter your coordinates */);
56
57    ExaxisPos midexaxisPos = new ExaxisPos(/* Enter the extended axis coordinates when the robot is at the arc midpoint */);
58    //9. Write the synchronized motion program
59
60    //Move to the starting point, assuming the tool coordinate system and workpiece coordinate system are both 1
61    robot.ExtAxisMove(startexaxisPos, 20);
62    DescPose offdese = new DescPose(0, 0, 0, 0, 0, 0);
63
64    robot.MoveJ(startjointPos, startdescPose, 1, 1, 100, 100, 100, startexaxisPos, 0, 0, offdese);
65    //Start synchronized motion
66    robot.ExtAxisSyncMoveC(midjointPos, middescPose, 1, 1, 100, 100, midexaxisPos, 0, offdese, endjointPos, enddescPose, 1, 1, 100, 100, endexaxisPos, 0, offdese, 100, 0);
67}

13.47. Set extended DO

New in version C#SDK-v1.0.7.

1/**
2* @brief Set extended DO
3* @param [in] DONum DO number
4* @param [in] bOpen switch true-on; false-off
5* @param [in] smooth whether to smooth
6* @param [in] block whether to block
7* @return Error code
8*/
9int SetAuxDO(int DONum, bool bOpen, bool smooth, bool block);

13.48. Set extended AO

New in version C#SDK-v1.0.7.

1/**
2* @brief Set extended AO
3* @param [in] AONum AO number
4* @param [in] value Analog value [0-4095]
5* @param [in] block Whether to block
6* @return Error code
7*/
8int SetAuxAO(int AONum, double value, bool block);

13.49. Set extended DI input filter time

New in version C#SDK-v1.0.7.

1/**
2* @brief Set extended DI input filter time
3* @param [in] filterTime Filter time (ms)
4* @return Error code
5*/
6int SetAuxDIFilterTime(int filterTime);

13.50. Set extended AI input filter time

New in version C#SDK-v1.0.7.

1/**
2* @brief Set extended AI input filter time
3* @param [in] filterTime Filter time (ms)
4* @return Error code
5*/
6int SetAuxAIFilterTime(int filterTime);

13.51. Wait for extended DI input

New in version C#SDK-v1.0.7.

1/**
2* @brief Wait for extended DI input
3* @param [in] DINum DI number
4* @param [in] bOpen Switch 0-off; 1-on
5* @param [in] time Maximum wait time (ms)
6* @param [in] errorAlarm Whether to continue movement
7* @return Error code
8*/
9int WaitAuxDI(int DINum, bool bOpen, int time, bool errorAlarm);

13.52. Wait for extended AI input

New in version C#SDK-v1.0.7.

 1/**
 2* @brief Wait for extended AI input
 3* @param [in] AINum AI number
 4* @param [in] sign 0-greater than; 1-less than
 5* @param [in] value AI value
 6* @param [in] time Maximum wait time (ms)
 7* @param [in] errorAlarm Continue movement
 8* @return Error code
 9*/
10int WaitAuxAI(int AINum, int sign, int value, int time, bool errorAlarm);

13.53. Get extended DI value

New in version C#SDK-v1.0.7.

1/**
2* @brief Get extended DI value
3* @param [in] DINum DI number
4* @param [in] isNoBlock Whether to block
5* @param [out] isOpen 0-off; 1-on
6* @return Error code
7*/
8int GetAuxDI(int DINum, bool isNoBlock, bool& isOpen);

13.54. Get extended AI value

New in version C#SDK-v1.0.7.

1/**
2* @brief Get extended AI value
3* @param [in] AINum AI number
4* @param [in] isNoBlock Whether to block
5* @param [in] value Input value
6* @return Error code
7*/
8int GetAuxAI(int AINum, bool isNoBlock, int& value);

13.55. Extended IO code example

 1private void btnAODO_Click(object sender, EventArgs e)
 2{
 3    int rtn;
 4    for (int i = 0; i < 128; i++)
 5    {
 6        robot.SetAuxDO(i, true, false, true);
 7        Thread.Sleep(100);
 8    }
 9    for (int i = 0; i < 128; i++)
10    {
11        robot.SetAuxDO(i, false, false, true);
12        Thread.Sleep(100);
13    }
14
15    for (int i = 0; i < 409; i++)
16    {
17        robot.SetAuxAO(0, i * 10, true);
18        robot.SetAuxAO(1, 4095 - i * 10, true);
19        robot.SetAuxAO(2, i * 10, true);
20        robot.SetAuxAO(3, 4095 - i * 10, true);
21        Thread.Sleep(10);
22    }
23
24    robot.SetAuxDIFilterTime(10);
25    robot.SetAuxAIFilterTime(0, 10);
26
27    for (int i = 0; i < 20; i++)
28    {
29        bool curValue = false;
30        rtn = robot.GetAuxDI(i, false, ref curValue);
31        Console.WriteLine("DI" + i + "   " + curValue);
32    }
33    int curValueAI = -1;
34    for (int i = 0; i < 4; i++)
35    {
36        rtn = robot.GetAuxAI(i, true, ref curValueAI);
37    }
38
39    robot.WaitAuxDI(1, false, 1000, false);
40    robot.WaitAuxAI(1, 1, 132, 1000, false);
41}

13.56. Enable movable device

New in version C#SDK-v1.0.9.

1/**
2* @brief Enable movable device
3* @param enable false-disable; true-enable
4* @return Error code
5*/
6int TractorEnable(bool enable);

13.57. Stop movable device movement

New in version C#SDK-v1.0.9.

1/**
2* @brief Stop the movement of the movable device
3* @return Error code
4*/
5int TractorStop();

13.58. Reset the movable device

New in version C#SDK-v1.0.9.

1/**
2* @brief Movable device returns to zero
3* @return Error code
4*/
5int TractorHoming();

13.59. Movable device moves in a straight line

New in version C#SDK-v1.0.9.

1/**
2* @brief Movable device moves in a straight line
3* @param distance Linear movement distance (mm)
4* @param vel Linear movement speed percentage (0-100)
5* @return Error code
6*/
7int TractorMoveL(double distance, double vel);

13.60. Circular motion of a movable device

New in version C#SDK-v1.0.9.

1/**
2* @brief Circular motion of a movable device
3* @param radio Circular motion radius (mm)
4* @param angle Arc movement angle (°)
5* @param vel Linear movement speed percentage (0-100)
6* @return Error code
7*/
8int TractorMoveC(double radio, double angle, double vel);

13.61. Code example

 1private void button6_Click(object sender, EventArgs e)
 2{
 3    int rtn;
 4    robot.ExtDevSetUDPComParam("192.168.58.2", 2021, 2, 50, 5, 50, 1, 50, 10,1);
 5    robot.ExtDevLoadUDPDriver();
 6    rtn = robot.ExtAxisServoOn(1, 1);
 7    rtn = robot.ExtAxisServoOn(2, 1);
 8    Thread.Sleep(2000);
 9    robot.ExtAxisSetHoming(1, 0, 10, 2);
10    Thread.Sleep(2000);
11    rtn = robot.ExtAxisSetHoming(2, 0, 10, 2);
12    Thread.Sleep(4000);
13    robot.ExtAxisParamConfig(1, 0, 0, 50000, -50000, 1000, 1000, 6.280f, 16384, 200, 0, 0, 0);
14    robot.ExtAxisParamConfig(2, 0, 0, 50000, -50000, 1000, 1000, 6.280f, 16384, 200, 0, 0, 0);
15    robot.SetAxisDHParaConfig(5, 0, 0, 0, 0, 0, 0, 0, 0);
16    robot.TractorEnable(false);
17    Thread.Sleep(2000);
18    robot.TractorEnable(true);
19    Thread.Sleep(2000);
20    robot.TractorHoming();
21    Thread.Sleep(2000);
22    robot.TractorMoveL(100, 2);
23    Thread.Sleep(5000);
24    robot.TractorStop();
25    robot.TractorMoveL(-100, 20);
26    Thread.Sleep(5000);
27    robot.TractorMoveC(300, 90, 20);
28    Thread.Sleep(10000);
29    robot.TractorMoveC(300, -90, 20);
30    Thread.Sleep(1000);
31    robot.TractorStop();
32}

13.62. Set the synchronous motion strategy of the extension axis and the robot

New in version C#SDK-V1.1.7: Web-3.8.5

1/**
2* @brief Set the synchronous movement strategy of the extended axis with the robot
3* @param strategy Strategy; 0 - Robot as the main; 1 - Extended axis synchronous with the robot
4* @return Error code */
5
6int SetExAxisRobotPlan(int strategy)

13.63. Code example for setting up the extended axis to move synchronously with the robot

New in version C#SDK-V1.1.7: Web-3.8.5

 1private void button94_Click(object sender, EventArgs e)
 2{
 3    JointPos joint_pos1 = new JointPos(-22.016, -49.217, 124.714, -161.100, -85.108, -0.333);
 4    JointPos joint_pos2 = new JointPos(-21.083, -46.613, 110.079, -147.796, -80.757, -0.330);
 5    JointPos joint_pos3 = new JointPos(-25.572, -60.090, 135.397, -163.889, -82.489, -0.345);
 6    DescPose desc_pos1 = new DescPose(2.637, -0.001, 30.673, 178.786, -4.134, 68.326);
 7    DescPose desc_pos2 = new DescPose(213.812, -1.440, 47.311, 177.410, 0.166, 68.946);
 8    DescPose desc_pos3 = new DescPose(444.342, -12.723, 82.470, -177.701, -1.325, 65.151);
 9    ExaxisPos epos1 = new ExaxisPos(0.001, 0.000, 0.000, 0.000);
10    ExaxisPos epos2 = new ExaxisPos(299.977, 0.000, 0.000, 0.000);
11    ExaxisPos epos3 = new ExaxisPos(399.969, 0.000, 0.000, 0.000);
12    DescPose offset_pos = new DescPose(0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
13    int rtn = robot.SetExAxisRobotPlan(0);
14    Console.WriteLine($"SetExAxisRobotPlan rtn is {rtn}");
15    Thread.Sleep(1000);
16    rtn = robot.ExtAxisSyncMoveL(joint_pos1, desc_pos1, 1, 0, 100, 100, 100, -1, epos1, 0, offset_pos);
17    Console.WriteLine($"ExtAxisSyncMoveL 1 rtn is {rtn}");
18
19    rtn = robot.ExtAxisSyncMoveL(joint_pos2, desc_pos2, 1, 0, 100, 100, 100, -1, epos2, 0, offset_pos);
20    Console.WriteLine($"ExtAxisSyncMoveL 2 rtn is {rtn}");
21    rtn = robot.ExtAxisSyncMoveL(joint_pos3, desc_pos3, 1, 0, 100, 100, 100, -1, epos3, 0, offset_pos);
22    Console.WriteLine($"ExtAxisSyncMoveL 3 rtn is {rtn}");
23    Thread.Sleep(8000);
24}

13.64. UDP Extension Axis Positioning Completion Time Setting

1/**
2* @brief UDP extension axis positioning completion time setting
3* @param [in] time Positioning completion time [ms]
4* @return Error code
5*/
6public int SetExAxisCmdDoneTime(double time)