ioPAC RTU Controllers
C/C++ Sample Code Programming Guide
|
Macros | |
#define | AI_TC_RTD_EVENT_GREATER 0 |
#define | AI_TC_RTD_EVENT_SMALLER 1 |
#define | AI_TC_RTD_EVENT_EQUAL 2 |
Functions | |
IO_ERR_CODE | MX_RTU_AI_Event_Register (UINT8 slot, UINT8 channel, float value, UINT32 condition, int *handle) |
IO_ERR_CODE | MX_RTU_AI_Event_Unregister (int handle) |
IO_ERR_CODE | MX_RTU_AI_Event_Get (int handle, float *value, struct Timestamp *time) |
IO_ERR_CODE | MX_RTU_AI_Event_Set_Value (int handle, float value, UINT32 condition) |
IO_ERR_CODE | MX_RTU_AI_Event_Get_Value (int handle, float *value, UINT32 *condition) |
IO_ERR_CODE | MX_RTU_AI_Event_Count (int handle, UINT32 *count) |
IO_ERR_CODE | MX_RTU_AI_Event_Clear (int handle) |
IO_ERR_CODE | MX_RTU_AI_Event_Reset () |
Sample Code:
ai_event.c
#define AI_TC_RTD_EVENT_GREATER 0 |
#define AI_TC_RTD_EVENT_SMALLER 1 |
#define AI_TC_RTD_EVENT_EQUAL 2 |
IO_ERR_CODE MX_RTU_AI_Event_Register | ( | UINT8 | slot, |
UINT8 | channel, | ||
float | value, | ||
UINT32 | condition, | ||
int * | handle | ||
) |
[in] | slot | slot 0: Built-in IO, slot 1 ~ 9: IO Module. |
[in] | channel | channel 0 ~ 23. |
[in] | value | An AI value works with the AI Condition. |
[in] | condition | Condition should be AI_TC_RTD_EVENT_GREATER , AI_TC_RTD_EVENT_SMALLER , or AI_TC_RTD_EVENT_EQUAL . |
[out] | handle | A handle, like a file descriptor, stands for the AI Event. |
IO_ERR_CODE MX_RTU_AI_Event_Unregister | ( | int | handle | ) |
[in] | handle | A handle, like a file descriptor, stands for the AI Event. |
IO_ERR_CODE MX_RTU_AI_Event_Get | ( | int | handle, |
float * | value, | ||
struct Timestamp * | time | ||
) |
[in] | handle | A handle, like a file descriptor, stands for the AI Event. |
[out] | value | An AI value when the condition and value are matched. |
[out] | time | Timestamp of the AI Event. |
IO_ERR_CODE MX_RTU_AI_Event_Set_Value | ( | int | handle, |
float | value, | ||
UINT32 | condition | ||
) |
[in] | handle | A handle, like a file descriptor, stands for the AI Event. |
[in] | value | An AI value works with the AI Condition. |
[in] | condition | Condition should be AI_TC_RTD_EVENT_GREATER , AI_TC_RTD_EVENT_SMALLER , or AI_TC_RTD_EVENT_EQUAL . |
IO_ERR_CODE MX_RTU_AI_Event_Get_Value | ( | int | handle, |
float * | value, | ||
UINT32 * | condition | ||
) |
[in] | handle | A handle, like a file descriptor, stands for the AI Event. |
[out] | value | An AI value when the condition and value are matched. |
[out] | condition | Condition can be AI_TC_RTD_EVENT_GREATER , AI_TC_RTD_EVENT_SMALLER , or AI_TC_RTD_EVENT_EQUAL . |
IO_ERR_CODE MX_RTU_AI_Event_Count | ( | int | handle, |
UINT32 * | count | ||
) |
[in] | handle | A handle, like a file descriptor, stands for the AI Event. |
[out] | count | The amount of AI Events in I/O Event Queue. |
IO_ERR_CODE MX_RTU_AI_Event_Clear | ( | int | handle | ) |
[in] | handle | A handle, like a file descriptor, stands for the AI Event. |
IO_ERR_CODE MX_RTU_AI_Event_Reset | ( | ) |