11. Peripherals
11.1. Configuration of jaws
Prototype |
|
|---|---|
Description |
Configuration jaws |
Required Parameters |
|
Default parameters |
|
Return Value |
Error Code Success-0 Failure- errcode |
11.2. Get Jaw Configuration
Prototype |
|
|---|---|
Description |
Get Jaw Configuration |
Mandatory parameters |
NULL |
Default parameters |
NULL |
Return Value |
|
11.3. Activate jaws
Prototype |
|
|---|---|
Description |
Activate the jaws. |
Mandatory parameter |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
11.4. Control jaws
Prototype |
|
|---|---|
Description |
Control jaws |
Mandatory parameter |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
11.5. Getting the jaw movement status
Prototype |
|
|---|---|
Description |
Get the state of the jaw motion |
Mandatory parameters |
NULL |
Default parameters |
NULL |
Return Value |
|
11.6. Obtain the activated status of the gripper
New in version python: SDK-v2.1.2
Prototype |
|
|---|---|
Description |
Obtain the activated status of the gripper |
Mandatory parameter |
NULL |
Default parameters |
NULL |
Return Value |
|
11.7. Obtain the position of the gripper
New in version python: SDK-v2.1.2
Prototype |
|
|---|---|
Description |
Obtain the position of the gripper |
Mandatory parameter |
NULL |
Default parameters |
NULL |
Return Value |
|
11.8. Obtain the gripper speed
New in version python: SDK-v2.1.2
Prototype |
|
|---|---|
Description |
Obtain the gripper speed |
Mandatory parameter |
NULL |
Default parameters |
NULL |
Return Value |
|
11.9. Obtain the gripper current
New in version python: SDK-v2.1.2
Prototype |
|
|---|---|
Description |
Obtain the gripper current |
Mandatory parameter |
NULL |
Default parameters |
NULL |
Return Value |
|
11.10. Obtain the gripper voltage
New in version python: SDK-v2.1.2
Prototype |
|
|---|---|
Description |
Obtain the gripper voltage |
Mandatory parameter |
NULL |
Default parameters |
NULL |
Return Value |
|
11.11. Obtain the temperature of the gripper
New in version python: SDK-v2.1.2
Prototype |
|
|---|---|
Description |
Obtain the temperature of the gripper |
Mandatory parameter |
NULL |
Default parameters |
NULL |
Return Value |
|
11.12. Calculate pre-capture point-visual
Prototype |
|
|---|---|
Description |
Calculate pre-capture point-visual |
Mandatory parameter |
|
Default parameters |
NULL |
Return Value |
|
11.13. Calculate retreat point-visual
Prototype |
|
|---|---|
Description |
Computing Retreat Point-Vision |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
|
11.14. Robot claw operation 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')
4company = 4
5device = 0
6softversion = 0
7bus = 2
8index = 2
9act = 0
10max_time = 30000
11block = 0
12status = 0
13fault = 0
14active_status = 0
15current_pos = 0
16current = 0
17voltage = 0
18temp = 0
19speed = 0
20robot.SetGripperConfig(company, device, softversion, bus)
21time.sleep(1)
22error,[company, device, softversion, bus] = robot.GetGripperConfig()
23print(f"gripper config:{company},{device},{softversion},{bus}")
24robot.ActGripper(index, act)
25time.sleep(1)
26act = 1
27robot.ActGripper(index, act)
28time.sleep(1)
29error = robot.MoveGripper(index, 90, 50, 50, max_time, block, 0, 0, 0, 0)
30print(f"MoveGripper retval is:{error}")
31time.sleep(1)
32error = robot.MoveGripper(index, 30, 50, 0, max_time, block, 0, 0, 0, 0)
33print(f"MoveGripper retval is:{error}")
34error, [fault, status] = robot.GetGripperMotionDone()
35print(f"motion status:{fault},{status}")
36error, [fault, active_status] = robot.GetGripperActivateStatus()
37print(f"gripper active fault is:{fault},status is:{active_status}")
38error, [fault, current_pos] = robot.GetGripperCurPosition()
39print(f"fault is:{fault},current position is:{current_pos}")
40error, [fault, current] = robot.GetGripperCurCurrent()
41print(f"fault is:{fault},current current is:{current}")
42error, [fault, voltage] = robot.GetGripperVoltage()
43print(f"fault is:{fault},current voltage is:{voltage}")
44error, [fault, temp] = robot.GetGripperTemp()
45print(f"fault is:{fault},current temperature is:{temp}")
46error, [fault, speed] = robot.GetGripperCurSpeed()
47print(f"fault is:{fault},current speed is:{speed}")
48retval = 0
49prepick_pose = [0.0]*6
50postpick_pose = [0.0]*6
51p1Desc = [-419.524, -13.000, 351.569, -178.118, 0.314, 3.833]
52p2Desc = [-321.222, 185.189, 335.520, -179.030, -1.284, -29.869]
53retval, prepick_pose = robot.ComputePrePick(p1Desc, 10, 0)
54print(f"ComputePrePick retval is:{retval}")
55print(f"xyz is:{prepick_pose[0]},{prepick_pose[1]},{prepick_pose[2]};rpy is:{prepick_pose[3]},{prepick_pose[4]},{prepick_pose[5]}")
56retval, postpick_pose = robot.ComputePostPick(p2Desc, -10, 0)
57print(f"ComputePostPick retval is:{retval}")
58print(f"xyz is:{postpick_pose[0]},{postpick_pose[1]},{postpick_pose[2]};rpy is:{postpick_pose[3]},{postpick_pose[4]},{postpick_pose[5]}")
59robot.CloseRPC()
11.15. Get the number of rotation turns of the rotary gripper
New in version python: SDK-v2.0.7
Prototype |
|
|---|---|
Description |
Get the number of rotation turns of the rotary gripper |
Mandatory parameter |
NULL |
Default parameters |
NULL |
Return Value |
|
11.16. Gets the percentage of rotation speed of the rotating gripper
New in version python: SDK-v2.0.7
Prototype |
|
|---|---|
Description |
Gets the percentage of rotation speed of the rotating gripper |
Mandatory parameter |
NULL |
Default parameters |
NULL |
Return Value |
|
11.17. Obtains the percentage of rotating torque of the rotating gripper
New in version python: SDK-v2.0.7
Prototype |
|
|---|---|
Description |
Obtains the percentage of rotating torque of the rotating gripper |
Mandatory parameter |
NULL |
Default parameters |
NULL |
Return Value |
|
11.18. Get the rotary gripper status 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')
4fault = 0
5rotNum = 0.0
6rotSpeed = 0
7rotTorque = 0
8error,fault, rotNum = robot.GetGripperRotNum()
9error,fault, rotSpeed = robot.GetGripperRotSpeed()
10error,fault, rotTorque = robot.GetGripperRotTorque()
11print(f"gripper rot num:{rotNum},gripper rotSpeed:{rotSpeed},gripper rotTorque:{rotTorque}")
12robot.CloseRPC()
11.19. Drive belt start and stop
Prototype |
|
|---|---|
Description |
Drive belt start, stop |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
11.20. Record IO detection points
Prototype |
|
|---|---|
Description |
Record IO detection points |
Mandatory parameters |
NULL |
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
11.21. Record point A
Prototype |
|
|---|---|
Description |
Record point A. |
Mandatory parameters |
NULL |
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
11.22. Recording reference points
Prototype |
|
|---|---|
Description |
Record reference point |
Mandatory parameters |
NULL |
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
11.23. Record point B
Prototype |
|
|---|---|
Description |
Record point B. |
Mandatory parameters |
NULL |
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
11.24. Conveyorized workpiece IO inspection
Prototype |
|
|---|---|
Description |
Conveyorized workpiece IO detection |
Mandatory parameter |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
11.25. Get the current position of the object
Prototype |
|
|---|---|
Description |
Get the current position of the object. |
Mandatory Parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
11.26. Drive belt tracking started
Prototype |
|
|---|---|
Description |
Drive belt tracking started |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
11.27. Belt tracking stop
Prototype |
|
|---|---|
Description |
Drive belt tracking stop |
Mandatory parameters |
NULL |
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
11.28. Drive Belt Parameter Configuration
Prototype |
|
|---|---|
Description |
Configuration of drive belt parameters |
Mandatory parameters |
|
Default parameters |
|
Return Value |
Error Code Success-0 Failure- errcode |
11.29. Belt Grip Point Compensation
Prototype |
|
|---|---|
Description |
Drive belt grip point compensation |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
11.30. linear motion
prototype |
|
|---|---|
Description |
Linear motion |
Mandatory parameters |
|
Default Parameters |
|
Return Value |
Error Code Success-0 Failure- errcode |
11.31. Conveyor communication input detection
New in version python: SDK-v2.1.1
Prototype |
|
|---|---|
Description |
Conveyor communication input detection |
Mandatory parameters |
|
Default Parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
11.32. Conveyor communication input detection triggered
New in version python: SDK-v2.1.1
Prototype |
|
|---|---|
Description |
Conveyor communication input detection triggered |
Mandatory parameters |
NULL |
Default Parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
11.33. Robot conveyor operation code example
1from fairino import Robot
2import time
3import threading
4# Establish a connection with the robot controller and return a robot object if the connection is successful
5robot = Robot.RPC('192.168.58.2')
6retval = robot.ConveyorStartEnd(1)
7print(f"ConveyorStartEnd retval is:{retval}")
8retval = robot.ConveyorPointIORecord()
9print(f"ConveyorPointIORecord retval is:{retval}")
10retval = robot.ConveyorPointARecord()
11print(f"ConveyorPointARecord retval is:{retval}")
12retval = robot.ConveyorRefPointRecord()
13print(f"ConveyorRefPointRecord retval is:{retval}")
14retval = robot.ConveyorPointBRecord()
15print(f"ConveyorPointBRecord retval is:{retval}")
16retval = robot.ConveyorStartEnd(0)
17print(f"ConveyorStartEnd retval is:{retval}")
18param = [1.0, 10000.0, 200.0, 0.0, 0.0, 20.0]
19retval = robot.ConveyorSetParam(param,0)
20print(f"ConveyorSetParam retval is:{retval}")
21cmp = [0.0, 0.0, 0.0]
22retval = robot.ConveyorCatchPointComp(cmp)
23print(f"ConveyorCatchPointComp retval is:{retval}")
24index = 1
25max_time = 30000
26block = 0
27retval = 0
28p1Desc = [-419.524, -13.000, 351.569, -178.118, 0.314, 3.833]
29p2Desc = [-321.222, 185.189, 335.520, -179.030, -1.284, -29.869]
30retval = robot.MoveCart(p1Desc, 1, 0, 100.0)
31print(f"MoveCart retval is:{retval}")
32retval = robot.WaitMs(1)
33print(f"WaitMs retval is:{retval}")
34retval = robot.ConveyorIODetect(10000)
35print(f"ConveyorIODetect retval is:{retval}")
36retval = robot.ConveyorGetTrackData(1)
37print(f"ConveyorGetTrackData retval is:{retval}")
38retval = robot.ConveyorTrackStart(1)
39print(f"ConveyorTrackStart retval is:{retval}")
40retval = robot.ConveyorTrackMoveL("cvrCatchPoint", 1, 0, 100)
41print(f"TrackMoveL retval is:{retval}")
42retval = robot.MoveGripper(index, 51, 40, 30, max_time, block, 0, 0, 0, 0)
43print(f"MoveGripper retval is:{retval}")
44retval = robot.ConveyorTrackMoveL("cvrRaisePoint", 1, 0, 100)
45print(f"TrackMoveL retval is:{retval}")
46retval = robot.ConveyorTrackEnd()
47print(f"ConveyorTrackEnd retval is:{retval}")
48robot.MoveCart(p2Desc, 1, 0, 100.0, 100.0)
49retval = robot.MoveGripper(index, 100, 40, 10, max_time, block, 0, 0, 0, 0)
50print(f"MoveGripper retval is:{retval}")
51robot.CloseRPC()
11.34. End Sensor Configuration
New in version python: SDK-v2.0.5
Prototype |
|
|---|---|
Description |
End Sensor Configuration |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
11.35. Get End Sensor Configuration
New in version python: SDK-v2.0.5
Prototype |
|
|---|---|
Description |
Get end sensor configuration |
Mandatory parameters |
NULL |
Default parameters |
NULL |
Return Value |
|
11.36. End sensor activation
New in version python: SDK-v2.0.5
Prototype |
|
|---|---|
Description |
End sensor activation |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
|
11.37. End Sensor Register Write
New in version python: SDK-v2.0.5
Prototype |
|
|---|---|
Description |
End Sensor Register Write |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
11.38. End sensor code example
1from fairino import Robot
2import time
3import threading
4# Establish a connection with the robot controller and return a robot object if the connection is successful
5robot = Robot.RPC('192.168.58.2')
6robot.AxleSensorConfig(18, 0, 0, 1)
7error, company, type = robot.AxleSensorConfigGet()
8print(f"company is:{company},type is:{type}")
9rtn = robot.AxleSensorActivate(1)
10print(f"AxleSensorActivate rtn is:{rtn}")
11time.sleep(1)
12rtn = robot.AxleSensorRegWrite(1, 4, 6, 1, 0, 0, 0)
13print(f"AxleSensorRegWrite rtn is:{rtn}")
14robot.CloseRPC()
11.39. Obtaining Robot Peripheral Protocols
New in version python: SDK-v2.0.3
Prototype |
|
|---|---|
Description |
Get robot peripheral protocol |
Mandatory parameters |
NULL |
Default parameters |
NULL |
Return Value |
|
11.40. Setting up robot peripheral protocols
New in version python: SDK-v2.0.3
Prototype |
|
|---|---|
Description |
Setting the robot peripheral protocol |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
11.41. Example of setup robot peripheral protocol 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')
4protocol = 4096
5rtn = robot.SetExDevProtocol(protocol)
6print(f"SetExDevProtocol rtn:{rtn}")
7rtn, protocol = robot.GetExDevProtocol()
8print(f"GetExDevProtocol rtn:{rtn},protocol is:{protocol}")
9robot.CloseRPC()
11.42. Getting end communication parameters
New in version python: SDK-v2.0.5
Prototype |
|
|---|---|
Description |
Get end communication parameters |
Mandatory parameters |
NULL |
Default parameters |
NULL |
Return Value |
|
11.43. Setting the end communication parameters
New in version python: SDK-v2.0.5
Prototype |
|
|---|---|
description |
set end communication parameters |
Required Parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
11.44. Setting the end file transfer type
New in version python: SDK-v2.0.5
Prototype |
|
|---|---|
Description |
Set the end file transfer type |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
11.45. Setting Enable End LUA Execution
New in version python: SDK-v2.0.5
Prototype |
|
|---|---|
Description |
Set Enable End LUA Enforcement |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
11.46. End LUA file exception error recovery
New in version python: SDK-v2.0.5
Prototype |
|
|---|---|
Description |
End LUA File Exception Error Recovery |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
11.47. Get end LUA execution enable status
New in version python: SDK-v2.0.5
Prototype |
|
|---|---|
description |
Get end LUA execution enable state |
Mandatory parameters |
NULL |
Default parameters |
NULL |
Return Value |
|
11.48. Setting the end LUA end device enable type
New in version python: SDK-v2.0.5
prototype |
|
|---|---|
Description |
Set end LUA end device enable type |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
11.49. Get End LUA End Device Enablement Type
New in version python: SDK-v2.0.5
Prototype |
|
|---|---|
Description |
Get End LUA End Device Enablement Type |
Mandatory parameters |
NULL |
Default parameters |
NULL |
Return Value |
|
11.50. Get the currently configured end device
New in version python: SDK-v2.0.5
Prototype |
|
|---|---|
Description |
Get the currently configured end device |
Mandatory parameters |
NULL |
Default parameters |
NULL |
Return Value |
|
11.51. Setting to enable the jaw movement control function
New in version python: SDK-v2.0.5
Prototype |
|
|---|---|
Description |
Set to enable the jaw motion control function |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
11.52. Getting to Enable Jaw Motion Control
New in version python: SDK-v2.0.5
Prototype |
|
|---|---|
Description |
Get the Enable Jaw Motion Control function |
Mandatory parameter |
|
Default parameters |
NULL |
Return Value |
|
11.53. The Ethercat slave file is written by the robot
New in version python: SDK-v2.0.5
Prototype |
|
|---|---|
Description |
The Ethercat slave file is written by the robot |
Mandatory parameter |
|
Default parameters |
NULL |
Return Value |
errorcode Success-0 Failure- errcode |
11.54. Upload the end Lua open protocol file
New in version python: SDK-v2.0.5
Prototype |
|
|---|---|
Description |
Upload the end Lua open protocol file |
Mandatory parameter |
|
Default parameters |
NULL |
Return Value |
errorcode Success-0 Failure- errcode |
11.55. The robot Ethercat enters boot mode from the station
New in version python: SDK-v2.0.5
Prototype |
|
|---|---|
Description |
The robot Ethercat enters boot mode from the station |
Mandatory parameter |
NULL |
Default parameters |
NULL |
Return Value |
errorcode Success-0 Failure- errcode |
11.56. Example of LUA file manipulation code at the end of the robot
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.AxleLuaUpload("D://zUP/AXLE_LUA_End_DaHuan.lua")
5param = [7, 8, 1, 0, 5, 3, 1] # 对应AxleComParam参数
6robot.SetAxleCommunicationParam(7, 8, 1, 0, 5, 3, 1)
7error,getParam0,getParam1,getParam2,getParam3,getParam4,getParam5,getParam6 = robot.GetAxleCommunicationParam()
8print(f"GetAxleCommunicationParam param is:{getParam0} {getParam1} {getParam2} {getParam3} {getParam4} {getParam5} {getParam6}")
9robot.SetAxleLuaEnable(1)
10error,luaEnableStatus = robot.GetAxleLuaEnableStatus()
11robot.SetAxleLuaEnableDeviceType(0, 1, 0)
12error,forceEnable, gripperEnable, ioEnable = robot.GetAxleLuaEnableDeviceType()
13print(f"GetAxleLuaEnableDeviceType param is:{forceEnable} {gripperEnable} {ioEnable}")
14func = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
15robot.SetAxleLuaGripperFunc(1, func)
16error,getFunc = robot.GetAxleLuaGripperFunc(1)
17error,getforceEnable, getgripperEnable, getioEnable = robot.GetAxleLuaEnableDevice()
18print("\ngetforceEnable status:", end=" ")
19for i in range(8):
20 print(f"{getforceEnable[i]},", end="")
21print("\ngetgripperEnable status:", end=" ")
22for i in range(8):
23 print(f"{getgripperEnable[i]},", end="")
24print("\ngetioEnable status:", end=" ")
25for i in range(8):
26 print(f"{getioEnable[i]},", end="")
27print()
28robot.ActGripper(1, 0)
29time.sleep(2)
30robot.ActGripper(1, 1)
31time.sleep(2)
32robot.MoveGripper(1, 90, 10, 100, 50000, 0, 0, 0, 0, 0)
33while True:
34 error,pkg = robot.GetRobotRealTimeState()
35 print(f"gripper pos is:{pkg.gripper_position}")
36 time.sleep(0.1)
37robot.CloseRPC()
11.59. Set the load detection before drag is started
New in version python: SDK-v2.1.6
Prototype |
|
|---|---|
Description |
Set the load detection before drag is started |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
11.60. Laser peripheral open and close function
New in version python: SDK-v2.1.6
Prototype |
|
|---|---|
Description |
Laser peripheral open and close function |
Mandatory parameters |
|
Default parameters |
|
Return Value |
Error Code Success-0 Failure- errcode |
11.61. Laser tracking start-end function
New in version python: SDK-v2.1.6
Prototype |
|
|---|---|
Description |
Laser tracking start-end function |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
11.62. Laser positioning - Fixed direction
New in version python: SDK-v2.1.6
Prototype |
|
|---|---|
Description |
Laser positioning - Fixed direction |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
11.63. Laser positioning - in any direction
New in version python: SDK-v2.1.6
Prototype |
|
|---|---|
Description |
Laser positioning - in any direction |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
11.64. Laser IP configuration
New in version python: SDK-v2.1.6
Prototype |
|
|---|---|
Description |
Laser IP configuration |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
11.65. Configuration of sampling period for laser peripherals
New in version python: SDK-v2.1.6
Prototype |
|
|---|---|
Description |
Configuration of sampling period for laser peripherals |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
11.66. Laser peripheral driver loading
New in version python: SDK-v2.1.6
Prototype |
|
|---|---|
Description |
Laser peripheral driver loading |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
11.67. Laser peripheral driver unloading
New in version python: SDK-v2.1.6
Prototype |
|
|---|---|
Description |
Laser peripheral driver unloading |
Mandatory parameters |
NULL |
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
11.68. Laser weld seam trajectory recording
New in version python: SDK-v2.1.6
Prototype |
|
|---|---|
Description |
Laser weld seam trajectory recording |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
11.69. Laser weld seam trajectory reproduction
New in version python: SDK-v2.1.6
Prototype |
|
|---|---|
Description |
Laser weld seam trajectory reproduction |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
11.70. Laser tracking reproduction
New in version python: SDK-v2.1.6
Prototype |
|
|---|---|
Description |
Laser tracking reproduction |
Mandatory parameters |
NULL |
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
11.71. Laser weld seam trajectory reproduction
New in version python: SDK-v2.1.6
Prototype |
|
|---|---|
Description |
Laser Weld Seam Trajectory Replay |
Required Parameters |
|
Default Parameters |
None |
Return Value |
Error Code. Success - 0, Failure - errcode |
11.72. Movement to the starting point of weld record
New in version python: SDK-v2.1.6
Prototype |
|
|---|---|
Description |
Movement to the starting point of weld record |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
11.73. Movement to the end of the weld record
New in version python: SDK-v2.1.6
Prototype |
|
|---|---|
Description |
Movement to the end of the weld record |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
11.74. Move to the laser sensor to find the site
New in version python: SDK-v2.1.6
Prototype |
|
|---|---|
Description |
Move to the laser sensor to find the site |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
11.75. Obtain the coordinate information of the laser sensor location
New in version python: SDK-v2.1.6
Prototype |
|
|---|---|
Description |
Obtain the coordinate information of the laser sensor location |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
|
11.76. Example of laser peripheral sensor parameter configuration and debugging 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')
4robot.LaserTrackingSensorConfig("192.168.58.20", 5020)
5robot.LaserTrackingSensorSamplePeriod(20)
6robot.LoadPosSensorDriver(101)
7robot.LaserTrackingLaserOnOff(0, 0)
8time.sleep(3)
9robot.LaserTrackingLaserOnOff(1, 0)
10robot.CloseRPC()
11.77. Code example of laser trajectory scanning and trajectory reproduction
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.OpenLuaUpload("D://zUP/CtrlDev_laser_ruiniu-0117.lua")
5time.sleep(2)
6robot.SetCtrlOpenLUAName(0, "CtrlDev_laser_ruiniu-0117.lua")
7robot.UnloadCtrlOpenLUA(0)
8robot.LoadCtrlOpenLUA(0)
9time.sleep(8)
10i = 0
11while i<10:
12 startjointPos = [56.205, -117.951, 141.872, -118.149, -94.217, -122.176]
13 startdescPose = [-97.552, -282.855, 26.675, 174.182, -1.338, -91.707]
14 exaxisPos = [0.0] * 4
15 offdese = [0.0] * 6
16 robot.MoveL(desc_pos=startdescPose,tool= 1,user= 0,vel= 100,acc= 100,ovl= 100,blendR= -1,exaxis_pos= exaxisPos,search= 0,offset_flag= 0, offset_pos= offdese,overSpeedStrategy= 1,speedPercent= 1)
17 robot.LaserSensorRecord1(2, 10)
18 endjointPos = [68.809, -87.100, 121.120, -127.233, -95.038, -109.555]
19 enddescPose = [-103.555, -464.234, 13.076, 174.179, -1.344, -91.709]
20 robot.MoveL(desc_pos=enddescPose,tool= 1,user= 0,vel= 50,acc= 100,ovl= 100,blendR= -1,exaxis_pos= exaxisPos,search= 0,offset_flag= 0, offset_pos= offdese,overSpeedStrategy= 1,speedPercent= 1)
21 robot.LaserSensorRecord1(0, 10)
22 robot.MoveToLaserRecordStart(1, 30)
23 robot.LaserSensorReplay(10, 100)
24 robot.MoveLTR()
25 robot.LaserSensorRecord1(0, 10)
26 i = i+1
27robot.CloseRPC()
11.78. Code examples for laser locating and real-time tracking
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.OpenLuaUpload("D://zUP/CtrlDev_laser_ruiniu-0117.lua")
5time.sleep(2)
6robot.SetCtrlOpenLUAName(0, "CtrlDev_laser_ruiniu-0117.lua")
7robot.UnloadCtrlOpenLUA(0)
8robot.LoadCtrlOpenLUA(0)
9time.sleep(8)
10time.sleep(8)
11i = 0
12while i < 10:
13 startjointPos = [56.205, -117.951, 141.872, -118.149, -94.217, -122.176]
14 startdescPose = [-97.552, -282.855, 26.675, 174.182, -1.338, -91.707]
15 exaxisPos = [0.0] * 4
16 offdese = [0.0] * 6
17 directionPoint = [0.0] * 3
18 robot.MoveL(desc_pos=startdescPose,tool= 1,user= 0,vel= 100,acc= 100,ovl= 100,blendR= -1,exaxis_pos= exaxisPos,search= 0,offset_flag= 0, offset_pos= offdese,overSpeedStrategy= 1,speedPercent= 1)
19 robot.LaserTrackingSearchStart_xyz(3, 100, 300, 1000, 3)
20 robot.LaserTrackingSearchStop()
21 robot.MoveToLaserSeamPos(1, 30, 0, 0, 0, offdese)
22 robot.LaserTrackingTrackOnOff(1, 3)
23 endjointPos = [68.809, -87.100, 121.120, -127.233, -95.038, -109.555]
24 enddescPose = [-103.555, -464.234, 13.076, 174.179, -1.344, -91.709]
25 robot.MoveL(desc_pos=enddescPose,tool= 1,user= 0,vel= 20,acc= 100,ovl= 100,blendR= -1,exaxis_pos= exaxisPos,search= 0,offset_flag= 0, offset_pos= offdese,overSpeedStrategy= 1,speedPercent= 1)
26 robot.LaserTrackingTrackOnOff(0, 3)
27 i = i + 1
28 print(i)
29robot.CloseRPC()
11.79. Code example of the extended axis synchronized with the robot for laser tracking
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')
4startexaxisPos = [0.0, 0.0, 0.0, 0.0]
5seamexaxisPos = [-10.0, 0.0, 0.0, 0.0]
6endexaxisPos = [-30.0, 0.0, 0.0, 0.0]
7offdese = [0.0] * 6
8seamjointPos = [0.0] * 6
9seamdescPose = [0.0] * 6
10i=0
11while i < 10:
12 startjointPos = [58.337, -119.628, 146.037, -116.358, -92.224, -117.654]
13 startdescPose = [-53.375, -255.363, 0.919, 178.054, 1.077, -94.026]
14 robot.ExtAxisSyncMoveJ(joint_pos=startjointPos, tool=1,user= 0,vel= 100,acc= 100, ovl=100,exaxis_pos= startexaxisPos,blendT= -1,offset_flag= 0,offset_pos= offdese)
15 ret = robot.LaserTrackingSearchStart_xyz(3, 100, 300, 1000, 2)
16 robot.LaserTrackingSearchStop()
17 tool = 0
18 user = 0
19 rnte, seamjointPos, seamdescPose, tool, user, startexaxisPos = robot.GetLaserSeamPos(0, offdese)
20 print(f"{seamjointPos[0]},{seamjointPos[1]},{seamjointPos[2]},{seamjointPos[3]},{seamjointPos[4]},{seamjointPos[5]},{seamdescPose[0]},{seamdescPose[1]},{seamdescPose[2]},{seamdescPose[3]},{seamdescPose[4]},{seamdescPose[5]}")
21 if ret == 0:
22 robot.ExtAxisSyncMoveJ(joint_pos=seamjointPos, tool=1,user= 0,vel= 100,acc= 100, ovl=100,exaxis_pos= seamexaxisPos,blendT= -1,offset_flag= 0,offset_pos= offdese)
23 robot.LaserTrackingTrackOnOff(1, 2)
24 endjointPos = [70.580, -90.918, 126.593, -125.154, -92.162, -105.403]
25 enddescPose = [-53.375, -419.020, 0.920, 178.054, 1.076, -94.026]
26 robot.ExtAxisSyncMoveL(desc_pos=enddescPose, tool=1,user= 0,vel= 20,acc= 100, ovl=100,blendR= -1,exaxis_pos= endexaxisPos,offset_pos= offdese)
27 robot.LaserTrackingTrackOnOff(0, 2)
28 i = i+1
29 print(i)
30robot.CloseRPC()
11.80. Control Array Suction Cup
New in version python: SDK-v2.1.5
Prototype |
|
|---|---|
Description |
Control array suction cup |
Required Parameters |
|
Default Parameters |
None |
Return Value |
Error code Success-0 Failure-errcode |
11.81. Get Array Suction Cup Status
New in version python: SDK-v2.1.5
Prototype |
|
|---|---|
Description |
Get array suction cup status |
Required Parameters |
|
Default Parameters |
None |
Return Value |
|
11.82. Wait for Suction Cup Status
New in version python: SDK-v2.1.5
Prototype |
|
|---|---|
Description |
Wait for suction cup status |
Required Parameters |
|
Default Parameters |
None |
Return Value |
Error code Success-0 Failure-errcode |
11.83. Array Suction Cup Control Command Code Example
New in version python: SDK-v2.1.5
1from fairino import Robot
2# Establish connection with robot controller, returns a robot object upon successful connection
3robot = Robot.RPC('192.168.58.2')
4robot.OpenLuaUpload("C://Project/PeripheralSDK/CtrlDev_sucker.lua")
5time.sleep(2)
6robot.UnloadCtrlOpenLUA(1)
7robot.LoadCtrlOpenLUA(1)
8time.sleep(1)
9ctrl = bytearray(20)
10ctrl[0] = 1
11robot.SetSuckerCtrl(0, 1, ctrl)
12for i in range(100):
13 rtn, state, press_value, error = robot.GetSuckerState(1)
14 print(f"sucker1 state is {state}, pressValue is {press_value}, error num is {error}")
15 rtn, state, press_value, error = robot.GetSuckerState(12)
16 print(f"sucker12 state is {state}, pressValue is {press_value}, error num is {error}")
17 time.sleep(0.1)
18ret = robot.WaitSuckerState(1, 1, 100)
19print(f"WaitSuckerState result is {ret}")
20ctrl[0] = 3
21robot.SetSuckerCtrl(1, 1, ctrl)
22robot.SetSuckerCtrl(12, 1, ctrl)
23robot.CloseRPC()
11.84. Upload Open Protocol Lua File
New in version python: SDK-v2.1.5
Prototype |
|
|---|---|
Description |
Upload open protocol Lua file |
Required Parameters |
|
Default Parameters |
None |
Return Value |
Error code Success-0 Failure-errcode |
11.85. Get Slave Station Board Parameters
New in version python: SDK-v2.1.5
Prototype |
|
|---|---|
Description |
Get slave station board parameters |
Required Parameters |
None |
Default Parameters |
None |
Return Value |
|
11.86. Write Slave Station DO
New in version python: SDK-v2.1.5
Prototype |
|
|---|---|
Description |
Write slave station DO |
Required Parameters |
|
Default Parameters |
None |
Return Value |
Error code Success-0 Failure-errcode |
11.87. Write Slave Station AO
New in version python: SDK-v2.1.5
Prototype |
|
|---|---|
Description |
Write slave station AO |
Required Parameters |
|
Default Parameters |
None |
Return Value |
Error code Success-0 Failure-errcode |
11.88. Read Slave Station DI
New in version python: SDK-v2.1.5
Prototype |
|
|---|---|
Description |
Read slave station DI |
Required Parameters |
|
Default Parameters |
None |
Return Value |
|
11.89. Read Slave Station AI
New in version python: SDK-v2.1.5
Prototype |
|
|---|---|
Description |
Read slave station AI |
Required Parameters |
|
Default Parameters |
None |
Return Value |
|
11.90. Wait for Extended DI Input
New in version python: SDK-v2.1.5
Prototype |
|
|---|---|
Description |
Wait for extended DI input |
Required Parameters |
|
Default Parameters |
None |
Return Value |
Error code Success-0 Failure-errcode |
11.91. Wait for Extended AI Input
New in version python: SDK-v2.1.5
Prototype |
|
|---|---|
Description |
Wait for extended AI input |
Required Parameters |
|
Default Parameters |
None |
Return Value |
Error code Success-0 Failure-errcode |
11.93. End-Effector Transparent Transmission Function Enable/Disable SDK Interface
Prototype |
|
|---|---|
Description |
Enable end-effector general transparent transmission function |
Required Parameters |
|
Default Parameters |
None |
Return Value |
Error code Success-0 Failure-errcode |
11.94. End-Effector Transparent Transmission Function Non-Periodic Data Transmission and Reception SDK Interface
Prototype |
|
|---|---|
Description |
End-effector sends non-periodic data and waits for response |
Required Parameters |
|
Default Parameters |
None |
Return Value |
Error code Success-0 Failure-errcode |
11.95. Code Example for Non-Periodic Data Communication of DIO Health Care Moxibustion Head Based on End-Effector Transparent Transmission Function
1from time import sleep
2from fairino import Robot
3from ctypes import sizeof
4# Establish connection with robot controller, returns a robot object upon successful connection
5robot = Robot.RPC('192.168.58.2')
6
7import time
8
9
10def testAxleGenCom(self):
11
12 led_on = [0xAB, 0xBA, 0x12, 0x01, 0x01, 0x79]
13 led_off = [0xAB, 0xBA, 0x12, 0x01, 0x00, 0x78]
14 version = [0xAB, 0xBA, 0x11, 0x00, 0x76]
15 state = [0xAB, 0xBA, 0x1B, 0x01, 0xAA, 0x2B]
16 cycleState = [0xAB, 0xBA, 0x12, 0x01, 0x00, 0x78]
17 cnt = 1
18
19 p1Joint = [88.708, -86.178, 140.989, -141.825, -89.162, -49.879]
20 p1Desc = [188.007, -377.850, 260.207, 178.715, 2.823, -131.466]
21 p2Joint = [112.131, -75.554, 126.989, -139.027, -88.044, -26.477]
22 p2Desc = [368.003, -377.848, 260.211, 178.715, 2.823, -131.465]
23
24 exaxisPos = [0, 0, 0, 0]
25 offdese = [0, 0, 0, 0, 0, 0]
26
27 # Enable end-effector transparent transmission function
28 robot.SetAxleGenComEnable(1)
29 robot.SetAxleLuaEnable(1)
30
31 while cnt <= 10000:
32 # Read version number
33 ret,rcvdata = robot.SndRcvAxleGenComCmdData(len_snd=5, sndBuff=version, len_rcv=10)
34 print(ret)
35 print(rcvdata)
36 print(f"hard version : {rcvdata[4]},hard code:{rcvdata[5]}, soft version:{rcvdata[6]} {rcvdata[7]}, soft code:{rcvdata[8]}")
37 if ret != 0:
38 break
39 time.sleep(1)
40 # Read moxibustion head presence status
41 ret,rcvdata = robot.SndRcvAxleGenComCmdData(6, state, 6)
42 print(f"state : {rcvdata[4]} ")
43 time.sleep(1)
44 # Turn on moxibustion head laser
45 ret,rcvdata = robot.SndRcvAxleGenComCmdData(6, led_on, 6)
46 print(f"led on rcv data is: {rcvdata[0]}, {rcvdata[1]}, {rcvdata[2]}, {rcvdata[3]}, {rcvdata[4]}, {rcvdata[5]}")
47 robot.MoveJ(joint_pos=p1Joint, tool=0, user=0, vel=100, acc=100, ovl=100, exaxis_pos=exaxisPos, blendT=-1,
48 offset_flag=0, offset_pos=offdese)
49 time.sleep(4)
50 # Turn off moxibustion head laser
51 ret, rcvdata = robot.SndRcvAxleGenComCmdData(6, led_off, 6)
52 print(f"led off rcv data is: {rcvdata[0]}, {rcvdata[1]}, {rcvdata[2]}, {rcvdata[3]}, {rcvdata[4]}, {rcvdata[5]}")
53 robot.MoveJ(joint_pos=p2Joint, tool=0, user=0, vel=100, acc=100, ovl=100, exaxis_pos=exaxisPos, blendT=-1,offset_flag=0, offset_pos=offdese)
54 time.sleep(1)
55 print(f"***********************complate No. {cnt} SDK test*****************************")
56 cnt = cnt + 1
57
58 robot.CloseRPC()
59 return 0
60
61testAxleGenCom(robot)
11.96. Download Open Protocol Lua File
Prototype |
|
|---|---|
Description |
Download open protocol Lua file |
Required Parameters |
|
Default Parameters |
None |
Return Value |
Error code Success-0 Failure-errcode |
11.97. Delete Specified Open Protocol Lua File
Prototype |
|
|---|---|
Description |
Delete specified open protocol Lua file |
Required Parameters |
|
Default Parameters |
None |
Return Value |
Error code Success-0 Failure-errcode |
11.98. Delete All Open Protocol Lua Files
Prototype |
|
|---|---|
Description |
Delete all open protocol Lua files |
Required Parameters |
None |
Default Parameters |
None |
Return Value |
Error code Success-0 Failure-errcode |
11.99. Open Protocol Lua File Operation SDK Code Example
1from time import sleep
2import time
3from fairino import Robot
4
5# Establish connection with robot controller
6robot = Robot.RPC('192.168.58.2')
7
8
9def TestCtrlOpenLuaOperate(self):
10 # Upload Lua file to robot
11 rtn = robot.OpenLuaUpload("D://zUP/openlua/CtrlDev_WELDING_A.lua")
12 print(f"OpenLuaUpload rtn is {rtn}")
13
14 rtn = robot.OpenLuaUpload("D://zUP/openlua/CtrlDev_SWDPOLISH.lua")
15 print(f"OpenLuaUpload rtn is {rtn}")
16
17 # Download Lua file from robot
18 rtn = robot.OpenLuaDownload("CtrlDev_WELDING_A.lua", "D://zDOWN/")
19 print(f"OpenLuaDownload rtn is {rtn}")
20
21 rtn = robot.OpenLuaDownload("CtrlDev_SWDPOLISH.lua", "D://zDOWN/")
22 print(f"OpenLuaDownload rtn is {rtn}")
23
24 # Set control open protocol Lua name
25 rtn = robot.SetCtrlOpenLUAName(0, "CtrlDev_WELDING_A.lua")
26 print(f"SetCtrlOpenLUAName rtn is {rtn}")
27
28 rtn = robot.SetCtrlOpenLUAName(1, "CtrlDev_SWDPOLISH.lua")
29 print(f"SetCtrlOpenLUAName rtn is {rtn}")
30
31 # Get control open protocol Lua name
32 rtn, name = robot.GetCtrlOpenLUAName()
33 print(f"ctrl open lua names : {name[0]}, {name[1]}, {name[2]}, {name[3]}")
34
35 # Load control open protocol Lua
36 rtn = robot.LoadCtrlOpenLUA(1)
37 print(f"LoadCtrlOpenLUA rtn is {rtn}")
38 time.sleep(2)
39
40 # Unload control open protocol Lua
41 rtn = robot.UnloadCtrlOpenLUA(1)
42 print(f"UnloadCtrlOpenLUA rtn is {rtn}")
43
44 # Delete specified Lua file
45 rtn = robot.OpenLuaDelete("CtrlDev_WELDING_A.lua")
46 print(f"OpenLuaDelete rtn is {rtn}")
47
48 # Delete all Lua files
49 rtn = robot.AllOpenLuaDelete()
50 print(f"AllOpenLuaDelete rtn is {rtn}")
51
52 # Close connection
53 robot.CloseRPC()
54 time.sleep(1)
55
56
57# Call test function
58TestCtrlOpenLuaOperate(robot)