Prototype | GetToolDO() |
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 | GetDO() |
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
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')
block = 0
error,di = robot.GetDI(0, block)
print(f"di0: {di}")
error,tool_di = robot.GetToolDI(1, block)
print(f"tool_di1: {tool_di}")
error,ai = robot.GetAI(0, block)
print(f"ai0: {ai:.2f}")
error,tool_ai = robot.GetToolAI(0, block)
print(f"tool_ai0: {tool_ai:.2f}")
error,button_state = robot.GetAxlePointRecordBtnState()
print(f"_button_state is: {button_state}")
error,tool_do_state = robot.GetToolDO()
print(f"tool DO state: {tool_do_state}")
error,[do_state_h, do_state_l] = robot.GetDO()
print(f"DO state hight : {do_state_h}")
print(f"DO state low : {do_state_l}")
robot.CloseRPC()
5.14. Waiting for control box digital inputs
prototype | WaitDI(id,status,maxtime,opt) |
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 | WaitMultiDI(mode,id,status,maxtime,opt) |
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 | WaitToolDI(id,status,maxtime,opt) |
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 | WaitAI(id,sign,value,maxtime,opt) |
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 | WaitToolAI(id,sign,value,maxtime,opt) |
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
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')
status = 1
smooth = 0
block = 0
for i in range(16):
robot.SetDO(i, status, smooth, block)
time.sleep(0.3)
status = 0
for i in range(16):
robot.SetDO(i, status, smooth, block)
time.sleep(0.3)
status = 1
for i in range(2):
robot.SetToolDO(i, status, smooth, block)
time.sleep(1)
status = 0
for i in range(2):
robot.SetToolDO(i, status, smooth, block)
time.sleep(1)
for i in range(100):
robot.SetAO(0, i, block)
time.sleep(0.03)
for i in range(100):
robot.SetToolAO(0, i, block)
time.sleep(0.03)
block =