BS120x Ethernet Library 1.0.0
BS120x Ethernet Library
Loading...
Searching...
No Matches
Auxiliary IO

Functions for controlling and reading auxiliary IO. More...

+ Collaboration diagram for Auxiliary IO:

Functions

int Bs120xEnet_SetDIOStates (Bs120xEnetHandle handle, const bool output[], size_t output_len, const bool direction[], size_t direction_len)
 Set the output states and directions for all DIO.
 
int Bs120xEnet_SetAnalogOutputs (Bs120xEnetHandle handle, const float voltages[], size_t voltages_len)
 Set the voltages for all analog outputs.
 
int Bs120xEnet_GetAnalogInput (Bs120xEnetHandle handle, unsigned int analog_input, float *voltage_out)
 Gets the voltage of an analog input.
 
int Bs120xEnet_GetAllAnalogInput (Bs120xEnetHandle handle, float voltage_out[], size_t voltage_out_len)
 Gets the voltages of all analog inputs.
 
int Bs120xEnet_GetDIOState (Bs120xEnetHandle handle, unsigned int dio, bool *state_out)
 Gets the output state of a DIO.
 
int Bs120xEnet_GetAllDIOState (Bs120xEnetHandle handle, bool state_out[], size_t state_out_len)
 Gets the output states of all DIO.
 

Detailed Description

Functions for controlling and reading auxiliary IO.

Function Documentation

◆ Bs120xEnet_GetAllAnalogInput()

int Bs120xEnet_GetAllAnalogInput ( Bs120xEnetHandle  handle,
float  voltage_out[],
size_t  voltage_out_len 
)

Gets the voltages of all analog inputs.

Note
The BS120x unit must have UDP data broadcast enabled for this method to return valid data.
Parameters
[in]handleEthernet client handle.
[out]voltage_outArray to store the returned voltages.
[in]voltage_out_lenLength of the voltages_out array. Must be equal to the number of analog inputs.
Returns
0 on success or a negative error code.

◆ Bs120xEnet_GetAllDIOState()

int Bs120xEnet_GetAllDIOState ( Bs120xEnetHandle  handle,
bool  state_out[],
size_t  state_out_len 
)

Gets the output states of all DIO.

Note
The BS120x unit must have UDP data broadcast enabled for this method to return valid data.
Parameters
[in]handleEthernet client handle.
[out]state_outArray to store the returned states.
[in]state_out_lenLength of the state_out array. Must be equal to the number of DIO.
Returns
0 on success or a negative error code.

◆ Bs120xEnet_GetAnalogInput()

int Bs120xEnet_GetAnalogInput ( Bs120xEnetHandle  handle,
unsigned int  analog_input,
float *  voltage_out 
)

Gets the voltage of an analog input.

Note
The BS120x unit must have UDP data broadcast enabled for this method to return valid data.
Parameters
[in]handleEthernet client handle.
[in]analog_inputThe analog input to target. Analog inputs are 0-indexed.
[out]voltage_outPointer to the returned voltage.
Returns
0 on success or a negative error code.

◆ Bs120xEnet_GetDIOState()

int Bs120xEnet_GetDIOState ( Bs120xEnetHandle  handle,
unsigned int  dio,
bool *  state_out 
)

Gets the output state of a DIO.

Note
The BS120x unit must have UDP data broadcast enabled for this method to return valid data.
Parameters
[in]handleEthernet client handle.
[in]dioThe DIO to target. DIO are 0-indexed.
[out]state_outPointer to the returned state.
Returns
0 or a negative error code.

◆ Bs120xEnet_SetAnalogOutputs()

int Bs120xEnet_SetAnalogOutputs ( Bs120xEnetHandle  handle,
const float  voltages[],
size_t  voltages_len 
)

Set the voltages for all analog outputs.

Parameters
[in]handleEthernet client handle.
[in]voltagesArray of analog output voltages.
[in]voltages_lenLength of the voltages array. Must be equal to the number of analog outputs.
Returns
0 on success or a negative error code.

◆ Bs120xEnet_SetDIOStates()

int Bs120xEnet_SetDIOStates ( Bs120xEnetHandle  handle,
const bool  output[],
size_t  output_len,
const bool  direction[],
size_t  direction_len 
)

Set the output states and directions for all DIO.

Parameters
[in]handleEthernet client handle.
[in]outputArray of output states. A TRUE value corresponds to a HIGH output.
[in]output_lenLength of the output array. Must be equal to the number of DIO.
[in]directionArray of DIO directions. A TRUE value corresponds to an output.
[in]direction_lenLength of the direction array. Must be equal to the number of DIO.
Returns
0 on success or a negative error code.