Extension I/O 2.3.3

The extension board has 12DI/12DO/2AI/2AO, see User Manual for interface details.

Set Digital Output auto_sync

Sets digital output (extension board).

  • Function: set_extra_do from the lua module
  • Parameters:
    1. pin: [int] Port, starting from 0
    2. value: [int] Value to set, 0 off / 1 on
  • Returns: [bool] Whether set successfully

Example

set_extra_do(1, 1)

Get Digital Input

Gets digital input (extension board).

  • Function: get_extra_di from the lua module
  • Parameters:
    1. pin: [int] Port, starting from 0
  • Returns: [int] Port current value, 0 off / 1 on

Example

print(get_extra_di(1))

Wait Digital Input auto_sync

Blocks and waits until the specified port input value meets the specified condition.

  • Function: wait_extra_di from the lua module
  • Parameters:
    1. pin: [int] Port, starting from 0
    2. value: [int] Value to compare, 0 off / 1 on
    3. relation: [str] Relational Operator
  • Returns: [bool] Whether condition is met

Example

wait_extra_di(1, 0, "=")

Set Analog Output auto_sync

Sets analog output (extension board).

  • Function: set_extra_ao from the lua module
  • Parameters:
    1. pin: [int] Port, starting from 0
    2. value: [float] Value to set, specify voltage or current based on output type
  • Returns: [bool] Whether set successfully

Example

-- Set EAO0 output 3V
set_extra_ao(0, 3)

Get Analog Input

Gets analog input (extension board).

  • Function: get_extra_ai from the lua module
  • Parameters:
    1. pin: [int] Port, starting from 0
  • Returns: [float] Port current value (V)

Example

print(get_extra_ai(0))

Wait Analog Input auto_sync

Blocks and waits until the specified port input value meets the specified condition.

  • Function: wait_extra_ai from the lua module
  • Parameters:
    1. pin: [int] Port, starting from 0
    2. value: [float] Value to compare
    3. relation: [str] Relational Operator
  • Returns: [bool] Whether condition is met

Example

wait_extra_ai(0, 3, ">=")