ioPAC RTU Controllers
C/C++ Sample Code Programming Guide
|
Macros | |
#define | FAST_AI_BATCH_DATA_SIZE 60*1000 |
Sample Code:
fast_ai.c
#define FAST_AI_BATCH_DATA_SIZE 60*1000 |
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Raw_Value_Get | ( | UINT8 | slot, |
UINT8 | start, | ||
UINT8 | count, | ||
UINT32 * | buf, | ||
struct Timestamp * | time | ||
) |
[in] | slot | Slot 0: Built-in IO Ports, Slots 1 ~ 9: Expansion IO Ports. |
[in] | start | The first channel to get. |
[in] | count | The number of channels to get. |
[out] | buf | The AI raw data for the corresponding channels. |
[out] | time | Timestamp of AI data. |
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Eng_Value_Get | ( | UINT8 | slot, |
UINT8 | start, | ||
UINT8 | count, | ||
float * | buf, | ||
struct Timestamp * | time | ||
) |
[in] | slot | Slot 0: Built-in IO Ports, Slots 1 ~ 9: Expansion IO Ports. |
[in] | start | The first channel to get. |
[in] | count | The number of channels to get. |
[out] | buf | The AI engineering data for the corresponding channels. |
[out] | time | Timestamp of AI data. |
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Range_Get | ( | UINT8 | slot, |
UINT8 | start, | ||
UINT8 | count, | ||
UINT8 * | buf | ||
) |
[in] | slot | Slot 0: Built-in IO Ports, Slots 1 ~ 9: Expansion IO Ports. |
[in] | start | The first channel to get. |
[in] | count | The number of channels to get. |
[out] | buf | The AI range for the corresponding channels. |
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Min_Raw_Get | ( | UINT8 | slot, |
UINT8 | start, | ||
UINT8 | count, | ||
UINT32 * | buf | ||
) |
[in] | slot | Slot 0: Built-in IO Ports, Slots 1 ~ 9: Expansion IO Ports. |
[in] | start | The first channel to get. |
[in] | count | The number of channels to get. |
[out] | buf | The AI range for the corresponding channels. |
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Max_Raw_Get | ( | UINT8 | slot, |
UINT8 | start, | ||
UINT8 | count, | ||
UINT32 * | buf | ||
) |
[in] | slot | Slot 0: Built-in IO Ports, Slots 1 ~ 9: Expansion IO Ports. |
[in] | start | The first channel to get. |
[in] | count | The number of channels to get. |
[out] | buf | The maximum AI raw data for the corresponding channels. |
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Min_Eng_Get | ( | UINT8 | slot, |
UINT8 | start, | ||
UINT8 | count, | ||
float * | buf | ||
) |
[in] | slot | Slot 0: Built-in IO Ports, Slots 1 ~ 9: Expansion IO Ports. |
[in] | start | The first channel to get. |
[in] | count | The number of channels to get. |
[out] | buf | The minimum AI engineering data for the corresponding channels. |
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Max_Eng_Get | ( | UINT8 | slot, |
UINT8 | start, | ||
UINT8 | count, | ||
float * | buf | ||
) |
[in] | slot | Slot 0: Built-in IO Ports, Slots 1 ~ 9: Expansion IO Ports. |
[in] | start | The first channel to get. |
[in] | count | The number of channels to get. |
[out] | buf | The maximum AI engineering data for the corresponding channels. |
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Burnout_Value_Get | ( | UINT8 | slot, |
UINT8 | start, | ||
UINT8 | count, | ||
float * | buf | ||
) |
[in] | slot | Slot 0: Built-in IO Ports, Slots 1 ~ 9: Expansion IO Ports. |
[in] | start | The first channel to get. |
[in] | count | The number of channels to get. |
[out] | buf | The burnout value for the corresponding channels. |
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Status_Get | ( | UINT8 | slot, |
UINT8 | start, | ||
UINT8 | count, | ||
UINT8 * | buf | ||
) |
[in] | slot | Slot 0: Built-in IO Ports, Slots 1 ~ 9: Expansion IO Ports. |
[in] | start | The first channel to get. |
[in] | count | The number of channels to get. |
[out] | buf | The AI status for the corresponding channels. |
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Range_Set | ( | UINT8 | slot, |
UINT8 | start, | ||
UINT8 | count, | ||
UINT8 * | buf | ||
) |
[in] | slot | Slot 0: Built-in IO Ports, Slots 1 ~ 9: Expansion IO Ports. |
[in] | start | The first channel to set. |
[in] | count | The number of channels to set. |
[in] | buf | The AI range for the corresponding channels. |
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Min_Raw_Reset | ( | UINT8 | slot, |
UINT32 | channel | ||
) |
[in] | slot | Slot 0: Built-in IO Ports, Slots 1 ~ 9: Expansion IO Ports. |
[in] | channel | Reset the minimum AI raw data for the specified channel. The bit 0 represents channel 0 will be reset and so on. |
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Max_Raw_Reset | ( | UINT8 | slot, |
UINT32 | channel | ||
) |
[in] | slot | Slot 0: Built-in IO Ports, Slots 1 ~ 9: Expansion IO Ports. |
[in] | channel | Reset the maximum AI raw data for the specified channel. The bit 0 represents channel 0 will be reset and so on. |
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Min_Eng_Reset | ( | UINT8 | slot, |
UINT32 | channel | ||
) |
[in] | slot | Slot 0: Built-in IO Ports, Slots 1 ~ 9: Expansion IO Ports. |
[in] | channel | Reset the minimum AI engineering data for the specified channel. The bit 0 represents channel 0 will be reset and so on. |
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Max_Eng_Reset | ( | UINT8 | slot, |
UINT32 | channel | ||
) |
[in] | slot | Slot 0: Built-in IO Ports, Slots 1 ~ 9: Expansion IO Ports. |
[in] | channel | Reset the maximum AI engineering data for the specified channel. The bit 0 represents channel 0 will be reset and so on. |
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Burnout_Value_Set | ( | UINT8 | slot, |
UINT8 | start, | ||
UINT8 | count, | ||
float * | buf | ||
) |
[in] | slot | Slot 0: Built-in IO Ports, Slots 1 ~ 9: Expansion IO Ports. |
[in] | start | The first channel to set. |
[in] | count | The number of channels to set. |
[in] | buf | The burnout value for the corresponding channels. |
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Sampling_Rate_Get | ( | UINT8 | slot, |
UINT32 * | rate | ||
) |
[in] | slot | Slot 0: Built-in IO Ports, Slots 1 ~ 9: Expansion IO Ports. |
[out] | rate | The sampling rate of the fast AI channel. |
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Buf_Overflow_Get | ( | UINT8 | slot, |
UINT32 * | overflow | ||
) |
[in] | slot | Slot 0: Built-in IO Ports, Slots 1 ~ 9: Expansion IO Ports. |
[out] | overflow | A bitwise value to indicate all channels' overflow status. The value for bit 0 indicates whether or not channel 0's buffer is overflowed (0: OK, 1: overflow). |
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Batch_Data_Get | ( | UINT8 | slot, |
UINT32 | channel, | ||
UINT32 | fore_interval, | ||
UINT32 | back_interval, | ||
UINT8 * | buf, | ||
struct Timestamp * | time | ||
) |
[in] | slot | Slot 0: Built-in IO Ports, Slots 1 ~ 9: Expansion IO Ports. |
[in] | channel | The channel to get. |
[in] | fore_interval | The pre-recording time before the trigger time (one unit = 1sec). |
[in] | back_interval | The recording time after the trigger time (one unit = 1sec). |
[out] | buf | The batch of AI raw data. |
[out] | time | Timestamp of the first AI data. |
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Sampling_Rate_Set | ( | UINT8 | slot, |
UINT32 | rate | ||
) |
[in] | slot | Slot 0: Built-in IO Ports, Slots 1 ~ 9: Expansion IO Ports. |
[in] | rate | The sampling rate of the fast AI channel. |
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Buf_Overflow_Reset | ( | UINT8 | slot, |
UINT32 | overflow | ||
) |
[in] | slot | Slot 0: Built-in IO Ports, Slots 1 ~ 9: Expansion IO Ports. |
[in] | overflow | A bitwise value to specify that the channel's buffer and overflow flag to be reset. If bit 0's value is 1, then channel 0's buffer and buffer overflow flag will be reset, and so on. |
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Trigger_Set | ( | UINT8 | slot, |
UINT32 | channel_trigger, | ||
UINT32 | fore_interval, | ||
UINT32 | back_interval, | ||
UINT32 * | required_buf_size | ||
) |
[in] | slot | Slot 0: Built-in IO Ports, Slots 1 ~ 9: Expansion IO Ports. |
[in] | channel_trigger | A bitwise value to specify that the channel to be trigger. If bit 0's value is 1, then channel 0 will be triggered, and so on. |
[in] | fore_interval | The pre-recording time before the trigger time (one unit = 1 second). |
[in] | back_interval | The recording time after the trigger time (one unit = 1 second). |
[out] | required_buf_size | The required buffer size of the batch of AI raw data. |