14. Weld

14.1. Setting Welding Process Curve Parameters

Added in version python: SDK-v2.0.5

Prototype

WeldingSetProcessParam(id, startCurrent, startVoltage, startTime, weldCurrent, weldVoltage, endCurrent, endVoltage, endTime)

Description

Set weld process profile parameters

Mandatory parameters

  • id: Welding process number (1-99)

  • startCurrent: Arc starting current (A)

  • startVoltage: startVoltage Arc-starting voltage (V)

  • startTime: startTime Arc start time (ms)

  • weldCurrent: weldCurrent Welding current (A)

  • weldVoltage: weldVoltage Welding voltage (V)

  • endCurrent: endCurrent Arc recovery current (A)

  • endVoltage: endVoltage Arc charging voltage (V)

  • endTime: endTime closing time (ms)

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.2. Obtaining Welding Process Curve Parameters

Added in version python: SDK-v2.0.5

Prototype

WeldingGetProcessParam(id)

Description

Get welding process curve parameters

Mandatory parameters

  • id: Welding process number (1-99)

Default parameters

NULL

Return Value

  • errorcode Success-0 Failure- errcode

  • startCurrent: arc starting current (A)

  • startVoltage: Arc starting voltage (V)

  • startTime: start time (ms)

  • weldCurrent: welding current (A)

  • weldVoltage: welding voltage (V)

  • endCurrent: arc closing current (A)

  • endVoltage: arc closing voltage (V)

  • endTime: arc closing time (ms)

14.3. Setting of welding current and output analog correspondences

Changed in version python: SDK-v2.0.5

Prototype

WeldingSetCurrentRelation(currentMin, currentMax, outputVoltageMin, outputVoltageMax)

Description

Setting the welding current to correspond to the output analog

Mandatory parameters

  • currentMin: Welding current - analog output linear relationship left point current value (A)

  • currentMax: Welding current - analog output linear relationship right point current value (A)

  • outputVoltageMin: analog output voltage value (V) at the left point of the welding current-analog output linear relationship.

  • outputVoltageMax: analog output voltage value (V) at the point on the right side of the weld current-analog output linear relationship.

  • AOIndex: analog output port for welding current

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.4. Setting the welding voltage and output analog correspondence

Changed in version python: SDK-v2.0.5

Prototype

WeldingSetVoltageRelation(weldVoltageMin, weldVoltageMax, outputVoltageMin, outputVoltageMax)

Description

Setting the weld voltage to correspond to the output analog

Mandatory parameters

  • weldVoltageMin: Welding voltage - analog output linear relationship left point welding voltage value (A)

  • weldVoltageMax: Welding voltage - analog output linear relationship right point welding voltage value (A)

  • outputVoltageMin: analog output voltage value (V) at the left point of the welding voltage-analog output linear relationship.

  • outputVoltageMax: analog output voltage value (V) at the point on the right side of the weld voltage-analog output linear relationship.

  • AOIndex: welding voltage analog output port

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.5. Acquiring the correspondence between welding current and output analog quantity

Changed in version python: SDK-v2.0.5

Prototype

WeldingGetCurrentRelation()

Description

Get weld current to output analog correspondence

Mandatory parameters

NULL

Default parameters

NULL

Return Value

  • errorcode Success-0 Failure- errcode

  • currentMin: welding current - analog output linear relationship left point current value (A)

  • currentMax: welding current - analog output linear relationship right point current value (A)

  • outputVoltageMin: analog output voltage value at the left point of the welding current-analog output linear relationship (V)

  • outputVoltageMax: analog output voltage value (V) at the point on the right side of the weld current-analog output linear relationship.

  • AOIndex: welding voltage analog output port

14.6. Getting welding voltage and output analog correspondence

Changed in version python: SDK-v2.0.5

Prototype

WeldingGetVoltageRelation()

Description

Get weld voltage to output analog correspondence

Mandatory parameters

NULL

Default parameters

NULL

Return Value

  • errorcode Success-0 Failure- errcode

  • weldVoltageMin: Welding voltage - analog output linear relationship left point welding voltage value (V)

  • weldVoltageMax: Welding voltage - analog output linear relationship of the right point welding voltage value (V)

  • outputVoltageMin: Analog output voltage value at the left point of the welding voltage-analog output linear relationship (V)

  • outputVoltageMax: Analog output voltage value (V) at the right point of the weld current-analog output linear relationship

  • AOIndex: welding voltage analog output port

14.7. Setting the welding current

Changed in version python: SDK-v2.0.5

Prototype

WeldingSetCurrent(ioType, current, AOIndex, blend)

Description

Setting the welding current

Mandatory parameters

  • ioType: type 0 - controller IO; 1 - extended IO

  • current: Welding current value (A)

  • AOIndex: Analog output port (0-1) of the welding current control box

  • blend: smooth or not 0 - not smooth, 1 - smooth

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.8. Setting the welding voltage

Changed in version python: SDK-v2.0.5

Prototype

WeldingSetVoltage(ioType, voltage, AOIndex, blend)

Description

Set weld voltage

Mandatory parameters

  • ioType: type 0 - controller IO; 1 - extended IO

  • voltage: Welding voltage value (V)

  • AOIndex: Analog output port (0-1) of the welding current control box

  • blend: smooth or not 0 - not smooth, 1 - smooth

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.9. Set Weaving Parameters

Prototype

WeaveSetPara(weaveNum, weaveType, weaveFrequency, weaveIncStayTime, weaveRange, weaveLeftRange, weaveRightRange, additionalStayTime, weaveLeftStayTime, weaveRightStayTime, weaveCircleRadio, weaveStationary, weaveYawAngle, weaveRotAngle, weavePendulumLength, weavePendulumAngle)

Description

Set weaving parameters

Required Parameters

  • weaveNum: Weaving parameter configuration number

  • 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

  • weaveFrequency: Weaving frequency (Hz)

  • weaveIncStayTime: Wait mode: 0-cycle does not include wait time; 1-cycle includes wait time (required parameter)

  • weaveRange: Weaving amplitude (mm)

  • weaveLeftRange: Left chord length of vertical triangular weaving (mm)

  • weaveRightRange: Right chord length of vertical triangular weaving (mm)

  • additionalStayTime: Stay time at the vertical triangular point of vertical triangular weaving (mm)

  • weaveLeftStayTime: Left stay time of weaving (ms)

  • weaveRightStayTime: Right stay time of weaving (ms)

  • weaveCircleRadio: Circular weaving-feedback ratio (0-100%)

  • weaveStationary: Weaving position wait: 0-position continues to move during wait time; 1-position is stationary during wait time

Default Parameters

  • weaveYawAngle: Azimuth angle of weaving direction (rotation around weaving Z axis), unit °, default 0

  • weaveRotAngle: Azimuth angle of weaving direction (rotation around weaving X axis), unit °, default 0

  • weavePendulumLength: Pendulum length of pendulum weaving, unit mm, default 0

  • weavePendulumAngle: Pendulum angle of pendulum weaving, unit °, default 0

Return Value

Error code Success-0 Failure-errcode

14.10. Example code for setting welding parameters

 1from fairino import Robot
 2import time
 3# Establish a connection with the robot controller and return a robot object if the connection is successful
 4robot = Robot.RPC('192.168.58.2')
 5robot.WeldingSetProcessParam(1, 177, 27, 1000, 178, 28, 176, 26, 1000)
 6robot.WeldingSetProcessParam(2, 188, 28, 555, 199, 29, 133, 23, 333)
 7start_current = 0
 8start_voltage = 0
 9start_time = 0
10weld_current = 0
11weld_voltage = 0
12end_current = 0
13end_voltage = 0
14end_time = 0
15error, start_current, start_voltage, start_time, weld_current, weld_voltage, end_current,end_voltage, end_time = robot.WeldingGetProcessParam(1)
16print(f"the Num 1 process param is {start_current} {start_voltage} {start_time} {weld_current} {weld_voltage} {end_current} {end_voltage} {end_time}")
17error, start_current, start_voltage, start_time, weld_current, weld_voltage, end_current,end_voltage, end_time = robot.WeldingGetProcessParam(2)
18print(f"the Num 2 process param is {start_current} {start_voltage} {start_time} {weld_current} {weld_voltage} {end_current} {end_voltage} {end_time}")
19rtn = robot.WeldingSetCurrentRelation(0, 400, 0, 10, 0)
20print(f"WeldingSetCurrentRelation rtn is: {rtn}")
21rtn = robot.WeldingSetVoltageRelation(0, 40, 0, 10, 1)
22print(f"WeldingSetVoltageRelation rtn is: {rtn}")
23current_min = 0
24current_max = 0
25vol_min = 0
26vol_max = 0
27output_vmin = 0
28output_vmax = 0
29cur_index = 0
30vol_index = 0
31rtn,current_min, current_max, output_vmin, output_vmax, cur_index = robot.WeldingGetCurrentRelation()
32print(f"WeldingGetCurrentRelation rtn is: {rtn}")
33print(f"current min {current_min} current max {current_max} output vol min {output_vmin} output vol max {output_vmax}")
34rtn,vol_min, vol_max, output_vmin, output_vmax, vol_index = robot.WeldingGetVoltageRelation()
35print(f"WeldingGetVoltageRelation rtn is: {rtn}")
36print(f"vol min {vol_min} vol max {vol_max} output vol min {output_vmin} output vol max {output_vmax}")
37rtn = robot.WeldingSetCurrent(1, 100, 0, 0)
38print(f"WeldingSetCurrent rtn is: {rtn}")
39time.sleep(3)
40rtn = robot.WeldingSetVoltage(1, 10, 0, 0)
41print(f"WeldingSetVoltage rtn is: {rtn}")
42rtn = robot.WeaveSetPara(0, 0, 2.000000, 0, 10.000000, 0.000000, 0.000000, 0, 0, 0, 0, 0,0.0, 60.000000)
43print(f"rtn is: {rtn}")
44robot.WeaveOnlineSetPara(0, 0, 1, 0, 20, 0, 0, 0, 0)
45rtn = robot.WeldingSetCheckArcInterruptionParam(1, 200)
46print(f"WeldingSetCheckArcInterruptionParam {rtn}")
47rtn = robot.WeldingSetReWeldAfterBreakOffParam(1, 5.7, 98.2, 0)
48print(f"WeldingSetReWeldAfterBreakOffParam {rtn}")
49enable = 0
50length = 0
51velocity = 0
52move_type = 0
53check_enable = 0
54arc_interrupt_time_length = 0
55rtn,check_enable, arc_interrupt_time_length = robot.WeldingGetCheckArcInterruptionParam()
56print(f"WeldingGetCheckArcInterruptionParam checkEnable {check_enable} arcInterruptTimeLength {arc_interrupt_time_length}")
57rtn,enable, length, velocity, move_type = robot.WeldingGetReWeldAfterBreakOffParam()
58print(f"WeldingGetReWeldAfterBreakOffParam enable = {enable}, length = {length}, velocity = {velocity}, moveType = {move_type}")
59robot.SetWeldMachineCtrlModeExtDoNum(17)
60for i in range(5):
61    robot.SetWeldMachineCtrlMode(0)
62    time.sleep(1)
63    robot.SetWeldMachineCtrlMode(1)
64    time.sleep(1)
65robot.CloseRPC()

14.11. Instant setup of swing parameters

Added in version python: SDK-v2.0.1

Prototype

WeaveOnlineSetPara (weaveNum, weaveType, weaveFrequency, weaveIncStayTime, weaveRange, weaveLeftStayTime, weaveRightStayTime. weaveCircleRadio, weaveStationary)

Description

Set swing parameters on the fly

Mandatory parameters

  • weaveNum: Pendulum welding parameter configuration number

  • weaveType: type of oscillation 0-planar triangular oscillation; 1-vertical L-shaped triangular oscillation; 2-clockwise circular oscillation; 3-counterclockwise circular oscillation; 4-planar sinusoidal oscillation; 5-vertical L-shaped sinusoidal oscillation; 6-vertical triangular oscillation; 7-vertical sinusoidal oscillation.

  • weaveFrequency: swing frequency (Hz)

  • weaveIncStayTime: wait mode 0-cycle without wait time; 1-cycle with wait time mandatory parameter

  • weaveRange: swing range (mm)

  • weaveLeftStayTime: wave left stay time (ms)

  • weaveRightStayTime: wave right stay time (ms)

  • weaveCircleRadio: Circle swing-back ratio (0-100%)

  • weaveStationary: swing position wait, 0 - position continues to move during wait time; 1 - position is stationary during wait time

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.12. The detection parameters of unexpected interruption of robot welding arc were obtained

Added in version python: SDK-v2.0.8

Prototype

WeldingGetCheckArcInterruptionParam()

Description

The detection parameters of unexpected interruption of robot welding arc were obtained

Mandatory parameters

NULL

Default parameters

NULL

Return Value

  • Error Code Success-0 Failure- errcode

  • checkEnable: Whether to enable detection. 0: Indicates that the function is disabled. 1- Enable

  • arcInterruptTimeLength:Arc break confirmation time (ms)

14.13. Set the detection parameters of robot welding arc unexpected interruption

Added in version python: SDK-v2.0.8

Prototype

WeldingSetCheckArcInterruptionParam(checkEnable, arcInterruptTimeLength)

Description

Set the detection parameters of robot welding arc unexpected interruption

Mandatory parameters

  • checkEnable: Whether to enable detection. 0: Indicates that the function is disabled. 1- Enable

  • arcInterruptTimeLength:Arc break confirmation time (ms)

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.14. Obtain the robot welding interrupt recovery parameters

Added in version python: SDK-v2.0.8

Prototype

WeldingGetReWeldAfterBreakOffParam()

Description

Obtain the robot welding interrupt recovery parameters

Mandatory parameters

NULL

Default parameters

NULL

Return Value

  • Error Code Success-0 Failure- errcode

  • enable: Whether to enable recovery from welding interruption

  • length: weld overlap distance (mm)

  • velocity: Percentage of robot return to rearcing point (0-100)

  • moveType: The way the robot moves to the rearcing point; 0-LIN; 1-PTP

14.15. Set the robot welding interrupt recovery parameters

Added in version python: SDK-v2.0.8

Prototype

WeldingSetReWeldAfterBreakOffParam(enable, length, velocity, moveType)

Description

Set the robot welding interrupt recovery parameters

Mandatory parameters

  • enable:Whether to enable recovery from welding interruption

  • length: weld overlap distance (mm)

  • velocity: Percentage of robot return to rearcing point (0-100)

  • moveType: The way the robot moves to the rearcing point; 0-LIN; 1-PTP

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.16. Set welder control mode to expand DO port

Added in version python: SDK-v2.0.5

Prototype

SetWeldMachineCtrlModeExtDoNum(DONum)

Description

Set welder control mode to extend DO port

Mandatory parameters

  • DONum: welder control mode DO port (0-127)

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.17. Setting the welder control mode

Added in version python: SDK-v2.0.5

Prototype

SetWeldMachineCtrlMode(mode, ioType)

Description

Set welding machine control mode

Required Parameters

  • ioType: Control type; 0-Control box IO; 1-Digital communication protocol (UDP); 2-Digital communication protocol (ModbusTCP)

  • mode: Welder control mode; welder control mode; 0-DC synergic mode; 1-Pulse synergic mode; 2-JOB mode; 3-Local control mode; 4-Separate mode; 5-CC/CV mode; 6-TIG; 7-CMT, 8-Panasonic-Pulse mode, 9-Panasonic-No-pulse mode

Default Parameters

None

Return Value

Error code Success-0 Failure-errcode

14.18. Get Welding Machine Control Mode

Added in version python: SDK-v3.9.8

Prototype

GetWeldMachineCtrlMode(self)

Description

Get welding machine control mode

Required Parameters

  • 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

Default Parameters

None

Return Value

Error code, 0-success; non-zero-error

14.19. Get Welding Machine Control Mode Code Example

Added in version python: SDK-v3.9.8

 1from fairino import Robot
 2import time
 3
 4def main():
 5    robot = Robot.RPC('192.168.58.2')
 6    time.sleep(0.5)
 7
 8    robot.WeldingSetProcessParam(1, 177, 27, 1000, 178, 28, 176, 26, 1000)
 9    robot.WeldingSetProcessParam(2, 188, 28, 555, 199, 29, 133, 23, 333)
10
11    start_current = 0
12    start_voltage = 0
13    start_time = 0
14    weld_current = 0
15    weld_voltage = 0
16    end_current = 0
17    end_voltage = 0
18    end_time = 0
19
20    error, start_current, start_voltage, start_time, weld_current, weld_voltage, end_current,end_voltage, end_time = robot.WeldingGetProcessParam(1)
21    print(f"the Num 1 process param is {start_current} {start_voltage} {start_time} {weld_current} {weld_voltage} {end_current} {end_voltage} {end_time}")
22
23    error, start_current, start_voltage, start_time, weld_current, weld_voltage, end_current,end_voltage, end_time = robot.WeldingGetProcessParam(2)
24    print(f"the Num 2 process param is {start_current} {start_voltage} {start_time} {weld_current} {weld_voltage} {end_current} {end_voltage} {end_time}")
25
26    rtn = robot.WeldingSetCurrentRelation(0, 400, 0, 10, 0)
27    print(f"WeldingSetCurrentRelation rtn is: {rtn}")
28
29    rtn = robot.WeldingSetVoltageRelation(0, 40, 0, 10, 1)
30    print(f"WeldingSetVoltageRelation rtn is: {rtn}")
31
32    current_min = 0
33    current_max = 0
34    vol_min = 0
35    vol_max = 0
36    output_vmin = 0
37    output_vmax = 0
38    cur_index = 0
39    vol_index = 0
40
41    rtn,current_min, current_max, output_vmin, output_vmax, cur_index = robot.WeldingGetCurrentRelation()
42    print(f"WeldingGetCurrentRelation rtn is: {rtn}")
43    print(
44        f"current min {current_min} current max {current_max} output vol min {output_vmin} output vol max {output_vmax}")
45
46    rtn,vol_min, vol_max, output_vmin, output_vmax, vol_index = robot.WeldingGetVoltageRelation()
47    print(f"WeldingGetVoltageRelation rtn is: {rtn}")
48    print(f"vol min {vol_min} vol max {vol_max} output vol min {output_vmin} output vol max {output_vmax}")
49
50    rtn = robot.WeldingSetCurrent(1, 100, 0, 0)
51    print(f"WeldingSetCurrent rtn is: {rtn}")
52
53    time.sleep(3)
54
55    rtn = robot.WeldingSetVoltage(1, 10, 0, 0)
56    print(f"WeldingSetVoltage rtn is: {rtn}")
57
58    rtn = robot.WeaveSetPara(0, 0, 2.000000, 0, 10.000000, 0.000000, 0.000000, 0, 0, 0, 0, 0,0.0, 60.000000)
59    print(f"rtn is: {rtn}")
60
61    robot.WeaveOnlineSetPara(0, 0, 1, 0, 20, 0, 0, 0, 0)
62
63    rtn = robot.WeldingSetCheckArcInterruptionParam(1, 200)
64    print(f"WeldingSetCheckArcInterruptionParam {rtn}")
65
66    rtn = robot.WeldingSetReWeldAfterBreakOffParam(1, 5.7, 98.2, 0)
67    print(f"WeldingSetReWeldAfterBreakOffParam {rtn}")
68
69    enable = 0
70    length = 0
71    velocity = 0
72    move_type = 0
73    check_enable = 0
74    arc_interrupt_time_length = 0
75
76    rtn,check_enable, arc_interrupt_time_length = robot.WeldingGetCheckArcInterruptionParam()
77    print(
78        f"WeldingGetCheckArcInterruptionParam checkEnable {check_enable} arcInterruptTimeLength {arc_interrupt_time_length}")
79
80    rtn,enable, length, velocity, move_type = robot.WeldingGetReWeldAfterBreakOffParam()
81    print(
82        f"WeldingGetReWeldAfterBreakOffParam enable = {enable}, length = {length}, velocity = {velocity}, moveType = {move_type}")
83
84    robot.SetWeldMachineCtrlModeExtDoNum(17)
85    for i in range(5):
86        robot.SetWeldMachineCtrlMode(0,1)
87        error,getCtrlMode=robot.GetWeldMachineCtrlMode
88        print(f"GetWeldMachineCtrlMode = {getCtrlMode}")
89        time.sleep(1)
90        robot.SetWeldMachineCtrlMode(1,1)
91        error, getCtrlMode = robot.GetWeldMachineCtrlMode
92        print(f"GetWeldMachineCtrlMode = {getCtrlMode}")
93        time.sleep(1)
94
95    robot.CloseRPC()

14.20. Welding Start

Added in version python: SDK-v2.0.1

Prototype

ARCStart(ioType, arcNum, timeout)

Description

Welding Start

Required Parameters

  • ioType: io type 0 - controller IO; 1 - extended IO

  • arcNum: Welder profile number

  • timeout: timeout for starting an arc

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.21. End of welding

Added in version python: SDK-v2.0.1

prototype

ARCEnd(ioType, arcNum, timeout)

Description

End of welding

Mandatory parameters

  • ioType: type 0 - controller IO; 1 - extended IO

  • arcNum: Welder profile number

  • timeout: timeout for starting an arc

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.22. swing start

Added in version python: SDK-v2.0.1

Prototype

WeaveStart(weaveNum)

Description

Swing Start

Mandatory parameters

  • weaveNum: type 0 - controller IO; 1 - extended IO

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.23. end of swing (math.)

Added in version python: SDK-v2.0.1

Prototype

WeaveEnd(weaveNum)

description

end of swing

Mandatory parameter

  • weaveNum: Pendulum welding parameter configuration number

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.24. Positive wire feed

Added in version python: SDK-v2.0.1

Prototype

SetForwardWireFeed(ioType, wireFeed)

Description

Positive Wire Feed

Mandatory parameters

  • ioType: 0 - controller IO; 1 - extended IO

  • wireFeed: wire feed control 0 - stop wire feed; 1 - wire feed.

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.25. Reverse wire feed

Added in version python: SDK-v2.0.1

Prototype

SetReverseWireFeed(ioType, wireFeed)

Description

Reverse Wire Feed

Mandatory parameters

  • ioType: 0 - controller IO; 1 - extended IO

  • wireFeed: wire feed control 0 - stop wire feed; 1 - wire feed.

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.26. aspiration

Added in version python: SDK-v2.0.1

Prototype

SetAspirated(ioType, airControl)

Description

Air delivery

Mandatory parameters

  • ioType: 0 - controller IO; 1 - extended IO

  • airControl: air delivery control 0 - stop air delivery; 1 - air delivery

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.27. Set the robot to resume welding after welding interruption

Added in version python: SDK-v2.0.8

Prototype

WeldingStartReWeldAfterBreakOff()

Description

Set the robot to resume welding after welding interruption

Mandatory parameters

NULL

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.28. Set the robot to exit welding after welding interruption

Added in version python: SDK-v2.0.8

Prototype

WeldingAbortWeldAfterBreakOff()

Description

Set the robot to exit welding after welding interruption

Mandatory parameters

NULL

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.29. Sample code for robot welding control

 1from fairino import Robot
 2# Establish a connection with the robot controller and return a robot object if the connection is successful
 3robot = Robot.RPC('192.168.58.2')
 4robot.SetForwardWireFeed(0, 1)
 5time.sleep(1)
 6robot.SetForwardWireFeed(0, 0)
 7robot.SetReverseWireFeed(0, 1)
 8time.sleep(1)
 9robot.SetReverseWireFeed(0, 0)
10robot.SetAspirated(0, 1)
11time.sleep(1)
12robot.SetAspirated(0, 0)
13robot.WeldingSetCurrent(1, 230, 0, 0)
14robot.WeldingSetVoltage(1, 24, 0, 1)
15p1Desc = [228.879, -503.594, 453.984, -175.580, 8.293, 171.267]
16p1Joint = [102.700, -85.333, 90.518, -102.365, -83.932, 22.134]
17p2Desc = [-333.302, -435.580, 449.866, -174.997, 2.017, 109.815]
18p2Joint = [41.862, -85.333, 90.526, -100.587, -90.014, 22.135]
19exaxisPos = [0, 0, 0, 0]
20offdese = [0, 0, 0, 0, 0, 0]
21robot.MoveJ(joint_pos=p1Joint, tool=13, user=0)
22robot.ARCStart(1, 0, 10000)
23robot.WeaveStart(0)
24robot.MoveL(desc_pos=p2Desc, tool=13, user=0)
25robot.ARCEnd(1, 0, 10000)
26robot.WeaveEnd(0)
27robot.WeldingStartReWeldAfterBreakOff()
28robot.WeldingAbortWeldAfterBreakOff()
29robot.CloseRPC()

14.30. Segmented welding startup

Added in version python: SDK-v2.0.1

Prototype

SegmentWeldStart(startDesePos, endDesePos, startJPos, endJPos, weldLength, noWeldLength, weldIOType, arcNum, weldTimeout, isWeave. weaveNum,tool,user,vel=20.0, acc=0.0, ovl=100.0, blendR=-1.0,exaxis_pos=[0.0, 0.0, 0.0, 0.0], search=0, offset_flag=0, offset_pos=[0.0, 0.0, 0.0, 0.0, 0.0, 0.0])

Description

Segmented Welding Initiation

Mandatory parameters

  • startDesePos: Initial Cartesian position in [mm][°].

  • endDesePos: target Cartesian position in [mm][°].

  • startJPos: initial joint position in [°].

  • endJPos: target joint position in [°]

  • weldLength: weld length in [mm]

  • noWeldLength: non-weld length in [mm]

  • weldIOType: weld IO type (0-control box IO; 1-expansion IO) arcNum welder profile number

  • timeout: timeout for arc extinguishing

  • isWeave: welded False – not welded

  • weaveNum: Pendulum welding parameter configuration number

  • tool: tool number, [0 to 14]

  • user: artifact number, [0 to 14]

Default parameters

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

  • acc: acceleration [0~100] Not open Default 0.0

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

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

  • exaxis_pos: external axis 1 position ~ external axis 4 position Default [0.0,0.0,0.0,0.0]

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

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

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

Return Value

  • errcode Success-0 Failure- errcode

14.31. Sample robot segment welding code

 1from fairino import Robot
 2import time
 3# Establish a connection with the robot controller and return a robot object if the connection is successful
 4robot = Robot.RPC('192.168.58.2')
 5robot.WeldingSetCurrent(1, 230, 0, 0)
 6robot.WeldingSetVoltage(1, 24, 0, 1)
 7p1Desc = [228.879, -503.594, 453.984, -175.580, 8.293, 171.267]
 8p1Joint = [102.700, -85.333, 90.518, -102.365, -83.932, 22.134]
 9p2Desc = [-333.302, -435.580, 449.866, -174.997, 2.017, 109.815]
10p2Joint = [41.862, -85.333, 90.526, -100.587, -90.014, 22.135]
11exaxisPos = [0, 0, 0, 0]
12offdese = [0, 0, 0, 0, 0, 0]
13rtn = robot.SegmentWeldStart(p1Desc, p2Desc, p1Joint, p2Joint, 20, 20, 0, 0, 5000, 0, 0, 0, 0)
14print(f"SegmentWeldStart rtn is {rtn}")
15robot.CloseRPC()

14.32. Simulated swing start

Added in version python: SDK-v2.0.5

Prototype

WeaveStartSim(weaveNum)

Description

Simulation of swing start

Mandatory parameters

  • weaveNum: swing parameter number

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.33. End of simulation swing

Added in version python: SDK-v2.0.5

Prototype

WeaveEndSim(weaveNum)

description

end of simulation swing

Mandatory parameters

  • weaveNum: swing parameter number

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.34. Start trajectory detection warning (no movement)

Added in version python: SDK-v2.0.5

Prototype

WeaveInspectStart(weaveNum)

Description

Start Trajectory Detection Warning (No Movement)

Mandatory parameters

  • weaveNum: swing parameter number

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.35. End trajectory detection warning (no movement)

Added in version python: SDK-v2.0.5

Prototype

WeaveInspectEnd(weaveNum)

Description

End Trajectory Detection Warning (No Movement)

Mandatory parameters

  • weaveNum: swing parameter number

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.36. Wobble start

Added in version python: SDK-v2.1.2

Prototype

WeaveChangeStart(weaveNum)

Description

Wobble start

Mandatory parameters

  • weaveChangeFlag: Swing number 1- Variable swing parameters; 2- Variable swing parameters + welding speed

  • weaveNum: Swing number

  • velStart: Welding start speed, (cm/min)

  • velEnd: Welding end speed, (cm/min)

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.37. Robot swing gradient welding code example

 1from fairino import Robot
 2# Establish a connection with the robot controller and return a robot object if the connection is successful
 3robot = Robot.RPC('192.168.58.2')
 4p1Desc = [228.879, -503.594, 453.984, -175.580, 8.293, 171.267]
 5p1Joint = [102.700, -85.333, 90.518, -102.365, -83.932, 22.134]
 6p2Desc = [-333.302, -435.580, 449.866, -174.997, 2.017, 109.815]
 7p2Joint = [41.862, -85.333, 90.526, -100.587, -90.014, 22.135]
 8exaxisPos = [0, 0, 0, 0]
 9offdese = [0, 0, 0, 0, 0, 0]
10robot.MoveJ(joint_pos= p1Joint,tool= 13,user= 0)
11robot.WeaveStartSim(0)
12robot.MoveL(desc_pos= p2Desc,tool= 13,user= 0)
13robot.WeaveEndSim(0)
14robot.MoveJ(joint_pos= p1Joint,tool= 13,user= 0)
15robot.WeaveInspectStart(0)
16robot.MoveL(desc_pos= p2Desc,tool= 13,user= 0,)
17robot.WeaveInspectEnd(0)
18robot.WeldingSetVoltage(1, 19, 0, 0)
19robot.WeldingSetCurrent(1, 190, 0, 0)
20robot.MoveL(desc_pos= p1Desc,tool= 1,user= 1,vel= 100,acc= 100,ovl= 50)
21robot.ARCStart(1, 0, 10000)
22robot.ArcWeldTraceControl(1, 0, 1, 0.06, 5, 5, 60, 1, 0.06, 5, 5, 80, 0, 0, 4, 1, 10, 0, 0)
23robot.WeaveStart(0)
24robot.WeaveChangeStart(1, 0, 50, 30)
25robot.MoveL(desc_pos= p2Desc,tool= 1,user= 1,vel= 100)
26robot.WeaveChangeEnd()
27robot.WeaveEnd(0)
28robot.ArcWeldTraceControl(0, 0, 1, 0.06, 5, 5, 60, 1, 0.06, 5, 5, 80, 0, 0, 4, 1, 10, 0, 0)
29robot.ARCEnd(1, 0, 10000)
30robot.CloseRPC()

14.38. Wobble end

Added in version python: SDK-v2.0.9-3.7.9

Prototype

WeaveChangeEnd()

Description

Wobble end

Mandatory parameters

NULL

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.39. Extended IO-Configuration Welder Gas Detection Signal

Added in version python: SDK-v2.0.5

Prototype

SetAirControlExtDoNum(DONum)

Description

Extended IO-Configuration Welder Gas Detection Signal

Mandatory parameters

  • DONum: gas detection signal extension DO number

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.40. Extended IO-Configuration of welder arc start signal

Added in version python: SDK-v2.0.5

Prototype

SetArcStartExtDoNum(DONum)

Description

Extended IO-Configuration Welder Arc Start Signal

Mandatory parameters

  • DONum: gas detection signal extension DO number

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.41. Extended IO-Configuration of the welder’s reverse wire feed signal

Added in version python: SDK-v2.0.5

Prototype

SetWireReverseFeedExtDoNum(DONum)

Description

Extended IO-Configuration Welder Reverse Wire Feed Signal

Mandatory parameters

  • DONum: gas detection signal extension DO number

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.42. Extended IO-Configuration of the welder’s forward wire feed signal

Added in version python: SDK-v2.0.5

Prototype

SetWireForwardFeedExtDoNum(DONum)

Description

Extended IO-Configure welder positive wire feed signal

Mandatory parameters

  • DONum: gas detection signal extension DO number

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.43. Extended IO-Configuration of the welder’s arc start success signal

Added in version python: SDK-v2.0.5

Prototype

SetArcDoneExtDiNum(DINum)

Description

Extended IO-Configuration Welder Arc Start Success Signal

Mandatory parameters

  • DINum: Welder Ready Signal Expansion DI Number

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.44. Extended IO-Configuration Welder Ready Signal

Added in version python: SDK-v2.0.5

Prototype

SetArcDoneExtDiNum(DINum)

Description

Extended IO-Configuration Welder Ready Signal

Mandatory parameters

  • DINum: Welder Ready Signal Expansion DI Number

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.45. Extended IO-Configuration Weld Interrupt Recovery Signal

Added in version python: SDK-v2.0.5

Prototype

SetExtDIWeldBreakOffRecover(reWeldDINum, abortWeldDINum)

description

Extended IO-Configuration Weld Interrupt Recovery Signal

Mandatory parameters

  • reWeldDINum: Weld signal extension DI number for resumption of welding after a weld interruption

  • abortWeldDINum: exit weld signal extension DI number after weld interruption

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.46. Example code for setting up extended IO solder signals

 1from fairino import Robot
 2import time
 3# Establish a connection with the robot controller and return a robot object if the connection is successful
 4robot = Robot.RPC('192.168.58.2')
 5rtn = robot.SetArcStartExtDoNum(10)
 6print(f"SetArcStartExtDoNum rtn is {rtn}")
 7rtn = robot.SetAirControlExtDoNum(20)
 8print(f"SetAirControlExtDoNum rtn is {rtn}")
 9rtn = robot.SetWireForwardFeedExtDoNum(30)
10print(f"SetWireForwardFeedExtDoNum rtn is {rtn}")
11rtn = robot.SetWireReverseFeedExtDoNum(40)
12rtn = robot.SetWeldReadyExtDiNum(50)
13print(f"SetWeldReadyExtDiNum rtn is {rtn}")
14rtn = robot.SetArcDoneExtDiNum(60)
15print(f"SetArcDoneExtDiNum rtn is {rtn}")
16rtn = robot.SetExtDIWeldBreakOffRecover(70, 80)
17print(f"SetExtDIWeldBreakOffRecover rtn is {rtn}")
18rtn = robot.SetWireSearchExtDIONum(0, 1)
19print(f"SetWireSearchExtDIONum rtn is {rtn}")
20robot.CloseRPC()

14.47. Get Extended DI Function Configuration

Added in version python: SDK-V3.9.8

Prototype

GetExtDIConfig(self)

Description

Get extended DI function configuration

Required Parameters

  • DIConfig: Extended DI input configuration; DIConfig[0]-welding machine ready extended DI port

  • DIConfig[1]: Arc start success extended DI port

  • DIConfig[2]: Welding interrupt resume extended DI port

  • DIConfig[3]: Welding interrupt exit extended DI port

  • DIConfig[4]: Wire search success extended DI port

  • DIConfig[5]: Laser welding machine running status extended DI port

  • DIConfig[6]: Laser welding machine fault status extended DI port

  • DIConfig[7-15]: Reserved

Default Parameters

None

Return Value

Error code, 0-success; non-zero-error

14.48. Get Extended DO Function Configuration

Added in version python: SDK-V3.9.8

Prototype

GetExtDOConfig(self)

Description

Get extended DO function configuration

Required Parameters

  • DOConfig: Extended DO output configuration; DOConfig[0]-welding machine arc start extended DO port

  • DOConfig[1]: Gas detection extended DO port

  • DOConfig[2]: Forward wire feed extended DO port

  • DOConfig[3]: Reverse wire feed extended DO port

  • DOConfig[4]: Wire search extended DO port

  • DOConfig[5]: Welding machine control mode extended DO port

  • DOConfig[6]: Laser welding machine enable extended DO port

  • DOConfig[7]: Laser welding machine start (laser output) extended DO port

  • DOConfig[8]: Laser welding machine reset extended DO port

  • DOConfig[9-15]: Reserved

Default Parameters

None

Return Value

Error code, 0-success; non-zero-error

14.49. Get Extended DI/DO Code Example

Added in version python: SDK-V3.9.8

 1from fairino import Robot
 2import time
 3
 4def main():
 5    robot = Robot.RPC('192.168.58.2')
 6    time.sleep(0.5)
 7
 8rtn = robot.SetArcStartExtDoNum(10)
 9    print(f"SetArcStartExtDoNum rtn is {rtn}")
10
11    rtn = robot.SetAirControlExtDoNum(20)
12    print(f"SetAirControlExtDoNum rtn is {rtn}")
13
14    rtn = robot.SetWireForwardFeedExtDoNum(30)
15    print(f"SetWireForwardFeedExtDoNum rtn is {rtn}")
16
17    rtn = robot.SetWireReverseFeedExtDoNum(40)
18    print(f"SetWireReverseFeedExtDoNum rtn is {rtn}")
19
20    rtn = robot.SetWeldReadyExtDiNum(50)
21    print(f"SetWeldReadyExtDiNum rtn is {rtn}")
22
23    rtn = robot.SetArcDoneExtDiNum(60)
24    print(f"SetArcDoneExtDiNum rtn is {rtn}")
25
26    rtn = robot.SetExtDIWeldBreakOffRecover(70, 80)
27    print(f"SetExtDIWeldBreakOffRecover rtn is {rtn}")
28
29    rtn = robot.SetWireSearchExtDIONum(0, 1)
30    print(f"SetWireSearchExtDIONum rtn is {rtn}")
31
32    rtn, DIConfig = robot.GetExtDIConfig()
33    print(f"GetExtDIConfig rtn is {rtn}")
34    print(f"welder ready {DIConfig[0]}")
35    print(f"arc done {DIConfig[1]}")
36    print(f"reweld start {DIConfig[2]}")
37    print(f"abort reweld {DIConfig[3]}")
38    print(f"wiresearch done {DIConfig[4]}")
39    print(f"Laser welding State {DIConfig[5]}")
40    print(f"laser welding error state {DIConfig[6]}")
41
42    rtn, DOConfig = robot.GetExtDOConfig()
43    print(f"GetExtDOConfig rtn is {rtn}")
44    print(f"Arc Start {DOConfig[0]}")
45    print(f"Air Test {DOConfig[1]}")
46    print(f"Wire forward {DOConfig[2]}")
47    print(f"Wire Inverse {DOConfig[3]}")
48    print(f"wiresearch {DOConfig[4]}")
49    print(f"Weld Mode {DOConfig[5]}")
50    print(f"laser Enable {DOConfig[6]}")
51    print(f"Laser On {DOConfig[7]}")
52    print(f"Laser Reset Error {DOConfig[8]}")
53
54    robot.CloseRPC()

14.50. Arc tracking control

Added in version python: SDK-v2.0.9-3.7.9

Prototype

ArcWeldTraceControl(flag,delaytime, isLeftRight, klr, tStartLr, stepMaxLr, sumMaxLr, isUpLow, kud, tStartUd, stepMaxUd, sumMaxUd. axisSelect, referenceType, referSampleStartUd, referSampleCountUd, referenceCurrent, offsetType, offsetParameter)

Description

Arc tracking control

Mandatory parameters

  • flag: switch, 0-off; 1-on

  • delayTime: lag time in ms

  • isLeftRight: left-right deviation compensation 0 - off, 1 - on

  • klr: left/right adjustment factor (sensitivity)

  • tStartLr: left and right start compensation time cyc

  • stepMaxLr: Maximum compensation in mm for each left and right step.

  • sumMaxLr: total maximum compensation left and right mm

  • isUpLow: up and down deviation compensation 0 - off, 1 - on

  • kud: upward and downward adjustment factor (sensitivity)

  • tStartUd: up and down start compensation time cyc

  • stepMaxUd: Maximum compensation per step up and down mm

  • sumMaxUd: total maximum compensation up and down

  • axisSelect: upper and lower coordinate system selection, 0 - swing; 1 - tool; 2 - base

  • referenceType: upper and lower reference current setting mode, 0 - feedback; 1 - constant

  • referSampleStartUd: upper and lower reference current sampling start count (feedback), cyc

  • referSampleCountUd: upper and lower reference current sample cycle count (feedback), cyc

  • referenceCurrent: upper and lower reference currents mA

  • offsetType: bias tracking type, 0- no bias; 1- Sampling; 2- percent

  • offsetParameter: bias parameter; Sampling (offset sampling start time, default sampling cycle); Percentage (offset percentage (-100 ~ 100))

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.51. Arc tracking AI passband selection

Added in version python: SDK-v2.0.5

Prototype

ArcWeldTraceExtAIChannelConfig(channel)

Description

Arc Tracking AI Passband Selection

Mandatory parameters

  • channel: arc tracking AI passband selection, [0-3]

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.52. Arc tracking + multi-layer multi-channel compensation on

Added in version python: SDK-v2.0.5

prototype

ArcWeldTraceReplayStart()

Description

Arc Tracking + Multi-Layer Multi-Channel Compensation On

Mandatory parameters

NULL

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.53. Arc Tracking + Multi-Layer Multi-Channel Compensation Off

Added in version python: SDK-v2.0.5

Prototype

ArcWeldTraceReplayEnd()

Description

Arc Tracking + Multi-Layer Multi-Channel Compensation Shutdown

Mandatory parameters

NULL

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.54. Offset Coordinate Change - Multi-layer Multi-pass Welding

Added in version python: SDK-v2.0.5

Prototype

MultilayerOffsetTrsfToBase(pointo, pointX, pointZ, dx, dy, db)

Description

Offset Coordinate Change - Multi-Layer Multi-Pass Welding

Mandatory parameters

  • pointo: datum Cartesian orientation

  • pointX: Cartesian position of point X in the offset direction from the reference point X.

  • pointZ: Cartesian position of point Z in the direction of offset from datum Z.

  • dx: x-direction offset (mm)

  • dz: z-direction offset (mm)

  • dry: offset around the y-axis (°)

Default parameters

NULL

Return Value

  • Error Code Success-0 Failure- errcode

  • offset: the offset of the result of the calculation

14.55. Example code for multi-layer multi-pass welding arc tracking

 1from fairino import Robot
 2import time
 3# Establish a connection with the robot controller and return a robot object if the connection is successful
 4robot = Robot.RPC('192.168.58.2')
 5mulitilineorigin1_joint = [-24.090, -63.501, 84.288, -111.940, -93.426, 57.669]
 6mulitilineorigin1_desc = [-677.559, 190.951, -1.205, 1.144, -41.482, -82.577]
 7mulitilineX1_desc = [-677.556, 211.949, -1.206]
 8mulitilineZ1_desc = [-677.564, 190.956, 19.817]
 9mulitilinesafe_joint = [-25.734, -63.778, 81.502, -108.975, -93.392, 56.021]
10mulitilinesafe_desc = [-677.561, 211.950, 19.812, 1.144, -41.482, -82.577]
11mulitilineorigin2_joint = [-29.743, -75.623, 101.241, -116.354, -94.928, 55.735]
12mulitilineorigin2_desc = [-563.961, 215.359, -0.681, 2.845, -40.476, -87.443]
13mulitilineX2_desc = [-563.965, 220.355, -0.680]
14mulitilineZ2_desc = [-563.968, 215.362, 4.331]
15epos = [0, 0, 0, 0]
16offset = [0, 0, 0, 0, 0, 0]
17time.sleep(0.01)
18error = robot.MoveJ(joint_pos= mulitilinesafe_joint,tool= 13,user= 0,vel= 10)
19print(f"MoveJ return: {error}")
20error = robot.MoveL(desc_pos= mulitilineorigin1_desc,tool= 13,user= 0,vel= 10,speedPercent=100)
21print(f"MoveL return: {error}")
22error = robot.MoveJ(joint_pos= mulitilinesafe_joint,tool= 13,user= 0,vel= 10)
23print(f"MoveJ return: {error}")
24error = robot.MoveL(desc_pos= mulitilineorigin2_desc,tool= 13,user= 0,vel= 10,speedPercent=100)
25print(f"MoveL return: {error}")
26error = robot.MoveJ(joint_pos= mulitilinesafe_joint,tool= 13,user= 0,vel= 10)
27print(f"MoveJ return: {error}")
28error = robot.MoveL(desc_pos= mulitilineorigin1_desc,tool= 13,user= 0,vel= 10,speedPercent=100)
29print(f"MoveL return: {error}")
30error = robot.ARCStart(1, 0, 3000)
31print(f"ARCStart return: {error}")
32error = robot.WeaveStart(0)
33print(f"WeaveStart return: {error}")
34error = robot.ArcWeldTraceControl(1, 0, 1, 0.06, 5, 5, 50, 1, 0.06, 5, 5, 55, 0, 0, 4, 1, 10,0,0)
35print(f"ArcWeldTraceControl return: {error}")
36error = robot.MoveL(desc_pos= mulitilineorigin2_desc,tool= 13,user= 0,vel= 1,speedPercent=100)
37print(f"MoveL return: {error}")
38error = robot.ArcWeldTraceControl(0, 0, 1, 0.06, 5, 5, 50, 1, 0.06, 5, 5, 55, 0, 0, 4, 1, 10,0,0)
39print(f"ArcWeldTraceControl return: {error}")
40error = robot.WeaveEnd(0)
41print(f"WeaveEnd return: {error}")
42error = robot.ARCEnd(1, 0, 10000)
43print(f"ARCEnd return: {error}")
44error = robot.MoveJ(joint_pos= mulitilinesafe_joint,tool= 13,user= 0,vel= 10)
45print(f"MoveJ return: {error}")
46error,offset = robot.MultilayerOffsetTrsfToBase(mulitilineorigin1_desc[:3], mulitilineX1_desc, mulitilineZ1_desc, 10.0, 0.0, 0.0)
47print(f"MultilayerOffsetTrsfToBase return: {error}")
48error = robot.MoveL(desc_pos= mulitilineorigin1_desc,tool= 13,user= 0,vel= 10,speedPercent=100)
49print(f"MoveL return: {error}")
50error = robot.ARCStart(1, 0, 3000)
51print(f"ARCStart return: {error}")
52error, offset = robot.MultilayerOffsetTrsfToBase(mulitilineorigin2_desc[:3], mulitilineX2_desc, mulitilineZ2_desc, 10, 0, 0)
53print(f"MultilayerOffsetTrsfToBase return: {error}")
54error = robot.ArcWeldTraceReplayStart()
55print(f"ArcWeldTraceReplayStart return: {error}")
56error = robot.MoveL(desc_pos= mulitilineorigin2_desc,tool= 13,user= 0,vel= 2,speedPercent=100)
57print(f"MoveL return: {error}")
58error = robot.ArcWeldTraceReplayEnd()
59print(f"ArcWeldTraceReplayEnd return: {error}")
60error = robot.ARCEnd(1, 0, 10000)
61print(f"ARCEnd return: {error}")
62error = robot.MoveJ(joint_pos= mulitilinesafe_joint,tool= 13,user= 0,vel= 10)
63print(f"MoveJ return: {error}")
64error, offset = robot.MultilayerOffsetTrsfToBase(mulitilineorigin1_desc[:3], mulitilineX1_desc, mulitilineZ1_desc, 0, 10, 0)
65print(f"MultilayerOffsetTrsfToBase return: {error}")
66error = robot.MoveL(desc_pos= mulitilineorigin1_desc,tool= 13,user= 0,vel= 10,speedPercent=100)
67print(f"MoveL return: {error}")
68error = robot.ARCStart(1, 0, 3000)
69print(f"ARCStart return: {error}")
70error, offset = robot.MultilayerOffsetTrsfToBase(mulitilineorigin2_desc[:3], mulitilineX2_desc, mulitilineZ2_desc, 0, 10, 0)
71error = robot.ArcWeldTraceReplayStart()
72print(f"ArcWeldTraceReplayStart return: {error}")
73error = robot.MoveL(desc_pos= mulitilineorigin2_desc,tool= 13,user= 0,vel= 2,speedPercent=100)
74print(f"MoveL return: {error}")
75error = robot.ArcWeldTraceReplayEnd()
76print(f"ArcWeldTraceReplayEnd return: {error}")
77error = robot.ARCEnd(1, 0, 3000)
78print(f"ARCEnd return: {error}")
79error = robot.MoveJ(joint_pos= mulitilinesafe_joint,tool= 13,user= 0,vel= 10)
80print(f"MoveJ return: {error}")
81robot.CloseRPC()

14.56. Selection of AI channels for current feedback in arc tracking welding machines

Added in version python: SDK-v2.1.2

Prototype

ArcWeldTraceAIChannelCurrent(channel)

Description

Selection of AI channels for current feedback in arc tracking welding machines

Mandatory parameters

  • channel: Passage 0- Expand AI0; 1- Expand AI1; 2- Expand AI2; 3- Expand AI3; 4- Control Box AI0 5- Control Box AI1

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.57. Selection of AI channel for voltage feedback of arc tracking welding machine

Added in version python: SDK-v2.1.2

Prototype

ArcWeldTraceAIChannelVoltage(channel)

Description

Selection of AI channel for voltage feedback of arc tracking welding machine

Mandatory parameters

  • channel: Passage 0- Expand AI0; 1- Expand AI1; 2- Expand AI2; 3- Expand AI3; 4- Control Box AI0 5- Control Box AI1

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.58. Current feedback conversion parameters of arc tracking welding machine

Added in version python: SDK-v2.1.2

Prototype

ArcWeldTraceCurrentPara(AILow, AIHigh, currentLow, currentHigh)

Description

Current feedback conversion parameters of arc tracking welding machine

Mandatory parameters

NULL

Default parameters

  • AILow: Lower limit of AI channel, default value 0V, range [0-10V]

  • AIHigh: AI channel upper limit, default value 10V, range [0-10V]

  • currentLow: The lower limit of the AI channel corresponds to the current value of the welding machine. The default value is 0V, and the range is [0-200V]

  • currentHigh: The upper limit of the AI channel corresponds to the current value of the welding machine. The default value is 100V, and the range is [0-200V]

Return Value

Error Code Success-0 Failure- errcode

14.59. Voltage feedback conversion parameters of arc tracking welding machine

Added in version python: SDK-v2.1.2

Prototype

ArcWeldTraceVoltagePara(AILow, AIHigh, voltageLow, voltageHigh)

Description

Voltage feedback conversion parameters of arc tracking welding machine

Mandatory parameters

NULL

Default parameters

  • AILow: Lower limit of AI channel, default value 0V, range [0-10V]

  • AIHigh: AI channel upper limit, default value 10V, range [0-10V]

  • voltageLow: The lower limit of the AI channel corresponds to the welding machine voltage value. The default value is 0V, and the range is [0-200V]

  • voltageHigh: The upper limit of the AI channel corresponds to the voltage value of the welding machine. The default value is 100V, and the range is [0-200V]

Return Value

Error Code Success-0 Failure- errcode

14.60. Example arc tracking code

 1from fairino import Robot
 2# Establish a connection with the robot controller and return a robot object if the connection is successful
 3robot = Robot.RPC('192.168.58.2')
 4
 5safetydescPose = [-504.043,275.181,40.908,-28.002,-42.025,-14.044]
 6safetyjointPos = [-39.078,-76.732,87.227,-99.47,-94.301,18.714]
 7startdescPose = [-473.86,257.879,-20.849,-37.317,-42.021,2.543]
 8startjointPos = [-43.487,-76.526,95.568,-104.445,-89.356,3.72]
 9enddescPose = [-499.844,141.225,7.72,-34.856,-40.17,13.13]
10endjointPos = [-31.305,-82.998,99.401,-104.426,-89.35,3.696]
11exaxisPos = [0, 0, 0, 0]
12offdese = [0, 0, 0, 0, 0, 0]
13robot.MoveJ(joint_pos=safetyjointPos, tool=1, user=0, vel=20, acc=100)
14robot.WeldingSetCurrentRelation(0, 495, 1, 10, 0)
15robot.WeldingSetVoltageRelation(10, 45, 1, 10, 1)
16robot.WeldingSetVoltage(0, 25, 1, 0)
17robot.WeldingSetCurrent(0, 260, 0, 0)
18rtn = robot.ArcWeldTraceAIChannelCurrent(4)
19print("ArcWeldTraceAIChannelCurrent rtn is", rtn)
20rtn = robot.ArcWeldTraceAIChannelVoltage(5)
21print("ArcWeldTraceAIChannelVoltage rtn is", rtn)
22rtn = robot.ArcWeldTraceCurrentPara(0, 5, 0, 500)
23print("ArcWeldTraceCurrentPara rtn is", rtn)
24rtn = robot.ArcWeldTraceVoltagePara(1.018, 10, 0, 50)
25print("ArcWeldTraceVoltagePara rtn is", rtn)
26robot.MoveJ(joint_pos=startjointPos, tool=1, user=0, vel=20, acc=100)
27robot.ArcWeldTraceControl(1, 0, 1, 0.08, 5, 5, 300, 1, 0.06, 4, 4, 300, 1, 0, 4, 1, 10, 0, 0)
28robot.ARCStart(0, 0, 10000)
29robot.WeaveStart(0)
30robot.MoveL(desc_pos=enddescPose, tool=1, user=0, vel=100, ovl= 2, acc=100)
31robot.ARCEnd(0, 0, 10000)
32robot.WeaveEnd(0)
33robot.ArcWeldTraceControl(0, 0, 1, 0.08, 5, 5, 300, 1, 0.06, 4, 4, 300, 1, 0, 4, 1, 10, 0, 0)
34robot.MoveJ(joint_pos=safetyjointPos, tool=1, user=0, vel=20, acc=100)

14.61. Setting Up the Weld Wire Seek Expansion IO Port

Added in version python: SDK-v2.0.5

Prototype

SetWireSearchExtDIONum(searchDoneDINum, searchStartDONum)

Description

Setting up the Weld Wire Seeker Expansion IO Port

Mandatory parameter

  • searchDoneDINum: weld wire seek success DO port (0-127)

  • searchStartDONum: wire seek start/stop control DO port (0-127)

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.62. code example

 1from fairino import Robot
 2import time
 3# Establish a connection with the robot controller and return a robot object if the connection is successful
 4robot = Robot.RPC('192.168.58.2')
 5toolCoord = [0, 0, 200, 0, 0, 0]
 6robot.SetToolCoord(1, toolCoord, 0, 0, 1, 0)
 7wobjCoord = [0, 0, 0, 0, 0, 0]
 8robot.SetWObjCoord(1, wobjCoord, 0)
 9robot.ExtDevSetUDPComParam("192.168.58.88", 2021, 2, 50, 5, 50, 1, 50, 10)
10robot.ExtDevLoadUDPDriver()
11robot.SetWireSearchExtDIONum(0, 0)
12exaxisPos = [0, 0, 0, 0]
13offdese = [0, 0, 0, 0, 0, 0]
14descStart = [216.543, 445.175, 93.465, 179.683, 1.757, -112.641]
15jointStart = [-128.345, -86.660, 114.679, -119.625, -89.219, 74.303]
16descEnd = [111.143, 523.384, 87.659, 179.703, 1.835, -97.750]
17jointEnd = [-113.454, -81.060, 109.328, -119.954, -89.218, 74.302]
18error = robot.MoveL(desc_pos=descStart,tool= 1,user= 1,vel= 100)
19print(f"MoveL return: {error}")
20error = robot.MoveL(desc_pos=descEnd,tool= 1,user= 1,vel= 100)
21print(f"MoveL return: {error}")
22descREF0A = [142.135, 367.604, 86.523, 179.728, 1.922, -111.089]
23jointREF0A = [-126.794, -100.834, 128.922, -119.864, -89.218, 74.302]
24descREF0B = [254.633, 463.125, 72.604, 179.845, 2.341, -114.704]
25jointREF0B = [-130.413, -81.093, 112.044, -123.163, -89.217, 74.303]
26descREF1A = [92.556, 485.259, 47.476, -179.932, 3.130, -97.512]
27jointREF1A = [-113.231, -83.815, 119.877, -129.092, -89.217, 74.303]
28descREF1B = [203.103, 583.836, 63.909, 179.991, 2.854, -103.372]
29jointREF1B = [-119.088, -69.676, 98.692, -121.761, -89.219, 74.303]
30error = robot.WireSearchStart(0, 10, 100, 0, 10, 100, 0)
31print(f"WireSearchStart return: {error}")
32error = robot.MoveL(desc_pos=descREF0A,tool= 1,user= 1,vel= 100)
33print(f"MoveL return: {error}")
34error = robot.MoveL(desc_pos=descREF0B,tool= 1,user= 1,vel= 100,search=1)
35print(f"MoveL return: {error}")
36error = robot.WireSearchWait("REF0")
37print(f"WireSearchWait return: {error}")
38error = robot.WireSearchEnd(0, 10, 100, 0, 10, 100, 0)
39print(f"WireSearchEnd return: {error}")
40error = robot.WireSearchStart(0, 10, 100, 0, 10, 100, 0)
41print(f"WireSearchStart return: {error}")
42error = robot.MoveL(desc_pos= descREF1A,tool= 1,user= 1,vel= 100)
43print(f"MoveL return: {error}")
44error = robot.MoveL(desc_pos= descREF1B,tool= 1,user= 1,vel= 100,search=1)
45print(f"MoveL return: {error}")
46error = robot.WireSearchWait("REF1")
47print(f"WireSearchWait return: {error}")
48error = robot.WireSearchEnd(0, 10, 100, 0, 10, 100, 0)
49error = robot.WireSearchStart(0, 10, 100, 0, 10, 100, 0)
50print(f"WireSearchStart return: {error}")
51error = robot.MoveL(desc_pos= descREF0A,tool= 1,user= 1,vel= 100)
52print(f"MoveL return: {error}")
53error = robot.MoveL(desc_pos= descREF0B,tool= 1,user= 1,vel= 100,search=1)
54print(f"MoveL return: {error}")
55error = robot.WireSearchWait("RES0")
56print(f"WireSearchWait return: {error}")
57error = robot.WireSearchEnd(0, 10, 100, 0, 10, 100, 0)
58print(f"WireSearchEnd return: {error}")
59error = robot.WireSearchStart(0, 10, 100, 0, 10, 100, 0)
60print(f"WireSearchStart return: {error}")
61error = robot.MoveL(desc_pos= descREF1A,tool= 1,user= 1,vel= 100)
62print(f"MoveL return: {error}")
63error = robot.MoveL(desc_pos= descREF1B,tool= 1,user= 1,vel= 100,search=1)
64print(f"MoveL return: {error}")
65error = robot.WireSearchWait("RES1")
66print(f"WireSearchWait return: {error}")
67error = robot.WireSearchEnd(0, 10, 100, 0, 10, 100, 0)
68print(f"WireSearchEnd return: {error}")
69varNameRef = ["REF0", "REF1", "#", "#", "#", "#"]
70varNameRes = ["RES0", "RES1", "#", "#", "#", "#"]
71offectFlag = 0
72offectPos = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
73error, offectFlag, offectPos = robot.GetWireSearchOffset(0, 0, varNameRef, varNameRes)
74print(f"GetWireSearchOffset return: {error}")
75error = robot.PointsOffsetEnable(0, offectPos)
76print(f"PointsOffsetEnable return: {error}")
77error = robot.MoveL(desc_pos= descStart,tool= 1,user= 1,vel= 100)
78print(f"MoveL return: {error}")
79error = robot.MoveL(desc_pos= descEnd,tool= 1,user= 1,vel= 100,search=1)
80print(f"MoveL return: {error}")
81error = robot.PointsOffsetDisable()
82robot.CloseRPC()

14.63. Welding wire position finding start

Added in version python: SDK-v2.0.5

Prototype

WireSearchStart(refPos,searchVel,searchDis,autoBackFlag,autoBackVel,autoBackDis,offectFlag)

Description

Welding wire seek start

Mandatory parameters

  • refPos: 1 - reference point 0 - contact point

  • searchVel: search velocity %

  • searchDis: search distance mm

  • autoBackFlag: autoBackFlag, 0 - not auto; - auto

  • autoBackVel: Automatic Back Velocity %

  • autoBackDis: automatic back distance mm

  • offectFlag: 1 - seek with offset; 0 - teach point seek

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.64. End of wire position finding

Added in version python: SDK-v2.0.5

Prototype

WireSearchEnd(refPos,searchVel,searchDis,autoBackFlag,autoBackVel,autoBackDis,offectFlag)

Description

Welding wire seek end

Mandatory parameters

  • refPos: 1 - reference point 2 - contact point

  • searchVel: search velocity %

  • searchDis: search distance mm

  • autoBackFlag: autoBackFlag, 0 - not auto; - auto

  • autoBackVel: Automatic Back Velocity %

  • autoBackDis: automatic back distance mm

  • offectFlag: 1 - seek with offset; 2 - teach point seek

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.65. Calculate the wire finding offset

Added in version python: SDK-v2.0.5

Prototype

GetWireSearchOffset(seamType, method,varNameRef,varNameRes)

Description

Calculate the welding wire seek offset

Mandatory parameters

  • seamType: weld type

  • method: method of calculation

  • varNameRef: datums 1-6, “#” denotes a pointless variable

  • varNameRes: Contacts 1-6, “#” for dotless variables

Default parameters

NULL

Return Value

  • errorcode Success-0 Failure- errcode

  • offsetFlag: 0 - the offset is superimposed directly on the instruction point; 1 - the offset requires a coordinate transformation of the instruction point

  • offset: offset position [x, y, z, a, b, c]

14.66. Waiting for wire seek to complete

Added in version python: SDK-v2.0.5

Prototype

WireSearchWait(varname)

Description

Waiting for wire seek to complete.

Mandatory parameters

  • varName: contact name “RES0” ~ “RES99”

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.67. Wire seek contact points written to database

Added in version python: SDK-v2.0.5

Prototype

SetPointToDatabase(varName,pos)

Description

Welding wire seeker contact points written to database

Mandatory parameters

  • varName: contact name “RES0” ~ “RES99”

  • pos: contact point data [x, y, x, a, b, c]

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.68. Example of robot wire locating code

 1from fairino import Robot
 2import time
 3# Establish a connection with the robot controller and return a robot object if the connection is successful
 4robot = Robot.RPC('192.168.58.2')
 5toolCoord = [0, 0, 200, 0, 0, 0]
 6robot.SetToolCoord(1, toolCoord, 0, 0, 1, 0)
 7wobjCoord = [0, 0, 0, 0, 0, 0]
 8robot.SetWObjCoord(1, wobjCoord, 0)
 9exaxisPos = [0, 0, 0, 0]
10offdese = [0, 0, 0, 0, 0, 0]
11descStart = [216.543, 445.175, 93.465, 179.683, 1.757, -112.641]
12jointStart = [-128.345, -86.660, 114.679, -119.625, -89.219, 74.303]
13descEnd = [111.143, 523.384, 87.659, 179.703, 1.835, -97.750]
14jointEnd = [-113.454, -81.060, 109.328, -119.954, -89.218, 74.302]
15error = robot.MoveL(desc_pos=descStart,tool= 1,user= 1,vel= 100)
16print(f"MoveL return: {error}")
17error = robot.MoveL(desc_pos=descEnd,tool= 1,user= 1,vel= 100)
18print(f"MoveL return: {error}")
19descREF0A = [142.135, 367.604, 86.523, 179.728, 1.922, -111.089]
20jointREF0A = [-126.794, -100.834, 128.922, -119.864, -89.218, 74.302]
21descREF0B = [254.633, 463.125, 72.604, 179.845, 2.341, -114.704]
22jointREF0B = [-130.413, -81.093, 112.044, -123.163, -89.217, 74.303]
23descREF1A = [92.556, 485.259, 47.476, -179.932, 3.130, -97.512]
24jointREF1A = [-113.231, -83.815, 119.877, -129.092, -89.217, 74.303]
25descREF1B = [203.103, 583.836, 63.909, 179.991, 2.854, -103.372]
26jointREF1B = [-119.088, -69.676, 98.692, -121.761, -89.219, 74.303]
27error = robot.WireSearchStart(0, 10, 100, 0, 10, 100, 0)
28print(f"WireSearchStart return: {error}")
29error = robot.MoveL(desc_pos=descREF0A,tool= 1,user= 1,vel= 100)
30print(f"MoveL return: {error}")
31error = robot.MoveL(desc_pos=descREF0B,tool= 1,user= 1,vel= 100,search=1)
32print(f"MoveL return: {error}")
33error = robot.WireSearchWait("REF0")
34print(f"WireSearchWait return: {error}")
35error = robot.WireSearchEnd(0, 10, 100, 0, 10, 100, 0)
36print(f"WireSearchEnd return: {error}")
37error = robot.WireSearchStart(0, 10, 100, 0, 10, 100, 0)
38print(f"WireSearchStart return: {error}")
39error = robot.MoveL(desc_pos= descREF1A,tool= 1,user= 1,vel= 100)
40print(f"MoveL return: {error}")
41error = robot.MoveL(desc_pos= descREF1B,tool= 1,user= 1,vel= 100,search=1)
42print(f"MoveL return: {error}")
43error = robot.WireSearchWait("REF1")
44print(f"WireSearchWait return: {error}")
45error = robot.WireSearchEnd(0, 10, 100, 0, 10, 100, 0)
46error = robot.WireSearchStart(0, 10, 100, 0, 10, 100, 0)
47print(f"WireSearchStart return: {error}")
48error = robot.MoveL(desc_pos= descREF0A,tool= 1,user= 1,vel= 100)
49print(f"MoveL return: {error}")
50error = robot.MoveL(desc_pos= descREF0B,tool= 1,user= 1,vel= 100,search=1)
51print(f"MoveL return: {error}")
52error = robot.WireSearchWait("RES0")
53print(f"WireSearchWait return: {error}")
54error = robot.WireSearchEnd(0, 10, 100, 0, 10, 100, 0)
55print(f"WireSearchEnd return: {error}")
56error = robot.WireSearchStart(0, 10, 100, 0, 10, 100, 0)
57print(f"WireSearchStart return: {error}")
58error = robot.MoveL(desc_pos= descREF1A,tool= 1,user= 1,vel= 100)
59print(f"MoveL return: {error}")
60error = robot.MoveL(desc_pos= descREF1B,tool= 1,user= 1,vel= 100,search=1)
61print(f"MoveL return: {error}")
62error = robot.WireSearchWait("RES1")
63print(f"WireSearchWait return: {error}")
64error = robot.WireSearchEnd(0, 10, 100, 0, 10, 100, 0)
65print(f"WireSearchEnd return: {error}")
66varNameRef = ["REF0", "REF1", "#", "#", "#", "#"]
67varNameRes = ["RES0", "RES1", "#", "#", "#", "#"]
68offectFlag = 0
69offectPos = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
70error, offectFlag, offectPos = robot.GetWireSearchOffset(0, 0, varNameRef, varNameRes)
71print(f"GetWireSearchOffset return: {error}")
72error = robot.PointsOffsetEnable(0, offectPos)
73print(f"PointsOffsetEnable return: {error}")
74error = robot.MoveL(desc_pos= descStart,tool= 1,user= 1,vel= 100)
75print(f"MoveL return: {error}")
76error = robot.MoveL(desc_pos= descEnd,tool= 1,user= 1,vel= 100,search=1)
77print(f"MoveL return: {error}")
78error = robot.PointsOffsetDisable()
79robot.CloseRPC()

14.69. Set the welding voltage to start gradually

Added in version python: SDK-v2.1.2

Prototype

WeldingSetVoltageGradualChangeStart(IOType, voltageStart, voltageEnd, AOIndex, blend)

Description

Set the welding voltage to start gradually

Mandatory parameters

  • IOType: Control type 0- Control Box IO 1- Digital Communication Protocol (UDP) 2- Digital Communication Protocol (ModbusTCP)

  • voltageStart: Initial welding voltage (V)

  • voltageEnd: Termination welding voltage (V)

  • AOIndex: The AO port number of the control box (0-1)

  • blend: Whether smooth 0- Not smooth; 1- Smooth

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.70. Set the welding voltage gradient to end

Added in version python: SDK-v2.1.2

Prototype

WeldingSetVoltageGradualChangeEnd()

Description

Set the welding voltage gradient to end

Mandatory parameters

NULL

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.71. Set the welding current to start gradually

Added in version python: SDK-v2.1.2

Prototype

WeldingSetCurrentGradualChangeStart(IOType, currentStart, currentEnd, AOIndex, blend)

Description

Set the welding current to start gradually

Mandatory parameters

  • IOType: Control type 0- Control Box IO 1- Digital Communication Protocol (UDP) 2- Digital Communication Protocol (ModbusTCP)

  • currentStart: Initial welding current (A)

  • currentEnd: Termination welding current (A)

  • AOIndex: The AO port number of the control box (0-1)

  • blend: Whether smooth 0- Not smooth; 1- Smooth

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.72. Set the welding current to gradually end

Added in version python: SDK-v2.1.2

Prototype

WeldingSetCurrentGradualChangeEnd()

Description

Set the welding current to gradually end

Mandatory parameters

NULL

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.73. Robot welding current voltage gradient code example

 1from fairino import Robot
 2# Establish a connection with the robot controller and return a robot object if the connection is successful
 3robot = Robot.RPC('192.168.58.2')
 4startdescPose = [-484.707, 276.996, -14.013, -37.657, -40.508, -1.548]
 5startjointPos = [-45.421, -75.673, 93.627, -104.302, -87.938, 6.005]
 6enddescPose = [-508.767, 137.109, -13.966, -37.639, -40.508, -1.559]
 7endjointPos = [-32.768, -80.947, 100.254, -106.201, -87.201, 18.648]
 8safedescPose = [-484.709, 294.436, 13.621, -37.660, -40.508, -1.545]
 9safejointPos = [-46.604, -75.410, 89.109, -100.003, -88.012, 4.823]
10exaxisPos = [0, 0, 0, 0]
11offdese = [0, 0, 0, 0, 0, 0]
12robot.WeldingSetCurrentRelation(0, 495, 1, 10, 0)
13robot.WeldingSetVoltageRelation(10, 45, 1, 10, 1)
14robot.WeldingSetVoltage(0, 25, 1, 0)
15robot.WeldingSetCurrent(0, 260, 0, 0)
16robot.MoveJ(joint_pos=safejointPos, tool=1, user=0, vel=5, acc=100)
17rtn = robot.WeldingSetCurrentGradualChangeStart(0, 260, 220, 0, 0)
18print("WeldingSetCurrentGradualChangeStart rtn is", rtn)
19rtn = robot.WeldingSetVoltageGradualChangeStart(0, 25, 22, 1, 0)
20print("WeldingSetVoltageGradualChangeStart rtn is", rtn)
21rtn = robot.ArcWeldTraceControl(1, 0, 1, 0.08, 5, 5, 300, 1, 0.06, 4, 4, 300, 1, 0, 4, 1, 10, 0, 0)
22print("ArcWeldTraceControl rtn is", rtn)
23robot.MoveJ(joint_pos=startjointPos, tool=1, user=0, vel=5, acc=100)
24robot.ARCStart(0, 0, 10000)
25robot.WeaveStart(0)
26robot.WeaveChangeStart(2, 1, 24, 36)
27robot.MoveL(desc_pos=enddescPose, tool=1, user=0, vel=100, ovl=2, acc=100)
28robot.ARCEnd(0, 0, 10000)
29robot.WeaveChangeEnd()
30robot.WeaveEnd(0)
31robot.ArcWeldTraceControl(0, 0, 1, 0.08, 5, 5, 300, 1, 0.06, 4, 4, 300, 1, 0, 4, 1, 10, 0, 0)
32robot.WeldingSetCurrentGradualChangeEnd()
33robot.WeldingSetVoltageGradualChangeEnd()

14.74. Set custom swing parameters

Added in version python: SDK-v2.1.6

Prototype

CustomWeaveSetPara(id, pointNum, point, stayTime, frequency, incStayType, stationary)

Description

Set custom swing parameters

Mandatory parameters

  • id:Custom swing number: 0-2

  • pointNum:The number of swing points is 0-10

  • point:Move endpoint data x,y,z

  • stayTime:The swing residence time is ms

  • frequency:Swing frequency Hz

  • incStayType:Waiting mode: 0-cycle does not contain waiting time; The 1-cycle contains the waiting time

  • stationary:Swing position waiting: 0- continue to move within the waiting time; 1 -The position is stationary during the waiting time

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

14.75. Gets custom swing parameters

Added in version python: SDK-v2.1.6

Prototype

CustomWeaveGetPara(id)

Description

Gets custom swing parameters

Mandatory parameters

  • id:Custom swing number: 0-2

Default parameters

NULL

Return Value

  • Error Code Success-0 Failure- errcode

  • pointNum:The number of swing points is 0-10

  • point:Move endpoint data x,y,z

  • stayTime:The swing residence time is ms

  • frequency:Swing frequency Hz

  • incStayType:Waiting mode: 0-cycle does not contain waiting time; The 1-cycle contains the waiting time

  • stationary:Swing position waiting: 0- continue to move within the waiting time; 1 -The position is stationary during the waiting time

14.76. Custom swing parameter code example

 1from fairino import Robot
 2# Establish a connection with the robot controller and return a robot object if the connection is successful
 3robot = Robot.RPC('192.168.58.2')
 4point = [0.0] * 30
 5point[0] = -3.0
 6point[1] = -3.0
 7point[2] = 0.0
 8point[3] = -6.0
 9point[4] = 0.0
10point[5] = 0.0
11point[6] = -3.0
12point[7] = 3.0
13point[8] = 0.0
14point[9] = 0.0
15point[10] = 0.0
16point[11] = 0.0
17stayTime = [0.0] * 10
18rtn = robot.CustomWeaveSetPara(2, 4, point, stayTime, 1.000, 0, 0)
19print(f"CustomWeaveSetPara rtn is {rtn}")
20time.sleep(1)
21pointNum = 0
22frequency = 0.0
23incStayType = 0
24stationary = 0
25rtn, pointNum, point, stayTime, frequency, incStayType, stationary = robot.CustomWeaveGetPara(2)
26print(f"pointNum is {pointNum}")
27for i in range(pointNum):
28    print(f"point {i}, point x y z {point[i * 3 + 0]},{point[i * 3 + 1]},{point[i * 3 + 2]}")
29print(f"fre is {frequency}, stay is {incStayType},{stationary}")
30robot.WeaveSetPara(0, 9, 1.000000, 1, 5.000000, 6.000000, 5.000000, 50, 100, 100, 0, 1, 0.000000, 0.000000)
31desc_p1 = [-288.650, 367.807, 288.404, 0.000, -0.001, 0.001]
32desc_p2 = [-431.714, 367.815, 288.415, 0.001, 0.001, 0.000]
33desc_p3 = [-348.666, 427.798, 288.404, -0.000, -0.000, 0.001]
34j1 = [140.656, -84.560, -91.707, -93.734, 90.000, 50.655]
35j2 = [149.873, -98.298, -77.599, -94.103, 90.000, 59.873]
36j3 = [139.773, -96.173, -80.014, -93.814, 90.000, 49.772]
37epos = [0.0] * 4
38offset_pos = [0.0] * 6
39robot.MoveJ(joint_pos=j1, tool=3, user=0, vel=100)
40robot.WeaveStart(0)
41robot.Circle(desc_pos_p=desc_p3, tool_p=3, user_p=0, vel_p=50, desc_pos_t=desc_p2, tool_t=3, user_t=0, vel_t=50, oacc=10)
42robot.WeaveEnd(0)
43robot.MoveJ(joint_pos=j1, tool=3, user=0, vel=100)
44robot.WeaveStart(0)
45robot.MoveC(desc_pos_p=desc_p3, tool_p=3, user_p=0, vel_p=50, desc_pos_t=desc_p2, tool_t=3, user_t=0, vel_t=50)
46robot.WeaveEnd(0)
47robot.MoveJ(joint_pos=j1, tool=3, user=0, vel=100)
48robot.WeaveStart(0)
49robot.MoveL(desc_pos=desc_p2, tool=3, user=0, vel=100, ovl=10, speedPercent=100)
50robot.WeaveEnd(0)
51robot.CloseRPC()

14.77. Laser Welding Machine Parameter Configuration

Prototype

SetLaserWeldingParam(self, num, scanSpeed, scanWidth, peakPower, dutyCycle, Freq, io_type=1)

Description

Write configuration parameters of one of the 10 process groups of the laser welding machine and configure them to the welder

Required Parameters

  • io_type: Communication type 0-IO 1-UDP

  • Num: Group number to set (1~10)

  • scanSpeed: Scanning speed

  • scanWidth: Scanning width

  • peakPower: Peak power

  • dutyCycle: Duty cycle

  • Freq: Frequency

Default Parameters

None

Return Value

Error code Success-0 Failure- errcode

14.78. Start/Stop Laser Welding

Prototype

SetLaserWeldingStartEnd(self, status, io_type=1, max_waittime=10000)

Description

Start/stop laser welding machine

Required Parameters

  • io_type: Communication type 0-IO 1-UDP

  • status: Control word 0-laser off 1-laser on

  • max_waittime: Maximum wait time

Default Parameters

None

Return Value

Error code Success-0 Failure- errcode

14.79. Enable/Disable Laser Welding Machine

Prototype

SetLaserWeldingEnable(self, status, io_type=1)

Description

Enable/disable laser welding machine

Required Parameters

  • io_type: Communication type 0-IO 1-UDP

  • status: 0-disable 1-enable

Default Parameters

None

Return Value

Error code Success-0 Failure- errcode

14.80. Laser Welding Machine Fault Reset

Prototype

ResetLaserWeldingErr(self,status, io_type=1)

Description

Laser welding machine fault reset

Required Parameters

  • io_type: Communication type 0-IO 1-UDP

  • status: Control word 0-invalid 1-fault reset

Default Parameters

None

Return Value

Error code Success-0 Failure- errcode

14.81. Get Laser Welding Machine Running Status

Prototype

GetLaserWeldingRunningState(self, io_type=1)

Description

Get laser welding machine running status

Required Parameters

  • io_type: Communication type 0-IO 1-UDP

  • status: Control word 0-stopped 1-running

Default Parameters

None

Return Value

Error code Success-0 Failure- errcode

14.82. Get Laser Welding Machine Fault Status

Prototype

GetLaserWeldingErrState(self, io_type=1)

Description

Get laser welding machine fault status

Required Parameters

  • io_type: Communication type 0-IO 1-UDP

  • status: 0-no fault 1-fault present

Default Parameters

None

Return Value

Error code Success-0 Failure- errcode

14.83. Get Laser Welding Machine Configuration Parameters

Prototype

GetLaserWeldingParamTarget(self, num)

Description

Get configuration parameters of one of the 10 process groups of the laser welding machine

Required Parameters

  • Num: Group number to set (1~10)

  • scanSpeed: Scanning speed

  • scanWidth: Scanning width

  • peakPower: Peak power

  • dutyCycle: Duty cycle

  • Freq: Frequency

Default Parameters

None

Return Value

Error code Success-0 Failure- errcode

14.84. Get Currently Active Configuration Parameters of Laser Welding Machine

Prototype

GetLaserWeldingParamActual(self, io_type=1)

Description

Get currently active configuration parameters of the laser welding machine

Required Parameters

  • io_type: Communication type 0-IO 1-UDP

  • scanSpeed: Scanning speed

  • scanWidth: Scanning width

  • peakPower: Peak power

  • dutyCycle: Duty cycle

  • Freq: Frequency

Default Parameters

None

Return Value

Error code Success-0 Failure- errcode

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

Prototype

SetLaserWeldingEnableExtDoNum(self, ctrlModeDONum)

Description

Configure extended IO enable DO port for laser welding machine

Required Parameters

  • ctrlModeDONum: Extended DO port number for laser welding machine enable

Default Parameters

None

Return Value

Error code Success-0 Failure- errcode

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

Prototype

SetLaserWeldingStartExtDoNum(self, ctrlModeDONum)

Description

Configure extended IO start DO port for laser welding machine

Required Parameters

  • ctrlModeDONum: Extended DO port number for laser welding machine start/stop

Default Parameters

None

Return Value

Error code Success-0 Failure- errcode

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

Prototype

SetLaserWeldingErrResetExtDoNum(self, ctrlModeDONum)

Description

Configure extended IO fault reset DO port for laser welding machine

Required Parameters

  • ctrlModeDONum: Extended DO port number for laser welding machine fault reset

Default Parameters

None

Return Value

Error code Success-0 Failure- errcode

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

Prototype

SetLaserWeldingRunningStateExtDiNum(self, diNum)

Description

Configure extended IO running status (laser on status) DI port for laser welding machine

Required Parameters

  • diNum: Extended DI port number for laser welding machine running status (laser on status)

Default Parameters

None

Return Value

Error code Success-0 Failure- errcode

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

Prototype

SetLaserWeldingErrStateExtDiNum(self, diNum)

Description

Configure extended IO fault status DI port for laser welding machine

Required Parameters

  • diNum: Extended DI port number for laser welding machine fault status

Default Parameters

None

Return Value

Error code Success-0 Failure- errcode

14.90. Laser Welding Code Example

 1from time import sleep
 2from fairino import Robot
 3import time
 4
 5# Establish connection with the robot controller, return a robot object upon successful connection
 6robot = Robot.RPC('192.168.58.2')
 7
 8def testLsaerWeld():
 9    robot.ExtDevLoadUDPDriver()
10    time.sleep(1)
11
12    robot.SetLaserWeldingParam(num = 3, scanSpeed = 2000, scanWidth = 3, peakPower = 1500, dutyCycle = 100, Freq = 1000, io_type=1)
13    robot.SetLaserWeldingStartExtDoNum(ctrlModeDONum=1)
14
15    robot.Mode(0)
16    time.sleep(1)
17
18    desc_pos1 = [-303.721, -206.960, 297.105, 152.209, 19.857, 109.166]
19    desc_pos2 = [-301.575, -254.888, 284.786, 155.919, 26.946, 111.629]
20    desc_safe = [-344.386, -280.830, 435.073, 173.835, 15.333, 124.931]
21    jointPos1 = [9.827, -99.740, 120.088, -78.900, -77.241, -17.904]
22    jointPos2 = [15.251, -96.456, 120.138, -84.664, -68.542, -17.843]
23    jointSafe = [19.142, -98.078, 101.493, -83.078, -77.070, -17.794]
24
25    error = robot.MoveL(desc_pos=desc_pos1,joint_pos=jointPos1, tool=1, user=0, vel=100, ovl= 2, acc=100)
26    print("MoveL return:", error)
27    robot.SetLaserWeldingStartEnd(1, io_type=1, max_waittime=10000)
28
29    error = robot.MoveL(desc_pos=desc_pos2, joint_pos=jointPos2, tool=1, user=0, vel=100, ovl= 2, acc=100)
30    print("MoveL return:", error)
31    robot.SetLaserWeldingStartEnd(0, io_type=1, max_waittime=10000)
32
33    error = robot.MoveL(desc_pos=desc_safe, joint_pos=jointSafe, tool=1, user=0, vel=100, ovl= 2, acc=100)
34    print("MoveL return:", error)
35
36    robot.Mode(1)
37    time.sleep(1)
38
39    # Close connection
40    robot.CloseRPC()
41    time.sleep(1)
42
43# Call test function
44testLsaerWeld()

14.91. Set Weave End Return to Cycle Zero Point

Prototype

SetWeaveBackCenterConfig(self, flag)

Description

Set whether to return to the cycle zero point at the end of weaving

Required Parameters

  • flag: Whether to return to cycle zero point at weave end; 0-do not return; 1-return to cycle zero point

Default Parameters

None

Return Value

Error code, 0-success; non-zero-error

14.92. Get Weave End Return to Cycle Zero Point Parameters

Prototype

GetWeaveBackCenterConfig(self)

Description

Get the weave end return to cycle zero point parameters

Required Parameters

  • flag: Whether to return to cycle zero point at weave end; 0-do not return; 1-return to cycle zero point

Default Parameters

None

Return Value

Error code, 0-success; non-zero-error

14.93. Weave End Return to Cycle Zero Point Code Example

 1from fairino import Robot
 2import time
 3
 4def main():
 5    robot = Robot.RPC('192.168.58.2')
 6    time.sleep(0.5)
 7
 8    def callback(src_type, count, cmd_id, data_len, content):
 9        print(" cmd_id={} count={} data_len={} content={}".format(cmd_id, count, data_len, content))
10        return 0
11
12    robot.SetUDPCmdRpyCallback(callback)
13
14    j1 = [9.000, -66.067, 67.706, -103.217, -90.151, 100.669]
15    j2 = [-4.660, -107.973, 103.734, -76.214, -89.999, 90.886]
16    j3 = [-36.762, -77.380, 91.364, -127.159, -90.024, 54.833]
17    j4 = [-62.875, -89.460, 86.437, -77.030, -90.012, 31.539]
18
19
20    desc_pos1 = [-654.129, -235.344, 246.543, 6.010, -11.535, -176.787]
21    desc_pos2 = [-273.710, -100.871, 280.935, 5.692, 9.522, 179.512]
22    desc_pos3 = [-566.093, 311.278, 215.008, -10.453, -17.486, -174.209]
23    desc_pos4 = [-246.558, 328.240, 292.173, 13.912, 4.437, -179.067]
24
25    offset_pos = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
26    epos = [0.0, 0.0, 0.0, 0.0]
27
28    tool = 2
29    user = 0
30    vel = 100.0
31    acc = 100.0
32    ovl = 20.0
33    oacc = 100.0
34    blendT = 0.0
35    blendR = 0.0
36    flag = 0
37    search = 0
38    blendMode = 0
39    velAccMode = 0
40
41    robot.SetSpeed(1)
42
43    robot.WeaveEnd(0)
44
45    rtn = robot.SetWeaveBackCenterConfig(1)
46    print(f"SetWeaveBackCenterConfig rtn is {rtn}")
47
48    rtn, weaveBackConfig = robot.GetWeaveBackCenterConfig()
49    print(f"GetWeavebackCenterConfig {weaveBackConfig}")
50
51    rtn = robot.MoveJ(joint_pos=j1, desc_pos=desc_pos1, tool=tool, user=user,
52                    vel=vel, acc=acc, ovl=100.0, exaxis_pos=epos,
53                    blendT=blendT, offset_flag=flag, offset_pos=offset_pos)
54    print(f"MoveJ rtn is {rtn}")
55
56    robot.WeaveStart(0)
57
58    robot.NewSplineStart(0, 6000)
59
60    rtn = robot.NewSplinePoint(joint_pos=j1, desc_pos=desc_pos1, tool=tool, user=user,lastFlag=0,
61                            vel=vel, acc=acc, ovl=ovl, blendR=-1, config=0)
62    print(f"NewSplinePoint 1 rtn is {rtn}")
63
64    rtn = robot.NewSplinePoint(joint_pos=j2, desc_pos=desc_pos2, tool=tool, user=user,lastFlag=0,
65                            vel=vel, acc=acc, ovl=ovl, blendR=-1, config=0)
66    print(f"NewSplinePoint 2 rtn is {rtn}")
67
68    rtn = robot.NewSplinePoint(joint_pos=j3, desc_pos=desc_pos3, tool=tool, user=user,lastFlag=0,
69                            vel=vel, acc=acc, ovl=ovl, blendR=-1, config=0)
70    print(f"NewSplinePoint 3 rtn is {rtn}")
71
72    rtn = robot.NewSplinePoint(joint_pos=j4, desc_pos=desc_pos4, tool=tool, user=user,lastFlag=1,
73                            vel=vel, acc=acc, ovl=ovl, blendR=-1, config=1)
74    print(f"NewSplinePoint 4 rtn is {rtn}")
75
76    robot.NewSplineEnd()
77
78    robot.CloseRPC()
79
80
81if __name__ == "__main__":
82    main()

14.94. Pendulum Weaving Parameter Setting Code Example

 1from fairino import Robot
 2import time
 3
 4def main():
 5    # Establish connection with the robot controller
 6    robot = Robot.RPC('192.168.58.2')
 7    time.sleep(0.5)  # Wait for connection and data reception
 8
 9    print("========== Weave with Swing Test ==========")
10
11    # Joint positions
12    j1 = [-72.561, -38.933, 92.047, -143.101, -90.000, 17.439]
13    j2 = [-100.211, -44.358, 105.565, -151.192, -90.007, -10.211]
14
15    # Cartesian poses
16    desc_pos1 = [-300.008, 599.999, -199.999, -0.013, -0.004, 0.000]
17    desc_pos2 = [-0.004, 599.977, -200.038, -0.017, -0.004, 0.000]
18
19    offset_pos = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
20    epos = [0.0, 0.0, 0.0, 0.0]
21
22    tool = 1
23    user = 0
24    vel = 100.0
25    acc = 100.0
26    ovl = 100.0
27    oacc = 100.0
28    blendR = -1.0
29    flag = 0
30    search = 0
31    blendMode = 0
32    velAccMode = 0
33
34    # Set speed to 5%
35    robot.SetSpeed(5)
36
37    # Set weave parameters
38    rtn = robot.WeaveSetPara(0, 10, 1.000000, 0, 2.000000, 0.000000, 0.000000, 0, 50, 80, 0, 1, 0.000000, 0.000000, 20, 15)
39    print(f"WeaveSetPara rtn is: {rtn}")
40
41    # Move to start point
42    rtn = robot.MoveJ(joint_pos=j1, desc_pos=desc_pos1, tool=tool, user=user,
43                    vel=vel, acc=acc, ovl=ovl, exaxis_pos=epos,
44                    blendT=-1.0, offset_flag=flag, offset_pos=offset_pos)
45    print(f"movej errcode:{rtn}")
46
47    # Start weaving
48    robot.WeaveStart(0)
49
50    # MoveL with weaving
51    rtn = robot.MoveL(desc_pos=desc_pos2, tool=tool, user=user, joint_pos=j2,
52                    vel=vel, acc=acc, ovl=ovl, blendR=blendR, blendMode=blendMode,
53                    exaxis_pos=epos, search=search, offset_flag=flag, offset_pos=offset_pos,
54                    oacc=oacc, config=-1, velAccParamMode=velAccMode)
55    print(f"movel errcode:{rtn}")
56
57    # End weaving
58    robot.WeaveEnd(0)
59
60    time.sleep(1)
61
62    # Close connection
63    robot.CloseRPC()
64    time.sleep(1)
65
66if __name__ == "__main__":
67    main()

14.95. Set Motion Real-Time Offset Code Example

 1from fairino import Robot
 2import time
 3import threading
 4import sys
 5
 6def cart_offset_pos(robot):
 7    """Background thread: read user input and set cartesian offset in real time"""
 8    while True:
 9        try:
10            # Print prompt on a new line to avoid mixing with motion logs
11            sys.stdout.write("\nPlease input offset y value: ")
12            sys.stdout.flush()
13            input_val = input()
14            input_val = float(input_val)
15            # Build offset pose with only y-axis offset
16            offset_pos = [0.0, input_val, 0.0, 0.0, 0.0, 0.0]
17            rtn = robot.SetCartOffsetRT(2, offset_pos)
18            print(f"\nSetCartOffsetRT(2, y={input_val}) rtn is {rtn}")
19        except ValueError:
20            print("\nInvalid number!")
21
22
23def main():
24    # Establish connection with the robot controller
25    robot = Robot.RPC('192.168.58.2')
26    time.sleep(0.5)  # Wait for connection and data reception
27
28    # Start background thread for offset input
29    th = threading.Thread(target=cart_offset_pos, args=(robot,))
30    th.daemon = True
31    th.start()
32
33    # Define motion points
34    j1 = [-72.561, -38.933, 92.047, -143.101, -90.000, 17.439]
35    j2 = [-100.211, -44.358, 105.565, -151.192, -90.007, -10.211]
36    d1 = [-300.008, 599.999, -199.999, -0.013, -0.004, 0.000]
37    d2 = [-0.004, 599.977, -200.038, -0.017, -0.004, 0.000]
38
39    ex = [0.0, 0.0, 0.0, 0.0]
40    zeroOff = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
41
42    # Infinite loop: MoveL back and forth between two points
43    while True:
44        rtn = robot.MoveL(desc_pos=d1, tool=1, user=0, joint_pos=j1,
45                        vel=100, acc=100, ovl=100, blendR=-1, blendMode=0,
46                        exaxis_pos=ex, search=0, offset_flag=0, offset_pos=zeroOff,
47                        oacc=100, config=0, velAccParamMode=0, overSpeedStrategy=0, speedPercent=10)
48        print(f"\nMoveL j1->d1 rtn: {rtn}")
49
50        rtn = robot.MoveL(desc_pos=d2, tool=1, user=0, joint_pos=j2,
51                        vel=100, acc=100, ovl=100, blendR=-1, blendMode=0,
52                        exaxis_pos=ex, search=0, offset_flag=0, offset_pos=zeroOff,
53                        oacc=100, config=0, velAccParamMode=0, overSpeedStrategy=0, speedPercent=10)
54        print(f"\nMoveL j2->d2 rtn: {rtn}")
55
56    # Close connection (never reached due to infinite loop)
57    robot.CloseRPC()
58
59
60if __name__ == "__main__":
61    main()

14.96. Set Welding Type

Prototype

SetWeldType(self, type)

Description

Set welding type

Required Parameters

  • type: 0-arc welding; 1-laser welding

Default Parameters

None

Return Value

Error code Success-0 Failure-errcode

14.97. Set Welder Manufacturer

Prototype

SetWeldCompany(self, value)

Description

Set welder manufacturer

Required Parameters

  • value: 101-Megmeet; 102-OTC; 103-Panasonic; 104-Miller; 1001-everlast laser welding

Default Parameters

None

Return Value

Error code Success-0 Failure-errcode

14.98. Set Wire Feed Speed

Prototype

SetWeldWFS(self, io_type, status)

Description

Set wire feed speed

Required Parameters

  • io_type: 0-IO; 1-UDP; 2-modbusTCP

  • status: Wire feed speed value

Default Parameters

None

Return Value

Error code Success-0 Failure-errcode

14.99. Set Welding Arc Length

Prototype

SetWeldArcLen(self, io_type, status)

Description

Set welding arc length

Required Parameters

  • io_type: 0-IO; 1-UDP; 2-modbusTCP

  • status: Arc length

Default Parameters

None

Return Value

Error code Success-0 Failure-errcode

14.100. Set Arc Control Value

Prototype

SetWeldArcCtrl(self, io_type, status)

Description

Set arc control value

Required Parameters

  • io_type: 0-IO; 1-UDP; 2-modbusTCP

  • status: Arc control value

Default Parameters

None

Return Value

Error code Success-0 Failure-errcode

14.101. Set Program Slot Number

Prototype

SetWeldSlot(self, io_type, status)

Description

Set program slot number

Required Parameters

  • io_type: 0-IO; 1-UDP; 2-modbusTCP

  • status: Program slot number value

Default Parameters

None

Return Value

Error code Success-0 Failure-errcode

14.102. Set “Welding Prohibition”

Prototype

SetWeldDisable(self, io_type, status)

Description

Set the welding prohibition DO

Required Parameters

  • io_type: 0-IO; 1-UDP; 2-modbusTCP

  • status: 0-turn off welding prohibition; 1-turn on welding prohibition

Default Parameters

None

Return Value

Error code Success-0 Failure-errcode

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

Prototype

SetweldWFSUdpNum(self, udpNum)

Description

Set the wire feed speed UDP custom control word sequence number

Required Parameters

  • udpNum: UDP custom control word sequence number, default 44

Default Parameters

None

Return Value

Error code Success-0 Failure-errcode

14.104. Set Arc Length UDP Custom Control Word Sequence Number

Prototype

SetWeldArcLenUdpNum(self, udpNum)

Description

Set the arc length UDP custom control word sequence number

Required Parameters

  • udpNum: UDP custom control word sequence number, default 45

Default Parameters

None

Return Value

Error code Success-0 Failure-errcode

14.105. Set Arc Control UDP Custom Control Word Sequence Number

Prototype

SetWeldArcCtrlUdpNum(self, udpNum)

Description

Set the arc control UDP custom control word sequence number

Required Parameters

  • udpNum: UDP custom control word sequence number, default 46

Default Parameters

None

Return Value

Error code Success-0 Failure-errcode

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

Prototype

SetWeldSlotUdpNum(self, udpNum)

Description

Set the program slot number UDP custom control word sequence number

Required Parameters

  • udpNum: UDP custom control word sequence number, default 47

Default Parameters

None

Return Value

Error code Success-0 Failure-errcode

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

Prototype

SetWeldDisableExtDoNum(self, DONum)

Description

Set the welding prohibition UDP extended DO sequence number

Required Parameters

  • DONum: UDP extended DO sequence number, default 18

Default Parameters

None

Return Value

Error code Success-0 Failure-errcode

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

Prototype

SetWeldSynStateExtDINum(self, DINum)

Description

Set the synergic status UDP extended DI sequence number

Required Parameters

  • DINum: UDP extended DI sequence number, default -1 not enabled

Default Parameters

None

Return Value

Error code Success-0 Failure-errcode

14.109. Get “Synergic Status”

Prototype

GetWeldSynState(self, io_type)

Description

Get the synergic status

Required Parameters

  • io_type: 0-IO; 1-UDP; 2-modbusTCP

  • synState: 0-non-synergic; 1-synergic

Default Parameters

None

Return Value

Error code Success-0 Failure-errcode

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

Prototype

SetWeldWfsFeedbackUdpNum(self, udpNum)

Description

Set the wire feed speed UDP custom status word sequence number

Required Parameters

  • udpNum: UDP custom status word sequence number, default 47

Default Parameters

None

Return Value

Error code Success-0 Failure-errcode

14.111. Get Current “Wire Feed Speed” Value

Prototype

GetWeldWfsFeedback(self, io_type)

Description

Get the current wire feed speed value

Required Parameters

  • io_type: 0-IO; 1-UDP; 2-modbusTCP

  • weldWfsFdbk: Current wire feed speed

Default Parameters

None

Return Value

Error code Success-0 Failure-errcode

14.112. Welder Setting & Feedback Printing Code Example

  1from fairino import Robot
  2import time
  3
  4from fairino.Robot import AddRobotRealtimeState, RobotState
  5
  6
  7def test_weld_set_param(robot):
  8    """Weld machine set parameter test (observe PLC D242~D249, D257.2)"""
  9    print("\n========== Weld Set Param Test ==========")
 10
 11    j1 = [-143.902, -59.161, 101.339, -130.844, -90.116, -56.026]
 12    j2 = [-112.507, -77.118, 129.920, -141.195, -89.783, -24.639]
 13    d1 = [436.675, 437.436, 148.030, 178.907, 0.265, 1.550]
 14    d2 = [75.368, 437.428, 148.031, 178.907, 0.265, 1.549]
 15    ex = [0.0, 0.0, 0.0, 0.0]
 16    zeroOff = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
 17
 18    # 1) Select arc welding + Miller welder; io_type=1 means UDP link
 19    rtn = robot.SetWeldType(0)  # 0-arc welding, 1-laser welding
 20    print(f"SetWeldType(arc): {rtn}")
 21    rtn = robot.SetWeldCompany(104)  # 104-Miller
 22    print(f"SetWeldCompany(Miller): {rtn}")
 23    rtn = robot.ExtDevLoadUDPDriver()  # Establish robot UDP peripheral communication
 24    print(f"ExtDevLoadUDPDriver: {rtn}")
 25    time.sleep(2)
 26
 27    rtn = robot.MoveL(desc_pos=d1, tool=0, user=0, joint_pos=j1,
 28                    vel=100, acc=100, ovl=100, blendR=-1, blendMode=0,
 29                    exaxis_pos=ex, search=0, offset_flag=0, offset_pos=zeroOff,
 30                    oacc=100, config=0, velAccParamMode=0, overSpeedStrategy=0, speedPercent=10)
 31    print(f"moveL errcode:{rtn}")
 32
 33    # 2) Default control words 44~47 -> D242~D245
 34    rtn = robot.SetweldWFSUdpNum(44)
 35    print(f"SetweldWFSUdpNum(44): {rtn}")
 36    rtn = robot.SetWeldArcLenUdpNum(45)
 37    print(f"SetWeldArcLenUdpNum(45): {rtn}")
 38    rtn = robot.SetWeldArcCtrlUdpNum(46)
 39    print(f"SetWeldArcCtrlUdpNum(46): {rtn}")
 40    rtn = robot.SetWeldSlotUdpNum(47)
 41    print(f"SetWeldSlotUdpNum(47): {rtn}")
 42    time.sleep(3)
 43
 44    rtn = robot.SetWeldWFS(1, 300.0)  # Wire feed speed 300
 45    print(f"SetWeldWFS(300): {rtn}")
 46    rtn = robot.SetWeldArcLen(1, 0)  # Arc length 0 (500 is middle value)
 47    print(f"SetWeldArcLen(0): {rtn}")
 48    rtn = robot.SetWeldArcCtrl(1, 25)  # Arc control 25 (default)
 49    print(f"SetWeldArcCtrl(25): {rtn}")
 50    rtn = robot.SetWeldSlot(1, 1)  # Program slot 1
 51    print(f"SetWeldSlot(1): {rtn}")
 52    print(">>> Please confirm PLC D242~D245 updated to 300/0/25/1")
 53    time.sleep(3)
 54
 55    rtn = robot.MoveL(desc_pos=d2, tool=0, user=0, joint_pos=j2,
 56                    vel=100, acc=100, ovl=100, blendR=-1, blendMode=0,
 57                    exaxis_pos=ex, search=0, offset_flag=0, offset_pos=zeroOff,
 58                    oacc=100, config=0, velAccParamMode=0, overSpeedStrategy=0, speedPercent=10)
 59    print(f"moveL errcode:{rtn}")
 60
 61    # 3) Custom control words 48~51 -> D246~D249
 62    rtn = robot.SetweldWFSUdpNum(48)
 63    print(f"SetweldWFSUdpNum(48): {rtn}")
 64    rtn = robot.SetWeldArcLenUdpNum(49)
 65    print(f"SetWeldArcLenUdpNum(49): {rtn}")
 66    rtn = robot.SetWeldArcCtrlUdpNum(50)
 67    print(f"SetWeldArcCtrlUdpNum(50): {rtn}")
 68    rtn = robot.SetWeldSlotUdpNum(51)
 69    print(f"SetWeldSlotUdpNum(51): {rtn}")
 70    time.sleep(3)
 71
 72    # 4) Write same control words (48~51) for 10 cycles, each value +1 per round
 73    for i in range(1, 11):
 74        wfs = 350.0 + i
 75        arcLen = 10 + i
 76        arcCtrl = 30 + i
 77        slot = 1 + (i - 1) % 8  # Slot range 1~8, wrap around
 78
 79        rtn = robot.SetWeldWFS(1, wfs)
 80        rtn = robot.SetWeldArcLen(1, arcLen)
 81        rtn = robot.SetWeldArcCtrl(1, arcCtrl)
 82        rtn = robot.SetWeldSlot(1, slot)
 83
 84        print(f">>> [{i}/10] D246~D249 should update to {wfs}/{arcLen}/{arcCtrl}/{slot}")
 85        time.sleep(0.5)
 86
 87    rtn = robot.MoveL(desc_pos=d1, tool=0, user=0, joint_pos=j1,
 88                    vel=100, acc=100, ovl=100, blendR=-1, blendMode=0,
 89                    exaxis_pos=ex, search=0, offset_flag=0, offset_pos=zeroOff,
 90                    oacc=100, config=0, velAccParamMode=0, overSpeedStrategy=0, speedPercent=10)
 91    print(f"moveL errcode:{rtn}")
 92
 93    # 5) Disable welding: extended DO default 18 -> D257.2
 94    rtn = robot.SetWeldDisableExtDoNum(18)
 95    print(f"SetWeldDisableExtDoNum(18): {rtn}")
 96    rtn = robot.SetWeldDisable(1, 1)
 97    print(f"SetWeldDisable(1): {rtn}")
 98    print(">>> Please confirm PLC D257.2 is set to 1, auto restore to 0 after 5 seconds")
 99    time.sleep(1.5)
100    rtn = robot.SetWeldDisable(1, 0)
101    print(f"SetWeldDisable(0): {rtn}")
102
103    rtn = robot.MoveL(desc_pos=d2, tool=0, user=0, joint_pos=j2,
104                    vel=100, acc=100, ovl=100, blendR=-1, blendMode=0,
105                    exaxis_pos=ex, search=0, offset_flag=0, offset_pos=zeroOff,
106                    oacc=100, config=0, velAccParamMode=0, overSpeedStrategy=0, speedPercent=10)
107    print(f"moveL errcode:{rtn}")
108
109
110def test_weld_feedback(robot):
111    """Weld machine feedback print test"""
112    print("\n========== Weld Feedback Test ==========")
113
114    rtn = robot.SetWeldType(0)  # 0-arc welding, 1-laser welding
115    print(f"SetWeldType(arc): {rtn}")
116    rtn = robot.SetWeldCompany(104)  # 104-Miller
117    print(f"SetWeldCompany(Miller): {rtn}")
118    rtn = robot.ExtDevLoadUDPDriver()  # Establish robot UDP peripheral communication
119    print(f"ExtDevLoadUDPDriver: {rtn}")
120    rtn = robot.SetWeldSynStateExtDINum(0)  # Set sync state DI
121    print(f"SetWeldSynStateExtDINum: {rtn}")
122    rtn = robot.SetWeldWfsFeedbackUdpNum(47)  # Set wire feed speed feedback UDP status word number
123    print(f"SetWeldWfsFeedbackUdpNum(47): {rtn}")
124    time.sleep(3)
125
126    count = 1800
127    for i in range(count):
128        # Get robot real-time state (voltage/current)
129        stateRtn, pkg = robot.GetRobotRealTimeState()
130
131        # Get wire feed speed feedback (io_type=1 UDP)
132        wfsRtn, wfs = robot.GetWeldWfsFeedback(1)
133
134        # Get sync state (io_type=1 UDP)
135        synRtn, synState = robot.GetWeldSynState(1)
136        # Get robot error code
137        errRtn, errorcode = robot.GetRobotErrorCode()
138
139        print(f"[{i}] Voltage={pkg.weldVoltage:.2f}V Current={pkg.weldCurrent:.2f}A "
140            f"WFS={wfs:.2f}(rtn={wfsRtn}) Sync={synState}(rtn={synRtn}) "
141            f"MainErr={errorcode[0]} SubErr={errorcode[1]}(rtn={errRtn}) stateRtn={stateRtn}")
142        print(f"pkg.jt_cur_pos[5]: {pkg.jt_cur_pos[5]}")
143        time.sleep(0.5)
144
145
146def main():
147    # Establish connection with the robot controller
148    rtn = AddRobotRealtimeState([
149        RobotState.WeldVoltage,
150        RobotState.WeldCurrent,
151    ])
152
153    robot = Robot.RPC('192.168.58.2')
154    time.sleep(0.5)  # Wait for connection and data reception
155
156    # Run the desired test (uncomment one at a time)
157    # test_weld_set_param(robot)
158    test_weld_feedback(robot)
159    # Close connection
160    robot.CloseRPC()
161
162
163if __name__ == "__main__":
164    main()