ioPAC RTU Controllers
C/C++ Sample Code Programming Guide
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Modules | Functions
DI

Modules

 DI_MODE
 
 DI_TOGGLE
 

Functions

MODULE_RW_ERR_CODE MX_RTU_Module_DI_Value_Get (UINT8 slot, UINT32 *value, struct Timestamp *time)
 
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Mode_Get (UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
 
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Filter_Get (UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
 
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Counter_Start_Get (UINT8 slot, UINT32 *start)
 
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Counter_Trigger_Get (UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
 
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Counter_Value_Get (UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf, struct Timestamp *time)
 
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Counter_Overflow_Get (UINT8 slot, UINT32 *overflow)
 
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Mode_Set (UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
 
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Filter_Set (UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
 
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Counter_Start_Set (UINT8 slot, UINT32 start)
 
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Counter_Trigger_Set (UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
 
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Counter_Value_Set (UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
 
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Counter_Overflow_Reset (UINT8 slot, UINT32 overflow)
 

Detailed Description

Sample Code:
di.c

Function Documentation

MODULE_RW_ERR_CODE MX_RTU_Module_DI_Value_Get ( UINT8  slot,
UINT32 value,
struct Timestamp time 
)
Parameters
[in]slotslot 0: Built-in IO Ports, slot 1 ~ 9: Expansion IO Ports.
[out]valueA bitwise value to indicate all channels' values. The bit 0 represents channel 0's value and so on.
[out]timeTimestamp of DI value.
Returns
MODULE_RW_ERR_CODE
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Mode_Get ( UINT8  slot,
UINT8  start,
UINT8  count,
UINT8 buf 
)
Parameters
[in]slotslot 0: Built-in IO Ports, slot 1 ~ 9: Expansion IO Ports.
[in]startThe first channel to get.
[in]countThe number of channels to get.
[out]bufThe DI modes for the corresponding channels.
Returns
MODULE_RW_ERR_CODE
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Filter_Get ( UINT8  slot,
UINT8  start,
UINT8  count,
UINT32 buf 
)
Parameters
[in]slotslot 0: Built-in IO Ports, slot 1 ~ 9: Expansion IO Ports.
[in]startThe first channel to get.
[in]countThe number of channels to get.
[out]bufThe DI filter values for the corresponding channels.
  • ioPAC 8500: One unit = 100us.
  • ioPAC 5542: One unit = 500us.
  • ioPAC 5542-HSPA: One unit = 500us.
Returns
MODULE_RW_ERR_CODE
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Counter_Start_Get ( UINT8  slot,
UINT32 start 
)
Parameters
[in]slotslot 0: Built-in IO Ports, slot 1 ~ 9: Expansion IO Ports.
[out]startA bitwise value to indicate all channels counters' status. The bit 0's value represents channel 0's counter is started or not and so on (0: stop, 1: start).
Returns
MODULE_RW_ERR_CODE
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Counter_Trigger_Get ( UINT8  slot,
UINT8  start,
UINT8  count,
UINT8 buf 
)
Parameters
[in]slotslot 0: Built-in IO Ports, slot 1 ~ 9: Expansion IO Ports.
[in]startThe first channel to get.
[in]countThe number of channels to get.
[out]bufThe DI counter trigger conditions for the corresponding channels.
Returns
MODULE_RW_ERR_CODE
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Counter_Value_Get ( UINT8  slot,
UINT8  start,
UINT8  count,
UINT32 buf,
struct Timestamp time 
)
Parameters
[in]slotslot 0: Built-in IO Ports, slot 1 ~ 9: Expansion IO Ports.
[in]startThe first channel to get.
[in]countThe number of channels to get.
[out]bufThe counter values for the corresponding channels.
[out]timeThe Timestamp of di counter values.
Returns
MODULE_RW_ERR_CODE
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Counter_Overflow_Get ( UINT8  slot,
UINT32 overflow 
)
Parameters
[in]slotslot 0: Built-in IO Ports, slot 1 ~ 9: Expansion IO Ports.
[out]overflowA bitwise value to indicate all channels' overflow status. The bit 0's value represents channel 0's counter is overflowed or not and so on (0: ok, 1: overflow).
Returns
MODULE_RW_ERR_CODE
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Mode_Set ( UINT8  slot,
UINT8  start,
UINT8  count,
UINT8 buf 
)
Parameters
[in]slotslot 0: Built-in IO Ports, slot 1 ~ 9: Expansion IO Ports.
[in]startthe first channel to set.
[in]countthe number of channels to set.
[in]bufthe DI modes for the corresponding channels.
Returns
MODULE_RW_ERR_CODE
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Filter_Set ( UINT8  slot,
UINT8  start,
UINT8  count,
UINT32 buf 
)
Parameters
[in]slotslot 0: Built-in IO Ports, slot 1 ~ 9: Expansion IO Ports.
[in]startthe first channel to set.
[in]countthe number of channels to set.
[in]bufThe DI filter values for the corresponding channels.
  • ioPAC 8500: One unit = 100us.
  • ioPAC 5542: One unit = 500us.
  • ioPAC 5542-HSPA: One unit = 500us.
Returns
MODULE_RW_ERR_CODE
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Counter_Start_Set ( UINT8  slot,
UINT32  start 
)
Parameters
[in]slotslot 0: Built-in IO Ports, slot 1 ~ 9: Expansion IO Ports.
[in]startA bitwise value to indicate all channels counters' status. The bit 0's value represents channel 0's counter will start or not and so on (0: stop, 1: start).
Returns
MODULE_RW_ERR_CODE
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Counter_Trigger_Set ( UINT8  slot,
UINT8  start,
UINT8  count,
UINT8 buf 
)
Parameters
[in]slotslot 0: Built-in IO Ports, slot 1 ~ 9: Expansion IO Ports.
[in]startThe first channel to set.
[in]countThe number of channels to set.
[in]bufThe DI counter trigger conditions for the corresponding channels.
Returns
MODULE_RW_ERR_CODE
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Counter_Value_Set ( UINT8  slot,
UINT8  start,
UINT8  count,
UINT32 buf 
)
Parameters
[in]slotslot 0: Built-in IO Ports, slot 1 ~ 9: Expansion IO Ports.
[in]startThe first channel to set.
[in]countThe number of channels to set.
[in]bufThe counter values for the corresponding channels.
Returns
MODULE_RW_ERR_CODE
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Counter_Overflow_Reset ( UINT8  slot,
UINT32  overflow 
)
Parameters
[in]slotslot 0: Built-in IO Ports, slot 1 ~ 9: Expansion IO Ports.
[in]overflowA bitwise value to specify that the channel's overflow flag to be reset. The bit 0's value is 1 represents channel 0's counter overflow flag will be reset and so on.
Returns
MODULE_RW_ERR_CODE