ioPAC RTU Controllers
C/C++ Sample Code Programming Guide
Macros | Functions
AIEvent

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 (void)
 

Detailed Description

Sample Code:
ai_event.c

Macro Definition Documentation

#define AI_TC_RTD_EVENT_GREATER   0
#define AI_TC_RTD_EVENT_SMALLER   1
#define AI_TC_RTD_EVENT_EQUAL   2

Function Documentation

IO_ERR_CODE MX_RTU_AI_Event_Register ( UINT8  slot,
UINT8  channel,
float  value,
UINT32  condition,
int *  handle 
)
Parameters
[in]slotslot 0: Built-in IO, slot 1 ~ 12: IO Module.
[in]channelchannel 0 ~ 23.
[in]valueAn AI value works with the AI Condition.
[in]conditionCondition should be AI_TC_RTD_EVENT_GREATER , AI_TC_RTD_EVENT_SMALLER , or AI_TC_RTD_EVENT_EQUAL .
[out]handleA handle, like a file descriptor, stands for the AI Event.
Returns
IO_ERR_CODE
IO_ERR_CODE MX_RTU_AI_Event_Unregister ( int  handle)
Parameters
[in]handleA handle, like a file descriptor, stands for the AI Event.
Returns
IO_ERR_CODE
IO_ERR_CODE MX_RTU_AI_Event_Get ( int  handle,
float *  value,
struct Timestamp time 
)
Parameters
[in]handleA handle, like a file descriptor, stands for the AI Event.
[out]valueAn AI value when the condition and value are matched.
[out]timeTimestamp of the AI Event.
Returns
IO_ERR_CODE
Note
Maximum I/O Events are IO_EVENT_QUEUE_MAX .
IO_ERR_CODE MX_RTU_AI_Event_Set_Value ( int  handle,
float  value,
UINT32  condition 
)
Parameters
[in]handleA handle, like a file descriptor, stands for the AI Event.
[in]valueAn AI value works with the AI Condition.
[in]conditionCondition should be AI_TC_RTD_EVENT_GREATER , AI_TC_RTD_EVENT_SMALLER , or AI_TC_RTD_EVENT_EQUAL .
Returns
IO_ERR_CODE
IO_ERR_CODE MX_RTU_AI_Event_Get_Value ( int  handle,
float *  value,
UINT32 condition 
)
Parameters
[in]handleA handle, like a file descriptor, stands for the AI Event.
[out]valueAn AI value when the condition and value are matched.
[out]conditionCondition can be AI_TC_RTD_EVENT_GREATER , AI_TC_RTD_EVENT_SMALLER , or AI_TC_RTD_EVENT_EQUAL .
Returns
IO_ERR_CODE
IO_ERR_CODE MX_RTU_AI_Event_Count ( int  handle,
UINT32 count 
)
Parameters
[in]handleA handle, like a file descriptor, stands for the AI Event.
[out]countThe amount of AI Events in I/O Event Queue.
Returns
IO_ERR_CODE
IO_ERR_CODE MX_RTU_AI_Event_Clear ( int  handle)
Parameters
[in]handleA handle, like a file descriptor, stands for the AI Event.
Returns
IO_ERR_CODE
Note
Clear all AI Events in queue.
IO_ERR_CODE MX_RTU_AI_Event_Reset ( void  )
Returns
IO_ERR_CODE
Note
Unregister all registered AI Events.