Wifi-DAQ-E3-AOD
Device pinout
API function description
- class pywpc.WifiDAQE3AOD
Analog input: 8ch simultaneous and 16-bit single-ended
Max. sampling rate: 10kHz
Input range: +/-10V
Web-based configurator
802.11 b/g/n Wi-Fi
2.4GHz to 2.5GHz
- AI_close(port, timeout=3)
Close AI module on a given port.
- Parameters
- portint
Port number. See here for available ports of different WPC devices.
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- AI_closeStreaming(port, timeout=3)
Close AI streaming acquisition on a given port. This parameter is only effective for the “N-samples” and “continuous” modes.
- Parameters
- portint
Port number. See here for available ports of different WPC devices.
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- async AI_closeStreaming_async(port)
Close AI streaming acquisition on a given port with async mode. This parameter is only effective for the “N-samples” and “continuous” modes.
- async AI_close_async(port)
Close AI module on a given port with async mode.
- AI_enableCS(slot, chip_select=[0], timeout=3)
Set AI chip selection on a given slot. This API is only effective for STEM.
- Parameters
- slotint
Slot number. See here for available ports of different WPC devices.
- chip_selectlist
Chip-number
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- async AI_enableCS_async(slot, chip_select=[0])
Set AI chip selection on a given slot with async mode. This API is only effective for STEM.
- Parameters
- slotint
Slot number. See here for available ports of different WPC devices.
- chip_selectlist
Chip-number. The default chip number is 0.
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- AI_enableChannel(port, channel, timeout=3)
Set AI channel on a given port. This API is only effective for USBDAQF1AD and USBDAQF1AOD.
- Parameters
- portint
Port number. See here for available ports of different WPC devices.
- channelint
The number of channels that you want to enable. If this parameter is set to 4, it means the AI channel is open from channel 0 to 3.
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- async AI_enableChannel_async(port, channel)
Set AI channel on a given port with async mode. This API is only effective for USBDAQF1AD and USBDAQF1AOD.
- Parameters
- portint
Port number. See here for available ports of different WPC devices.
- channelint
The number of channels that you want to enable. If this parameter is set to 4, it means the AI channel is open from channel 0 to 3.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- AI_open(port, timeout=3)
Open AI module on a given port.
- Parameters
- portint
Port number. See here for available ports of different WPC devices.
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- AI_openStreaming(port, timeout=3)
Open streaming acquisition on a given port. This parameter is only effective for the “N-samples” and “continuous” modes.
- Parameters
- portint
Port number. See here for available ports of different WPC devices.
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- async AI_openStreaming_async(port)
Open streaming acquisition on a given port with async mode. This parameter is only effective for the “N-samples” and “continuous” modes.
- async AI_open_async(port)
Open AI module on a given port with async mode.
- AI_readOnDemand(port, timeout=3)
Read one sample from a given port. This should only be used in the “on demand” mode.
- Parameters
- portint
Port number. See here for available ports of different WPC devices.
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- samplelist of float
List of AI values in volt that are measured on enabled channels.
- async AI_readOnDemand_async(port)
Read one sample from a given port with async mode. This should only be used in the “on demand” mode.
- Parameters
- portint
Port number. See here for available ports of different WPC devices.
- Returns
- samplelist of float
List of AI values in volt that are measured on enabled channels.
- AI_readStreaming(port, num_samples, delay=0.005)
Read AI streaming samples from a given port.
After streaming starts, data are acquired by the DAQ with the rate indicated by configuration. The data are then streamed to the PC and are stocked in a queue in the WPC device handle. Users should call this function to retrieve them from the queue.
- Parameters
- portint
Port number. See here for available ports of different WPC devices.
- num_samplesint
Number of samples to get out from the queue. A sample is a list of values measured simultaneously from different channels. If there are fewer samples than the expected number, the function will return all available ones after
delay
seconds expire.- delayfloat
Time in seconds to wait for the indicated amount of data to arrive. This becomes ineffective if there are already num_samples samples in the queue.
- Returns
- sample_listlist of list of float
AI data in volt. Each element of
sample_list
is a sample. A sample is a list of values measured simultaneously from different channels. For eachi
,len(sample_list[i])
should be equal to the number of enabled channels.
- async AI_readStreaming_async(port, num_samples, delay=0.005)
Read AI streaming samples from a given port with async mode.
After streaming starts, data are acquired by the DAQ with the rate indicated by configuration. The data are then streamed to the PC and are stocked in a queue in the WPC device handle. Users should call this function to retrieve them from the queue.
- Parameters
- portint
Port number. See here for available ports of different WPC devices.
- num_samplesint
Number of samples to get out from the queue. A sample is a list of values measured simultaneously from different channels. If there are fewer samples than the expected number, the function will return all available ones after
delay
seconds expire.- delayfloat
Time in seconds to wait for the indicated amount of data to arrive. This becomes ineffective if there are already num_samples samples in the queue.
- Returns
- sample_listlist of list of float
AI data in volt. Each element of
sample_list
is a sample. A sample is a list of values measured simultaneously from different channels. For eachi
,len(sample_list[i])
should be equal to the number of enabled channels.
- AI_setMode(port, mode, timeout=3)
Set AI acquisition mode on a given port.
- Parameters
- portint
Port number. See here for available ports of different WPC devices.
- modeint
Acquisition mode. 0: on demand, 1: N-samples, 2: continuous.
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- async AI_setMode_async(port, mode)
Set AI acquisition mode on a given port with async mode.
- AI_setNumSamples(port, num_samples, timeout=3)
Set number of AI samples to acquire on a given port. This parameter is only effective for the “N-samples” mode.
- Parameters
- portint
Port number. See here for available ports of different WPC devices.
- num_samplesint
Number of samples. A sample is a list of values measured simultaneously from different channels. If N channels have been enabled, then a sample is made of N values.
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- async AI_setNumSamples_async(port, num_samples)
Set number of AI samples to acquire on a given port with async mode. This parameter is only effective for the “N-samples” mode.
- Parameters
- portint
Port number. See here for available ports of different WPC devices.
- num_samplesint
Number of samples. A sample is a list of values measured simultaneously from different channels. If N channels have been enabled, then a sample is made of N values.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- AI_setSamplingRate(port, sampling_rate, timeout=3)
Set AI sampling rate on a given port. This parameter is only effective for the “N-samples” and “continuous” modes.
- Parameters
- portint
Port number. See here for available ports of different WPC devices.
- sampling_ratefloat
Sampling rate in Hz.
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- async AI_setSamplingRate_async(port, sampling_rate)
Set AI sampling rate on a given port with async mode. This parameter is only effective for the “N-samples” and “continuous” modes.
- AI_setTriggerMode(port, mode, timeout=3)
Set AI trigger mode.
- Parameters
- portint
Port number. See here for available ports of different WPC devices.
- modeint
0: Use CMD to start AI streaming 1: Use RTC to start AI streaming 2: Use EXTI to start AI streaming 3: Use CMD & RTC to start AI streaming 4: Use CMD & EXTI to start AI streaming 5: Use RTC & EXTI to start AI streaming 6: Use CMD & RTC & EXTI to start AI streaming
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- async AI_setTriggerMode_async(port, mode)
Set AI trigger mode with async mode.
- Parameters
- portint
Port number. See here for available ports of different WPC devices.
- modeint
0: Use CMD to start AI streaming 1: Use RTC to start AI streaming 2: Use EXTI to start AI streaming 3: Use CMD & RTC to start AI streaming 4: Use CMD & EXTI to start AI streaming 5: Use RTC & EXTI to start AI streaming 6: Use CMD & RTC & EXTI to start AI streaming
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- AI_startStreaming(port, timeout=3)
Start streaming acquisition on a given port. This parameter is only effective for the “N-samples” and “continuous” modes.
- Parameters
- portint
Port number. See here for available ports of different WPC devices.
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- async AI_startStreaming_async(port)
Start streaming acquisition on a given port with async mode. This parameter is only effective for the “N-samples” and “continuous” modes.
- AO_close(port, timeout=3)
Close AO module on a given port.
- Parameters
- portint
Port number. See here for available ports of different WPC devices.
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- async AO_close_async(port)
Close AO module on a given port with async mode.
- AO_getPort()
Get AO port number(s).
- Parameters
- None
- Returns
- portlist
Available AO port(s) from the device.
- AO_open(port, timeout=3)
Open AO module on a given port.
- Parameters
- portint
Port number. See here for available ports of different WPC devices.
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- async AO_open_async(port)
Open AO module on a given port with async mode.
- AO_writeAllChannels(port, value_list, timeout=3)
Write voltages to all channels on a given port. This should only be used in the “on demand” mode.
- Parameters
- portint
Port number. See here for available ports of different WPC devices.
- value_listlist of float
The list of voltages in volts.
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- async AO_writeAllChannels_async(port, value_list)
Write voltages to all channels on a given port with async mode. This should only be used in the “on demand” mode.
- AO_writeOneChannel(port, channel, value, timeout=3)
Write voltage to the specific channel. This should only be used in the “on demand” mode.
- Parameters
- portint
Port number. See here for available ports of different WPC devices.
- channelint
Channel number.
- valuefloat
Voltage in volts.
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- async AO_writeOneChannel_async(port, channel, value)
Write voltage to the specific channel with async mode. This should only be used in the “on demand” mode.
- DIO_loadStartup(port, timeout=3)
Load DIO values from EEPROM.
- Parameters
- portint
See here for available ports of different WPC devices.
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- enable_list
Get status about pin enable.
0: disable, 1: enable
- direction_list
Get status about pin direction.
0: input, 1: output
- state_list
Get status about pin state.
- async DIO_loadStartup_async(port)
Load DIO values from EEPROM with async mode.
- Parameters
- portint
See here for available ports of different WPC devices.
- Returns
- enable_list
Get status about pin enable.
0: disable, 1: enable
- direction_list
Get status about pin direction.
0: input, 1: output
- state_list
Get status about pin state.
- DI_closePins(port, pin, timeout=3)
Close the specific pin to digital intput.
- Parameters
- portint
See here for available ports of different WPC devices.
- pinint or list
Pin number you want to set. For example, you want to set pin 0, pin 1 and pin 5. pin_index will be [0, 1, 5].
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- async DI_closePins_async(port, pin)
Close the specific pin to digital intput with async mode.
- Parameters
- portint
See here for available ports of different WPC devices.
- pinint or list
Pin number you want to set. For example, you want to set pin 0, pin 1 and pin 5. pin_index will be [0, 1, 5].
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- DI_closePort(port, timeout=3)
Close all pins in the specific port to digital input.
- async DI_closePort_async(port)
Close all pins in the specific port to digital input with async mode.
- DI_getPinMap()
Get all available DI port numbers & the pins that are associated with them.
- Returns
- Pinmapdictionary
Each key is an available port. Its associated value yields the corresponding pins of that port.
Each pin is an integer representing its number.
For example: {0: [0, 1, 2, 3, 4, 5, 6, 7], 1: [0, 1, 2, 3, 4, 5]} means that there are two DI ports.
They are numbered as 0 & 1. Port 0 has 8 pins: P0.0 to P0.7. Port 1 has 6 pins: P1.0 to P1.5.
General format: {DI_port: [pin, …, pin]}.
- DI_openPins(port, pin, timeout=3)
Open the specific pin to digital intput.
- Parameters
- portint
See here for available ports of different WPC devices.
- pinint or list
Pin number you want to set. For example, you want to set pin 0, pin 1 and pin 5. pin_index will be [0, 1, 5].
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- async DI_openPins_async(port, pin)
Open the specific pin to digital intput with async mode.
- Parameters
- portint
See here for available ports of different WPC devices.
- pinint or list
Pin number you want to set. For example, you want to set pin 0, pin 1 and pin 5. pin_index will be [0, 1, 5].
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- DI_openPort(port, timeout=3)
Open all pins in the specific port to digital input.
- async DI_openPort_async(port)
Open all pins in the specific port to digital input with async mode.
- DI_readPins(port, pin, timeout=3)
Read the specefic pin state.
- Parameters
- portint
See here for available ports of different WPC devices.
- pinint or list
Pin number you want to set. For example, you want to set pin 0, pin 1 and pin 5. pin_index will be [0, 1, 5].
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statelist
Get status about pin state.
- async DI_readPins_async(port, pin)
Read the specefic pin state with async mode.
- Parameters
- portint
See here for available ports of different WPC devices.
- pinint or list
Pin number you want to set. For example, you want to set pin 0, pin 1 and pin 5. pin_index will be [0, 1, 5].
- Returns
- statelist
Get status about pin state.
- DI_readPort(port, timeout=3)
Read all pins state in the specific port.
- Parameters
- portint
See here for available ports of different WPC devices.
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statelist
Get status about pin state.
- async DI_readPort_async(port)
Read all pins state in the specific port with async mode.
- Parameters
- portint
See here for available ports of different WPC devices.
- Returns
- statelist
Get status about pin state.
- DO_closePins(port, pin, timeout=3)
Close the specific pin to digital output.
- Parameters
- portint
See here for available ports of different WPC devices.
- pinint or list
Pin number you want to set. For example, you want to set pin 0, pin 1 and pin 5. pin_index will be [0, 1, 5].
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- async DO_closePins_async(port, pin)
Close the specific pin to digital output with async mode.
- Parameters
- portint
See here for available ports of different WPC devices.
- pinlist
Pin number you want to close.
For example, you want to close pin 0, pin 1 and pin 5.
pin [0,1,5].
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- DO_closePort(port, timeout=3)
Close all pins in the specific port with digital output.
- async DO_closePort_async(port)
Close all pins in the specific port with digital output with async mode.
- DO_getPinMap()
Get all available DO port numbers & the pins that are associated with them.
- Returns
- Pinmapdictionary
Each key is an available port. Its associated value yields the corresponding pins of that port.
Each pin is an integer representing its number.
For example: {0: [0, 1, 2, 3, 4, 5, 6, 7], 1: [0, 1, 2, 3, 4, 5]} means that there are two DO ports.
They are numbered as 0 & 1. Port 0 has 8 pins: P0.0 to P0.7. Port 1 has 6 pins: P1.0 to P1.5.
General format: {DO_port: [pin, …, pin]}.
- DO_openPins(port, pin, timeout=3)
Open the specific pin to digital output.
- Parameters
- portint
See here for available ports of different WPC devices.
- pinint or list
Pin number you want to set. For example, you want to set pin 0, pin 1 and pin 5. pin_index will be [0, 1, 5].
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- async DO_openPins_async(port, pin)
Open the specific pin to digital output with async mode.
- Parameters
- portint
See here for available ports of different WPC devices.
- pinint or list
Pin number you want to set to digital output.
For example, you want to set pin 0, pin 1 and pin 5.
pin [0, 1, 5].
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- DO_openPort(port, timeout=3)
Open all pins in the specific port to digital output.
- async DO_openPort_async(port)
Open all pins in the specific port to digital output with async mode.
- DO_togglePins(port, pin, timeout=3)
Toggle the specific pin.
- Parameters
- portint
See here for available ports of different WPC devices.
- pinint or list
Pin number you want to set. For example, you want to set pin 0, pin 1 and pin 5. pin_index will be [0, 1, 5].
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statelist
The list of pins state.
- async DO_togglePins_async(port, pin)
Toggle the specific pin with async mode.
- Parameters
- portint
See here for available ports of different WPC devices.
- pinint or list
Pin number you want to set. For example, you want to set pin 0, pin 1 and pin 5. pin_index will be [0, 1, 5].
- Returns
- statelist
The list of pins state.
- DO_togglePort(port, timeout=3)
Toggle all pins in the specific port.
- Parameters
- portint
See here for available ports of different WPC devices.
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statelist
The list of pins state.
- async DO_togglePort_async(port)
Toggle all pins in the specific port with async mode.
- Parameters
- portint
See here for available ports of different WPC devices.
- Returns
- statelist
The list of pins state.
- DO_writePins(port, pin, value, timeout=3)
Write high or low value to the specific pin.
- Parameters
- portint
See here for available ports of different WPC devices.
- pinint or list
Pin number you want to set.
For example, you want to set pin 0, pin 1 and pin 5.
pin = [0, 1, 5].
- valueint or list
Pin number you want to set high or low.
High = 1, Low = 0.
For example, set pin 0 and pin 1 to high, and pin 5 to low.
value = [1, 1, 0].
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- async DO_writePins_async(port, pin, value)
Write high or low value to the specific pin with async mode.
- Parameters
- portint
See here for available ports of different WPC devices.
- pinint or list
Pin number you want to set.
For example, you want to set pin 0, pin 1 and pin 5.
pin = [0, 1, 5].
- valueint or list
Pin number you want to set high or low.
High = 1, Low = 0.
For example, set pin 0 and pin 1 to high, and pin 5 to low.
value = [1, 1, 0].
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- DO_writePort(port, value, timeout=3)
Write high or low value to all pins in the specefic port.
- Parameters
- portint
See here for available ports of different WPC devices.
- valueint or list
Pin number you want to set digital high or low.
High = 1, Low = 0.
For example if intput type is list
you want to write pin 0 and pin 2 to high, others to low.
[1, 0, 1, 0, 0, 0, 0, 0] in LSB.
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- async DO_writePort_async(port, value)
Write high or low value to all pins in the specefic port with async mode.
- Parameters
- portint
See here for available ports of different WPC devices.
- valueint or list
Pin number you want to set digital high or low.
High = 1, Low = 0.
For example if intput type is list
you want to write pin 0 and pin 2 to high, others to low.
[1, 0, 1, 0, 0, 0, 0 ,0] in LSB.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- Logger_openFile(filename, clear_old=True, verbose=True)
Open CSV file.
- Parameters
- filenamestr
The file name.
- clear_oldbool, default: True
Whether to clear old data (if the file alread exists) or not.
- verbosebool, default: True
Whether to print message out.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- Logger_write2DList(value_mat)
Write list of list into file.
- Parameters
- value_matlist of list
The list of list of data to be written.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- Logger_writeHeader(header)
Write header into file.
- Parameters
- headerlist of str
Header to be written.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- Logger_writeList(value_list)
Write list into file.
- Parameters
- value_listlist
The list of data to be written.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- Logger_writeValue(value)
Write value into file.
- Parameters
- valueobject
The data to be written.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- Net_getGateway(timeout=3)
Get geteway from the connected web device.
- Parameters
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- gatewaystr of 4 int separated by period.
Network gateway.
- async Net_getGateway_async()
Get geteway from the connected web device with async mode.
- Returns
- gatewaystr of 4 int separated by period.
Network gateway.
- Net_getIPAddrAndSubmask(timeout=3)
Get IP address and subnet mask from the connected web device.
- Parameters
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- network_infolist of 2 str.
network_info[0]
: IP addressnetwork_info[1]
: subnet mask
- async Net_getIPAddrAndSubmask_async()
Get IP address and subnet mask from the connected web device with async mode.
- Returns
- network_infolist of 2 str.
network_info[0]
: IP addressnetwork_info[1]
: subnet mask
- Net_getMACAddr(timeout=3)
Get MAC address from the connected web device.
- Parameters
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- mac_addrstr of 6 int separated by colon.
MAC address.
- async Net_getMACAddr_async()
Get MAC address from the connected web device with async mode.
- Returns
- mac_addrstr of 6 int separated by colon.
MAC address.
- Net_setIPAddrAndSubmask(ip_addr, subnet_mask='255.255.255.0', timeout=3)
Set IP address and subnet mask to the connected web device.
- Parameters
- ip_addrstr of 4 int separated by period.
IP network address.
- subnet_maskstr of 4 int separated by period.
Subnet mask. (default: “255.255.255.0”)
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- async Net_setIPAddrAndSubmask_async(ip_addr, subnet_mask='255.255.255.0')
Set IP address and subnet mask to the connected web device with async mode.
- Parameters
- ip_addrstr of 4 int separated by period.
IP network address.
- subnet_maskstr of 4 int separated by period.
Subnet mask. (default: “255.255.255.0”)
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- SD_closeFile(timeout=3)
Close file in SD card.
- Parameters
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- async SD_closeFile_async()
Close file in SD card with async mode.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- SD_getStorage(timeout=3)
Get SD card storage.
- Parameters
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- storageint
The SD card storage in MB.
- async SD_getStorage_async()
Get SD card storage with async mode.
- Returns
- storageint
The SD card storage in MB.
- SD_openFile(filename, mode, timeout=3)
Open file in SD card.
- Parameters
- filenamestr
The file name.
- modeint
Open mode. 0: write, 1:read
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- async SD_openFile_async(filename, mode)
Open file in SD card with async mode.
- Parameters
- filenamestr
The file name.
- modeint
Open mode. 0: write, 1:read
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- SD_readFile(byte_to_read, timeout=3)
Read data from SD card.
- Parameters
- bytes_to_readint
The number of bytes to receive.
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- datalist
The list of received data.
- async SD_readFile_async(byte_to_read)
Read data from SD card with async mode.
- Parameters
- bytes_to_readint
The number of bytes to receive.
- Returns
- datalist
The list of received data.
- SD_writeFile(write_data, timeout=3)
Write data in SD card.
- Parameters
- write_datastring or list of characters
Data to be transferred.
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- async SD_writeFile_async(write_data)
Write data in SD card with async mode.
- Parameters
- write_datastring or list of characters
Data to be transferred.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- Sys_getDeviceAlias(timeout=3)
Get device alias name.
- Parameters
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- Alias namestring
The alias name of the device.
- async Sys_getDeviceAlias_async()
Get device alias name with async mode.
- Returns
- Alias namestring
The alias name of the device.
- Sys_getDriverInfo(timeout=3)
Get device firmware information.
- Parameters
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- driver_infolist of three string
driver_info[0]
: Model name.driver_info[1]
: Mode.driver_info[2]
: Firmware version.
- async Sys_getDriverInfo_async()
Get device firmware information with async mode.
- Returns
- driver_infolist of three string
driver_info[0]
: Model name.driver_info[1]
: Mode.driver_info[2]
: Firmware version.
- Sys_getGateway(timeout=3)
Deprecated in v1.0.5. Will be removed in v1.2.0.
See :ref:
Net_getGateway
.
- async Sys_getGateway_async()
Deprecated in v1.0.5. Will be removed in v1.2.0.
See :ref:
Net_getGateway_async
.
- Sys_getIPAddrAndSubmask(timeout=3)
Deprecated in v1.0.5. Will be removed in v1.2.0.
See :ref:
Net_getIPAddrAndSubmask
.
- async Sys_getIPAddrAndSubmask_async()
Deprecated in v1.0.5. Will be removed in v1.2.0.
See :ref:
Net_getIPAddrAndSubmask_async
.
- Sys_getMACAddr(timeout=3)
Deprecated in v1.0.5. Will be removed in v1.2.0.
See :ref:
Net_getMACAddr
.
- async Sys_getMACAddr_async()
Deprecated in v1.0.5. Will be removed in v1.2.0.
See :ref:
Net_getMACAddr_async
.
- Sys_getMode(slot, timeout=3)
Get the mode from a given slot.
- Parameters
- slotint
Slot number. See here for available slot of different WPC devices.
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- str_str
Mode of slot.
- async Sys_getMode_async(slot)
Get the mode from a given slot with async mode.
- Parameters
- slotint
Slot number. See here for available slot of different WPC devices.
- Returns
- str_str
Mode of slot.
- Sys_getPinModeInPort(port, timeout=3)
Get pin mode in specific port.
- Parameters
- portint
See here for available ports of different WPC devices.
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- pinsint
How many pins in specific port.
- pin_modelist of 8 string
[pin0, pin1,……pin7]
pinmode : Disabled, Idle, DI, DO, UART, I2C, SPI, CAN, PWM and ADC.
- async Sys_getPinModeInPort_async(port)
Get pin mode in specific port with async mode.
- Parameters
- portint
See here for available ports of different WPC devices.
- Returns
- pinsint
How many pins in specific port.
- pin_modelist of 8 string
[pin0, pin1,……pin7]
pinmode : Disabled, Idle, DI, DO, UART, I2C, SPI, CAN, PWM and ADC.
- Sys_getPythonVersion(timeout=3)
Get python software version.
- Parameters
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- versionstring
- async Sys_getPythonVersion_async()
Get python software version with async mode.
- Returns
- versionstring
- Sys_getRTC(timeout=3)
Get RTC date and time.
- Parameters
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- str_str
- Date and time represented by “A-B-C, D:E:F”.
“A” is year.
“B” is month.
“C” is day.
“D” is hour.
“E” is minute.
“F” is second.
- async Sys_getRTC_async()
Get RTC date and time with async mode.
- Returns
- str_str
- Date and time represented by “A-B-C, D:E:F”.
“A” is year.
“B” is month.
“C” is day.
“D” is hour.
“E” is minute.
“F” is second.
- Sys_getSerialNumber(timeout=3)
Get serial number.
- Parameters
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- str_str
Serial number represented by string of 8 characters.
- async Sys_getSerialNumber_async()
Get serial number with async mode.
- Returns
- str_str
Serial number represented by string of 8 characters.
- Sys_reboot(timeout=3)
Reboot the device.
- Parameters
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- async Sys_reboot_async()
Reboot the device with async mode.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- Sys_setAIOMode(slot, timeout=3)
Set the AIO state on a given slot.
- Parameters
- slotint
Slot number. See here for available slot of different WPC devices.
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- async Sys_setAIOMode_async(slot)
Set the AIO state on a given slot with async mode.
- Sys_setDIMode(slot, timeout=3)
Set the DI state on a given slot.
- Parameters
- slotint
Slot number. See here for available slot of different WPC devices.
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- async Sys_setDIMode_async(slot)
Set the DI state on a given slot with async mode.
- Sys_setDIOMode(slot, timeout=3)
Set the DIO state for the slot in the connected WPC device.
- Parameters
- slotint
Slot number. See here for available slot of different WPC devices.
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- async Sys_setDIOMode_async(slot)
Set the DIO state for the slot in the connected WPC device with async mode.
- Sys_setDOMode(slot, timeout=3)
Set the DO state for the slot in the connected WPC device.
- Parameters
- slotint
Slot number. See here for available slot of different WPC devices.
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- async Sys_setDOMode_async(slot)
Set the DO state for the slot in the connected WPC device with async mode.
- Sys_setDeviceAlias(alias, timeout=3)
Set the alias name of the device.
- Parameters
- aliasstr
The alias name of the device
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- async Sys_setDeviceAlias_async(alias)
Set the alias name of the device.
- Parameters
- aliasstr
The alias name of the device
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- Sys_setIPAddrAndSubmask(ip_addr, subnet_mask='255.255.255.0', timeout=3)
Deprecated in v1.0.5. Will be removed in v1.2.0.
See :ref:
Net_setIPAddrAndSubmask
.
- async Sys_setIPAddrAndSubmask_async(ip_addr, subnet_mask='255.255.255.0')
Deprecated in v1.0.5. Will be removed in v1.2.0.
See :ref:
Net_setIPAddrAndSubmask_async
.
- Sys_setIdleMode(slot, timeout=3)
Set the IDLE state on a given slot.
- Parameters
- slotint
Slot number. See here for available slot of different WPC devices.
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- async Sys_setIdleMode_async(slot)
Set the IDLE state on a given slot with async mode.
- Sys_setMotionMode(slot, timeout=3)
Set the motion state on a given slot.
- Parameters
- slotint
Slot number. See here for available slot of different WPC devices.
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- async Sys_setMotionMode_async(slot)
Set the motion state on a given slot with async mode.
- Sys_setRTC(year, month, day, hour, minute, second, timeout=3)
Set RTC date and time.
- Parameters
- yearint
year (CE).
- monthint
month (1~12).
- dayint
day (1~31).
- hourint
hour (24-hour clock) (0~23).
- minuteint
minute (0~59).
- secondint
second (0~59).
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- async Sys_setRTC_async(year, month, day, hour, minute, second)
Set RTC date and time with async mode.
- Parameters
- yearint
year (CE).
- monthint
month (1~12).
- dayint
day (1~31).
- hourint
hour (24-hour clock) (0~23).
- minuteint
minute (0~59).
- secondint
second (0~59).
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- Sys_setSwitchMode(slot, timeout=3)
Set the switch state on a given slot.
- Parameters
- slotint
Slot number. See here for available slot of different WPC devices.
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- async Sys_setSwitchMode_async(slot)
Set the switch state on a given slot with async mode.
- Sys_startRTCAlarm(mode, day, hour, minute, second, timeout=3)
Start RTC time to alarm AI.
- Parameters
- modeint
0: Day value interpreted as calendar day. 1: Day value interpreted as weekday.
- dayint
Celendar day (1~31)/ Weekday (1~7).
- hourint
hour (24-hour clock) (0~23).
- minuteint
minute (0~59).
- secondint
second (0~59).
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- async Sys_startRTCAlarm_async(mode, day, hour, minute, second)
Start RTC time to alarm AI with async mode.
- Parameters
- modeint
0: Day value interpreted as calendar day. 1: Day value interpreted as weekday.
- dayint
Celendar day (1~31)/ Weekday (1~7).
- hourint
hour (24-hour clock) (0~23).
- minuteint
minute (0~59).
- secondint
second (0~59).
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- Sys_stopRTCAlarm(timeout=3)
Stop alarming.
- Parameters
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- async Sys_stopRTCAlarm_async()
Stop alarming with async mode.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- Wifi_getChargeStatus(timeout=3)
Get status about the battery being charged from WifiDAQ.
- Parameters
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Charge status.
- async Wifi_getChargeStatus_async()
Get status about the battery being charged from WifiDAQ with async mode.
- Parameters
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Charge status.
- Wifi_getConfiguration(timeout=3)
Get reconnection times and AP stay time from WifiDAQ.
- Parameters
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- wifi_configurationlist of 2 positive int.
wifi_configuration[0]
: Wifi connection retry timeswifi_configuration[1]
: Time of staying in AP mode in second
- async Wifi_getConfiguration_async()
Get reconnection times and AP stay time from WifiDAQ with async mode.
- Returns
- wifi_configurationlist of 2 positive int.
wifi_configuration[0]
: Wifi connection retry timeswifi_configuration[1]
: Time of staying in AP mode in second
- Wifi_getPowerGoodStatus(timeout=3)
Get status about the battery being fully charged from WifiDAQ.
- Parameters
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Battery status.
- async Wifi_getPowerGoodStatus_async()
Get status about the battery being fully charged from WifiDAQ with async mode.
- Parameters
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Battery status.
- Wifi_getWifiBandWidth(timeout=3)
Get the bandwidth from WifiDAQ.
- Parameters
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- bandwidthint
1 : bandwidth is HT20.
2 : bandwidth is HT40.
- async Wifi_getWifiBandWidth_async()
Get the bandwidth from WifiDAQ with async mode.
- Returns
- bandwidthint
1 : bandwidth is HT20.
2 : bandwidth is HT40.
- Wifi_readBattery(timeout=3)
Get volatge of battery from WifiDAQ.
- Parameters
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- batteryint
Battery level in mV.
- async Wifi_readBattery_async()
Get volatge of battery from WifiDAQ with async mode.
- Returns
- batteryint
Battery level in mV.
- Wifi_readRSSI(timeout=3)
Read the signal strength from WifiDAQ.
- Parameters
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- rssiint
RSSI signal in dBm.
- async Wifi_readRSSI_async()
Read the signal strength from WifiDAQ with async mode.
- Returns
- rssiint
RSSI signal in dBm.
- Wifi_resetLED(timeout=3)
Reset LED to WifiDAQ.
- Parameters
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- async Wifi_resetLED_async()
Reset LED to WifiDAQ with async mode.
- Parameters
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- Wifi_setBlueLED(value, timeout=3)
Set the blue LED status, while turning off the others to WifiDAQ.
- Parameters
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- valueint
High(1) or low(0) value.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- async Wifi_setBlueLED_async(value)
Set the blue LED status, while turning off the others to WifiDAQ with async mode.
- Parameters
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- valueint
High(1) or low(0) value.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- Wifi_setGreenLED(value, timeout=3)
Set the green LED status, while turning off the others to WifiDAQ.
- Parameters
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- valueint
High(1) or low(0) value.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- async Wifi_setGreenLED_async(value)
Set the green LED status, while turning off the others to WifiDAQ with async mode.
- Parameters
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- valueint
High(1) or low(0) value.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- Wifi_setRedLED(value, timeout=3)
Set the red LED status, while turning off the others to WifiDAQ.
- Parameters
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- valueint
High(1) or low(0) value.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- async Wifi_setRedLED_async(value)
Set the red LED status, while turning off the others to WifiDAQ with async mode.
- Parameters
- timeoutint
Specify the time (sec) to wait before reporting a timeout error. The default is 3 s.
- valueint
High(1) or low(0) value.
- Returns
- statusint
Return 0 if executed successfully; return error code otherwise. See here for corresponding error messages.
- close()
Close wifi device handle.
- Parameters
- verbose: bool, default: True
Whether to print out messages or not.
- Returns
- None
- connect(ip)
Connect handle to wifi device.
- Parameters
- ipstr of 4 int separated by period.
IP network address of the WPC device to connect to.
- port1int, default: 7
TCP port for commands.
- port2int, default: 1336
TCP port for data.
- verbose: bool, default: True
Whether to print out messages or not.
- Returns
- None
- disconnect()
Disconnect handle from wifi device.
- Parameters
- verbose: bool, default: True
Whether to print out messages or not.
- Returns
- None