top of page

Python 5. IO

5.1. Setting the control box digital output

prototype

SetDO(id, status, smooth=0, block=0)

Description

Setting the control box digital outputs

Mandatory parameters

  • id: io number, range [0~15];

  • status: 0 - off, 1 - on;

Default Parameters

  • smooth: 0-not smooth, 1-smooth Default 0;

  • block:0-blocking, 1-non-blocking Default 0

Return Value

Error Code Success-0 Failure- errcode

5.2. Setting Tool Digital Outputs

prototype

SetToolDO (id, status, smooth=0, block=0)

Description

Setting the digital output of the tool

Mandatory parameters

  • id: io number, range [0~1];

  • status: 0 - off, 1 - on;

Default Parameters

  • smooth: 0-not smooth, 1-smooth;

  • block: 0-blocking, 1-non-blocking.

Return Value

Error Code Success-0 Failure- errcode

5.3. Setting the control box analog output

Prototype

SetAO(id,value,block=0)

Description

Setting the control box analog output

Mandatory parameters

  • id: io number, range [0~1];

  • value: percentage of current or voltage value in the range [0 to 100%] corresponding to current value [0 to 20 mA] or voltage [0 to 10 V];

Default parameters

  • block:[0]-blocking, [1]-non-blocking Default 0

Return Value

Error Code Success-0 Failure- errcode

5.4. Setting Tool Analog Outputs

Prototype

SetToolAO(id,value,block=0)

Description

Setup Tool Analog Output

Mandatory parameters

  • id: io number, range [0];

  • value: percentage of current or voltage value in the range [0 to 100%] corresponding to current value [0 to 20 mA] or voltage [0 to 10 V];

Default parameters

  • block:[0]-blocking, [1]-non-blocking Default 0

Return Value

Error Code Success-0 Failure- errcode

5.5. Set digital, analog output 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')
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)
robot.CloseRPC()

5.6. Getting control box digital inputs

prototype

GetDI(id, block=0)

Description

Get control box digital inputs

Mandatory parameters

  • id: io number, range [0~15];

Default Parameters

  • block: 0-blocking, 1-non-blocking Default 0

Return Value

  • errorcode Success-0 Failure- errcode

  • di: 0-low level, 1-high level

5.7. Get Tool Digital Inputs

prototype

GetToolDI(id, block=0)

Description

Get Tool Digital Inputs

Mandatory parameters

  • id: io number, range [0~1];

Default Parameters

  • block: 0-blocking, 1-non-blocking Default 0

Return Value

Error Code Success-0 Failure- errcode - di: 0 - low level, 1 - high level

5.8. Getting Control Box Analog Inputs

Prototype

GetAI(id, block = 0)

Description

Get control box analog inputs

Mandatory parameters

  • id: io number, range [0~1];

Default Parameters

  • block:0-blocking, 1-non-blocking Default 0

Return Value

  • errorcode Success-0 Failure- errcode

  • value: Percentage of input current or voltage value, range [0~100] corresponding to current value [0~20mA] or voltage [0~10V].

5.9. Get Tool Analog Inputs

Prototype

GetToolAI (id, block = 0)

Description

Get end analog input

Mandatory parameters

  • id: io number, range [0];

Default Parameters

  • block: 0-blocking, 1-non-blocking Default 0

Return Value

  • errorcode Success-0 Failure- errcode

  • value: Percentage of input current or voltage value, range [0~100] corresponding to current value [0~20mA] or voltage [0~10V].

5.10. Obtain the status of the button for recording the end point of the robot

Prototype

GetAxlePointRecordBtnState()

Description

Obtain the status of the button for recording the end point of the robot

Mandatory parameters

NULL

Default Parameters

NULL

Return Value

  • errorcode Success-0 Failure- errcode

  • buttonstatus: Button status: 0- Press, 1- release


robotic arm
FAIRINO ROBOTIC ARMS

Contact

Location: 10637 Scripps Summit Court,

San Diego, CA. 92131
Phone: (619) 333-FAIR
Email: hello@fairino.us

© 2023 Fairino US official site Proudly created By G2T

bottom of page