14. Robot Welding

14.1. Set welding process curve parameters

1/**
2* @brief Set welding process curve parameters
3* @param [in] id Welding process ID (1-99)
4* @param [in] param Welding process parameters
5* @return Error code
6*/
7int WeldingSetProcessParam(int id, WeldingProcessParam param);

14.2. Get welding process curve parameters

1/**
2* @brief Get welding process curve parameters
3* @param [in] id Welding process ID (1-99)
4* @param [out] param Welding process parameters
5* @return Error code
6*/
7int WeldingGetProcessParam(int id, WeldingProcessParam param);

14.3. Set welding current to analog output relation

1/**
2* @brief Set welding current to analog output relation
3* @param [in] relation Relation value
4* @return Error code
5*/
6int WeldingSetCurrentRelation(WeldCurrentAORelation relation);

14.4. Set welding voltage to analog output relation

1/**
2* @brief Set welding voltage to analog output relation
3* @param [in] relation Welding voltage-analog output relation value
4* @return Error code
5*/
6int WeldingSetVoltageRelation(WeldVoltageAORelation relation);

14.5. Get welding current to analog output relation

1/**
2* @brief Get welding current to analog output relation
3* @param [out] relation Relation value
4* @return Error code
5*/
6int WeldingGetCurrentRelation(WeldCurrentAORelation relation);

14.6. Get welding voltage to analog output relation

1/**
2* @brief Get welding voltage to analog output relation
3* @param [out] relation Welding voltage-analog output relation value
4* @return Error code
5*/
6int WeldingGetVoltageRelation(WeldVoltageAORelation relation);

14.7. Set welding current

1/**
2* @brief Set welding current
3* @param [in] ioType Control IO type: 0-Controller IO; 1-Extension IO
4* @param [in] current Welding current value (A)
5* @param [in] AOIndex Controller analog output port (0-1)
6* @param [in] blend Smoothing: 0-No smoothing; 1-Smoothing
7* @return Error code
8*/
9int WeldingSetCurrent(int ioType, double current, int AOIndex, int blend);

14.8. Set welding voltage

1/**
2* @brief Set welding voltage
3* @param [in] ioType Control IO type: 0-Controller IO; 1-Extension IO
4* @param [in] voltage Welding voltage value (V)
5* @param [in] AOIndex Controller analog output port (0-1)
6* @param [in] blend Smoothing: 0-No smoothing; 1-Smoothing
7* @return Error code
8*/
9int WeldingSetVoltage(int ioType, double voltage, int AOIndex, int blend);

14.9. Set weaving parameters

 1/**
 2* @brief Set weaving parameters
 3* @param [in] weaveNum Weaving parameter configuration number
 4* @param [in] weaveType Weaving type: 0-planar triangular wave weaving; 1-vertical L-shaped triangular wave weaving; 2-clockwise circular weaving; 3-counterclockwise circular weaving; 4-planar sine wave weaving; 5-vertical L-shaped sine wave weaving; 6-vertical triangular wave weaving; 7-vertical sine wave weaving
 5* @param [in] weaveFrequency Weaving frequency (Hz)
 6* @param [in] weaveIncStayTime Wait mode: 0-cycle does not include wait time; 1-cycle includes wait time
 7* @param [in] weaveRange Weaving amplitude (mm)
 8* @param [in] weaveLeftRange Left chord length of vertical triangular weaving (mm)
 9* @param [in] weaveRightRange Right chord length of vertical triangular weaving (mm)
10* @param [in] additionalStayTime Stay time at the vertical triangular point of vertical triangular weaving (mm)
11* @param [in] weaveLeftStayTime Left stay time of weaving (ms)
12* @param [in] weaveRightStayTime Right stay time of weaving (ms)
13* @param [in] weaveCircleRadio Circular weaving-feedback ratio (0-100%)
14* @param [in] weaveStationary Weaving position wait: 0-position continues to move during wait time; 1-position is stationary during wait time
15* @param [in] weaveYawAngle Azimuth angle of weaving direction (rotation around weaving Z axis), unit °
16* @param [in] weaveRotAngle Roll angle of weaving direction (deflection around weaving X axis), unit ° [-180-180], default 0
17* @param [in] weavePendulumLength Pendulum length of pendulum weaving, unit mm, default 0 (pendulum weaving disabled)
18* @param [in] weavePendulumAngle Pendulum angle of pendulum weaving, unit °, default 0 (pendulum weaving disabled)
19* @return Error code
20*/
21public int WeaveSetPara(int weaveNum, int weaveType, double weaveFrequency, int weaveIncStayTime, double weaveRange, double weaveLeftRange, double weaveRightRange, int additionalStayTime, int weaveLeftStayTime, int weaveRightStayTime, int weaveCircleRadio, int weaveStationary, double weaveYawAngle, double weaveRotAngle = 0, double weavePendulumLength = 0, double weavePendulumAngle = 0)

14.10. Welding parameter setting code example

  1public static int TestSetWeldParam(Robot robot) {
  2    // 1. Set welding process parameters
  3    WeldingProcessParam para1 = new WeldingProcessParam(177, 27, 1000, 178, 28, 176, 26, 1000);
  4    WeldingProcessParam para2 = new WeldingProcessParam(188, 28, 555, 199, 29, 133, 23, 333);
  5    robot.WeldingSetProcessParam(1, para1);
  6    robot.WeldingSetProcessParam(2, para2);
  7
  8    // 2. Get and print parameter set 1
  9    WeldingProcessParam param = new WeldingProcessParam(0, 0, 0, 0, 0, 0, 0, 0);
 10    robot.WeldingGetProcessParam(1, param);
 11    System.out.println("the Num 1 process param is "
 12            + param.startCurrent + " " + param.startVoltage + " "
 13            + param.startTime + " " + param.weldCurrent + " "
 14            + param.weldVoltage + " " + param.endCurrent + " "
 15            + param.endVoltage + " " + param.endTime);
 16
 17    // 3. Get and print parameter set 2
 18    robot.WeldingGetProcessParam(2, param);
 19    System.out.println("the Num 2 process param is "
 20            + param.startCurrent + " " + param.startVoltage + " "
 21            + param.startTime + " " + param.weldCurrent + " "
 22            + param.weldVoltage + " " + param.endCurrent + " "
 23            + param.endVoltage + " " + param.endTime);
 24
 25    // 4. Set current/voltage relationship and print return value
 26    WeldCurrentAORelation rela1 = new WeldCurrentAORelation(0, 400, 0, 10, 0);
 27    int rtn = robot.WeldingSetCurrentRelation(rela1);
 28    System.out.println("WeldingSetCurrentRelation rtn is: " + rtn);
 29
 30    WeldVoltageAORelation rela2 = new WeldVoltageAORelation(0, 40, 0, 10, 1);
 31    rtn = robot.WeldingSetVoltageRelation(rela2);
 32    System.out.println("WeldingSetVoltageRelation rtn is: " + rtn);
 33
 34    // 5. Get and print current relationship
 35    WeldCurrentAORelation rela3 = new WeldCurrentAORelation(0, 0, 0, 0, 0);
 36    rtn = robot.WeldingGetCurrentRelation(rela3);
 37    System.out.println("WeldingGetCurrentRelation rtn is: " + rtn);
 38    System.out.println("current min " + rela3.currentMin
 39            + " current max " + rela3.currentMax
 40            + " output vol min " + rela3.outputVoltageMin
 41            + " output vol max " + rela3.outputVoltageMax);
 42
 43    // 6. Get and print voltage relationship
 44    WeldVoltageAORelation rela4 = new WeldVoltageAORelation(0, 0, 0, 0, 0);
 45    rtn = robot.WeldingGetVoltageRelation(rela4);
 46    System.out.println("WeldingGetVoltageRelation rtn is: " + rtn);
 47    System.out.println("vol min " + rela4.weldVoltageMin
 48            + " vol max " + rela4.weldVoltageMax
 49            + " output vol min " + rela4.outputVoltageMin
 50            + " output vol max " + rela4.outputVoltageMax);
 51
 52    // 7. Set current/voltage and print return value
 53    rtn = robot.WeldingSetCurrent(0, 100, 0, 0);
 54    System.out.println("WeldingSetCurrent rtn is: " + rtn);
 55
 56    robot.Sleep(3000);  // Corresponds to this_thread::sleep_for(chrono::seconds(3))
 57
 58    rtn = robot.WeldingSetVoltage(0, 10, 0, 0);
 59    System.out.println("WeldingSetVoltage rtn is: " + rtn);
 60
 61    // 8. Set weave parameters
 62    rtn = robot.WeaveSetPara(0, 0, 2.000000, 0, 10.000000, 0.000000, 0.000000, 0, 0, 0, 0, 0, 60.000000,0);
 63    System.out.println("rtn is: " + rtn);
 64
 65    robot.WeaveOnlineSetPara(0, 0, 1, 0, 20, 0, 0, 0, 0);
 66
 67    // 9. Set arc break detection and re-weld parameters
 68    rtn = robot.WeldingSetCheckArcInterruptionParam(1, 200);
 69    System.out.println("WeldingSetCheckArcInterruptionParam  " + rtn);
 70
 71    rtn = robot.WeldingSetReWeldAfterBreakOffParam(1, 5.7, 98.2, 0);
 72    System.out.println("WeldingSetReWeldAfterBreakOffParam  " + rtn);
 73
 74    // 10. Get and print arc break detection parameters
 75    List<Integer> inter = robot.WeldingGetCheckArcInterruptionParam();
 76    int checkEnable = inter.get(0);
 77    int arcInterruptTimeLength = inter.get(1);
 78    System.out.println("WeldingGetCheckArcInterruptionParam checkEnable " + checkEnable
 79            + "  arcInterruptTimeLength " + arcInterruptTimeLength);
 80
 81    // 11. Get and print re-weld parameters (returns List<Number>)
 82    List<Number> num = robot.WeldingGetReWeldAfterBreakOffParam();
 83    int enable = num.get(0).intValue();
 84    double length = num.get(1).doubleValue();
 85    double velocity = num.get(2).doubleValue();
 86    int moveType = num.get(3).intValue();
 87    System.out.printf("WeldingGetReWeldAfterBreakOffParam enable = %d, length = %f, velocity = %f, moveType = %d%n",
 88            enable, length, velocity, moveType);
 89
 90    // 12. Set extended DO and loop control
 91    robot.SetWeldMachineCtrlModeExtDoNum(17);
 92    for (int i = 0; i < 5; i++) {
 93        int[] mode = new int[1];   // Used to receive output value
 94
 95        robot.SetWeldMachineCtrlMode(0);
 96        rtn = robot.GetWeldMachineCtrlMode(mode);
 97        if (rtn == 0) {
 98            System.out.println("GetWeldMachineCtrlMode " + mode[0]);
 99        } else {
100            System.out.println("GetWeldMachineCtrlMode failed, err: " + rtn);
101        }
102        robot.Sleep(1000);
103
104        robot.SetWeldMachineCtrlMode(1);
105        rtn = robot.GetWeldMachineCtrlMode(mode);
106        if (rtn == 0) {
107            System.out.println("GetWeldMachineCtrlMode " + mode[0]);
108        } else {
109            System.out.println("GetWeldMachineCtrlMode failed, err: " + rtn);
110        }
111        robot.Sleep(1000);
112    }
113
114    return 0;
115}

14.11. Real-time weaving parameter setting

 1/**
 2* @brief Real-time weaving parameter setting
 3* @param [in] weaveNum Weaving parameter configuration ID
 4* @param [in] weaveType Weaving type:
 5*   0-Horizontal triangular wave
 6*   1-Vertical L-shaped triangular wave
 7*   2-Clockwise circular
 8*   3-Counter-clockwise circular
 9*   4-Horizontal sine wave
10*   5-Vertical L-shaped sine wave
11*   6-Vertical triangular wave
12*   7-Vertical sine wave
13* @param [in] weaveFrequency Weaving frequency (Hz)
14* @param [in] weaveIncStayTime Wait mode:
15*   0-Cycle excludes wait time
16*   1-Cycle includes wait time
17* @param [in] weaveRange Weaving amplitude (mm)
18* @param [in] weaveLeftStayTime Left dwell time (ms)
19* @param [in] weaveRightStayTime Right dwell time (ms)
20* @param [in] weaveCircleRadio Circular weaving callback ratio (0-100%)
21* @param [in] weaveStationary Position wait:
22*   0-Continue moving during wait
23*   1-Stationary during wait
24* @return Error code
25*/
26int WeaveOnlineSetPara(int weaveNum, int weaveType, double weaveFrequency, int weaveIncStayTime, double weaveRange, int weaveLeftStayTime, int weaveRightStayTime, int weaveCircleRadio, int weaveStationary);

14.12. Set welding arc interruption detection parameters

1/**
2* @brief Set welding arc interruption detection parameters
3* @param [in] checkEnable Enable detection: 0-Disable; 1-Enable
4* @param [in] arcInterruptTimeLength Arc interruption confirmation duration (ms)
5* @return Error code
6*/
7int WeldingSetCheckArcInterruptionParam(int checkEnable, int arcInterruptTimeLength);

14.13. Get welding arc interruption detection parameters

1/**
2* @brief Get welding arc interruption detection parameters
3* @return List[0]: Error code; List[1]: double Detection enable (0-Disable; 1-Enable); List[2]: Arc interruption confirmation duration (ms)
4*/
5List<Integer> WeldingGetCheckArcInterruptionParam();

14.14. Set welding interruption recovery parameters

1/**
2* @brief Set welding interruption recovery parameters
3* @param [in] enable Enable welding recovery
4* @param [in] length Weld overlap distance (mm)
5* @param [in] velocity Robot return speed percentage (0-100)
6* @param [in] moveType Robot movement type to restart point: 0-LIN; 1-PTP
7* @return Error code
8*/
9int WeldingSetReWeldAfterBreakOffParam(int enable, double length, double velocity, int moveType);

14.15. Get welding interruption recovery parameters

1/**
2* @brief Get welding interruption recovery parameters
3* @return List[0]: Error code; List[1]: int Enable welding recovery; List[2]: double Weld overlap distance (mm);
4* @return List[3]: double Robot return speed percentage (0-100); List[4]: int Robot movement type: 0-LIN; 1-PTP
5*/
6List<Number> WeldingGetReWeldAfterBreakOffParam();

14.16. Set Welder Control Mode

1/**
2* @brief Set the welder control mode extension DO port
3* @param DONum Welder control mode DO port (0-127)
4* @return Error code
5*/
6public int SetWeldMachineCtrlModeExtDoNum(int DONum)

14.17. Set welder control mode

1/**
2* @brief Set welding machine control mode
3* @param mode Welding machine control mode; 0-DC one-knob mode; 1-Pulse one-knob mode; 2-JOB mode; 3-Local control mode; 4-Separate mode; 5-CC/CV mode; 6-TIG; 7-CMT
4* @param ioType Control type; 0-Control box IO; 1-Digital communication protocol (UDP); 2-Digital communication protocol (ModbusTCP)
5* @return Error code
6*/
7public int SetWeldMachineCtrlMode(int mode, int ioType)

14.18. Get Welding Machine Control Mode

1/**
2* @brief Get welding machine control mode
3* @param mode Welding machine control mode; 0-DC one-knob mode; 1-pulse one-knob mode; 2-JOB mode; 3-local control mode; 4-separate mode; 5-CC/CV mode; 6-TIG; 7-CMT
4* @return Error code
5*/
6public int GetWeldMachineCtrlMode(int[] mode)

14.19. Welding start

1/**
2* @brief Welding start
3* @param [in] ioType IO type: 0-Controller IO; 1-Extension IO
4* @param [in] arcNum Welder configuration file ID
5* @param [in] timeout Arc start timeout
6* @return Error code
7*/
8int ARCStart(int ioType, int arcNum, int timeout);

14.20. Welding end

1/**
2* @brief Welding end
3* @param [in] ioType IO type: 0-Controller IO; 1-Extension IO
4* @param [in] arcNum Welder configuration file ID
5* @param [in] timeout Arc end timeout
6* @return Error code
7*/
8int ARCEnd(int ioType, int arcNum, int timeout);

14.21. Weaving start

1/**
2* @brief Weaving start
3* @param [in] weaveNum Weaving parameter configuration ID
4* @return Error code
5*/
6int WeaveStart(int weaveNum);

14.22. Weaving end

1/**
2* @brief Weaving end
3* @param [in] weaveNum Weaving parameter configuration ID
4* @return Error code
5*/
6int WeaveEnd(int weaveNum);

14.23. Forward wire feeding

1/**
2* @brief Forward wire feeding
3* @param [in] ioType IO type: 0-Controller IO; 1-Extension IO
4* @param [in] wireFeed Wire feed control: 0-Stop; 1-Feed
5* @return Error code
6*/
7int SetForwardWireFeed(int ioType, int wireFeed);

14.24. Reverse wire feeding

1/**
2* @brief Reverse wire feeding
3* @param [in] ioType IO type: 0-Controller IO; 1-Extension IO
4* @param [in] wireFeed Wire feed control: 0-Stop; 1-Feed
5* @return Error code
6*/
7int SetReverseWireFeed(int ioType, int wireFeed);

14.25. Gas feeding

1/**
2* @brief Gas feeding
3* @param [in] ioType IO type: 0-Controller IO; 1-Extension IO
4* @param [in] airControl Gas control: 0-Stop; 1-Feed
5* @return Error code
6*/
7int SetAspirated(int ioType, int airControl);

14.26. Set robot to resume welding after interruption

1/**
2* @brief Set robot to resume welding after interruption
3* @return Error code
4*/
5int WeldingStartReWeldAfterBreakOff();

14.27. Set robot to abort welding after interruption

1/**
2* @brief Set robot to abort welding after interruption
3* @return Error code
4*/
5int WeldingAbortWeldAfterBreakOff();

14.28. Robot welding control code example

 1public static int TestWelding(Robot robot)
 2{
 3    robot.WeldingSetCurrent(0, 230, 0, 0);
 4    robot.WeldingSetVoltage(0, 24, 0, 1);
 5
 6    DescPose p1Desc = new DescPose(228.879, -503.594, 453.984, -175.580, 8.293, 171.267);
 7    JointPos p1Joint = new JointPos(102.700, -85.333, 90.518, -102.365, -83.932, 22.134);
 8
 9    DescPose p2Desc = new DescPose(-333.302, -435.580, 449.866, -174.997, 2.017, 109.815);
10    JointPos p2Joint = new JointPos(41.862, -85.333, 90.526, -100.587, -90.014, 22.135);
11
12    ExaxisPos exaxisPos = new ExaxisPos(0, 0, 0, 0);
13    DescPose offdese = new DescPose(0, 0, 0, 0, 0, 0);
14
15    robot.MoveJ(p1Joint, p1Desc, 13, 0, 20, 100, 100, exaxisPos, -1, 0, offdese);
16    robot.ARCStart(1, 0, 10000);
17    robot.WeaveStart(0);
18    robot.MoveL(p2Joint, p2Desc, 13, 0, 20, 100, 100, -1, 0, exaxisPos, 0, 0, offdese, 0, 10);
19    robot.ARCEnd(1, 0, 10000);
20    robot.WeaveEnd(0);
21    return 0;
22}

14.29. Segment welding start

 1/**
 2* @brief Segment welding start
 3* @param [in] startDesePos Start point Cartesian position
 4* @param [in] endDesePos End point Cartesian pose
 5* @param [in] startJPos Start point joint pose
 6* @param [in] endJPos End point joint pose
 7* @param [in] weldLength Weld segment length (mm)
 8* @param [in] noWeldLength Non-weld segment length (mm)
 9* @param [in] weldIOType Welding IO type (0-Controller IO; 1-Extension IO)
10* @param [in] arcNum Welder configuration file ID
11* @param [in] weldTimeout Arc start/end timeout
12* @param [in] isWeave Enable weaving
13* @param [in] weaveNum Weaving parameter configuration ID
14* @param [in] tool Tool number
15* @param [in] user Workpiece number
16* @param [in] vel Speed percentage (0~100)
17* @param [in] acc Acceleration percentage (0~100) (Not currently available)
18* @param [in] ovl Speed scaling factor (0~100)
19* @param [in] blendR [-1.0]-Move to position (blocking); [0~1000.0]-Smoothing radius (non-blocking) in mm
20* @param [in] epos External axis position in mm
21* @param [in] search 0-No wire search; 1-Wire search
22* @param [in] offset_flag 0-No offset; 1-Offset in base/workpiece frame; 2-Offset in tool frame
23* @param [in] offset_pos Pose offset
24* @return Error code
25*/
26int SegmentWeldStart(DescPose startDesePos, DescPose endDesePos, JointPos startJPos, JointPos endJPos, double weldLength, double noWeldLength, int weldIOType, int arcNum, int weldTimeout, boolean isWeave, int weaveNum, int tool, int user, double vel, double acc, double ovl, double blendR, ExaxisPos epos, int search, int offset_flag, DescPose offset_pos);

14.30. Robot segment welding code example

 1public static int TestSegWeld(Robot robot)
 2{
 3    robot.WeldingSetCurrent(0, 230, 0, 0);
 4    robot.WeldingSetVoltage(0, 24, 0, 1);
 5
 6    DescPose p1Desc = new DescPose(228.879, -503.594, 453.984, -175.580, 8.293, 171.267);
 7    JointPos p1Joint = new JointPos(102.700, -85.333, 90.518, -102.365, -83.932, 22.134);
 8
 9    DescPose p2Desc = new DescPose(-333.302, -435.580, 449.866, -174.997, 2.017, 109.815);
10    JointPos p2Joint = new JointPos(41.862, -85.333, 90.526, -100.587, -90.014, 22.135);
11
12    ExaxisPos exaxisPos = new ExaxisPos(0, 0, 0, 0);
13    DescPose offdese = new DescPose(0, 0, 0, 0, 0, 0);
14
15    robot.GetForwardKin(p1Joint, p1Desc);
16    robot.GetForwardKin(p2Joint, p2Desc);
17
18    int rtn = robot.SegmentWeldStart(p1Desc, p2Desc, p1Joint, p2Joint, 20, 20, 0, 0, 5000, true, 0, 1, 0, 30, 100, 100, -1, exaxisPos, 0, 0, offdese);
19    return 0;
20}

14.31. Simulation weaving start

1/**
2* @brief Simulation weaving start
3* @param [in] weaveNum Weaving parameter ID
4* @return Error code
5*/
6int WeaveStartSim(int weaveNum);

14.32. Simulation weaving end

1/**
2* @brief Simulation weaving end
3* @param [in] weaveNum Weaving parameter ID
4* @return Error code
5*/
6int WeaveEndSim(int weaveNum);

14.33. Start trajectory inspection warning (no movement)

1/**
2* @brief Start trajectory inspection warning (no movement)
3* @param [in] weaveNum Weaving parameter ID
4* @return Error code
5*/
6int WeaveInspectStart(int weaveNum);

14.34. End trajectory inspection warning (no movement)

1/**
2* @brief End trajectory inspection warning (no movement)
3* @param [in] weaveNum Weaving parameter ID
4* @return Error code
5*/
6int WeaveInspectEnd(int weaveNum);

14.35. Weaving transition start

Changed in version Java: SDK-v1.0.5-3.8.2

1/**
2* @brief Weaving transition start
3* @param [in] weaveChangeFlag 1-Change weaving parameters; 2-Change weaving parameters + welding speed
4* @param [in] weaveNum Weaving ID
5* @param [in] velStart Welding start speed (cm/min)
6* @param [in] velEnd Welding end speed (cm/min)
7* @return Error code
8*/
9int WeaveChangeStart(int weaveChangeFlag, int weaveNum, double velStart, double velEnd);

14.36. Robot weaving transition welding code example

 1public static int TestWeave(Robot robot)
 2{
 3    DescPose p1Desc = new DescPose(228.879, -503.594, 453.984, -175.580, 8.293, 171.267);
 4    JointPos p1Joint = new JointPos(102.700, -85.333, 90.518, -102.365, -83.932, 22.134);
 5
 6    DescPose p2Desc = new DescPose(-333.302, -435.580, 449.866, -174.997, 2.017, 109.815);
 7    JointPos p2Joint = new JointPos(41.862, -85.333, 90.526, -100.587, -90.014, 22.135);
 8
 9    ExaxisPos exaxisPos = new ExaxisPos(0, 0, 0, 0);
10    DescPose offdese = new DescPose(0, 0, 0, 0, 0, 0);
11
12    robot.MoveJ(p1Joint, p1Desc, 13, 0, 20, 100, 100, exaxisPos, -1, 0, offdese);
13    robot.WeaveStartSim(0);
14    robot.MoveL(p2Joint, p2Desc, 13, 0, 20, 100, 100, -1, 0, exaxisPos, 0, 0, offdese, 0, 10);
15    robot.WeaveEndSim(0);
16    robot.MoveJ(p1Joint, p1Desc, 13, 0, 20, 100, 100, exaxisPos, -1, 0, offdese);
17    robot.WeaveInspectStart(0);
18    robot.MoveL(p2Joint, p2Desc, 13, 0, 20, 100, 100, -1, 0, exaxisPos, 0, 0, offdese, 0, 10);
19    robot.WeaveInspectEnd(0);
20
21    robot.WeldingSetVoltage(1, 19, 0, 0);
22    robot.WeldingSetCurrent(1, 190, 0, 0);
23    robot.MoveL(p1Joint, p1Desc, 1, 1, 100, 100, 50, -1, 0, exaxisPos, 0, 0, offdese, 0, 10);
24    robot.ARCStart(1, 0, 10000);
25    robot.ArcWeldTraceControl(1, 0, 1, 0.06, 5, 5, 60, 1, 0.06, 5, 5, 80, 0, 0, 4, 1, 10, 0, 0);
26    robot.WeaveStart(0);
27    robot.WeaveChangeStart(1, 0, 50, 30);
28    robot.MoveL(p2Joint, p2Desc, 1, 1, 100, 100, 1, -1, 0, exaxisPos, 0, 0, offdese, 0, 10);
29    robot.WeaveChangeEnd();
30    robot.WeaveEnd(0);
31    robot.ArcWeldTraceControl(0, 0, 1, 0.06, 5, 5, 60, 1, 0.06, 5, 5, 80, 0, 0, 4, 1, 10, 0, 0);
32    robot.ARCEnd(1, 0, 10000);
33    return 0;
34}

14.37. Weaving transition end

Added in version Java: SDK-v1.0.2-3.7.9

1/**
2* @brief Weaving transition end
3* @return Error code
4*/
5int WeaveChangeEnd();

14.38. Extension IO - Configure welder gas detection signal

1/**
2* @brief Extension IO - Configure welder gas detection signal
3* @param [in] DONum Gas detection signal extension DO number
4* @return Error code
5*/
6int SetAirControlExtDoNum(int DONum);

14.39. Extension IO - Configure welder arc start signal

1/**
2* @brief Extension IO - Configure welder arc start signal
3* @param [in] DONum Welder arc start signal extension DO number
4* @return Error code
5*/
6int SetArcStartExtDoNum(int DONum);

14.40. Extension IO - Configure welder reverse wire feed signal

1/**
2* @brief Extension IO - Configure welder reverse wire feed signal
3* @param [in] DONum Reverse wire feed signal extension DO number
4* @return Error code
5*/
6int SetWireReverseFeedExtDoNum(int DONum);

14.41. Extension IO - Configure welder forward wire feed signal

1/**
2* @brief Extension IO - Configure welder forward wire feed signal
3* @param [in] DONum Forward wire feed signal extension DO number
4* @return Error code
5*/
6int SetWireForwardFeedExtDoNum(int DONum);

14.42. Extension IO - Configure welder arc success signal

1/**
2* @brief Extension IO - Configure welder arc success signal
3* @param [in] DINum Arc success signal extension DI number
4* @return Error code
5*/
6int SetArcDoneExtDiNum(int DINum);

14.43. Extension IO - Configure welder ready signal

1/**
2* @brief Extension IO - Configure welder ready signal
3* @param [in] DINum Welder ready signal extension DI number
4* @return Error code
5*/
6int SetWeldReadyExtDiNum(int DINum);

14.44. Extension IO - Configure welding interruption recovery signal

1/**
2* @brief Extension IO - Configure welding interruption recovery signal
3* @param [in] reWeldDINum Resume welding after interruption signal extension DI number
4* @param [in] abortWeldDINum Abort welding after interruption signal extension DI number
5* @return Error code
6*/
7int SetExtDIWeldBreakOffRecover(int reWeldDINum, int abortWeldDINum);

14.45. Set extension IO welding signal code example

 1public static int TestExtDIConfig(Robot robot)
 2{
 3    robot.SetArcStartExtDoNum(10);
 4    robot.SetAirControlExtDoNum(20);
 5    robot.SetWireForwardFeedExtDoNum(30);
 6    robot.SetWireReverseFeedExtDoNum(40);
 7
 8    robot.SetWeldReadyExtDiNum(50);
 9    robot.SetArcDoneExtDiNum(60);
10    robot.SetExtDIWeldBreakOffRecover(70, 80);
11    robot.SetWireSearchExtDIONum(0, 1);
12
13    int[] DIConfig = new int[16];
14    int[] DOConfig = new int[16];
15    int rtn = robot.GetExtDIConfig(DIConfig);
16    System.out.printf("GetExtDIConfig rtn is %d\n welder ready %d\narc done %d\nreweld start %d\nabort reweld %d\nwiresearch done %d\nLaser welding State %d\nlaser welding error state %d\n",
17        rtn, DIConfig[0], DIConfig[1], DIConfig[2], DIConfig[3], DIConfig[4], DIConfig[5], DIConfig[6]);
18
19    rtn = robot.GetExtDOConfig(DOConfig);
20    System.out.printf("GetExtDOConfig rtn is %d\n Arc Start %d\nAir Test %d\nWire forward %d\nWire Inverse %d\nwiresearch %d\nWeld Mode %d\nlaser Enable %d\nLaser On %d\nLaser Reset Error %d\n",
21        rtn, DOConfig[0], DOConfig[1], DOConfig[2], DOConfig[3], DOConfig[4], DOConfig[5], DOConfig[6], DOConfig[7], DOConfig[8]);
22
23
24
25    return 0;
26}

14.46. Get Extended DI Function Configuration

 1/**
 2* @brief Get extended DI function configuration
 3* @param DIConfig Extended DI input configuration; DIConfig[0]-welding machine ready extended DI port;
 4* DIConfig[1]-arc start success extended DI port;
 5* DIConfig[2]-welding interrupt resume extended DI port;
 6* DIConfig[3]-welding interrupt exit extended DI port;
 7* DIConfig[4]-wire search success extended DI port;
 8* DIConfig[5]-laser welding machine running status extended DI port;
 9* DIConfig[6]-laser welding machine fault status extended DI port;
10* DIConfig[7-15]-reserved
11* @return  Error code
12*/
13public int GetExtDIConfig(int[] DIConfig)

14.47. Get Extended DO Function Configuration

 1/**
 2* @brief Get extended DO function configuration
 3* @param DOConfig Extended DO output configuration; DOConfig[0]-welding machine arc start extended DO port;
 4* DOConfig[1]-gas detection extended DO port;
 5* DOConfig[2]-forward wire feed extended DO port;
 6* DOConfig[3]-reverse wire feed extended DO port;
 7* DOConfig[4]-wire search extended DO port;
 8* DOConfig[5]-welding machine control mode extended DO port;
 9* DOConfig[6]-laser welding machine enable extended DO port;
10* DOConfig[7]-laser welding machine start (laser output) extended DO port;
11* DOConfig[8]-laser welding machine reset extended DO port;
12* DOConfig[9-15]-reserved
13* @return  Error code
14*/
15public int GetExtDOConfig(int[] DOConfig)

14.48. Arc tracking control

Changed in version Java: SDK-v1.0.2-3.7.9

 1/**
 2* @brief Arc tracking control
 3* @param [in] flag Switch: 0-Off; 1-On
 4* @param [in] delaytime Lag time in ms
 5* @param [in] isLeftRight Left/right deviation compensation
 6* @param [in] klr Left/right adjustment coefficient (sensitivity)
 7* @param [in] tStartLr Left/right start compensation time in cycles
 8* @param [in] stepMaxLr Left/right maximum compensation per step in mm
 9* @param [in] sumMaxLr Left/right total maximum compensation in mm
10* @param [in] isUpLow Up/down deviation compensation
11* @param [in] kud Up/down adjustment coefficient (sensitivity)
12* @param [in] tStartUd Up/down start compensation time in cycles
13* @param [in] stepMaxUd Up/down maximum compensation per step in mm
14* @param [in] sumMaxUd Up/down total maximum compensation in mm
15* @param [in] axisSelect Up/down coordinate system selection: 0-Weaving; 1-Tool; 2-Base
16* @param [in] referenceType Up/down reference current setting method: 0-Feedback; 1-Constant
17* @param [in] referSampleStartUd Up/down reference current sampling start count (feedback) in cycles
18* @param [in] referSampleCountUd Up/down reference current sampling cycle count (feedback) in cycles
19* @param [in] referenceCurrent Up/down reference current in mA
20* @param [in] offsetType Offset tracking type: 0-No offset; 1-Sampling; 2-Percentage
21* @param [in] offsetParameter Offset parameters:
22*   Sampling (offset sampling start time, default one cycle)
23*   Percentage (offset percentage (-100 ~ 100))
24* @return Error code
25*/
26int ArcWeldTraceControl(int flag, double delaytime, int isLeftRight, double klr, double tStartLr, double stepMaxLr, double sumMaxLr, int isUpLow, double kud, double tStartUd, double stepMaxUd, double sumMaxUd, int axisSelect, int referenceType, double referSampleStartUd, double referSampleCountUd, double referenceCurrent, int offsetType, int offsetParameter);

14.49. Arc tracking AI channel selection

1/**
2* @brief Arc tracking AI channel selection
3* @param channel Arc tracking AI channel selection [0-3]
4* @return Error code
5*/
6public int ArcWeldTraceExtAIChannelConfig(int channel);

14.50. Arc tracking + multi-layer multi-pass compensation start

1/**
2* @brief Arc tracking + multi-layer multi-pass compensation start
3* @return Error code
4*/
5public int ArcWeldTraceReplayStart();

14.51. Arc tracking + multi-layer multi-pass compensation end

1/**
2* @brief Arc tracking + multi-layer multi-pass compensation end
3* @return Error code
4*/
5public int ArcWeldTraceReplayEnd();

14.52. Offset coordinate transformation - multi-layer multi-pass welding

 1/**
 2* @brief Offset coordinate transformation - multi-layer multi-pass welding
 3* @param pointO Reference point Cartesian pose
 4* @param pointX Reference point X-direction offset point Cartesian pose
 5* @param pointZ Reference point Z-direction offset point Cartesian pose
 6* @param dx X-direction offset (mm)
 7* @param dz Z-direction offset (mm)
 8* @param dry Rotation around Y-axis offset (°)
 9* @param offset Calculated offset
10* @return Error code
11*/
12public int MultilayerOffsetTrsfToBase(DescTran pointO, DescTran pointX, DescTran pointZ, double dx, double dz, double dry, DescPose offset);

14.53. Multi-layer multi-pass welding arc tracking code example

  1public static int TestArcWeldTrace(Robot robot)
  2{
  3    JointPos mulitilineorigin1_joint = new JointPos(-24.090, -63.501, 84.288, -111.940, -93.426, 57.669);
  4    DescPose mulitilineorigin1_desc = new DescPose(-677.559, 190.951, -1.205, 1.144, -41.482, -82.577);
  5
  6    DescTran mulitilineX1_desc = new DescTran(0, 0, 0);
  7    mulitilineX1_desc.x = -677.556;
  8    mulitilineX1_desc.y = 211.949;
  9    mulitilineX1_desc.z = -1.206;
 10
 11    DescTran mulitilineZ1_desc = new DescTran(0, 0, 0);
 12    mulitilineZ1_desc.x = -677.564;
 13    mulitilineZ1_desc.y = 190.956;
 14    mulitilineZ1_desc.z = 19.817;
 15
 16    JointPos mulitilinesafe_joint = new JointPos(-25.734, -63.778, 81.502, -108.975, -93.392, 56.021);
 17    DescPose mulitilinesafe_desc = new DescPose(-677.561, 211.950, 19.812, 1.144, -41.482, -82.577);
 18    JointPos mulitilineorigin2_joint = new JointPos(-29.743, -75.623, 101.241, -116.354, -94.928, 55.735);
 19    DescPose mulitilineorigin2_desc = new DescPose(-563.961, 215.359, -0.681, 2.845, -40.476, -87.443);
 20
 21    DescTran mulitilineX2_desc = new DescTran(0, 0, 0);
 22    mulitilineX2_desc.x = -563.965;
 23    mulitilineX2_desc.y = 220.355;
 24    mulitilineX2_desc.z = -0.680;
 25
 26    DescTran mulitilineZ2_desc = new DescTran(0, 0, 0);
 27    mulitilineZ2_desc.x = -563.968;
 28    mulitilineZ2_desc.y = 215.362;
 29    mulitilineZ2_desc.z = 4.331;
 30
 31    ExaxisPos epos = new ExaxisPos(0, 0, 0, 0);
 32    DescPose offset = new DescPose(0, 0, 0, 0, 0, 0);
 33
 34    robot.Sleep(10);
 35    int error = robot.MoveJ(mulitilinesafe_joint, mulitilinesafe_desc, 13, 0, 10, 100, 100, epos, -1, 0, offset);
 36
 37    error = robot.MoveL(mulitilineorigin1_joint, mulitilineorigin1_desc, 13, 0, 10, 100, 100, -1, 0, epos, 0, 0, offset, 0, 100);
 38
 39    error = robot.MoveJ(mulitilinesafe_joint, mulitilinesafe_desc, 13, 0, 10, 100, 100, epos, -1, 0, offset);
 40
 41    error = robot.MoveL(mulitilineorigin2_joint, mulitilineorigin2_desc, 13, 0, 10, 100, 100, -1, 0, epos, 0, 0, offset, 0, 100);
 42
 43    error = robot.MoveJ(mulitilinesafe_joint, mulitilinesafe_desc, 13, 0, 10, 100, 100, epos, -1, 0, offset);
 44
 45    error = robot.MoveL(mulitilineorigin1_joint, mulitilineorigin1_desc, 13, 0, 10, 100, 100, -1, 0, epos, 0, 0, offset, 0, 100);
 46
 47    error = robot.ARCStart(1, 0, 3000);
 48
 49    error = robot.WeaveStart(0);
 50
 51    error = robot.ArcWeldTraceControl(1, 0, 1, 0.06, 5, 5, 50, 1, 0.06, 5, 5, 55, 0, 0, 4, 1, 10, 0, 0);
 52
 53    error = robot.MoveL(mulitilineorigin2_joint, mulitilineorigin2_desc, 13, 0, 1, 100, 100, -1, 0, epos, 0, 0, offset, 0, 100);
 54
 55    error = robot.ArcWeldTraceControl(0, 0, 1, 0.06, 5, 5, 50, 1, 0.06, 5, 5, 55, 0, 0, 4, 1, 10, 0, 0);
 56
 57    error = robot.WeaveEnd(0);
 58
 59    error = robot.ARCEnd(1, 0, 10000);
 60
 61    error = robot.MoveJ(mulitilinesafe_joint, mulitilinesafe_desc, 13, 0, 10, 100, 100, epos, -1, 0, offset);
 62
 63    error = robot.MultilayerOffsetTrsfToBase(mulitilineorigin1_desc.tran, mulitilineX1_desc, mulitilineZ1_desc, 10.0, 0.0, 0.0, offset);
 64
 65    error = robot.MoveL(mulitilineorigin1_joint, mulitilineorigin1_desc, 13, 0, 10, 100, 100, -1, 0, epos, 0, 1, offset, 0, 100);
 66
 67    error = robot.ARCStart(1, 0, 3000);
 68
 69    error = robot.MultilayerOffsetTrsfToBase(mulitilineorigin2_desc.tran, mulitilineX2_desc, mulitilineZ2_desc, 10, 0, 0, offset);
 70
 71    error = robot.ArcWeldTraceReplayStart();
 72
 73    error = robot.MoveL(mulitilineorigin2_joint, mulitilineorigin2_desc, 13, 0, 2, 100, 100, -1, 0, epos, 0, 1, offset, 0, 100);
 74
 75    error = robot.ArcWeldTraceReplayEnd();
 76
 77    error = robot.ARCEnd(1, 0, 10000);
 78
 79    error = robot.MoveJ(mulitilinesafe_joint, mulitilinesafe_desc, 13, 0, 10, 100, 100, epos, -1, 0, offset);
 80
 81    error = robot.MultilayerOffsetTrsfToBase(mulitilineorigin1_desc.tran, mulitilineX1_desc, mulitilineZ1_desc, 0, 10, 0, offset);
 82
 83    error = robot.MoveL(mulitilineorigin1_joint, mulitilineorigin1_desc, 13, 0, 10, 100, 100, -1, 0, epos, 0, 1, offset, 0, 100);
 84
 85    error = robot.ARCStart(1, 0, 3000);
 86
 87    error = robot.MultilayerOffsetTrsfToBase(mulitilineorigin2_desc.tran, mulitilineX2_desc, mulitilineZ2_desc, 0, 10, 0, offset);
 88
 89    error = robot.ArcWeldTraceReplayStart();
 90
 91    error = robot.MoveL(mulitilineorigin2_joint, mulitilineorigin2_desc, 13, 0, 2, 100, 100, -1, 0, epos, 0, 1, offset, 0, 100);
 92
 93    error = robot.ArcWeldTraceReplayEnd();
 94
 95    error = robot.ARCEnd(1, 0, 3000);
 96
 97    error = robot.MoveJ(mulitilinesafe_joint, mulitilinesafe_desc, 13, 0, 10, 100, 100, epos, -1, 0, offset);
 98
 99    robot.CloseRPC();
100    return 0;
101}

14.54. Arc tracking welder current feedback AI channel selection

Added in version Java: SDK-v1.0.5-3.8.2

 1/**
 2* @brief Arc tracking welder current feedback AI channel selection
 3* @param [in] channel Channel:
 4*   0-Extension AI0
 5*   1-Extension AI1
 6*   2-Extension AI2
 7*   3-Extension AI3
 8*   4-Controller AI0
 9*   5-Controller AI1
10* @return Error code
11*/
12int ArcWeldTraceAIChannelCurrent(int channel);

14.55. Arc tracking welder voltage feedback AI channel selection

Added in version Java: SDK-v1.0.5-3.8.2

 1/**
 2* @brief Arc tracking welder voltage feedback AI channel selection
 3* @param [in] channel Channel:
 4*   0-Extension AI0
 5*   1-Extension AI1
 6*   2-Extension AI2
 7*   3-Extension AI3
 8*   4-Controller AI0
 9*   5-Controller AI1
10* @return Error code
11*/
12int ArcWeldTraceAIChannelVoltage(int channel);

14.56. Arc tracking welder current feedback conversion parameters

Added in version Java: SDK-v1.0.5-3.8.2

1/**
2* @brief Arc tracking welder current feedback conversion parameters
3* @param [in] AILow AI channel lower limit (default 0V, range [0-10V])
4* @param [in] AIHigh AI channel upper limit (default 10V, range [0-10V])
5* @param [in] currentLow AI channel lower limit corresponding welder current (default 0V, range [0-200V])
6* @param [in] currentHigh AI channel upper limit corresponding welder current (default 100V, range [0-200V])
7* @return Error code
8*/
9int ArcWeldTraceCurrentPara(double AILow, double AIHigh, double currentLow, double currentHigh);

14.57. Arc tracking welder voltage feedback conversion parameters

Added in version Java: SDK-v1.0.5-3.8.2

1/**
2* @brief Arc tracking welder voltage feedback conversion parameters
3* @param [in] AILow AI channel lower limit (default 0V, range [0-10V])
4* @param [in] AIHigh AI channel upper limit (default 10V, range [0-10V])
5* @param [in] voltageLow AI channel lower limit corresponding welder voltage (default 0V, range [0-200V])
6* @param [in] voltageHigh AI channel upper limit corresponding welder voltage (default 100V, range [0-200V])
7* @return Error code
8*/
9int ArcWeldTraceVoltagePara(double AILow, double AIHigh, double voltageLow, double voltageHigh);

14.58. Arc tracking code example

 1public static void WeldTraceControlWithCtrlBoxAI(Robot robot)
 2{
 3    DescPose startdescPose = new DescPose(-473.86, 257.879, -20.849, -37.317, -42.021, 2.543);
 4    JointPos startjointPos = new JointPos(-43.487, -76.526, 95.568, -104.445, -89.356, 3.72);
 5
 6    DescPose safedescPose = new DescPose(-504.043, 275.181, 40.908, -28.002, -42.025, -14.044);
 7    JointPos safejointPos = new JointPos(-39.078, -76.732, 87.227, -99.47, -94.301, 18.714);
 8
 9    DescPose enddescPose = new DescPose(-499.844, 141.225, 7.72, -34.856, -40.17, 13.13);
10    JointPos endjointPos = new JointPos(-31.305, -82.998, 99.401, -104.426, -89.35, 3.696);
11
12    ExaxisPos exaxisPos = new ExaxisPos(0, 0, 0, 0);
13    DescPose offdese = new DescPose(0, 0, 0, 0, 0, 0);
14    // Move to safe point
15    robot.MoveJ(safejointPos, safedescPose, 1, 0, 5, 20, 100, exaxisPos, -1, 0, offdese);
16
17    WeldCurrentAORelation current = new WeldCurrentAORelation(0, 495, 1, 10, 0);
18    WeldVoltageAORelation voltage = new WeldVoltageAORelation(10, 45, 1, 10, 1);
19    robot.WeldingSetCurrentRelation(current); // Current to analog output relation
20    robot.WeldingSetVoltageRelation(voltage); // Voltage to analog output relation
21    robot.WeldingSetVoltage(0, 25, 1, 0); // Set voltage
22    robot.WeldingSetCurrent(0, 260, 0, 0); // Set current
23
24    int rtn = robot.ArcWeldTraceAIChannelCurrent(4);
25    System.out.println("ArcWeldTraceAIChannelCurrent rtn is " + rtn);
26
27    rtn = robot.ArcWeldTraceAIChannelVoltage(5);
28    System.out.println("ArcWeldTraceAIChannelVoltage rtn is " + rtn);
29
30    rtn = robot.ArcWeldTraceCurrentPara(0.0, 5, 0, 500);
31    System.out.println("ArcWeldTraceCurrentPara rtn is " + rtn);
32
33    rtn = robot.ArcWeldTraceVoltagePara(1.018, 10, 0, 50);
34    System.out.println("ArcWeldTraceVoltagePara rtn is " + rtn);
35
36    robot.MoveJ(startjointPos, startdescPose, 1, 0, 20, 20, 100, exaxisPos, -1, 0, offdese);
37    robot.ArcWeldTraceControl(1, 0, 1, 0.08, 5, 5, 300, 1, 0.06, 4, 4, 300, 1, 0, 4, 1, 10, 0, 0);
38    robot.ARCStart(0, 0, 10000);
39    robot.WeaveStart(0);
40    robot.MoveL(endjointPos, enddescPose, 1, 0, 100, 100, 2, -1, 0, exaxisPos, 0, 0, offdese, 0, 10);
41    robot.ARCEnd(0, 0, 10000);
42    robot.WeaveEnd(0);
43    robot.ArcWeldTraceControl(0, 0, 1, 0.08, 5, 5, 300, 1, 0.06, 4, 4, 300, 1, 0, 4, 1, 10, 0, 0);
44
45    robot.MoveJ(safejointPos, safedescPose, 1, 0, 20, 20, 100, exaxisPos, -1, 0, offdese);
46}

14.59. Set Wire Search Extension IO Ports

1/**
2* @brief Sets the wire search extension IO ports
3* @param [in] searchDoneDINum Wire search success DO port (0-127)
4* @param [in] searchStartDONum Wire search start/stop control DO port (0-127)
5* @return Error code
6*/
7int SetWireSearchExtDIONum(int searchDoneDINum, int searchStartDONum);

14.60. Wire search start

 1/**
 2* @brief Wire search start
 3* @param [in] refPos 1-Reference point; 0-Contact point
 4* @param [in] searchVel Search speed %
 5* @param [in] searchDis Search distance mm
 6* @param [in] autoBackFlag Auto return flag: 0-No auto; 1-Auto
 7* @param [in] autoBackVel Auto return speed %
 8* @param [in] autoBackDis Auto return distance mm
 9* @param [in] offectFlag 1-Search with offset; 0-Teach point search
10* @return Error code
11*/
12int WireSearchStart(int refPos, double searchVel, int searchDis, int autoBackFlag, double autoBackVel, int autoBackDis, int offectFlag);

14.61. Wire search end

 1/**
 2* @brief Wire search end
 3* @param [in] refPos 1-Reference point; 2-Contact point
 4* @param [in] searchVel Search speed %
 5* @param [in] searchDis Search distance mm
 6* @param [in] autoBackFlag Auto return flag: 0-No auto; 1-Auto
 7* @param [in] autoBackVel Auto return speed %
 8* @param [in] autoBackDis Auto return distance mm
 9* @param [in] offectFlag 1-Search with offset; 2-Teach point search
10* @return Error code
11*/
12int WireSearchEnd(int refPos, double searchVel, int searchDis, int autoBackFlag, double autoBackVel, int autoBackDis, int offectFlag);

14.62. Calculate wire search offset

 1/**
 2* @brief Calculate wire search offset
 3* @param [in] seamType Weld seam type
 4* @param [in] method Calculation method
 5* @param [in] varNameRef Reference points 1-6, "#" indicates no point variable
 6* @param [in] varNameRes Contact points 1-6, "#" indicates no point variable
 7* @param [out] offset Offset pose [x, y, z, a, b, c] and offset method
 8* @return Error code
 9*/
10int GetWireSearchOffset(int seamType, int method, String[] varNameRef, String[] varNameRes, DescOffset offset);

14.63. Wait for wire search completion

1/**
2* @brief Wait for wire search completion
3* @return Error code
4*/
5int WireSearchWait(String name);

14.64. Write wire search contact point to database

1/**
2* @brief Write wire search contact point to database
3* @param [in] varName Contact point name "RES0" ~ "RES99"
4* @param [in] pos Contact point data [x, y, z, a, b, c]
5* @return Error code
6*/
7int SetPointToDatabase(String varName, DescPose pos);

14.65. Robot wire search code example

 1public static int TestWireSearch(Robot robot)
 2{
 3    DescPose toolCoord = new DescPose(0, 0, 200, 0, 0, 0);
 4    robot.SetToolCoord(1, toolCoord, 0, 0, 1, 0);
 5    DescPose wobjCoord = new DescPose(0, 0, 0, 0, 0, 0);
 6    robot.SetWObjCoord(1, wobjCoord, 0);
 7
 8    int rtn0, rtn1, rtn2 = 0;
 9    ExaxisPos exaxisPos = new ExaxisPos(0, 0, 0, 0);
10    DescPose offdese = new DescPose(0, 0, 0, 0, 0, 0);
11
12    DescPose descStart = new DescPose(216.543, 445.175, 93.465, 179.683, 1.757, -112.641);
13    JointPos jointStart = new JointPos(-128.345, -86.660, 114.679, -119.625, -89.219, 74.303);
14
15    DescPose descEnd = new DescPose(111.143, 523.384, 87.659, 179.703, 1.835, -97.750);
16    JointPos jointEnd = new JointPos(-113.454, -81.060, 109.328, -119.954, -89.218, 74.302);
17
18    robot.MoveL(jointStart, descStart, 1, 1, 100, 100, 100, -1, 0, exaxisPos, 0, 0, offdese, 0, 100);
19    robot.MoveL(jointEnd, descEnd, 1, 1, 100, 100, 100, -1, 0, exaxisPos, 0, 0, offdese, 0, 100);
20
21    DescPose descREF0A = new DescPose(142.135, 367.604, 86.523, 179.728, 1.922, -111.089);
22    JointPos jointREF0A = new JointPos(-126.794, -100.834, 128.922, -119.864, -89.218, 74.302);
23
24    DescPose descREF0B = new DescPose(254.633, 463.125, 72.604, 179.845, 2.341, -114.704);
25    JointPos jointREF0B = new JointPos(-130.413, -81.093, 112.044, -123.163, -89.217, 74.303);
26
27    DescPose descREF1A = new DescPose(92.556, 485.259, 47.476, -179.932, 3.130, -97.512);
28    JointPos jointREF1A = new JointPos(-113.231, -83.815, 119.877, -129.092, -89.217, 74.303);
29
30    DescPose descREF1B = new DescPose(203.103, 583.836, 63.909, 179.991, 2.854, -103.372);
31    JointPos jointREF1B = new JointPos(-119.088, -69.676, 98.692, -121.761, -89.219, 74.303);
32
33    rtn0 = robot.WireSearchStart(0, 10, 100, 0, 10, 100, 0);
34    robot.MoveL(jointREF0A, descREF0A, 1, 1, 100, 100, 100, -1, 0, exaxisPos, 0, 0, offdese, 0, 10);  // Start point
35    robot.MoveL(jointREF0B, descREF0B, 1, 1, 100, 100, 100, -1, 0, exaxisPos, 1, 0, offdese, 0, 10);  // Direction point
36    rtn1 = robot.WireSearchWait("REF0");
37    rtn2 = robot.WireSearchEnd(0, 10, 100, 0, 10, 100, 0);
38
39    rtn0 = robot.WireSearchStart(0, 10, 100, 0, 10, 100, 0);
40    robot.MoveL(jointREF1A, descREF1A, 1, 1, 100, 100, 100, -1, 0, exaxisPos, 0, 0, offdese, 0, 10);  // Start point
41    robot.MoveL(jointREF1B, descREF1B, 1, 1, 100, 100, 100, -1, 0, exaxisPos, 1, 0, offdese, 0, 10);  // Direction point
42    rtn1 = robot.WireSearchWait("REF1");
43    rtn2 = robot.WireSearchEnd(0, 10, 100, 0, 10, 100, 0);
44
45    rtn0 = robot.WireSearchStart(0, 10, 100, 0, 10, 100, 0);
46    robot.MoveL(jointREF0A, descREF0A, 1, 1, 100, 100, 100, -1, 0, exaxisPos, 0, 0, offdese, 0, 10);  // Start point
47    robot.MoveL(jointREF0B, descREF0B, 1, 1, 100, 100, 100, -1, 0, exaxisPos, 1, 0, offdese, 0, 10);  // Direction point
48    rtn1 = robot.WireSearchWait("RES0");
49    rtn2 = robot.WireSearchEnd(0, 10, 100, 0, 10, 100, 0);
50
51    rtn0 = robot.WireSearchStart(0, 10, 100, 0, 10, 100, 0);
52    robot.MoveL(jointREF1A, descREF1A, 1, 1, 100, 100, 100, -1, 0, exaxisPos, 0, 0, offdese, 0, 10);  // Start point
53    robot.MoveL(jointREF1B, descREF1B, 1, 1, 100, 100, 100, -1, 0, exaxisPos, 1, 0, offdese, 0, 10);  // Direction point
54    rtn1 = robot.WireSearchWait("RES1");
55    rtn2 = robot.WireSearchEnd(0, 10, 100, 0, 10, 100, 0);
56
57    String[] varNameRef = new String[]{"REF0", "REF1", "#", "#", "#", "#"};
58    String[] varNameRes = new String[]{"RES0", "RES1", "#", "#", "#", "#"};
59    int offectFlag = 0;
60
61    DescPose pos = new DescPose(0, 0, 0, 0, 0, 0);
62    DescOffset offectPos = new DescOffset();
63    offectPos.offset = pos;
64    offectPos.offsetFlag = 0;
65
66    rtn0 = robot.GetWireSearchOffset(0, 0, varNameRef, varNameRes, offectPos);
67    robot.PointsOffsetEnable(0, pos);
68    robot.MoveL(jointStart, descStart, 1, 1, 100, 100, 100, -1, 0, exaxisPos, 0, 0, offdese, 0, 10);
69    robot.MoveL(jointEnd, descEnd, 1, 1, 100, 100, 100, -1, 0, exaxisPos, 1, 0, offdese, 0, 10);
70    robot.PointsOffsetDisable();
71
72    robot.CloseRPC();
73    return 0;
74}

14.66. Set welding voltage gradual change start

Added in version Java: SDK-v1.0.5-3.8.2

 1/**
 2* @brief Set welding voltage gradual change start
 3* @param [in] IOType Control type:
 4*   0-Controller IO
 5*   1-Digital communication protocol (UDP)
 6*   2-Digital communication protocol (ModbusTCP)
 7* @param [in] voltageStart Starting welding voltage (V)
 8* @param [in] voltageEnd Ending welding voltage (V)
 9* @param [in] AOIndex Controller AO port number (0-1)
10* @param [in] blend Smoothing: 0-No smoothing; 1-Smoothing
11* @return Error code
12*/
13int WeldingSetVoltageGradualChangeStart(int IOType, double voltageStart, double voltageEnd, int AOIndex, int blend);

14.67. Set welding voltage gradual change end

Added in version Java: SDK-v1.0.5-3.8.2

1/**
2* @brief Set welding voltage gradual change end
3* @return Error code
4*/
5int WeldingSetVoltageGradualChangeEnd();

14.68. Set welding current gradual change start

Added in version Java: SDK-v1.0.5-3.8.2

 1/**
 2* @brief Set welding current gradual change start
 3* @param [in] IOType Control type:
 4*   0-Controller IO
 5*   1-Digital communication protocol (UDP)
 6*   2-Digital communication protocol (ModbusTCP)
 7* @param [in] currentStart Starting welding current (A)
 8* @param [in] currentEnd Ending welding current (A)
 9* @param [in] AOIndex Controller AO port number (0-1)
10* @param [in] blend Smoothing: 0-No smoothing; 1-Smoothing
11* @return Error code
12*/
13int WeldingSetCurrentGradualChangeStart(int IOType, double currentStart, double currentEnd, int AOIndex, int blend);

14.69. Set welding current gradual change end

Added in version Java: SDK-v1.0.5-3.8.2

1/**
2* @brief Set welding current gradual change end
3* @return Error code
4*/
5int WeldingSetCurrentGradualChangeEnd();

14.70. Robot welding current/voltage gradual change code example

 1public static void WeldparamChange(Robot robot)
 2{
 3    DescPose startdescPose = new DescPose(-484.707, 276.996, -14.013, -37.657, -40.508, -1.548);
 4    JointPos startjointPos = new JointPos(-45.421, -75.673, 93.627, -104.302, -87.938, 6.005);
 5
 6    DescPose enddescPose = new DescPose(-508.767, 137.109, -13.966, -37.639, -40.508, -1.559);
 7    JointPos endjointPos = new JointPos(-32.768, -80.947, 100.254, -106.201, -87.201, 18.648);
 8
 9    DescPose safedescPose = new DescPose(-484.709, 294.436, 13.621, -37.660, -40.508, -1.545);
10    JointPos safejointPos = new JointPos(-46.604, -75.410, 89.109, -100.003, -88.012, 4.823);
11
12    ExaxisPos exaxisPos = new ExaxisPos(0, 0, 0, 0);
13    DescPose offdese = new DescPose(0, 0, 0, 0, 0, 0);
14
15    WeldCurrentAORelation cur = new WeldCurrentAORelation(0, 495, 1, 10, 0);
16    WeldVoltageAORelation vol = new WeldVoltageAORelation(10, 45, 1, 10, 1);
17    robot.WeldingSetCurrentRelation(cur);
18    robot.WeldingSetVoltageRelation(vol);
19
20    robot.WeldingSetVoltage(0, 25, 1, 0);
21    robot.WeldingSetCurrent(0, 260, 0, 0);
22
23    robot.MoveJ(safejointPos, safedescPose, 1, 0, 5, 100, 100, exaxisPos, -1, 0, offdese);
24
25    robot.WeldingSetCurrentGradualChangeStart(0, 260, 220, 0, 0);
26    robot.WeldingSetVoltageGradualChangeStart(0, 25, 22, 1, 0);
27    int rtn = robot.ArcWeldTraceControl(1, 0, 1, 0.08, 5, 5, 300, 1, 0.06, 4, 4, 300, 1, 0, 4, 1, 10, 0, 0);
28
29    robot.MoveJ(startjointPos, startdescPose, 1, 0, 5, 100, 100, exaxisPos, -1, 0, offdese);
30    System.out.println("ArcWeldTraceControl rtn is " + rtn);
31
32    robot.ARCStart(0, 0, 10000);
33    robot.WeaveStart(0);
34    robot.WeaveChangeStart(2, 1, 24, 36);
35    robot.MoveL(endjointPos, enddescPose, 1, 0, 100, 100, 2, -1, 0, exaxisPos, 0, 0, offdese, 0, 10);
36    robot.ARCEnd(0, 0, 10000);
37    robot.WeaveChangeEnd();
38    robot.WeaveEnd(0);
39    robot.ArcWeldTraceControl(0, 0, 1, 0.08, 5, 5, 300, 1, 0.06, 4, 4, 300, 1, 0, 4, 1, 10, 0, 0);
40    robot.WeldingSetCurrentGradualChangeEnd();
41    robot.WeldingSetVoltageGradualChangeEnd();
42}

14.71. Set Custom Weaving Parameters

Added in version Java: SDK-v1.0.9-3.8.6

 1/**
 2 * @brief Set custom weaving parameters
 3 * @param [in] id Custom weaving number: 0-2
 4 * @param [in] pointNum Number of weaving points: 0-10
 5 * @param [in] point Moving endpoint data x,y,z
 6 * @param [in] stayTime Weaving dwell time in ms
 7 * @param [in] frequency Weaving frequency in Hz
 8 * @param [in] incStayType Wait mode: 0-cycle does not include wait time; 1-cycle includes wait time
 9 * @param [in] stationary Weaving position wait: 0-continue motion during wait time; 1-position static during wait time
10 * @return  Error code
11 */
12public int CustomWeaveSetPara(int id, int pointNum, DescTran[] point, double[] stayTime, double frequency, int incStayType, int stationary)

14.72. Get Custom Weaving Parameters

Added in version Java: SDK-v1.0.9-3.8.6

 1/**
 2 * @brief Get custom weaving parameters
 3 * @param [in] id Custom weaving number: 0-2
 4 * @param [out] pointNum Number of weaving points: 0-10
 5 * @param [out] point Moving endpoint data x,y,z
 6 * @param [out] stayTime Weaving dwell time in ms
 7 * @param [out] frequency Weaving frequency in Hz
 8 * @param [out] incStayType Wait mode: 0-cycle does not include wait time; 1-cycle includes wait time
 9 * @param [out] stationary Weaving position wait: 0-continue motion during wait time; 1-position static during wait time
10 * @return  Error code
11 */
12public int CustomWeaveGetPara(int id, int[] pointNum, DescTran[] point, double[] stayTime, double[] frequency, int[] incStayType, int[] stationary)

14.73. Custom Weaving Parameters Code Example

 1public static void TestCustomWeaveSetPara(Robot robot)
 2{
 3    DescTran[] point = new DescTran[10];
 4    point[0]=new DescTran();
 5    point[0].x = -3;
 6    point[0].y = -3;
 7    point[0].z = 0;
 8
 9    point[1]=new DescTran();
10    point[1].x = -6;
11    point[1].y = 0;
12    point[1].z = 0;
13
14    point[2]=new DescTran();
15    point[2].x = -3;
16    point[2].y = 3;
17    point[2].z = 0;
18
19    point[3]=new DescTran();
20    point[3].x = 0;
21    point[3].y = 0;
22    point[3].z = 0;
23    point[4]=new DescTran(0,0,0);
24    point[5]=new DescTran(0,0,0);
25    point[6]=new DescTran(0,0,0);
26    point[7]=new DescTran(0,0,0);
27    point[8]=new DescTran(0,0,0);
28    point[9]=new DescTran(0,0,0);
29
30    double[] stayTime =new double[] { 0,0,0,0,0,0,0,0,0,0 };
31    int rtn = robot.CustomWeaveSetPara(2, 4, point, stayTime, 1.000, 0, 0);
32    System.out.println("CustomWeaveSetPara rtn is: "+ rtn);
33    robot.Sleep(1000);
34
35    int[] pointNum = new int[1];
36    double[] frequency=new double[1];
37    int[] incStayType=new int[1];
38    int[] stationary=new int[1];
39    robot.CustomWeaveGetPara(2, pointNum, point, stayTime, frequency, incStayType, stationary);
40    System.out.println("pointNum is: "+ pointNum[0]);
41    for (int i = 0; i < pointNum[0]; i++)
42    {
43        System.out.println("point: "+i+", "+ point[i].x+", "+ point[i].y+", "+ point[i].z);
44    }
45    System.out.println("frequency is: "+ frequency[0]+", incStayType is: "+ incStayType[0]+", stationary is: "+ stationary[0]);
46
47    robot.WeaveSetPara(0, 9, 1.000000, 1, 5.000000,
48            6.000000, 5.000000, 50, 100, 100,
49            0, 1, 0.000000, 0.000000);
50
51    DescPose desc_p1 =new DescPose(-288.650, 367.807, 288.404, 0.000, -0.001, 0.001 );
52    DescPose desc_p2 = new DescPose( -431.714, 367.815, 288.415, 0.001, 0.001, 0.000 );
53    DescPose desc_p3 = new DescPose( -348.666, 427.798, 288.404, -0.000, -0.000, 0.001 );
54    JointPos j1 = new JointPos( 140.656, -84.560, -91.707, -93.734, 90.000, 50.655 );
55    JointPos j2 = new JointPos( 149.873, -98.298, -77.599, -94.103, 90.000, 59.873 );
56    JointPos j3 = new JointPos( 139.773, -96.173, -80.014, -93.814, 90.000, 49.772 );
57
58    ExaxisPos epos = new ExaxisPos();
59    DescPose offset_pos = new DescPose();
60
61    robot.MoveJ(j1, desc_p1, 3, 0, 100, 100,100, epos, -1, 0, offset_pos);
62    robot.WeaveStart(0);
63    robot.Circle(j3, desc_p3, 3, 0, 100, 100, epos, j2, desc_p2, 3, 0, 100, 100, epos, 10, -1, offset_pos,0,-1,0);
64    robot.WeaveEnd(0);
65    robot.MoveJ(j1, desc_p1, 3, 0, 100, 100, 100, epos, -1, 0, offset_pos);
66    robot.WeaveStart(0);
67    robot.MoveC(j3, desc_p3, 3, 0, 100, 100, epos, 0, offset_pos, j2, desc_p2, 3, 0, 100, 100, epos, 0, offset_pos, 10, -1,0);
68    robot.WeaveEnd(0);
69    robot.MoveJ(j1, desc_p1, 3, 0, 100, 100, 100, epos, -1, 0, offset_pos);
70    robot.WeaveStart(0);
71    robot.MoveL(j2, desc_p2, 3, 0, 100, 100, 10, -1,epos, 0, 0, offset_pos, 0,0, 100);
72    robot.WeaveEnd(0);
73
74    robot.CloseRPC();
75}

14.74. Laser Welding Machine Parameter Configuration

 1/**
 2* @brief Laser welding machine parameter configuration
 3* @param  io_type Communication type 0-IO 1-UDP
 4* @param  num Group number to set (1~10)
 5* @param  scanSpeed Scanning speed
 6* @param  scanWidth Scanning width
 7* @param  peakPower Peak power
 8* @param  dutyCycle Duty cycle
 9* @param  freq Frequency
10* @return Error code
11*/
12public int SetLaserWeldingParam(int io_type, int num, int scanSpeed, int scanWidth, int peakPower, int dutyCycle, int freq);

14.75. Start/Stop Laser Welding

1/**
2* @brief Start/stop laser welding
3* @param io_type Communication type 0-IO 1-UDP
4* @param status Control word 0-laser off 1-laser on
5* @param max_waittime Maximum wait time in milliseconds, default 10000
6* @return Error code
7*/
8public int SetLaserWeldingStartEnd(int io_type, int status, int max_waittime)

14.76. Enable/Disable Laser Welding Machine

1/**
2* @brief Enable/disable laser welding machine
3* @param io_type Communication type 0-IO 1-UDP
4* @param status 0-disable 1-enable
5* @return Error code
6*/
7public int SetLaserWeldingEnable(int io_type, int status)

14.77. Laser Welding Machine Fault Reset

1/**
2* @brief Laser welding machine fault reset
3* @param io_type Communication type 0-IO 1-UDP
4* @param status Control word 0-invalid 1-fault reset
5* @return Error code
6*/
7public int ResetLaserWeldingErr(int io_type, int status)

14.78. Get Laser Welding Machine Running Status

1/**
2* @brief Get laser welding machine running status
3* @param io_type Communication type 0-IO 1-UDP
4* @param  status Control word 0-stopped 1-running
5* @return Error code
6*/
7public int GetLaserWeldingRunningState(int io_type, int[] status)

14.79. Get Laser Welding Machine Fault Status

1/**
2* @brief Get laser welding machine fault status
3* @param io_type Communication type 0-IO 1-UDP
4* @param  status 0-no fault 1-fault present
5* @return Error code
6*/
7public int GetLaserWeldingErrState(int io_type, int[] status)

14.80. Get Laser Welding Machine Configuration Parameters

1/**
2* @brief Get configuration parameters of one of the 10 process groups of the laser welding machine
3* @param num Group number to set (1~10)
4* @param params Output parameter array: [scanSpeed, scanWidth, peakPower, dutyCycle, freq]
5* @return Error code
6*/
7public int GetLaserWeldingParamTarget(int num, int[] params)

14.81. Get Currently Active Configuration Parameters of Laser Welding Machine

1/**
2* @brief Get currently active configuration parameters of the laser welding machine
3* @param io_type Communication type 0-IO 1-UDP
4* @param params Output parameter array: [scanSpeed, scanWidth, peakPower, dutyCycle, freq]
5* @return Error code
6*/
7public int GetLaserWeldingParamActual(int io_type, int[] params)

14.82. Configure Extended IO Enable DO Port for Laser Welding Machine

1/**
2* @brief Configure extended IO enable DO port for laser welding machine
3* @param ctrlModeDONum Extended DO port number for laser welding machine enable
4* @return Error code
5*/
6public int SetLaserWeldingEnableExtDoNum(int ctrlModeDONum)

14.83. Configure Extended IO Start DO Port for Laser Welding Machine

1/**
2* @brief Configure extended IO start DO port for laser welding machine
3* @param ctrlModeDONum Extended DO port number for laser welding machine start/stop
4* @return Error code
5*/
6public int SetLaserWeldingStartExtDoNum(int ctrlModeDONum)

14.84. Configure Extended IO Fault Reset DO Port for Laser Welding Machine

1/**
2* @brief Configure extended IO fault reset DO port for laser welding machine
3* @param ctrlModeDONum Extended DO port number for laser welding machine fault reset
4* @return Error code
5*/
6public int SetLaserWeldingErrResetExtDoNum(int ctrlModeDONum)

14.85. Configure Extended IO Running Status (Laser On Status) DI Port for Laser Welding Machine

1/**
2* @brief Configure extended IO running status (laser on status) DI port for laser welding machine
3* @param diNum Extended DI port number for laser welding machine running status (laser on status)
4* @return Error code, 0 indicates success, non-zero indicates failure
5*/
6public int SetLaserWeldingRunningStateExtDiNum(int diNum);

14.86. Configure Extended IO Fault Status DI Port for Laser Welding Machine

1/**
2* @brief Configure extended IO fault status DI port for laser welding machine
3* @param diNum Extended DI port number for laser welding machine fault status
4* @return Error code, 0 indicates success, non-zero indicates failure
5*/
6public int SetLaserWeldingErrStateExtDiNum(int diNum);

14.87. Laser Welding Code Example

 1public static int testLsaerWeld(Robot robot) {
 2    int rtn = -1;
 3    rtn = robot.ExtDevLoadUDPDriver();
 4    if (rtn != 0) {
 5        System.out.println("Failed to load UDP driver, error code: " + rtn);
 6    }
 7    robot.Sleep(1000);
 8    rtn = robot.SetLaserWeldingParam(1, 3, 2000, 3, 1500, 100, 1000);
 9    if (rtn != 0) {
10        System.out.println("SetLaserWeldingParam failed, error code: " + rtn);
11    } else {
12        System.out.println("SetLaserWeldingParam success");
13    }
14    rtn = robot.SetLaserWeldingStartExtDoNum(1);
15    if (rtn != 0) {
16        System.out.println("SetLaserWeldingStartExtDoNum failed, error code: " + rtn);
17    }
18    rtn = robot.Mode(0);
19    if (rtn != 0) {
20        System.out.println("Set mode 0 failed, error code: " + rtn);
21    }
22    robot.Sleep(1000);
23    DescPose desc_pos1 = new DescPose(-303.721, -206.960, 297.105, 152.209, 19.857, 109.166);
24    DescPose desc_pos2 = new DescPose(-301.575, -254.888, 284.786, 155.919, 26.946, 111.629);
25    DescPose desc_safe = new DescPose(-344.386, -280.830, 435.073, 173.835, 15.333, 124.931);
26
27    JointPos jointPos1 = new JointPos(9.827, -99.740, 120.088, -78.900, -77.241, -17.904);
28    JointPos jointPos2 = new JointPos(15.251, -96.456, 120.138, -84.664, -68.542, -17.843);
29    JointPos jointSafe = new JointPos(19.142, -98.078, 101.493, -83.078, -77.070, -17.794);
30
31    ExaxisPos exaxis = new ExaxisPos(0.0, 0.0, 0.0, 0.0);
32    DescPose offset = new DescPose(0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
33    int error = robot.MoveL(desc_pos1, 0, 0, 100, 100, 100, -1, 0, exaxis, 0, 0, offset, -1, 0,0,0);
34    System.out.println("MoveL to pos1 return: " + error);
35    rtn = robot.SetLaserWeldingStartEnd(1, 1, 10000);
36    if (rtn != 0) {
37        System.out.println("SetLaserWeldingStartEnd (start) failed, error code: " + rtn);
38    } else {
39        System.out.println("Laser started");
40    }
41    rtn = robot.MoveL(desc_pos2, 0, 0, 30, 100, 100, -1, 0, exaxis, 0, 0, offset, -1, 0,0, 0);
42    System.out.println("MoveL to pos2 return: " + rtn);
43    rtn = robot.SetLaserWeldingStartEnd(1, 0, 10000);
44    if (rtn != 0) {
45        System.out.println("SetLaserWeldingStartEnd (stop) failed, error code: " + rtn);
46    } else {
47        System.out.println("Laser stopped");
48    }
49    robot.Sleep(500);
50    rtn = robot.MoveL(desc_safe, 0, 0, 100, 100, 100, -1, 0, exaxis, 0, 0, offset, -1, 0,0,0);
51    System.out.println("MoveL to safe_pos return: " + rtn);
52    rtn = robot.Mode(1);
53    if (rtn != 0) {
54        System.out.println("Set mode 1 failed, error code: " + rtn);
55    }
56    robot.Sleep(1000);
57    robot.CloseRPC();
58    robot.Sleep(1000);
59
60    System.out.println("Test completed");
61
62    return 0;
63}

14.88. Set Weave End Return to Cycle Zero Point

1/**
2* @brief Set whether to return to the cycle zero point at the end of weaving
3* @param flag Whether to return to cycle zero point at weave end; 0-do not return; 1-return to cycle zero point
4* @return Error code
5*/
6public int SetWeaveBackCenterConfig(int flag)

14.89. Get Weave End Return to Cycle Zero Point Parameters

1/**
2* @brief Get the weave end return to cycle zero point parameters
3* @param flag Whether to return to cycle zero point at weave end; 0-do not return; 1-return to cycle zero point
4* @return Error code
5*/
6public int GetWeaveBackCenterConfig(int[] flag)

14.90. Weave End Return to Cycle Zero Point Code Example

 1public static void TestSplineWeave(Robot robot)
 2{
 3    JointPos j1 = new JointPos(9.000, -66.067, 67.706, -103.217, -90.151, 100.669);
 4    JointPos j2 = new JointPos(-4.660, -107.973, 103.734, -76.214, -89.999, 90.886);
 5    JointPos j3 = new JointPos(-36.762, -77.380, 91.364, -127.159, -90.024, 54.833);
 6    JointPos j4 = new JointPos(-62.875, -89.460, 86.437, -77.030, -90.012, 31.539);
 7    DescPose desc_pos1 = new DescPose(-654.129, -235.344, 246.543, 6.010, -11.535, -176.787);
 8    DescPose desc_pos2 = new DescPose(-273.710, -100.871, 280.935, 5.692, 9.522, 179.512);
 9    DescPose desc_pos3 = new DescPose(-566.093, 311.278, 215.008, -10.453, -17.486, -174.209);
10    DescPose desc_pos4 = new DescPose(-246.558, 328.240, 292.173, 13.912, 4.437, -179.067);
11    DescPose offset_pos = new DescPose(0, 0, 0, 0, 0, 0);
12    ExaxisPos epos = new ExaxisPos(0, 0, 0, 0);
13    int tool = 2;
14    int user = 0;
15    float vel = 100.0f;
16    float acc = 100.0f;
17    float ovl = 20.0f;
18    float oacc = 100.0f;
19    float blendT = 0.0f;
20    float blendR = 0.0f;
21    int flag = 0;
22    int search = 0;
23    int blendMode = 0;
24    int velAccMode = 0;
25
26    robot.WeaveEnd(0);
27    robot.SetSpeed(1);
28
29    robot.SetWeaveBackCenterConfig(1);
30    int[] weaveBackConfig = new int[1];
31    robot.GetWeaveBackCenterConfig(weaveBackConfig);
32    System.out.printf("GetWeaveBackCenterConfig:  %d \n", weaveBackConfig[0]);
33
34    robot.MoveJ(j1, desc_pos1, tool, user, vel, acc, 100.0f, epos, blendT, flag, offset_pos);
35
36    robot.WeaveStart(0);
37    robot.NewSplineStart(0, 6000);
38    robot.NewSplinePoint(j1, desc_pos1, tool, user, vel, acc, ovl, -1, 0);
39    robot.NewSplinePoint(j2, desc_pos2, tool, user, vel, acc, ovl, -1, 0);
40    robot.NewSplinePoint(j3, desc_pos3, tool, user, vel, acc, ovl, -1, 0);
41    robot.NewSplinePoint(j4, desc_pos4, tool, user, vel, acc, ovl, -1, 1);
42    robot.NewSplineEnd();
43    robot.WeaveEnd(0);
44}

14.91. Real-time Speed Setting (Command Frame, Low Latency)

1/**
2* @brief Set speed (command frame, low latency)
3* @param vel Speed percentage, range [0~100]
4* @return Error code
5*/
6public int SetSpeedInstant(int vel)

14.92. Set Real-Time Weave Offset

1/**
2* @brief Set real-time weave offset
3* @param [in] offset Real-time offset [mm, °]
4* @return Error code
5*/
6public int SetWeaveOffsetRT(DescPose offset)

14.93. Weave Speed and Offset Test Code Example

  1public static void TestWeaveSpeedAndOffset(Robot robot) {
  2if (robot == null) {
  3    System.out.println("ERROR: connect fail");
  4    return;
  5}
  6int rtn;
  7ROBOT_STATE_PKG pkg = new ROBOT_STATE_PKG();
  8 ExaxisPos epos = new ExaxisPos(0, 0, 0, 0);
  9 DescPose offset_pos = new DescPose(0, 0, 0, 0, 0, 0);
 10
 11 JointPos j1 = new JointPos(5.027, -84.331, -75.139, -103.690, 86.379, 20.794);
 12 DescPose d1 = new DescPose(324.752, -83.339, 366.314, -172.321, -0.936, -106.047);
 13
 14 JointPos j2 = new JointPos(-35.335, -117.598, -57.174, -95.234, 90.001, -19.560);
 15 DescPose d2 = new DescPose(324.999, -355.439, 260.000, 179.995, 0.003, -105.775);
 16
 17 JointPos j3 = new JointPos(59.787, -117.594, -57.183, -95.222, 90.006, 75.562);
 18 DescPose d3 = new DescPose(324.998, 355.441, 260.002, 179.995, 0.003, -105.775);
 19
 20 System.out.println("\nStep 1: MoveJ to start point");
 21 rtn = robot.MoveJ(j1, d1, 1, 0, 100, 100, 50, epos, -1, 0, offset_pos);
 22 System.out.println("  MoveJ(j1) rtn=" + rtn);
 23 try {
 24     Thread.sleep(500);
 25 } catch (InterruptedException e) {
 26     Thread.currentThread().interrupt();
 27 }
 28
 29 System.out.println("\nStep 2: MoveJ to weave entry point");
 30 rtn = robot.MoveJ(j2, d2, 1, 0, 100, 100, 50, epos, -1, 0, offset_pos);
 31 System.out.println("  MoveJ(j2) rtn=" + rtn);
 32 try {
 33     Thread.sleep(500);
 34 } catch (InterruptedException e) {
 35     Thread.currentThread().interrupt();
 36 }
 37
 38 System.out.println("\nStep 3: WeaveStart + MoveL in background thread");
 39 robot.WeaveStart(0);
 40
 41 final boolean[] weaveRunning = {true};
 42 final int[] threadRtn = {0};
 43 Thread weaveThread = new Thread(new Runnable() {
 44     @Override
 45     public void run() {
 46         threadRtn[0] = robot.MoveL(j3, d3, 1, 0, 100, 100, 5, -1, 0, epos, 0, 0, offset_pos, 5, 0, 0, 10);
 47         System.out.println("  MoveL(weave) thread finished, rtn=" + threadRtn[0]);
 48         weaveRunning[0] = false;
 49     }
 50 });
 51 weaveThread.setDaemon(true);
 52 weaveThread.start();
 53 try {
 54     Thread.sleep(500);
 55 } catch (InterruptedException e) {
 56     Thread.currentThread().interrupt();
 57 }
 58
 59 System.out.println("\nStep 4: SetSpeed test during weaving");
 60 int[] speedValues = { 20, 50, 80, 30, 60, 10 };
 61 for (int speed : speedValues) {
 62     if (!weaveRunning[0]) break;
 63     rtn = robot.SetSpeedInstant(speed);
 64     pkg = robot.GetRobotRealTimeState();
 65     System.out.println("  SetSpeed(" + speed + ") -> rtn=" + rtn + ", TCP_CmpSpeed=" + pkg.target_TCP_CmpSpeed);
 66     try {
 67         Thread.sleep(5000);
 68     } catch (InterruptedException e) {
 69         Thread.currentThread().interrupt();
 70     }
 71 }
 72
 73 try {
 74     Thread.sleep(5000);
 75 } catch (InterruptedException e) {
 76     Thread.currentThread().interrupt();
 77 }
 78
 79 System.out.println("\nStep 5: SetWeaveOffsetRT test (50 iterations, delta=0.1)");
 80 double accumOffset = 0.0;
 81 for (int i = 0; i < 50 && weaveRunning[0]; i++) {
 82     accumOffset += 0.1;
 83     DescPose weaveOffset = new DescPose(0, 0, accumOffset, 0, 0, 0);
 84     rtn = robot.SetWeaveOffsetRT(weaveOffset);
 85     pkg = robot.GetRobotRealTimeState();
 86     System.out.printf("  [%d/50] SetWeaveOffsetRT(x=%.1f) -> rtn=%d, TCP_pos=(%.2f,%.2f,%.2f)\n",
 87         i + 1, accumOffset, rtn,
 88         pkg.tl_cur_pos[0], pkg.tl_cur_pos[1], pkg.tl_cur_pos[2]);
 89     try {
 90         Thread.sleep(100);
 91     } catch (InterruptedException e) {
 92         Thread.currentThread().interrupt();
 93     }
 94 }
 95
 96 System.out.println("\nStep 6: Wait for weave MoveL, then WeaveEnd");
 97  try {
 98      weaveThread.join();
 99  } catch (InterruptedException e) {
100      Thread.currentThread().interrupt();
101  }
102  robot.WeaveEnd(0);
103  try {
104      Thread.sleep(500);
105  } catch (InterruptedException e) {
106      Thread.currentThread().interrupt();
107  }
108
109  System.out.println("\nStep 7: MoveL back to start");
110  rtn = robot.MoveL(j1, d1, 1, 0, 100, 100, 50, -1, 0, epos, 0, 0, offset_pos, 50, 0, 0, 10);
111  System.out.println("  MoveL(back) rtn=" + rtn);
112
113  pkg = robot.GetRobotRealTimeState();
114  System.out.println("\n  Final robot state: main_code=" + pkg.main_code + ", sub_code=" + pkg.sub_code);
115}

14.94. Set Motion Real-Time Offset

1/**
2* @brief  Set motion real-time offset
3* @param [in] mode Offset coordinate system; 0-workpiece coordinate system; 1-base coordinate system; 2-tool coordinate system; 3-weaving coordinate system
4* @param [in] offset Real-time offset [mm, °]
5* @return  Error code
6*/
7public int SetCartOffsetRT(int mode, DescPose offset)

14.95. Set Motion Real-Time Offset Code Example

 1public static void cartOffsetPos(Robot robot)
 2{
 3    java.util.Scanner scanner = new java.util.Scanner(System.in);
 4    while (true)
 5    {
 6        System.out.print("Please input offset y value: ");
 7        try
 8        {
 9            double inputVal = scanner.nextDouble();
10            DescPose offsetPos = new DescPose();
11            offsetPos.tran.y = inputVal;
12            robot.SetCartOffsetRT(2, offsetPos);
13        }
14        catch (java.util.InputMismatchException e)
15        {
16            // Input error, clear input state
17            scanner.nextLine();
18            System.out.println("Invalid number!");
19        }
20    }
21}
22
23public static int TestSetCartOffsetRT(Robot robot)
24{
25    int rtn = 0;
26    Thread th = new Thread(() -> cartOffsetPos(robot));
27    th.start();
28
29    JointPos j1 = new JointPos(-72.561, -38.933, 92.047, -143.101, -90.000, 17.439);
30    JointPos j2 = new JointPos(-100.211, -44.358, 105.565, -151.192, -90.007, -10.211);
31    DescPose d1 = new DescPose(-300.008, 599.999, -199.999, -0.013, -0.004, 0.000);
32    DescPose d2 = new DescPose(-0.004, 599.977, -200.038, -0.017, -0.004, 0.000);
33
34    ExaxisPos ex = new ExaxisPos(0.0, 0.0, 0.0, 0.0);
35    DescPose zeroOff = new DescPose(0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
36    while (true)
37    {
38        rtn = robot.MoveL(j1, d1, 1, 0, 100, 100, 100, -1, 0, ex, 0, 0, zeroOff, 100, 0, 0, 10);
39        rtn = robot.MoveL(j2, d2, 1, 0, 100, 100, 100, -1, 0, ex, 0, 0, zeroOff, 100, 0, 0, 10);
40    }
41
42    //        return 0;
43}

14.96. Set Welding Type

1/**
2* @brief Set welding type
3* @param [in] type 0-arc welding; 1-laser welding
4* @return Error code
5*/
6public int SetWeldType(int type)

14.97. Set Welder Manufacturer

1/**
2* @brief Set welder manufacturer
3* @param [in] value 101-Megmeet; 102-OTC; 103-Panasonic; 104-Miller; 1001-everlast laser welding
4* @return Error code
5*/
6public int SetWeldCompany(int value)

14.98. Set Wire Feed Speed

1/**
2* @brief Set wire feed speed
3* @param [in] io_type 0-IO; 1-UDP; 2-modbusTCP
4* @param [in] status Wire feed speed value
5* @return Error code
6*/
7public int SetWeldWFS(int io_type, double status)

14.99. Set Welding Arc Length

1/**
2* @brief Set welding arc length
3* @param [in] io_type 0-IO; 1-UDP; 2-modbusTCP
4* @param [in] status Arc length
5* @return Error code
6*/
7public int SetWeldArcLen(int io_type, int status)

14.100. Set Arc Control Value

1/**
2* @brief Set arc control value
3* @param [in] io_type 0-IO; 1-UDP; 2-modbusTCP
4* @param [in] status Arc control value
5* @return Error code
6*/
7public int SetWeldArcCtrl(int io_type, int status)

14.101. Set Program Slot Number

1/**
2* @brief Set program slot number
3* @param [in] io_type 0-IO; 1-UDP; 2-modbusTCP
4* @param [in] status Program slot number value
5* @return Error code
6*/
7public int SetWeldSlot(int io_type, int status)

14.102. Set “Welding Prohibition”

1/**
2* @brief Set the "welding prohibition" DO
3* @param [in] io_type 0-IO; 1-UDP; 2-modbusTCP
4* @param [in] status 0-turn off "welding prohibition"; 1-turn on "welding prohibition"
5* @return Error code
6*/
7public int SetWeldDisable(int io_type, int status)

14.103. Set Wire Feed Speed UDP Custom Control Word Sequence Number

1/**
2* @brief Set the wire feed speed UDP custom control word sequence number
3* @param [in] udpNum UDP custom control word sequence number, default 44
4* @return Error code
5*/
6public int SetweldWFSUdpNum(int udpNum)

14.104. Set Arc Length UDP Custom Control Word Sequence Number

1/**
2* @brief Set the arc length UDP custom control word sequence number
3* @param [in] udpNum UDP custom control word sequence number, default 45
4* @return Error code
5*/
6public int SetWeldArcLenUdpNum(int udpNum)

14.105. Set Arc Control UDP Custom Control Word Sequence Number

1/**
2* @brief Set the arc control UDP custom control word sequence number
3* @param [in] udpNum UDP custom control word sequence number, default 46
4* @return Error code
5*/
6public int SetWeldArcCtrlUdpNum(int udpNum)

14.106. Set Program Slot Number UDP Custom Control Word Sequence Number

1/**
2* @brief Set the program slot number UDP custom control word sequence number
3* @param [in] udpNum UDP custom control word sequence number, default 47
4* @return Error code
5*/
6public int SetWeldSlotUdpNum(int udpNum)

14.107. Set “Welding Prohibition” UDP Extended DO Sequence Number

1/**
2* @brief Set the "welding prohibition" UDP extended DO sequence number
3* @param [in] DONum UDP extended DO sequence number, default 18
4* @return Error code
5*/
6public int SetWeldDisableExtDoNum(int DONum)

14.108. Set “Synergic Status” UDP Extended DI Sequence Number

1/**
2* @brief Set the "synergic status" UDP extended DI sequence number
3* @param [in] DINum UDP extended DI sequence number, default -1 not enabled
4* @return Error code
5*/
6public int SetWeldSynStateExtDINum(int DINum)

14.109. Welder Setting Code Example

 1public static void TestWeldSetParam(Robot robot)
 2{
 3    JointPos j1 = new JointPos(-115.844, -49.503, 92.747, -133.077, -89.998, -25.868);
 4    JointPos j2 = new JointPos(-149.585, -45.684, 82.489, -126.665, -90.092, -59.608);
 5    DescPose d1 = new DescPose(198.357, 643.556, 103.910, 179.851, 0.075, 0.023);
 6    DescPose d2 = new DescPose(565.183, 449.906, 118.825, 179.849, 0.074, 0.023);
 7    ExaxisPos ex = new ExaxisPos(0.0, 0.0, 0.0, 0.0);
 8    DescPose zeroOff = new DescPose(0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
 9
10    int rtn;
11    // 1) Select arc welding and Miller welder; afterwards io_type=1 sends via the UDP link
12    rtn = robot.SetWeldType(0);                 // 0-arc welding; 1-laser welding
13    System.out.println("SetWeldType(arc welding): " + rtn);
14    rtn = robot.SetWeldCompany(104);            // 104-Miller
15    System.out.println("SetWeldCompany(Miller): " + rtn);
16    rtn = robot.ExtDevLoadUDPDriver();          // Establish robot UDP peripheral communication
17    System.out.println("ExtDevLoadUDPDriver: " + rtn);
18    robot.Sleep(2000);
19
20    rtn = robot.MoveL(j1, d1, 0, 0, 100, 100, 100, -1, 0, ex, 0, 0, zeroOff, 100, 0, 0, 10);
21    System.out.println("moveL errcode:" + rtn);
22
23    // 2) Default control words 44~47 → D242~D245
24    rtn = robot.SetweldWFSUdpNum(44);
25    System.out.println("SetweldWFSUdpNum(44): " + rtn);
26    rtn = robot.SetWeldArcLenUdpNum(45);
27    System.out.println("SetWeldArcLenUdpNum(45): " + rtn);
28    rtn = robot.SetWeldArcCtrlUdpNum(46);
29    System.out.println("SetWeldArcCtrlUdpNum(46): " + rtn);
30    rtn = robot.SetWeldSlotUdpNum(47);
31    System.out.println("SetWeldSlotUdpNum(47): " + rtn);
32    robot.Sleep(3000);
33
34    rtn = robot.SetWeldWFS(1, 300.0);           // Wire feed speed 300 (double)
35    System.out.println("SetWeldWFS(300): " + rtn);
36    rtn = robot.SetWeldArcLen(1, 0);            // Arc length 0 (500 is the median)
37    System.out.println("SetWeldArcLen(0): " + rtn);
38    rtn = robot.SetWeldArcCtrl(1, 25);          // Arc control 25 (default value)
39    System.out.println("SetWeldArcCtrl(25): " + rtn);
40    rtn = robot.SetWeldSlot(1, 1);              // Program slot number 1
41    System.out.println("SetWeldSlot(1): " + rtn);
42    System.out.println(">>> Please confirm that PLC D242~D245 have been updated to 300/0/25/1");
43    robot.Sleep(3000);
44
45    rtn = robot.MoveL(j2, d2, 0, 0, 100, 100, 100, -1, 0, ex, 0, 0, zeroOff, 100, 0, 0, 10);
46    System.out.println("moveL errcode:" + rtn);
47
48    // 3) Change custom control words to 48~51 → D246~D249
49    rtn = robot.SetweldWFSUdpNum(48);
50    System.out.println("SetweldWFSUdpNum(48): " + rtn);
51    rtn = robot.SetWeldArcLenUdpNum(49);
52    System.out.println("SetWeldArcLenUdpNum(49): " + rtn);
53    rtn = robot.SetWeldArcCtrlUdpNum(50);
54    System.out.println("SetWeldArcCtrlUdpNum(50): " + rtn);
55    rtn = robot.SetWeldSlotUdpNum(51);
56    System.out.println("SetWeldSlotUdpNum(51): " + rtn);
57    robot.Sleep(3000);
58
59    // 4) Write the same group of control words (48~51) for 10 consecutive cycles: each of the 4 values +1 per cycle, 2-second interval, convenient for the PLC to observe D246~D249
60    for (int i = 1; i <= 10; i++)
61    {
62        double wfs = 350.0 + i;
63        int arcLen = 10 + i;
64        int arcCtrl = 30 + i;
65        int slot = 1 + (i - 1) % 8;             // Slot number range 1~8, wraps around when exceeded
66
67        rtn = robot.SetWeldWFS(1, wfs);
68        rtn = robot.SetWeldArcLen(1, arcLen);
69        rtn = robot.SetWeldArcCtrl(1, arcCtrl);
70        rtn = robot.SetWeldSlot(1, slot);
71
72        System.out.println(">>> [" + i + "/10] D246~D249 should be updated to " + wfs + "/" + arcLen + "/" + arcCtrl + "/" + slot);
73        robot.Sleep(500);
74    }
75
76    rtn = robot.MoveL(j1, d1, 0, 0, 100, 100, 100, -1, 0, ex, 0, 0, zeroOff, 100, 0, 0, 10);
77    System.out.println("moveL errcode:" + rtn);
78
79    // 5) Welding prohibition: extended DO sequence number defaults to 18, corresponding to bit 2 of D257
80    rtn = robot.SetWeldDisableExtDoNum(18);
81    System.out.println("SetWeldDisableExtDoNum(18): " + rtn);
82    rtn = robot.SetWeldDisable(1, 1);
83    System.out.println("SetWeldDisable(1): " + rtn);
84    System.out.println(">>> Please confirm that PLC D257.2 is set to 1 and will automatically return to 0 after 5 seconds");
85    robot.Sleep(1500);
86    rtn = robot.SetWeldDisable(1, 0);
87    System.out.println("SetWeldDisable(0): " + rtn);
88    rtn = robot.MoveL(j2, d2, 0, 0, 100, 100, 100, -1, 0, ex, 0, 0, zeroOff, 100, 0, 0, 10);
89    System.out.println("moveL errcode:" + rtn);
90}

14.110. Get “Synergic Status”

1/**
2* @brief Get the "synergic status"
3* @param [in] io_type 0-IO; 1-UDP; 2-modbusTCP
4* @param [out] synState 0-non-synergic; 1-synergic
5* @return Error code
6*/
7public int GetWeldSynState(int io_type, ref int synState)

14.111. Set “Wire Feed Speed” UDP Custom Status Word Sequence Number

1/**
2* @brief Set the "wire feed speed" UDP custom status word sequence number
3* @param [in] udpNum UDP custom status word sequence number, default 47
4* @return Error code
5*/
6public int SetWeldWfsFeedbackUdpNum(int udpNum)

14.112. Get Current “Wire Feed Speed” Value

1/**
2* @brief Get the current "wire feed speed" value
3* @param [in] io_type 0-IO; 1-UDP; 2-modbusTCP
4* @param [out] weldWfsFdbk Current wire feed speed
5* @return Error code
6*/
7public int GetWeldWfsFeedback(int io_type, double[] weldWfsFdbk)

14.113. Welder Feedback Printing Code Example

 1public static void TestWeldFeedback(Robot robot)
 2{
 3    int rtn;
 4
 5    rtn = robot.SetWeldType(0);                 // 0-arc welding; 1-laser welding
 6    System.out.println("SetWeldType(arc welding): " + rtn);
 7    rtn = robot.SetWeldCompany(104);            // 104-Miller
 8    System.out.println("SetWeldCompany(Miller): " + rtn);
 9    rtn = robot.ExtDevLoadUDPDriver();          // Establish robot UDP peripheral communication
10    System.out.println("ExtDevLoadUDPDriver: " + rtn);
11    rtn = robot.SetWeldSynStateExtDINum(0);     // Set the DI for synergic status
12    System.out.println("SetWeldSynStateExtDINum: " + rtn);
13    rtn = robot.SetWeldWfsFeedbackUdpNum(47);   // Set the UDP status word sequence number for wire feed speed feedback
14    System.out.println("SetWeldWfsFeedbackUdpNum(47): " + rtn);
15    robot.Sleep(3000);
16
17    ROBOT_STATE_PKG pkg = new ROBOT_STATE_PKG();
18    int count = 1800;
19    for (int i = 0; i < count; i++)
20    {
21        pkg = robot.GetRobotRealTimeState();
22
23        // C# ref double → Java single-element array
24        double[] wfs = new double[]{0};
25        int wfsRtn = robot.GetWeldWfsFeedback(1, wfs);      // io_type=1 UDP
26
27        // C# ref int → Java single-element array
28        int[] synState = new int[]{-1};
29        int synRtn = robot.GetWeldSynState(1, synState);    // io_type=1 UDP
30
31        // C# ref int, ref int → Java single-element array
32        int[] maincode=new int[1];
33        int[] subcode=new int[1];
34        robot.GetRobotErrorCode(maincode, subcode);
35
36        System.out.printf("[%d] Voltage=%.2fV Current=%.2fA WireFeedSpeed=%.2f(rtn=%d) Synergic=%d(rtn=%d) MainFault=%d SubFault=%d %n",
37                i, pkg.weldVoltage, pkg.weldCurrent,
38                wfs[0], wfsRtn,
39                synState[0], synRtn,
40                maincode[0], subcode[0]
41                );
42
43        robot.Sleep(500);
44    }
45}