13. Extended Axis
13.1. Set 485 Extended Axis Parameters
1/**
2* @brief Set 485 extended axis parameters
3* @param [in] servoId Servo driver ID, range [1-16], corresponding to slave ID
4* @param [in] param 485 extended axis parameters
5* @return Error code
6*/
7int AuxServoSetParam(int servoId, Axis485Param param)
13.2. Get 485 Extended Axis Parameters
1/**
2* @brief Get 485 extended axis configuration parameters
3* @param [in] servoId Servo driver ID, range [1-16], corresponding to slave ID
4* @param [out] param 485 extended axis parameters
5* @return Error code
6*/
7int AuxServoGetParam(int servoId, Axis485Param param);
13.3. Set 485 Extended Axis Enable/Disable
1/**
2* @brief Set 485 extended axis enable/disable
3* @param [in] servoId Servo driver ID, range [1-16], corresponding to slave ID
4* @param [in] status Enable status, 0-disable, 1-enable
5* @return Error code
6*/
7int AuxServoEnable(int servoId, int status);
13.4. Set 485 Extended Axis Control Mode
1/**
2* @brief Set 485 extended axis control mode
3* @param [in] servoId Servo driver ID, range [1-16], 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 485 Extended Axis Target Position (Position Mode)
1/**
2* @brief Set 485 extended axis target position (position mode)
3* @param [in] servoId Servo driver ID, range [1-16], corresponding to slave ID
4* @param [in] pos Target position, mm or °
5* @param [in] speed Target speed, mm/s or °/s
6* @param [in] acc Acceleration percentage [0-100]
7* @return Error code
8*/
9int AuxServoSetTargetPos(int servoId, double pos, double speed, double acc);
13.6. Set 485 Extended Axis Target Torque (Torque Mode) - Not Yet Available
1/**
2* @brief Set 485 extended axis target torque (torque mode) - Not yet available
3* @param [in] servoId Servo driver ID, range [1-16], corresponding to slave ID
4* @param [in] torque Target torque, Nm
5* @return Error code
6*/
7int AuxServoSetTargetTorque(int servoId, double torque);
13.7. Set 485 Extended Axis
1/**
2* @brief Set 485 extended axis homing
3* @param [in] servoId Servo driver ID, range [1-16], corresponding to slave ID
4* @param [in] mode Homing mode, 1-current position homing; 2-negative limit homing; 3-positive limit homing
5* @param [in] searchVel Homing speed, mm/s or °/s
6* @param [in] latchVel Latch speed, mm/s or °/s
7* @param [in] acc Acceleration percentage [0-100]
8* @return Error code
9*/
10int AuxServoHoming(int servoId, int mode, double searchVel, double latchVel);
13.8. Clear 485 Extended Axis Error Information
1/**
2* @brief Clear 485 extended axis error information
3* @param [in] servoId Servo driver ID, range [1-16], corresponding to slave ID
4* @return Error code
5*/
6int AuxServoClearError(int servoId);
13.9. Get 485 Extended Axis Servo Status
1/**
2* @brief Get 485 extended axis servo status
3* @param [in] servoId Servo driver ID, range [1-16], corresponding to slave ID
4* @param [in] servoErrCode Servo driver error code
5* @param [in] servoState Servo driver status bit0:0-disabled; 1-enabled; bit1:0-not moving; 1-moving; bit4 0-positioning not completed; 1-positioning completed; bit5:0-homing not completed; 1-homing completed
6* @param [in] servoPos Servo current position mm or °
7* @param [in] servoSpeed Servo current speed mm/s or °/s
8* @param [in] servoTorque Servo current torque Nm
9* @return Error code
10*/
11int AuxServoGetStatus(int servoId, int[] servoErrCode, int[] servoState, double[] servoPos, double[] servoSpeed, double[] servoTorque)
13.10. Set 485 Extended Axis Target Speed (Speed Mode)
1/**
2* @brief Set 485 extended axis target speed (speed mode)
3* @param [in] servoId Servo driver ID, range [1-16], corresponding to slave ID
4* @param [in] speed Target speed, mm/s or °/s
5* @param [in] acc Acceleration percentage [0-100]
6* @return Error code
7*/
8int AuxServoSetTargetSpeed(int servoId, double speed, double acc);
13.11. Set Axis Number for Status Feedback of 485 Extended Axis
1/**
2* @brief Set axis number for status feedback of 485 extended axis
3* @param [in] servoId Servo driver ID, range [1-16], corresponding to slave ID
4* @return Error code
5*/
6int AuxServosetStatusID(int servoId);
13.12. Set 485 Extended Axis Motion Acceleration/Deceleration
1/**
2* @brief Set 485 extended axis motion acceleration/deceleration
3* @param [in] acc 485 extended axis motion acceleration
4* @param [in] dec 485 extended axis motion deceleration
5* @return Error code
6*/
7int AuxServoSetAcc(double acc, double dec)
13.13. Set 485 Extended Axis Emergency Stop Acceleration/Deceleration
1/**
2* @brief Set 485 extended axis emergency stop acceleration/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 Motion Acceleration/Deceleration
1/**
2* @brief Get 485 extended axis motion acceleration/deceleration
3* @return List[0]: Error code; List[1]: 485 extended axis motion acceleration; List[2]: 485 extended axis motion deceleration
4*/
5List<Number> AuxServoGetAcc()
13.15. Get 485 Extended Axis Emergency Stop Acceleration/Deceleration
1/**
2* @brief Get 485 extended axis emergency stop acceleration/deceleration
3* @return List[0]: Error code; List[1]: 485 extended axis emergency stop acceleration; List[2]: 485 extended axis emergency stop deceleration
4*/
5List<Number> AuxServoGetEmergencyStopAcc()
13.16. Extended Axis Control Code Example
1public static int Test485Auxservo(Robot robot)
2{
3 Axis485Param ax=new Axis485Param(1, 1, 1, 131072, 15.45);
4 int retval = robot.AuxServoSetParam(1, ax);
5
6 Axis485Param ax2=new Axis485Param();
7 retval = robot.AuxServoGetParam(1, ax2);
8
9 ax.servoCompany=10;
10 ax.servoModel=11;
11 ax.servoSoftVersion=12;
12 ax.servoResolution=13;
13 ax.axisMechTransRatio=14;
14
15 retval = robot.AuxServoSetParam(1, ax);
16
17 retval = robot.AuxServoGetParam(1,ax2);
18
19 ax.servoCompany=1;
20 ax.servoModel=1;
21 ax.servoSoftVersion=1;
22 ax.servoResolution=131072;
23 ax.axisMechTransRatio=36;
24
25 retval = robot.AuxServoSetParam(1, ax);
26 robot.Sleep(3000);
27
28 robot.AuxServoSetAcc(3000, 3000);
29 robot.AuxServoSetEmergencyStopAcc(5000, 5000);
30 robot.Sleep(1000);
31 double emagacc = 0, acc = 0;
32 double emagdec = 0, dec = 0;
33
34 List<Number> aux=new ArrayList<>();
35
36 aux=robot.AuxServoGetEmergencyStopAcc();
37 aux=robot.AuxServoGetAcc();
38
39 robot.AuxServoSetControlMode(1, 0);
40 robot.Sleep(2000);
41
42 retval = robot.AuxServoEnable(1, 0);
43 robot.Sleep(1000);
44 int[] servoerrcode =new int[]{0};
45 int[] servoErrCode=new int[]{0};
46 int[] servoState=new int[]{0};
47 double[] servoPos=new double[]{0};
48 double[] servoSpeed=new double[]{0};
49 double[] servoTorque=new double[]{0};
50 retval = robot.AuxServoGetStatus(1, servoErrCode, servoState, servoPos, servoSpeed, servoTorque);
51 robot.Sleep(1000);;
52
53 retval = robot.AuxServoEnable(1, 1);
54 robot.Sleep(1000);
55 retval = robot.AuxServoGetStatus(1, servoErrCode, servoState, servoPos, servoSpeed, servoTorque);
56 robot.Sleep(1000);
57
58 retval = robot.AuxServoHoming(1, 1, 5, 1,100);
59 robot.Sleep(3000);
60
61 retval = robot.AuxServoSetTargetPos(1, 200, 30,100);
62 robot.Sleep(1000);
63 retval = robot.AuxServoGetStatus(1, servoErrCode, servoState, servoPos, servoSpeed, servoTorque);
64 robot.Sleep(8000);
65
66
67 robot.AuxServoSetControlMode(1, 1);
68 robot.Sleep(2000);
69
70 robot.AuxServoEnable(1, 0);
71 robot.Sleep(1000);
72 robot.AuxServoEnable(1, 1);
73 robot.Sleep(1000);
74 robot.AuxServoSetTargetSpeed(1, 100, 80);
75
76 robot.Sleep(5000);
77 robot.AuxServoSetTargetSpeed(1, 0, 80);
78
79 robot.CloseRPC();
80 return 0;
81}
13.17. UDP Extended Axis Communication Parameter Configuration
Changed in version Java: SDK-v1.0.5-3.8.2
1/**
2* @brief UDP extended axis communication parameter configuration
3* @param [in] param Communication parameters
4* @return Error code
5*/
6int ExtDevSetUDPComParam(UDPComParam param);
13.18. Get UDP Extended Axis Communication Parameter Configuration
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
1/**
2* @brief Load UDP communication
3* @return Error code
4*/
5int ExtDevLoadUDPDriver();
13.20. Unload UDP Communication
1/**
2* @brief Unload UDP communication
3* @return Error code
4*/
5int ExtDevUnloadUDPDriver();
13.21. Reconnect After UDP Extended Axis Communication Exception Disconnection
1/**
2* @brief Reconnect after UDP extended axis communication exception disconnection
3* @return Error code
4*/
5int ExtDevUDPClientComReset();
13.22. Close Communication After UDP Extended Axis Communication Exception Disconnection
1/**
2* @brief Close communication after UDP extended axis communication exception disconnection
3* @return Error code
4*/
5int ExtDevUDPClientComClose();
13.23. UDP Extended Axis Parameter Configuration
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-reverse
6* @param [in] axisMax Extended axis maximum position mm
7* @param [in] axisMin Extended axis minimum position 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 starting point extended 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, int encResolution, double axisOffect, int axisCompany, int axisModel, int axisEncType);
13.24. Set Extended Axis Installation Position
1/**
2* @brief Set extended axis installation position
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
1/**
2* @brief Set extended axis system DH parameter configuration
3* @param [in] axisConfig External axis configuration, 0-single degree of freedom linear slide, 1-two degree of freedom L-type positioner, 2-three degree of freedom, 3-four degree of freedom, 4-single degree of freedom positioner
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 a1 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
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 Homing
1/**
2* @brief UDP extended axis homing
3* @param [in] axisID Axis number [1-4]
4* @param [in] mode Homing method 0-current position homing, 1-negative limit homing, 2-positive limit homing
5* @param [in] searchVel Homing speed (mm/s)
6* @param [in] latchVel Homing latch 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
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
1/**
2* @brief UDP extended axis jog stop
3* @param [in] axisID Axis number [1-4]
4* @return Error code
5*/
6int ExtAxisStopJog(int axisID);
13.30. UDP Extended Axis Configuration and Jog Code Example
1public static int TestUDPAxis(Robot robot)//UDP
2{
3 UDPComParam para1=new UDPComParam("192.168.58.88", 2021, 2, 100, 3, 200, 1, 100, 5, 1);
4 int rtn = robot.ExtDevSetUDPComParam(para1);
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 UDPComParam para2=new UDPComParam(ip, port, period, lossPkgTime, lossPkgNum, disconnectTime, reconnectEnable, reconnectPeriod, reconnectNum,0);
7 rtn = robot.ExtDevGetUDPComParam(para2);
8
9 robot.ExtDevLoadUDPDriver();
10
11 rtn = robot.ExtAxisServoOn(1, 1);
12 rtn = robot.ExtAxisServoOn(2, 1);
13 robot.Sleep(3000);
14
15 robot.ExtAxisSetHoming(1, 0, 10, 2);
16 robot.Sleep(3000);
17 rtn = robot.ExtAxisSetHoming(2, 0, 10, 2);
18
19 robot.Sleep(4000);
20
21 rtn = robot.SetRobotPosToAxis(1);
22 rtn = robot.SetAxisDHParaConfig(10, 20, 0, 0, 0, 0, 0, 0, 0);
23 rtn = robot.ExtAxisParamConfig(1, 1, 1, 1000, -1000, 1000, 1000, 1.905, 262144, 200, 1, 0, 0);
24 rtn = robot.ExtAxisParamConfig(2, 1, 1, 1000, -1000, 1000, 1000, 4.444, 262144, 200, 1, 0, 0);
25
26 robot.Sleep(4000);
27 robot.ExtAxisStartJog(1, 0, 10, 10, 30);
28 robot.Sleep(4000);
29 robot.ExtAxisStopJog(1);
30 robot.Sleep(4000);
31 robot.ExtAxisServoOn(1, 0);
32
33 robot.Sleep(4000);
34 robot.ExtAxisStartJog(2, 0, 10, 10, 30);
35 robot.Sleep(4000);
36 robot.ExtAxisStopJog(2);
37 robot.Sleep(4000);
38 robot.ExtAxisServoOn(2, 0);
39 robot.Sleep(4000);
40 robot.ExtDevUnloadUDPDriver();
41
42 return 0;
43}
13.31. Set Extended Axis Coordinate System Reference Point - Four-Point Method
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
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. Positioner Coordinate System Reference Point Setting
1/**
2* @brief Positioner coordinate system reference point setting
3* @param [in] pointNum Point number [1-4]
4* @return Error code
5*/
6int PositionorSetRefPoint(int pointNum);
13.34. Positioner Coordinate System Calculation - Four-Point Method
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.35. Set Calibration Reference Point Pose in Extended Axis End Coordinate System
1/**
2* @brief Set calibration reference point pose in extended axis end coordinate system
3* @param [in] pos Pose value
4* @return Error code
5*/
6int SetRefPointInExAxisEnd(DescPose pos);
13.36. Apply Extended Axis Coordinate System
1/**
2* @brief Apply extended axis coordinate system
3* @param [in] applyAxisId Extended axis number bit0-bit3 corresponds to extended axis number 1-4, e.g., to apply extended axis 1 and 3, it is 0b 0000 0101; which is 5
4* @param [in] axisCoordNum Extended axis coordinate system number
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.37. Get Extended Axis Coordinate System
New in version Java: SDK-v1.0.5-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(DescPose coord);
13.38. Extended Axis Coordinate System Calibration Code Example
1public static int TestUDPAxisCalib(Robot robot)
2{
3 UDPComParam para1=new UDPComParam("192.168.58.88", 2021, 2, 100, 3, 200, 1, 100, 5, 1);
4
5 int rtn = robot.ExtDevSetUDPComParam(para1);
6 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;
7 UDPComParam para2=new UDPComParam(ip, port, period, lossPkgTime, lossPkgNum, disconnectTime, reconnectEnable, reconnectPeriod, reconnectNum,0);
8
9 rtn = robot.ExtDevGetUDPComParam(para2);
10
11 robot.ExtDevLoadUDPDriver();
12
13 rtn = robot.ExtAxisServoOn(1, 1);
14 rtn = robot.ExtAxisServoOn(2, 1);
15
16 robot.Sleep(4000);
17
18 rtn = robot.SetRobotPosToAxis(1);
19 rtn = robot.SetAxisDHParaConfig(1, 128.5, 206.4, 0, 0, 0, 0, 0, 0);
20 rtn = robot.ExtAxisParamConfig(1, 1, 1, 1000, -1000, 1000, 1000, 1.905, 262144, 200, 1, 0, 0);
21 rtn = robot.ExtAxisParamConfig(2, 1, 1, 1000, -1000, 1000, 1000, 4.444, 262144, 200, 1, 0, 0);
22
23 DescPose toolCoord=new DescPose(0, 0, 210, 0, 0, 0);
24 robot.SetToolCoord(1, toolCoord, 0, 0, 1, 0);
25
26 JointPos jSafe=new JointPos(115.193, -96.149, 92.489, -87.068, -89.15, -83.488);
27 JointPos j1=new JointPos(117.559, -92.624, 100.329, -96.909, -94.057, -83.488);
28 JointPos j2=new JointPos(112.239, -90.096, 99.282, -95.909, -89.824, -83.488);
29 JointPos j3=new JointPos(110.839, -83.473, 93.166, -89.22, -90.499, -83.487);
30 JointPos j4=new JointPos(107.935, -83.572, 95.424, -92.873, -87.933, -83.488);
31
32 DescPose descSafe =new DescPose(0,0,0,0,0,0);
33 DescPose desc1 = new DescPose(0,0,0,0,0,0);
34 DescPose desc2 = new DescPose(0,0,0,0,0,0);
35 DescPose desc3 = new DescPose(0,0,0,0,0,0);
36 DescPose desc4 = new DescPose(0,0,0,0,0,0);
37 ExaxisPos exaxisPos =new ExaxisPos(0,0,0,0);
38 DescPose offdese =new DescPose(0, 0, 0, 0, 0, 0);
39
40 robot.GetForwardKin(jSafe, descSafe);
41 robot.MoveJ(jSafe, descSafe, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
42 robot.Sleep(2000);
43
44 robot.GetForwardKin(j1, desc1);
45 robot.MoveJ(j1, desc1, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
46 robot.Sleep(2000);
47
48 DescPose actualTCPPos =new DescPose(0,0,0,0,0,0);
49
50 robot.GetActualTCPPose(actualTCPPos);
51 robot.SetRefPointInExAxisEnd(actualTCPPos);
52 rtn = robot.PositionorSetRefPoint(1);
53 robot.Sleep(2000);
54
55 robot.MoveJ(jSafe, descSafe, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
56 robot.ExtAxisStartJog(1, 0, 50, 50, 10);
57 robot.Sleep(1000);
58 robot.ExtAxisStartJog(2, 0, 50, 50, 10);
59 robot.Sleep(1000);
60 robot.GetForwardKin(j2, desc2);
61 rtn = robot.MoveJ(j2, desc2, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
62 rtn = robot.PositionorSetRefPoint(2);
63 robot.Sleep(2000);
64
65 robot.MoveJ(jSafe, descSafe, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
66 robot.ExtAxisStartJog(1, 0, 50, 50, 10);
67 robot.Sleep(1000);
68 robot.ExtAxisStartJog(2, 0, 50, 50, 10);
69 robot.Sleep(1000);
70 robot.GetForwardKin(j3, desc3);
71 robot.MoveJ(j3, desc3, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
72 rtn = robot.PositionorSetRefPoint(3);
73 robot.Sleep(2000);
74
75 robot.MoveJ(jSafe, descSafe, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
76 robot.ExtAxisStartJog(1, 0, 50, 50, 10);
77 robot.Sleep(1000);
78 robot.ExtAxisStartJog(2, 0, 50, 50, 10);
79 robot.Sleep(1000);
80 robot.GetForwardKin(j4, desc4);
81 robot.MoveJ(j4, desc4, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
82 rtn = robot.PositionorSetRefPoint(4);
83 robot.Sleep(2000);
84
85 DescPose axisCoord = new DescPose();
86 robot.PositionorComputeECoordSys(axisCoord);
87 robot.MoveJ(jSafe, descSafe, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
88 rtn = robot.ExtAxisActiveECoordSys(3, 1, axisCoord, 1);
89
90 robot.CloseRPC();
91 return 0;
92}
13.39. UDP Extended Axis Motion
Changed in version Java: SDK-v1.0.7-3.8.4
1/**
2*@ brief UDP Extended Axis Motion
3*@ param [in] pos target location
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);
13.40. UDP Extended Axis Motion Code Example
1public static int TestUDPAxisCalib(Robot robot)
2{
3 ExaxisPos exaxisPos = new ExaxisPos( 20, 0, 0, 0 );
4 robot.ExtAxisMove(exaxisPos,40);
5 robot.CloseRPC();
6 return 0;
7}
13.41. UDP Extended Axis and Robot Joint Motion Synchronous Motion
1/**
2* @brief UDP extended axis and robot joint motion synchronous motion
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 yet available
9* @param [in] ovl Speed scaling factor, range [0~100]
10* @param [in] epos Extended axis position, unit mm
11* @param [in] blendT [-1.0]-motion到位(blocking), [0~500.0]-smoothing time (non-blocking), unit ms
12* @param [in] offset_flag 0-no offset, 1-offset in base coordinate system/workpiece coordinate system, 2-offset in tool coordinate system
13* @param [in] ffset_pos Pose offset
14* @return Error code
15*/
16int ExtAxisSyncMoveJ(JointPos joint_pos, DescPose desc_pos, int tool, int user, double vel, double acc, double ovl, ExaxisPos epos, double blendT, int offset_flag, DescPose offset_pos);
13.42. UDP extended axis and robot joint motion synchronous motion (automatic forward kinematics calculation)
New in version Java: SDK-v1.0.8-3.8.5
1/**
2* @brief UDP extended axis and robot joint motion synchronous motion (automatic forward kinematics calculation)
3* @param [in] joint_pos Target joint position, unit deg
4* @param [in] tool Tool coordinate number, range [0~14]
5* @param [in] user Workpiece coordinate number, range [0~14]
6* @param [in] vel Velocity percentage, range [0~100]
7* @param [in] acc Acceleration percentage, range [0~100], not open yet
8* @param [in] ovl Velocity scaling factor, range [0~100]
9* @param [in] epos Extended axis position, unit mm
10* @param [in] blendT [-1.0]-move to position (blocking), [0~500.0]-smoothing time (non-blocking), unit ms
11* @param [in] offset_flag 0-no offset, 1-offset in base/workpiece coordinate system, 2-offset in tool coordinate system
12* @param [in] offset_pos Pose offset
13* @return Error code
14*/
15int ExtAxisSyncMoveJ(JointPos joint_pos, int tool, int user, double vel, double acc, double ovl, ExaxisPos epos, double blendT, int offset_flag, DescPose offset_pos)
13.43. UDP Extended Axis and Robot Joint Motion Synchronous Motion Code Example
1public int testSyncMoveJ(Robot robot)
2{
3 //1. Calibrate and apply robot tool coordinate system. You can use the four-point or six-point method for tool coordinate system calibration and application. The interfaces involved are as follows:
4 // int SetToolPoint(int point_num); //Set tool reference point - six-point method
5 // int ComputeTool(ref DescPose tcp_pose); //Calculate tool coordinate system
6 // int SetTcp4RefPoint(int point_num); //Set tool reference point - four-point method
7 // int ComputeTcp4(ref DescPose tcp_pose); //Calculate tool coordinate system - four-point method
8 // int SetToolCoord(int id, DescPose coord, int type, int install); //Set and apply tool coordinate system
9 // int SetToolList(int id, DescPose coord, int type, int install); //Set and apply tool coordinate system list
10 //2. Set UDP communication parameters and load UDP communication
11 UDPComParam param=new UDPComParam("192.168.58.88", 2021, 2, 100, 3, 100, 1, 100, 10,0);
12 robot.ExtDevSetUDPComParam(param);
13 robot.ExtDevLoadUDPDriver();
14 //3. Set extended axis parameters, including extended axis type, extended axis driver parameters, and extended axis DH parameters
15 robot.SetAxisDHParaConfig(4, 200, 200, 0, 0, 0, 0, 0, 0); //Single-axis positioner and DH parameters
16 robot.SetRobotPosToAxis(1); //Extended axis installation position
17 robot.ExtAxisParamConfig(1, 0, 1, 100, -100, 10, 10, 12, 131072, 0, 1, 0, 0); //Servo driver parameters. This example is for a single-axis positioner, so only one driver parameter needs to be set. If you choose an extended axis type with multiple axes, each axis needs to be configured.
18 //4. Enable the selected axis and perform homing
19 robot.ExtAxisServoOn(1, 0);
20 robot.ExtAxisSetHoming(1, 0, 20, 3);
21 //5. Perform extended axis coordinate system calibration and application
22 DescPose pos = new DescPose(/* Enter your calibration point coordinates */ );
23 robot.SetRefPointInExAxisEnd(pos);
24 robot.PositionorSetRefPoint(1); /*You need to call this interface 4 times with different points to complete the calibration */
25 DescPose coord = new DescPose();
26 robot.PositionorComputeECoordSys(coord); //Calculate extended axis calibration result
27 robot.ExtAxisActiveECoordSys(1, 1, coord, 1); //Apply the calibration result to the extended axis coordinate system
28 //6. Calibrate the workpiece coordinate system on the extended axis. You will need the following interfaces:
29 //int SetWObjCoordPoint(int point_num);
30 //int ComputeWObjCoord(int method, ref DescPose wobj_pose);
31 //int SetWObjCoord(int id, DescPose coord);
32 //int SetWObjList(int id, DescPose coord);
33 //7. Record your synchronous joint motion starting point
34 DescPose startdescPose = new DescPose(/*Enter your coordinates*/ );
35 JointPos startjointPos = new JointPos(/*Enter your coordinates*/ );
36 ExaxisPos startexaxisPos = new ExaxisPos(/* Enter your extended axis starting point coordinates */ );
37 //8. Record your synchronous joint motion end point coordinates
38 DescPose enddescPose = new DescPose(/*Enter your coordinates*/ );
39 JointPos endjointPos = new JointPos(/*Enter your coordinates*/ );
40 ExaxisPos endexaxisPos =new ExaxisPos(/* Enter your extended axis end point coordinates */);
41 //9. Write the synchronous motion program
42 //Move to the starting point, assuming the applied tool coordinate system and workpiece coordinate system are both 1
43 robot.ExtAxisMove(startexaxisPos, 20);
44 DescPose offdese = new DescPose( 0, 0, 0, 0, 0, 0 );
45 robot.MoveJ(startjointPos, startdescPose, 1, 1, 100, 100, 100, startexaxisPos, 0, 0, offdese);
46 //Start synchronous motion
47 robot.ExtAxisSyncMoveJ(endjointPos, enddescPose, 1, 1, 100, 100, 100, endexaxisPos, -1, 0, offdese);
48 robot.MoveJ(startjointPos, 1, 1, 100, 100, 100, startexaxisPos, 0, 0, offdese);
49 //Start synchronous motion
50 robot.ExtAxisSyncMoveJ(endjointPos, 1, 1, 100, 100, 100, endexaxisPos, -1, 0, offdese);
51
52 robot.CloseRPC();
53 return 0;
54}
13.44. UDP Extended Axis and Robot Linear Motion Synchronous Motion
1/**
2* @brief UDP extended axis and robot linear motion synchronous motion
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 yet available
9* @param [in] ovl Speed scaling factor, range [0~100]
10* @param [in] blendR [-1.0]-motion到位(blocking), [0~1000.0]-smoothing radius (non-blocking), unit mm
11* @param [in] epos Extended axis position, unit mm
12* @param [in] offset_flag 0-no offset, 1-offset in base coordinate system/workpiece coordinate system, 2-offset in tool coordinate system
13* @param [in] offset_pos Pose offset
14* @return Error code
15*/
16int ExtAxisSyncMoveL(JointPos joint_pos, DescPose desc_pos, int tool, int user, double vel, double acc, double ovl, double blendR, ExaxisPos epos, int offset_flag, DescPose offset_pos);
13.45. UDP extended axis and robot linear motion synchronous motion (automatic inverse kinematics calculation)
New in version Java: SDK-v1.0.8-3.8.5
1/**
2* @brief UDP extended axis and robot linear motion synchronous motion (automatic inverse kinematics calculation)
3* @param [in] desc_pos Target cartesian pose
4* @param [in] tool Tool coordinate number, range [0~14]
5* @param [in] user Workpiece coordinate number, range [0~14]
6* @param [in] vel Velocity percentage, range [0~100]
7* @param [in] acc Acceleration percentage, range [0~100], not open yet
8* @param [in] ovl Velocity scaling factor, range [0~100]
9* @param [in] blendR [-1.0]-move to position (blocking), [0~1000.0]-smoothing radius (non-blocking), unit mm
10* @param [in] epos Extended axis position, unit mm
11* @param [in] offset_flag 0-no offset, 1-offset in base/workpiece coordinate system, 2-offset in tool coordinate system
12* @param [in] offset_pos Pose offset
13* @param [in] config Inverse kinematics joint space configuration, [-1]-calculate based on current joint position, [0~7]-solve according to specific joint space configuration
14* @return Error code
15*/
16int ExtAxisSyncMoveL(DescPose desc_pos, int tool, int user, double vel, double acc, double ovl, double blendR, ExaxisPos epos, int offset_flag, DescPose offset_pos,int config)
13.46. UDP Extended Axis and Robot Linear Motion Synchronous Motion Code Example
1public int testSyncMoveL(Robot robot)
2{
3 //1. Calibrate and apply robot tool coordinate system. You can use the four-point or six-point method for tool coordinate system calibration and application. The interfaces involved are as follows:
4 // int SetToolPoint(int point_num); //Set tool reference point - six-point method
5 // int ComputeTool(ref DescPose tcp_pose); //Calculate tool coordinate system
6 // int SetTcp4RefPoint(int point_num); //Set tool reference point - four-point method
7 // int ComputeTcp4(ref DescPose tcp_pose); //Calculate tool coordinate system - four-point method
8 // int SetToolCoord(int id, DescPose coord, int type, int install); //Set and apply tool coordinate system
9 // int SetToolList(int id, DescPose coord, int type, int install); //Set and apply tool coordinate system list
10 //2. Set UDP communication parameters and load UDP communication
11 UDPComParam param=new UDPComParam("192.168.58.88", 2021, 2, 100, 3, 100, 1, 100, 10,0);
12 robot.ExtDevSetUDPComParam(param);
13 robot.ExtDevLoadUDPDriver();
14 //3. Set extended axis parameters, including extended axis type, extended axis driver parameters, and extended axis DH parameters
15 robot.SetAxisDHParaConfig(4, 200, 200, 0, 0, 0, 0, 0, 0); //Single-axis positioner and DH parameters
16 robot.SetRobotPosToAxis(1); //Extended axis installation position
17 robot.ExtAxisParamConfig(1, 0, 1, 100, -100, 10, 10, 12, 131072, 0, 1, 0, 0); //Servo driver parameters. This example is for a single-axis positioner, so only one driver parameter needs to be set. If you choose an extended axis type with multiple axes, each axis needs to be configured.
18 //4. Enable the selected axis and perform homing
19 robot.ExtAxisServoOn(1, 0);
20 robot.ExtAxisSetHoming(1, 0, 20, 3);
21 //5. Perform extended axis coordinate system calibration and application
22 DescPose pos = new DescPose(/* Enter your calibration point coordinates */ );
23 robot.SetRefPointInExAxisEnd(pos);
24 robot.PositionorSetRefPoint(1); /*You need to call this interface 4 times with different points to complete the calibration */
25 DescPose coord = new DescPose();
26 robot.PositionorComputeECoordSys(coord); //Calculate extended axis calibration result
27 robot.ExtAxisActiveECoordSys(1, 1, coord, 1); //Apply the calibration result to the extended axis coordinate system
28 //6. Calibrate the workpiece coordinate system on the extended axis. You will need the following interfaces:
29 //int SetWObjCoordPoint(int point_num);
30 //int ComputeWObjCoord(int method, ref DescPose wobj_pose);
31 //int SetWObjCoord(int id, DescPose coord);
32 //int SetWObjList(int id, DescPose coord);
33 //7. Record your synchronous joint motion starting point
34 DescPose startdescPose = new DescPose(/*Enter your coordinates*/ );
35 JointPos startjointPos = new JointPos(/*Enter your coordinates*/ );
36 ExaxisPos startexaxisPos = new ExaxisPos(/* Enter your extended axis starting point coordinates */ );
37 //8. Record your synchronous joint motion end point coordinates
38 DescPose enddescPose = new DescPose(/*Enter your coordinates*/ );
39 JointPos endjointPos = new JointPos(/*Enter your coordinates*/ );
40 ExaxisPos endexaxisPos =new ExaxisPos(/* Enter your extended axis end point coordinates */);
41 //9. Write the synchronous motion program
42 //Move to the starting point, assuming the applied tool coordinate system and workpiece coordinate system are both 1
43 robot.ExtAxisMove(startexaxisPos, 20);
44 DescPose offdese = new DescPose( 0, 0, 0, 0, 0, 0 );
45 robot.MoveJ(startjointPos, startdescPose, 1, 1, 100, 100, 100, startexaxisPos, 0, 0, offdese);
46 //Start synchronous motion
47 robot.ExtAxisSyncMoveL(endjointPos, enddescPose, 1, 1, 100, 100, 100, 0, endexaxisPos, 0, offdese);
48 robot.MoveJ(startjointPos, 1, 1, 100, 100, 100, startexaxisPos, 0, 0, offdese);
49 //Start synchronous motion
50 robot.ExtAxisSyncMoveL(enddescPose, 1, 1, 100, 100, 100, 0, endexaxisPos, 0, offdese,-1);
51 robot.CloseRPC();
52 return 0;
53}
13.47. UDP Extended Axis and Robot Arc Motion Synchronous Motion
1/**
2* @brief UDP extended axis and robot arc motion synchronous motion
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 yet available
9* @param [in] epos_p Intermediate point extended axis position, unit mm
10* @param [in] poffset_flag 0-no offset, 1-offset in base coordinate system/workpiece coordinate system, 2-offset in tool coordinate system
11* @param [in] offset_pos_p Pose offset
12* @param [in] joint_pos_t Target point joint position, unit deg
13* @param [in] desc_pos_t Target point Cartesian pose
14* @param [in] ttool Tool coordinate number, range [0~14]
15* @param [in] tuser Workpiece coordinate number, range [0~14]
16* @param [in] tvel Speed percentage, range [0~100]
17* @param [in] tacc Acceleration percentage, range [0~100], not yet available
18* @param [in] epos_t Extended axis position, unit mm
19* @param [in] toffset_flag 0-no offset, 1-offset in base coordinate system/workpiece coordinate system, 2-offset in 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]-motion到位(blocking), [0~1000.0]-smoothing radius (non-blocking), unit mm
23* @return Error code
24*/
25int ExtAxisSyncMoveC(JointPos joint_pos_p, DescPose desc_pos_p, int ptool, int puser, double pvel, double pacc, ExaxisPos epos_p, int poffset_flag, DescPose offset_pos_p, JointPos joint_pos_t, DescPose desc_pos_t, int ttool, int tuser, double tvel, double tacc, ExaxisPos epos_t, int toffset_flag, DescPose offset_pos_t, double ovl, double blendR);
13.48. UDP extended axis and robot circular motion synchronous motion (automatic inverse kinematics calculation)
New in version Java: SDK-v1.0.8-3.8.5
1/**
2* @brief UDP extended axis and robot circular motion synchronous motion (automatic inverse kinematics calculation)
3* @param [in] desc_pos_p Path point cartesian pose
4* @param [in] ptool Tool coordinate number, range [0~14]
5* @param [in] puser Workpiece coordinate number, range [0~14]
6* @param [in] pvel Velocity percentage, range [0~100]
7* @param [in] pacc Acceleration percentage, range [0~100], not open yet
8* @param [in] epos_p Extended axis position, unit mm
9* @param [in] poffset_flag 0-no offset, 1-offset in base/workpiece coordinate system, 2-offset in tool coordinate system
10* @param [in] offset_pos_p Pose offset
11* @param [in] desc_pos_t Target point cartesian pose
12* @param [in] ttool Tool coordinate number, range [0~14]
13* @param [in] tuser Workpiece coordinate number, range [0~14]
14* @param [in] tvel Velocity percentage, range [0~100]
15* @param [in] tacc Acceleration percentage, range [0~100], not open yet
16* @param [in] epos_t Extended axis position, unit mm
17* @param [in] toffset_flag 0-no offset, 1-offset in base/workpiece coordinate system, 2-offset in tool coordinate system
18* @param [in] offset_pos_t Pose offset
19* @param [in] ovl Velocity scaling factor, range [0~100]
20* @param [in] blendR [-1.0]-move to position (blocking), [0~1000.0]-smoothing radius (non-blocking), unit mm
21* @param [in] config Inverse kinematics joint space configuration, [-1]-calculate based on current joint position, [0~7]-solve according to specific joint space configuration
22* @return Error code
23*/
24int ExtAxisSyncMoveC(DescPose desc_pos_p, int ptool, int puser, double pvel, double pacc, ExaxisPos epos_p, int poffset_flag, DescPose offset_pos_p, DescPose desc_pos_t, int ttool, int tuser, double tvel, double tacc, ExaxisPos epos_t, int toffset_flag, DescPose offset_pos_t, double ovl, double blendR,int config)
13.49. UDP Extended Axis and Robot Arc Motion Synchronous Motion Code Example
1public int testSyncMoveC(Robot robot)
2{
3 //1. Calibrate and apply robot tool coordinate system. You can use the four-point or six-point method for tool coordinate system calibration and application. The interfaces involved are as follows:
4 // int SetToolPoint(int point_num); //Set tool reference point - six-point method
5 // int ComputeTool(ref DescPose tcp_pose); //Calculate tool coordinate system
6 // int SetTcp4RefPoint(int point_num); //Set tool reference point - four-point method
7 // int ComputeTcp4(ref DescPose tcp_pose); //Calculate tool coordinate system - four-point method
8 // int SetToolCoord(int id, DescPose coord, int type, int install); //Set and apply tool coordinate system
9 // int SetToolList(int id, DescPose coord, int type, int install); //Set and apply tool coordinate system list
10 //2. Set UDP communication parameters and load UDP communication
11 UDPComParam param=new UDPComParam("192.168.58.88", 2021, 2, 100, 3, 100, 1, 100, 10,0);
12 robot.ExtDevSetUDPComParam(param);
13 robot.ExtDevLoadUDPDriver();
14 //3. Set extended axis parameters, including extended axis type, extended axis driver parameters, and extended axis DH parameters
15 robot.SetAxisDHParaConfig(4, 200, 200, 0, 0, 0, 0, 0, 0); //Single-axis positioner and DH parameters
16 robot.SetRobotPosToAxis(1); //Extended axis installation position
17 robot.ExtAxisParamConfig(1, 0, 1, 100, -100, 10, 10, 12, 131072, 0, 1, 0, 0); //Servo driver parameters. This example is for a single-axis positioner, so only one driver parameter needs to be set. If you choose an extended axis type with multiple axes, each axis needs to be configured.
18 //4. Enable the selected axis and perform homing
19 robot.ExtAxisServoOn(1, 0);
20 robot.ExtAxisSetHoming(1, 0, 20, 3);
21 //5. Perform extended axis coordinate system calibration and application
22 DescPose pos = new DescPose(/* Enter your calibration point coordinates */ );
23 robot.SetRefPointInExAxisEnd(pos);
24 robot.PositionorSetRefPoint(1); /*You need to call this interface 4 times with different points to complete the calibration */
25 DescPose coord = new DescPose();
26 robot.PositionorComputeECoordSys(coord); //Calculate extended axis calibration result
27 robot.ExtAxisActiveECoordSys(1, 1, coord, 1); //Apply the calibration result to the extended axis coordinate system
28 //6. Calibrate the workpiece coordinate system on the extended axis. You will need the following interfaces:
29 //int SetWObjCoordPoint(int point_num);
30 //int ComputeWObjCoord(int method, ref DescPose wobj_pose);
31 //int SetWObjCoord(int id, DescPose coord);
32 //int SetWObjList(int id, DescPose coord);
33 //7. Record your synchronous arc motion starting point
34 DescPose startdescPose = new DescPose(/*Enter your coordinates*/ );
35 JointPos startjointPos = new JointPos(/*Enter your coordinates*/ );
36 ExaxisPos startexaxisPos = new ExaxisPos(/* Enter your extended axis starting point coordinates */ );
37 //8. Record your synchronous arc motion end point coordinates
38 DescPose enddescPose = new DescPose(/*Enter your coordinates*/ );
39 JointPos endjointPos = new JointPos(/*Enter your coordinates*/ );
40 ExaxisPos endexaxisPos = new ExaxisPos(/* Enter your extended axis end point coordinates */ );
41 //9. Record your synchronous arc motion intermediate point coordinates
42 DescPose middescPose = new DescPose(/*Enter your coordinates*/ );
43 JointPos midjointPos =new JointPos(/*Enter your coordinates*/ );
44 ExaxisPos midexaxisPos = new ExaxisPos(/* Enter the extended axis coordinates when the robot is at the arc intermediate point */ );
45 //10. Write the synchronous motion program
46 //Move to the starting point, assuming the applied tool coordinate system and workpiece coordinate system are both 1
47 robot.ExtAxisMove(startexaxisPos, 20);
48 DescPose offdese = new DescPose( 0, 0, 0, 0, 0, 0 );
49 robot.MoveJ(startjointPos, startdescPose, 1, 1, 100, 100, 100, startexaxisPos, 0, 0, offdese);
50 //Start synchronous motion
51 robot.ExtAxisSyncMoveC(midjointPos, middescPose, 1, 1, 100, 100, midexaxisPos, 0, offdese, endjointPos, enddescPose, 1, 1, 100, 100, endexaxisPos, 0, offdese, 100, 0);
52 robot.MoveJ(startjointPos, 1, 1, 100, 100, 100, startexaxisPos, 0, 0, offdese);
53 //Start synchronous motion
54 robot.ExtAxisSyncMoveC(middescPose, 1, 1, 100, 100, midexaxisPos, 0, offdese, enddescPose, 1, 1, 100, 100, endexaxisPos, 0, offdese, 100, 0,-1);
55 robot.CloseRPC();
56 return 0;
57}
13.50. Set Extended DO
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, boolean bOpen, boolean smooth, boolean block);
13.51. Set Extended AO
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, boolean block);
13.52. Set Extended DI Input Filter Time
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.53. Set Extended AI Input Filter Time
1/**
2* @brief Set extended AI input filter time
3* @param [in] AONum AO number
4* @param [in] filterTime Filter time (ms)
5* @return Error code
6*/
7int SetAuxAIFilterTime(int AONum, int filterTime);
13.54. Wait for Extended DI Input
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 motion
7* @return Error code
8*/
9int WaitAuxDI(int DINum, boolean bOpen, int time, boolean errorAlarm);
13.55. Wait for Extended AI Input
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 Whether to continue motion
8* @return Error code
9*/
10int WaitAuxAI(int AINum, int sign, int value, int time, boolean errorAlarm);
13.56. Get Extended DI Value
1/**
2* @brief Get extended DI value
3* @param [in] DINum DI number
4* @param [in] isNoBlock Whether to block
5* @return List[0]: Error code; List[1] : isOpen 0-off; 1-on
6*/
7List<Integer> GetAuxDI(int DINum, boolean isNoBlock)
13.57. Get Extended AI Value
1/**
2* @brief Get extended AI value
3* @param [in] AINum AI number
4* @param [in] isNoBlock Whether to block
5* @return List[0]: Error code; List[1] : value Input value
6*/
7List<Integer> GetAuxAI(int AINum, boolean isNoBlock);
13.58. Extended IO Code Example
1public static int TestAuxDOAO(Robot robot)
2{
3 for (int i = 0; i < 128; i++)
4 {
5 robot.SetAuxDO(i, true, false, true);
6 robot.Sleep(100);
7 }
8 for (int i = 0; i < 128; i++)
9 {
10 robot.SetAuxDO(i, false, false, true);
11 robot.Sleep(100);
12 }
13
14 for (int i = 0; i < 409; i++)
15 {
16 robot.SetAuxAO(0, i * 10, true);
17 robot.SetAuxAO(1, 4095 - i * 10, true);
18 robot.SetAuxAO(2, i * 10, true);
19 robot.SetAuxAO(3, 4095 - i * 10, true);
20 robot.Sleep(10);
21 }
22
23 robot.SetAuxDIFilterTime(10);
24 robot.SetAuxAIFilterTime(0, 10);
25
26
27 int curValue = -1;
28 List<Integer> liter=new ArrayList<>();
29 for (int i = 0; i < 4; i++)
30 {
31 liter = robot.GetAuxAI(i, true);
32 }
33
34 robot.WaitAuxDI(1, false, 1000, false);
35 robot.WaitAuxAI(1, 1, 132, 1000, false);
36
37 robot.CloseRPC();
38 return 0;
39}
13.59. Movable Device Enable
1/**
2* @brief Movable device enable
3* @param [in] enable false-disable; true-enable
4* @return Error code
5*/
6int TractorEnable(Boolean enable);
13.60. Movable Device Homing
1/**
2* @brief Movable device homing
3* @return Error code
4*/
5int TractorHoming();
13.61. Movable Device Linear Motion
1/**
2* @brief Movable device linear motion
3* @param [in] distance Linear motion distance (mm)
4* @param [in] vel Linear motion speed percentage (0-100)
5* @return Error code
6*/
7int TractorMoveL(double distance, double vel);
13.62. Movable Device Arc Motion
1/**
2* @brief Movable device arc motion
3* @param [in] radio Arc motion radius (mm)
4* @param [in] angle Arc motion angle (°)
5* @param [in] vel Linear motion speed percentage (0-100)
6* @return Error code
7*/
8int TractorMoveC(double radio, double angle, double vel);
13.63. Movable Device Stop Motion
1/**
2* @brief Movable device stop motion
3* @return Error code
4*/
5int TractorStop();
13.64. Movable Device Code Example
1public static void main(String[] args)
2{
3 Robot robot = new Robot();
4 robot.SetReconnectParam(true,20,500);//Set reconnection count and interval
5 robot.LoggerInit(FrLogType.DIRECT, FrLogLevel.INFO, "D://log", 10, 10);
6 int rtn = robot.RPC("192.168.58.2");
7 if(rtn == 0)
8 {
9 System.out.println("RPC connection success");
10 }
11 else
12 {
13 System.out.println("RPC connection fail");
14 return ;
15 }
16 UDPComParam param = new UDPComParam("192.168.58.88", 2021, 2, 100, 3, 100, 1, 100, 10);
17 robot.ExtDevSetUDPComParam(param);//UDP extended axis communication
18 robot.ExtAxisParamConfig(1, 0, 0, 50000, -50000, 1000, 1000, 6.280, 16384, 200, 0, 0, 0);
19 robot.ExtAxisParamConfig(2, 0, 0, 50000, -50000, 1000, 1000, 6.280, 16384, 200, 0, 0, 0);
20 robot.SetAxisDHParaConfig(5, 0, 0, 0, 0, 0, 0, 0, 0);
21
22 robot.TractorEnable(false);
23 robot.Sleep(2000);
24 robot.TractorEnable(true);
25 robot.Sleep(2000);
26 robot.TractorHoming();
27
28 robot.Sleep(2000);
29 robot.TractorMoveL(100, 20);
30 robot.Sleep(5000);
31 robot.TractorMoveL(-100, 20);
32 robot.Sleep(5000);
33 robot.TractorMoveC(300, 90, 20);
34 robot.Sleep(2000);
35 robot.TractorStop();//Stop the device
36 robot.TractorMoveC(300, -90, 20);
37}
13.65. UDP Extension Axis Positioning Completion Time Setting
1/**
2* @brief UDP extension axis positioning completion time setting
3* @param time Positioning completion time [ms]
4* @return Error code
5*/
6public int SetExAxisCmdDoneTime(double time)