ioPAC RTU Controllers
C/C++ Sample Code Programming Guide
|
Macros | |
#define | DI_EVENT_TOGGLE_L2H 0 |
#define | DI_EVENT_TOGGLE_H2L 1 |
#define | DI_EVENT_TOGGLE_BOTH 2 |
Functions | |
IO_ERR_CODE | MX_RTU_DI_Event_Register (UINT8 slot, UINT8 channel, UINT32 trigger, int *handle) |
IO_ERR_CODE | MX_RTU_DI_Event_Unregister (int handle) |
IO_ERR_CODE | MX_RTU_DI_Event_Get (int handle, UINT32 *status, struct Timestamp *time) |
IO_ERR_CODE | MX_RTU_DI_Event_Set_Trigger (int handle, UINT32 trigger) |
IO_ERR_CODE | MX_RTU_DI_Event_Get_Trigger (int handle, UINT32 *trigger) |
IO_ERR_CODE | MX_RTU_DI_Event_Count (int handle, UINT32 *count) |
IO_ERR_CODE | MX_RTU_DI_Event_Clear (int handle) |
IO_ERR_CODE | MX_RTU_DI_Event_Reset () |
Sample Code:
di_event.c
#define DI_EVENT_TOGGLE_L2H 0 |
#define DI_EVENT_TOGGLE_H2L 1 |
#define DI_EVENT_TOGGLE_BOTH 2 |
IO_ERR_CODE MX_RTU_DI_Event_Register | ( | UINT8 | slot, |
UINT8 | channel, | ||
UINT32 | trigger, | ||
int * | handle | ||
) |
[in] | slot | slot 0: Built-in IO, slot 1 ~ 12: IO Module. |
[in] | channel | channel 0 ~ 23. |
[in] | trigger | Trigger should be DI_EVENT_TOGGLE_L2H , DI_EVENT_TOGGLE_H2L , or DI_EVENT_TOGGLE_BOTH . |
[out] | handle | A handle, like a file descriptor, stands for the DI Event. |
IO_ERR_CODE MX_RTU_DI_Event_Unregister | ( | int | handle | ) |
[in] | handle | A handle, like a file descriptor, stands for the DI Event. |
IO_ERR_CODE MX_RTU_DI_Event_Get | ( | int | handle, |
UINT32 * | status, | ||
struct Timestamp * | time | ||
) |
[in] | handle | A handle, like a file descriptor, stands for the DI Event. |
[out] | status | A DI status when the trigger is matched. |
[out] | time | Timestamp of the DI Event. |
IO_ERR_CODE MX_RTU_DI_Event_Set_Trigger | ( | int | handle, |
UINT32 | trigger | ||
) |
[in] | handle | A handle, like a file descriptor, stands for the DI Event. |
[in] | trigger | Trigger should be DI_EVENT_TOGGLE_L2H , DI_EVENT_TOGGLE_H2L , or DI_EVENT_TOGGLE_BOTH . |
IO_ERR_CODE MX_RTU_DI_Event_Get_Trigger | ( | int | handle, |
UINT32 * | trigger | ||
) |
[in] | handle | A handle, like a file descriptor, stands for the DI Event. |
[out] | trigger | Trigger can be DI_EVENT_TOGGLE_L2H , DI_EVENT_TOGGLE_H2L , or DI_EVENT_TOGGLE_BOTH . |
IO_ERR_CODE MX_RTU_DI_Event_Count | ( | int | handle, |
UINT32 * | count | ||
) |
[in] | handle | A handle, like a file descriptor, stands for the DI Event. |
[out] | count | The amount of DI Events in I/O Event Queue. |
IO_ERR_CODE MX_RTU_DI_Event_Clear | ( | int | handle | ) |
[in] | handle | A handle, like a file descriptor, stands for the DI Event. |
IO_ERR_CODE MX_RTU_DI_Event_Reset | ( | ) |