Flange I/O
The flange has 2DI/2DO, see User Manual for interface details.
Set Digital Output auto_sync
Sets digital output (flange).
- Function:
set_flange_dofrom the lua module - Parameters:
- pin: [int] Port, starting from 0
- value: [int] Value to set, 0 off / 1 on
- Returns: [bool] Whether set successfully
Compatibility Note
In version 2.2 and earlier, the command was:
set_tcp_dio(pin, value)
Example
set_flange_do(1, 1)
Get Digital Input
Gets digital input (flange).
- Function:
get_flange_difrom the lua module - Parameters:
- pin: [int] Port, starting from 0
- Returns: [int] Port current value, 0 off / 1 on
Compatibility Note
In version 2.2 and earlier, the command was:
get_tcp_dio(pin)
Example
print(get_flange_di(0))
Wait Digital Input auto_sync
Blocks and waits until the specified port input value meets the specified condition, polling every 10ms.
- Function:
wait_flange_difrom the lua module - Parameters:
- pin: [int] Port, starting from 0
- value: [int] Value to compare
- relation: [str] Relational Operator
- Returns: [bool] Whether condition is met
Compatibility Note
In version 2.2 and earlier, the command was:
wait_tcp_dio(pin, value, relation)
Example
wait_flange_di(1, 1, "=")
