5. IO
5.1. Setting the control box digital output
prototype |
|
|---|---|
Description |
Setting the control box digital outputs |
Mandatory parameters |
|
Default Parameters |
|
Return Value |
Error Code Success-0 Failure- errcode |
5.2. Setting Tool Digital Outputs
prototype |
|
|---|---|
Description |
Setting the digital output of the tool |
Mandatory parameters |
|
Default Parameters |
|
Return Value |
Error Code Success-0 Failure- errcode |
5.3. Setting the control box analog output
Prototype |
|
|---|---|
Description |
Setting the control box analog output |
Mandatory parameters |
|
Default parameters |
|
Return Value |
Error Code Success-0 Failure- errcode |
5.4. Setting Tool Analog Outputs
Prototype |
|
|---|---|
Description |
Setup Tool Analog Output |
Mandatory parameters |
|
Default parameters |
|
Return Value |
Error Code Success-0 Failure- errcode |
5.5. Set digital, analog output 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')
5status = 1
6smooth = 0
7block = 0
8for i in range(16):
9 robot.SetDO(i, status, smooth, block)
10 time.sleep(0.3)
11status = 0
12for i in range(16):
13 robot.SetDO(i, status, smooth, block)
14 time.sleep(0.3)
15status = 1
16for i in range(2):
17 robot.SetToolDO(i, status, smooth, block)
18 time.sleep(1)
19status = 0
20for i in range(2):
21 robot.SetToolDO(i, status, smooth, block)
22 time.sleep(1)
23for i in range(100):
24 robot.SetAO(0, i, block)
25 time.sleep(0.03)
26for i in range(100):
27 robot.SetToolAO(0, i, block)
28 time.sleep(0.03)
29robot.CloseRPC()
5.6. Getting control box digital inputs
prototype |
|
|---|---|
Description |
Get control box digital inputs |
Mandatory parameters |
|
Default Parameters |
|
Return Value |
|
5.7. Get Tool Digital Inputs
prototype |
|
|---|---|
Description |
Get Tool Digital Inputs |
Mandatory parameters |
|
Default Parameters |
|
Return Value |
Error Code Success-0 Failure- errcode
- |
5.8. Getting Control Box Analog Inputs
Prototype |
|
|---|---|
Description |
Get control box analog inputs |
Mandatory parameters |
|
Default Parameters |
|
Return Value |
|
5.9. Get Tool Analog Inputs
Prototype |
|
|---|---|
Description |
Get end analog input |
Mandatory parameters |
|
Default Parameters |
|
Return Value |
|
5.11. Obtain the DO output status at the end of the robot
Prototype |
|
|---|---|
Description |
Obtain the DO output status at the end of the robot |
Mandatory parameters |
NULL |
Default Parameters |
NULL |
Return Value |
|
5.12. Obtain the DO output status of the robot controller
Prototype |
|
|---|---|
Description |
Obtain the DO output status of the robot controller |
Mandatory parameters |
NULL |
Default Parameters |
NULL |
Return Value |
|
5.13. Get the robot DI, DO status code examples
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')
5block = 0
6error,di = robot.GetDI(0, block)
7print(f"di0: {di}")
8error,tool_di = robot.GetToolDI(1, block)
9print(f"tool_di1: {tool_di}")
10error,ai = robot.GetAI(0, block)
11print(f"ai0: {ai:.2f}")
12error,tool_ai = robot.GetToolAI(0, block)
13print(f"tool_ai0: {tool_ai:.2f}")
14error,button_state = robot.GetAxlePointRecordBtnState()
15print(f"_button_state is: {button_state}")
16error,tool_do_state = robot.GetToolDO()
17print(f"tool DO state: {tool_do_state}")
18error,[do_state_h, do_state_l] = robot.GetDO()
19print(f"DO state hight : {do_state_h}")
20print(f"DO state low : {do_state_l}")
21robot.CloseRPC()
5.14. Waiting for control box digital inputs
prototype |
|
|---|---|
Description |
Waiting for control box digital input |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
5.15. Waiting for control box with multiple digital inputs
prototype |
|
|---|---|
Description |
Waiting for control box with multiple digital inputs |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
5.16. Waiting for tool digital inputs
prototype |
|
|---|---|
Description |
Waiting for end digital input |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
5.17. Waiting for control box analog inputs
prototype |
|
|---|---|
Description |
Waiting for control box analog input |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
5.18. Waiting for tool analog inputs
prototype |
|
|---|---|
Description |
Waiting for end analog input |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
5.19. Waiting control box digital, analog input signal 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')
4status = 1
5smooth = 0
6block = 0
7for i in range(16):
8 robot.SetDO(i, status, smooth, block)
9 time.sleep(0.3)
10status = 0
11for i in range(16):
12 robot.SetDO(i, status, smooth, block)
13 time.sleep(0.3)
14status = 1
15for i in range(2):
16 robot.SetToolDO(i, status, smooth, block)
17 time.sleep(1)
18status = 0
19for i in range(2):
20 robot.SetToolDO(i, status, smooth, block)
21 time.sleep(1)
22for i in range(100):
23 robot.SetAO(0, i, block)
24 time.sleep(0.03)
25for i in range(100):
26 robot.SetToolAO(0, i, block)
27 time.sleep(0.03)
28block = 0
29error,di = robot.GetDI(0, block)
30print(f"di0: {di}")
31error,tool_di = robot.GetToolDI(1, block)
32print(f"tool_di1: {tool_di}")
33error,ai = robot.GetAI(0, block)
34print(f"ai0: {ai:.2f}")
35error,tool_ai = robot.GetToolAI(0, block)
36print(f"tool_ai0: {tool_ai:.2f}")
37error,button_state = robot.GetAxlePointRecordBtnState()
38print(f"_button_state is: {button_state}")
39error,tool_do_state = robot.GetToolDO()
40print(f"tool DO state: {tool_do_state}")
41error,[do_state_h, do_state_l] = robot.GetDO()
42print(f"DO state hight : {do_state_h}")
43print(f"DO state low : {do_state_l}")
44rtn = robot.WaitDI(0, 1, 1000, 1)
45print(f"WaitDI over; rtn is: {rtn}")
46rtn = robot.WaitMultiDI(1, 3, 3, 1000, 1)
47print(f"WaitDI over; rtn is: {rtn}")
48rtn = robot.WaitToolDI(1, 1, 1000, 1)
49print(f"WaitDI over; rtn is: {rtn}")
50rtn = robot.WaitAI(0, 0, 50, 1000, 1)
51print(f"WaitDI over; rtn is: {rtn}")
52rtn = robot.WaitToolAI(0, 0, 50, 1000, 1)
53print(f"WaitDI over; rtn is: {rtn}")
54robot.CloseRPC()
5.20. Set Whether Control Box DO Output Resets After Stop/Pause
New in version python: SDK-v2.0.5
Prototype |
|
|---|---|
Description |
Set whether control box DO output resets after stop/pause |
Required Parameters |
|
Default Parameters |
None |
Return Value |
Error code Success-0 Failure- errcode |
5.21. Set Whether Control Box AO Output Resets After Stop/Pause
New in version python: SDK-v2.0.5
Prototype |
|
|---|---|
Description |
Set whether control box AO output resets after stop/pause |
Required Parameters |
|
Default Parameters |
None |
Return Value |
Error code Success-0 Failure- errcode |
5.22. Set Whether End Tool DO Output Resets After Stop/Pause
New in version python: SDK-v2.0.5
Prototype |
|
|---|---|
Description |
Set whether end tool DO output resets after stop/pause |
Required Parameters |
|
Default Parameters |
None |
Return Value |
Error code Success-0 Failure- errcode |
5.23. Set Whether End Tool AO Output Resets After Stop/Pause
New in version python: SDK-v2.0.5
Prototype |
|
|---|---|
Description |
Set whether end tool AO output resets after stop/pause |
Required Parameters |
|
Default Parameters |
None |
Return Value |
Error code Success-0 Failure- errcode |
5.24. Set Whether Extended DO Output Resets After Stop/Pause
New in version python: SDK-v2.0.5
Prototype |
|
|---|---|
Description |
Set whether extended DO output resets after stop/pause |
Required Parameters |
|
Default Parameters |
None |
Return Value |
Error code Success-0 Failure- errcode |
5.25. Set Whether Extended AO Output Resets After Stop/Pause
New in version python: SDK-v2.0.5
Prototype |
|
|---|---|
Description |
Set whether extended AO output resets after stop/pause |
Required Parameters |
|
Default Parameters |
None |
Return Value |
Error code Success-0 Failure- errcode |
5.26. Set Whether SmartTool Output Resets After Stop/Pause
New in version python: SDK-v2.0.5
Prototype |
|
|---|---|
Description |
Set whether SmartTool output resets after stop/pause |
Required Parameters |
|
Default Parameters |
None |
Return Value |
Error code Success-0 Failure- errcode |
5.27. Code Example for Setting Output Reset After Lua Program Stop/Pause
1from fairino import Robot
2import time
3robot = Robot.RPC('192.168.58.2')
4for i in range(16):
5 robot.SetDO(i, 1, 0, 0)
6 time.sleep(0.2)
7resetFlag = 0
8resumeReloadFlag = 0
9rtn = robot.SetOutputResetCtlBoxDO(resetFlag, resumeReloadFlag)
10robot.SetOutputResetCtlBoxAO(resetFlag, resumeReloadFlag)
11robot.SetOutputResetAxleDO(resetFlag, resumeReloadFlag)
12robot.SetOutputResetAxleAO(resetFlag, resumeReloadFlag)
13robot.SetOutputResetExtDO(resetFlag, resumeReloadFlag)
14robot.SetOutputResetExtAO(resetFlag, resumeReloadFlag)
15robot.SetOutputResetSmartToolDO(resetFlag, resumeReloadFlag)
16robot.ProgramLoad("/fruser/test.lua")
17robot.ProgramRun()
18time.sleep(2)
19robot.PauseMotion()
20time.sleep(2)
21robot.ResumeMotion()
22time.sleep(2)
23robot.CloseRPC()
24return 0
5.28. Set Configurable CI Port Functions
Prototype |
|
|---|---|
Description |
Set configurable CI port functions |
Required Parameters |
|
Default Parameters |
None |
Return Value |
Error code Success-0 Failure-errcode |
5.29. Get Configurable CI Port Functions of the Control Box
Prototype |
|
|---|---|
Description |
Get configurable CI port functions of the control box |
Required Parameters |
|
Default Parameters |
None |
Return Value |
Error code Success-0 Failure-errcode |
5.30. Set Configurable CO Port Functions
Prototype |
|
|---|---|
Description |
Set configurable CO port functions |
Required Parameters |
|
Default Parameters |
None |
Return Value |
Error code Success-0 Failure-errcode |
5.31. Get Configurable CO Port Functions
Prototype |
|
|---|---|
Description |
Get configurable CO port functions |
Required Parameters |
|
Default Parameters |
None |
Return Value |
Error code Success-0 Failure-errcode |
5.32. Set Configurable End-CI Port Functions of the End-Effector
Prototype |
|
|---|---|
Description |
Set configurable End-CI port functions of the end-effector |
Required Parameters |
|
Default Parameters |
None |
Return Value |
Error code Success-0 Failure-errcode |
5.33. Get Configurable End-CI Port Functions of the End-Effector
Prototype |
|
|---|---|
Description |
Get configurable End-CI port functions of the end-effector |
Required Parameters |
|
Default Parameters |
None |
Return Value |
Error code Success-0 Failure-errcode |
5.34. Set Configurable CI Active State of the Control Box
Prototype |
|
|---|---|
Description |
Set configurable CI active state of the control box |
Required Parameters |
|
Default Parameters |
None |
Return Value |
Error code Success-0 Failure-errcode |
5.35. Get Configurable CI Active State of the Control Box
Prototype |
|
|---|---|
Description |
Get configurable CI active state of the control box |
Required Parameters |
|
Default Parameters |
None |
Return Value |
Error code Success-0 Failure-errcode |
5.36. Set Configurable CO Active State of the Control Box
Prototype |
|
|---|---|
Description |
Set configurable CO active state of the control box |
Required Parameters |
|
Default Parameters |
None |
Return Value |
Error code Success-0 Failure-errcode |
5.37. Get Configurable CO Active State of the Control Box
Prototype |
|
|---|---|
Description |
Get configurable CO active state of the control box |
Required Parameters |
|
Default Parameters |
None |
Return Value |
Error code Success-0 Failure-errcode |
5.38. Set Configurable CI Active State of the End-Effector
Prototype |
|
|---|---|
Description |
Set configurable CI active state of the end-effector |
Required Parameters |
|
Default Parameters |
None |
Return Value |
Error code Success-0 Failure-errcode |
5.39. Get Configurable CI Active State of the End-Effector
Prototype |
|
|---|---|
Description |
Get configurable CI active state of the end-effector |
Required Parameters |
|
Default Parameters |
None |
Return Value |
Error code Success-0 Failure-errcode |
5.40. Set Standard DI Active State of the Control Box
Prototype |
|
|---|---|
Description |
Set standard DI active state of the control box |
Required Parameters |
|
Default Parameters |
None |
Return Value |
Error code Success-0 Failure-errcode |
5.41. Get Standard DI Active State of the Control Box
Prototype |
|
|---|---|
Description |
Get standard DI active state of the control box |
Required Parameters |
|
Default Parameters |
None |
Return Value |
Error code Success-0 Failure-errcode |
5.42. Set Standard DO Active State of the Control Box
Prototype |
|
|---|---|
Description |
Set standard DO active state of the control box |
Required Parameters |
|
Default Parameters |
None |
Return Value |
Error code Success-0 Failure-errcode |
5.43. Get Standard DO Active State of the Control Box
Prototype |
|
|---|---|
Description |
Get standard DO active state of the control box |
Required Parameters |
|
Default Parameters |
None |
Return Value |
Error code Success-0 Failure-errcode |