ioPAC RTU Controllers
C/C++ Sample Code Programming Guide
|
Modules | |
AO_RANGE | |
AO_STATUS | |
AO_WAVEFORM_TYPE | |
Sample Code:
ao.c
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Enable_Get | ( | UINT8 | slot, |
UINT8 | start, | ||
UINT8 | count, | ||
UINT8 * | buf | ||
) |
[in] | slot | slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports. |
[in] | start | The first channel to get. |
[in] | count | The number of channels to get. |
[out] | buf | The enable status for the corresponding channels. 0: disable, 1: enable. |
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Range_Get | ( | UINT8 | slot, |
UINT8 | start, | ||
UINT8 | count, | ||
UINT8 * | buf | ||
) |
[in] | slot | slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports. |
[in] | start | The first channel to get. |
[in] | count | The number of channels to get. |
[out] | buf | The AO range for the corresponding channels. |
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Raw_Value_Get | ( | UINT8 | slot, |
UINT8 | start, | ||
UINT8 | count, | ||
UINT32 * | buf | ||
) |
[in] | slot | slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports. |
[in] | start | The first channel to get. |
[in] | count | The number of channels to get. |
[out] | buf | The AO raw data for the corresponding channels. |
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Eng_Value_Get | ( | UINT8 | slot, |
UINT8 | start, | ||
UINT8 | count, | ||
float * | buf | ||
) |
[in] | slot | slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports. |
[in] | start | The first channel to get. |
[in] | count | The number of channels to get. |
[out] | buf | The AO engineering data for the corresponding channels. |
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Status_Get | ( | UINT8 | slot, |
UINT8 | start, | ||
UINT8 | count, | ||
UINT8 * | buf | ||
) |
[in] | slot | slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports. |
[in] | start | The first channel to get. |
[in] | count | The number of channels to get. |
[out] | buf | The AO status for the corresponding channels. |
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Type_Get | ( | UINT8 | slot, |
UINT8 | start, | ||
UINT8 | count, | ||
UINT8 * | buf | ||
) |
[in] | slot | slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports. |
[in] | start | The first channel to set. |
[in] | count | The number of channels to set. |
[out] | buf | The waveform type for the corresponding channels. |
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Config_Get | ( | UINT8 | slot, |
UINT8 | start, | ||
UINT8 | count, | ||
float * | frequency, | ||
float * | amplitude, | ||
float * | offset | ||
) |
[in] | slot | slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports. |
[in] | start | The first channel to get. |
[in] | count | The number of channels to get. |
[out] | frequency | The waveform frequency (Hz) for the corresponding channels. Range = 0.01Hz ~ MAX supported freqency. |
[out] | amplitude | The waveform amplitude (engineering value) for the corresponding channels. |
[out] | offset | The waveform offset (engineering value) for the corresponding channels. Range = -10V ~ 10V. |
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Count_Get | ( | UINT8 | slot, |
UINT8 | start, | ||
UINT8 | count, | ||
UINT32 * | buf | ||
) |
[in] | slot | slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports. |
[in] | start | The first channel to set. |
[in] | count | The number of channels to set. |
[out] | buf | The numbers of waveform count for the corresponding channels. |
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Start_Get | ( | UINT8 | slot, |
UINT32 * | start | ||
) |
[in] | slot | slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports. |
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Enable_Set | ( | UINT8 | slot, |
UINT8 | start, | ||
UINT8 | count, | ||
UINT8 * | buf | ||
) |
[in] | slot | slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports. |
[in] | start | The first channel to set. |
[in] | count | The number of channels to set. |
[in] | buf | The enable status for the corresponding channels. 0: disable, 1: enable. |
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Range_Set | ( | UINT8 | slot, |
UINT8 | start, | ||
UINT8 | count, | ||
UINT8 * | buf | ||
) |
[in] | slot | slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports. |
[in] | start | The first channel to set. |
[in] | count | The number of channels to set. |
[in] | buf | The AO range for the corresponding channels. |
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Raw_Value_Set | ( | UINT8 | slot, |
UINT8 | start, | ||
UINT8 | count, | ||
UINT32 * | buf | ||
) |
[in] | slot | slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports. |
[in] | start | The first channel to set. |
[in] | count | The number of channels to set. |
[out] | buf | The output value for the corresponding channels. |
0x800 | 0xC00 | 0x000 | 0x3FF | 0x7FF |
---|---|---|---|---|
-10V | -5V | 0V | 5V | 10V |
0x000 | 0x3FF | 0x7FF | 0xBFF | 0xFFF |
---|---|---|---|---|
0V | 2.5V | 5V | 7.5V | 10V |
0x000 | 0x3FF | 0x7FF | 0xBFF | 0xFFF |
---|---|---|---|---|
0mA | 5mA | 10mA | 15mA | 20mA |
0x000 | 0x3FF | 0x7FF | 0xBFF | 0xFFF |
---|---|---|---|---|
4mA | 8mA | 12mA | 16mA | 20mA |
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Eng_Value_Set | ( | UINT8 | slot, |
UINT8 | start, | ||
UINT8 | count, | ||
float * | buf | ||
) |
[in] | slot | slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports. |
[in] | start | The first channel to set. |
[in] | count | The number of channels to set. |
[out] | buf | The output value for the corresponding channels. |
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Type_Set | ( | UINT8 | slot, |
UINT8 | start, | ||
UINT8 | count, | ||
UINT8 * | buf | ||
) |
[in] | slot | slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports. |
[in] | start | The first channel to set. |
[in] | count | The number of channels to set. |
[in] | buf | The waveform type for the corresponding channels. |
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Config_Set | ( | UINT8 | slot, |
UINT8 | start, | ||
UINT8 | count, | ||
float * | frequency, | ||
float * | amplitude, | ||
float * | offset | ||
) |
[in] | slot | slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports. |
[in] | start | The first channel to get. |
[in] | count | The number of channels to get. |
[in] | frequency | The waveform frequency (Hz) for the corresponding channels. Range = 0.01Hz ~ MAX supported freqency. |
[in] | amplitude | The waveform amplitude (engineering value) for the corresponding channels. |
[in] | offset | The waveform offset (engineering value) for the corresponding channels. Range = -10V ~ 10V. |
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Count_Set | ( | UINT8 | slot, |
UINT8 | start, | ||
UINT8 | count, | ||
UINT32 * | buf | ||
) |
[in] | slot | slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports. |
[in] | start | The first channel to set. |
[in] | count | The number of channels to set. |
[in] | buf | The numbers of waveform count for the corresponding channels. |
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Start_Set | ( | UINT8 | slot, |
UINT32 | start | ||
) |
[in] | slot | slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports. |
[in] | start | A bitwise value to indicate all channels waveforms' status. The bit 0's value represents channel 0's waveform will start or ignore and so on (0: ignore, 1: start). |
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Stop_Set | ( | UINT8 | slot, |
UINT32 | stop | ||
) |
[in] | slot | slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports. |
[in] | stop | A bitwise value to indicate all channels waveforms' status. The bit 0's value represents channel 0's waveform will stop or ignore and so on (0: ignore, 1: stop). |