PYCO-ETH
AIO
-
mp_obj_t AI_readOneChannel(mp_obj_t ch)
Read voltage from a single analog input (AI) channel.
- Parameters:
ch – (int) Channel number (0 to 7).
- Returns:
float: Voltage in volts.
-
mp_obj_t AI_readOnDemand()
Read voltage values from all 8 analog input (AI) channels on demand.
- Returns:
list of 8 float values: Each value represents the voltage (in volts) of one AI channel.
-
mp_obj_t AI_readPort()
Read voltage values from the entire AI port.
- Returns:
list of 8 float values: Each value represents the voltage (in volts) of one AI channel.
-
mp_obj_t AI_sendOnDemand()
Send analog input (AI) data from all channels via TCP to PC.
- Returns:
int: WPC error code. Returns 0 on success, or a negative value on failure.
-
mp_obj_t AO_writeOneChannel(mp_obj_t ch, mp_obj_t value)
Write voltage to a single analog output (AO) channel.
- Parameters:
channel – (int) AO channel index (0-7).
value – (float) Voltage to set (-10.0 to 10.0 V).
- Returns:
int: WPC error code. Returns 0 on success, or a negative value on failure.
-
mp_obj_t AO_writeAllChannels(mp_obj_t value_list)
Write voltages to all analog output (AO) channels.
- Parameters:
value_list – (list of float) List of 8 voltages (-10.0 to 10.0 V each).
- Returns:
int: WPC error code. Returns 0 on success, or a negative value on failure.
DIO
-
mp_obj_t DO_writeAllChannels(mp_obj_t value_list)
Write states to all digital output (DO) channels.
- Parameters:
value_list – (list of int) List of 8 values (0 or 1) for each DO channel.
- Returns:
int: WPC error code. Returns 0 on success, or a negative value on failure.
-
mp_obj_t DO_writeOneChannel(mp_obj_t ch, mp_obj_t value)
Write state to a single digital output (DO) channel.
- Parameters:
ch – (int) Channel number (0 to 7).
value – (int) Pin state (0 or 1).
- Returns:
int: WPC error code. Returns 0 on success, or a negative value on failure.
-
mp_obj_t DI_readAllChannels()
Read states from all digital input (DI) channels.
- Returns:
list of 8 int values: Each value is 0 or 1, representing the state of a DI channel.
-
mp_obj_t DI_readOneChannel(mp_obj_t ch)
Read state from a single digital input (DI) channel.
- Parameters:
ch – (int) Channel number (0 to 7).
- Returns:
int: Pin state (0 or 1).
SYSTEM
-
mp_obj_t Sys_getDriverVersion()
Get the version string of the stand-alone Python driver.
- Returns:
str: Version string.
-
mp_obj_t Sys_getDriverName()
Get the name string of the stand-alone Python driver.
- Returns:
str: Driver name string.
-
mp_obj_t Sys_getSerialNumber()
Get the device serial number.
- Returns:
str: Serial number string (8 characters).
-
mp_obj_t Sys_getIP()
Get the device’s IP address.
- Returns:
list of 4 int values: [x, x, x, x] representing IPv4 address.
-
mp_obj_t Sys_getSubmask()
Get the device’s subnet mask.
- Returns:
list of 4 int values: [x, x, x, x] representing subnet mask.
-
mp_obj_t Sys_getGateway()
Get the device’s gateway address.
- Returns:
list of 4 int values: [x, x, x, x] representing gateway address.
-
mp_obj_t Sys_getMAC()
Get the device’s MAC address.
- Returns:
list of 6 int values: [x, x, x, x, x, x] representing MAC address.
-
mp_obj_t Sys_reboot()
Reboot the device system.
- Returns:
int: WPC error code. Returns 0 on success, or a negative value on failure.
-
mp_obj_t Sys_startScanEngine()
Start the scan engine for data acquisition.
- Returns:
int: WPC error code. Returns 0 on success, or a negative value on failure.
-
mp_obj_t Sys_stopScanEngine()
Stop the scan engine for data acquisition.
- Returns:
int: WPC error code. Returns 0 on success, or a negative value on failure.
-
mp_obj_t Sys_getFlashSize()
Get the device’s flash memory size.
- Returns:
int: Flash size in bytes.