New in version python: SDK-v2.0.5
Prototype | SetAxleLuaEnable(enable) |
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 | SetRecoverAxleLuaErr(enable) |
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 | GetAxleLuaEnableStatus() |
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 | SetAxleLuaEnableDeviceType(forceSensorEnable, gripperEnable, IOEnable) |
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 | GetAxleLuaEnableDeviceType() |
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 | GetAxleLuaEnableDevice() |
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 | SetAxleLuaGripperFunc(id, func) |
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 | GetAxleLuaGripperFunc(id) |
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 | SlaveFileWrite(type,slaveID,fileName) |
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 | AxleLuaUpload(filePath) |
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 | SetSysServoBootMode(filePath) |
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
from fairino import Robot
# Establish a connection with the robot controller and return a robot object if the connection is successful
robot = Robot.RPC('192.168.58.2')
robot.AxleLuaUpload("D://zUP/AXLE_LUA_End_DaHuan.lua")
param = [7, 8, 1, 0, 5, 3, 1] # 对应AxleComParam参数
robot.SetAxleCommunicationParam(7, 8, 1, 0, 5, 3, 1)
error,getParam0,getParam1,getParam2,getParam3,getParam4,getParam5,getParam6 = robot.GetAxleCommunicationParam()
print(f"GetAxleCommunicationParam param is:{getParam0} {getParam1} {getParam2} {getParam3} {getParam4} {getParam5} {getParam6}")
robot.SetAxleLuaEnable(1)
error,luaEnableStatus = robot.GetAxleLuaEnableStatus()
robot.SetAxleLuaEnableDeviceType(0, 1, 0)
error,forceEnable, gripperEnable, ioEnable = robot.GetAxleLuaEnableDeviceType()
print(f"GetAxleLuaEnableDeviceType param is:{forceEnable} {gripperEnable} {ioEnable}")
func = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
robot.SetAxleLuaGripperFunc(1, func)
error,getFunc = robot.GetAxleLuaGripperFunc(1)
error,getforceEnable, getgripperEnable, getioEnable = robot.GetAxleLuaEnableDevice()
print("\ngetforceEnable status:", end=" ")
for i in range(8):
print(f"{getforceEnable[i]},", end="")
print("\ngetgripperEnable status:", end=" ")
for i in range(8):
print(f"{getgripperEnable[i]},", end="")
print("\ngetioEnable status:", end=" ")
for i in range(8):
print(f"{getioEnable[i]},", end="")
print()
robot.ActGripper(1, 0)
time.sleep(2)
robot.ActGripper(1, 1)
time.sleep(2)
robot.MoveGripper(1, 90, 10, 100, 50000, 0, 0, 0, 0, 0)
while True:
error,pkg = robot.GetRobotRealTimeState()
print(f"gripper pos is:{pkg.gripper_position}")
time.sleep(0.1)
robot.CloseRPC()
11.57. Obtain the status of the SmartTool button
New in version python: SDK-v2.1.2
Prototype | GetSmarttoolBtnState() |
Description | Obtain the status of the SmartTool button |
Mandatory parameters | NULL |
Default parameters | NULL |
Return Value |
|
11.58. SmartTool button code example
from fairino import Robot
import time
# Establish a connection with the robot controller and return a robot object if the connection is successful
robot = Robot.RPC('192.168.58.2')
while True:
error,state = robot.GetSmarttoolBtnState()
print(f"{state:016b}")
time.sleep(0.1)
11.59. Set the load detection before drag is started
New in version python: SDK-v2.1.6
Prototype | SetTorqueDetectionSwitch(flag) |
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 | LaserTrackingLaserOnOff(OnOff, weldId) |
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 | LaserTrackingTrackOnOff(OnOff, coordId) |
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 | LaserTrackingSearchStart_xyz(direction, vel, distance, timeout, posSensorNum) |
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 | LaserTrackingSearchStart_point(directionPoint, vel, distance, timeout, posSensorNum) |
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 | LaserTrackingSensorConfig(ip, port) |
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 | LaserTrackingSensorSamplePeriod(period) |
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 | LoadPosSensorDriver(type) |
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 | UnLoadPosSensorDriver() |
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 | LaserSensorRecord1(status, delayTime) |
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 | LaserSensorReplay(delayTime, speed) |
Description | Laser weld seam trajectory reproduction |
Mandatory parameters |
|
Default parameters | NULL |
Error Code Success-0 Failure- errcode |
11.70. Laser tracking reproduction
New in version python: SDK-v2.1.6
Prototype | MoveLTR() |
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 | LaserSensorRecordandReplay(delayMode, delayTime, delayDisExAxisNum, delayDis, sensitivePara, int trackMode, int triggerMode, double runTime, speed) |
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 | MoveToLaserRecordStart(moveType, ovl) |
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 | MoveToLaserRecordEnd(moveType, ovl) |
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 | MoveToLaserSeamPos(moveFlag, ovl, dataFlag, plateType, trackOffectType, offset) |
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 | GetLaserSeamPos(trackOffectType, offset) |
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
from fairino import Robot
# Establish a connection with the robot controller and return a robot object if the connection is successful
robot = Robot.RPC('192.168.58.2')
robot.LaserTrackingSensorConfig("192.168.58.20", 5020)
robot.LaserTrackingSensorSamplePeriod(20)
robot.LoadPosSensorDriver(101)
robot.LaserTrackingLaserOnOff(0, 0)
time.sleep(3)
robot.LaserTrackingLaserOnOff(1, 0)
robot.CloseRPC()
11.77. Code example of laser trajectory scanning and trajectory reproduction
from fairino import Robot
# Establish a connection with the robot controller and return a robot object if the connection is successful
robot = Robot.RPC('192.168.58.2')
robot.OpenLuaUpload("D://zUP/CtrlDev_laser_ruiniu-0117.lua")
time.sleep(2)
robot.SetCtrlOpenLUAName(0, "CtrlDev_laser_ruiniu-0117.lua")
robot.UnloadCtrlOpenLUA(0)
robot.LoadCtrlOpenLUA(0)
time.sleep(8)
i = 0
while i<10:
startjointPos = [56.205, -117.951, 141.872, -118.149, -94.217, -122.176]
startdescPose = [-97.552, -282.855, 26.675, 174.182, -1.338, -91.707]
exaxisPos = [0.0] * 4
offdese = [0.0] * 6
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)
robot.LaserSensorRecord1(2, 10)
endjointPos = [68.809, -87.100, 121.120, -127.233, -95.038, -109.555]
enddescPose = [-103.555, -464.234, 13.076, 174.179, -1.344, -91.709]
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)
robot.LaserSensorRecord1(0, 10)
robot.MoveToLaserRecordStart(1, 30)
robot.LaserSensorReplay(10, 100)
robot.MoveLTR()
robot.LaserSensorRecord1(0, 10)
i = i+1
robot.CloseRPC()
11.78. Code examples for laser locating and real-time tracking
from fairino import Robot
# Establish a connection with the robot controller and return a robot object if the connection is successful
robot = Robot.RPC('192.168.58.2')
robot.OpenLuaUpload("D://zUP/CtrlDev_laser_ruiniu-0117.lua")
time.sleep(2)
robot.SetCtrlOpenLUAName(0, "CtrlDev_laser_ruiniu-0117.lua")
robot.UnloadCtrlOpenLUA(0)
robot.LoadCtrlOpenLUA(0)
time.sleep(8)
time.sleep(8)
i = 0
while i < 10:
startjointPos = [56.205, -117.951, 141.872, -118.149, -94.217, -122.176]
startdescPose = [-97.552, -282.855, 26.675, 174.182, -1.338, -91.707]
exaxisPos = [0.0] * 4
offdese = [0.0] * 6
directionPoint = [0.0] * 3
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)
robot.LaserTrackingSearchStart_xyz(3, 100, 300, 1000, 3)
robot.LaserTrackingSearchStop()
robot.MoveToLaserSeamPos(1, 30, 0, 0, 0, offdese)
robot.LaserTrackingTrackOnOff(1, 3)
endjointPos = [68.809, -87.100, 121.120, -127.233, -95.038, -109.555]
enddescPose = [-103.555, -464.234, 13.076, 174.179, -1.344, -91.709]
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)
robot.LaserTrackingTrackOnOff(0, 3)
i = i + 1
print(i)
robot.CloseRPC()
11.79. Code example of the extended axis synchronized with the robot for laser tracking
from fairino import Robot
# Establish a connection with the robot controller and return a robot object if the connection is successful
robot = Robot.RPC('192.168.58.2')
startexaxisPos = [0.0, 0.0, 0.0, 0.0]
seamexaxisPos = [-10.0, 0.0, 0.0, 0.0]
endexaxisPos = [-30.0, 0.0, 0.0, 0.0]
offdese = [0.0] * 6
seamjointPos = [0.0] *