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

Modules

 AI_RANGE
 
 AI_STATUS
 

Functions

AI_TRANSFORM_ERR_CODE MX_RTU_AI_Raw_to_Eng (UINT32 range, int raw_value, float *eng_value)
 
AI_TRANSFORM_ERR_CODE MX_RTU_AI_Eng_to_Raw (UINT32 range, float eng_value, int *raw_value)
 
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Raw_Value_Get (UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf, struct Timestamp *time)
 
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Eng_Value_Get (UINT8 slot, UINT8 start, UINT8 count, float *buf, struct Timestamp *time)
 
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Range_Get (UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
 
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Min_Raw_Get (UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
 
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Max_Raw_Get (UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
 
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Min_Eng_Get (UINT8 slot, UINT8 start, UINT8 count, float *buf)
 
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Max_Eng_Get (UINT8 slot, UINT8 start, UINT8 count, float *buf)
 
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Burnout_Value_Get (UINT8 slot, UINT8 start, UINT8 count, float *buf)
 
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Status_Get (UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
 
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Range_Set (UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
 
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Min_Raw_Reset (UINT8 slot, UINT32 channel)
 
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Max_Raw_Reset (UINT8 slot, UINT32 channel)
 
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Min_Eng_Reset (UINT8 slot, UINT32 channel)
 
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Max_Eng_Reset (UINT8 slot, UINT32 channel)
 
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Burnout_Value_Set (UINT8 slot, UINT8 start, UINT8 count, float *buf)
 

Detailed Description

Sample Code:
ai.c

Function Documentation

AI_TRANSFORM_ERR_CODE MX_RTU_AI_Raw_to_Eng ( UINT32  range,
int  raw_value,
float *  eng_value 
)
Parameters
[in]rangeAI range
[in]raw_valueThe raw value to transform.
[out]eng_valueThe engineering value transformed form the input raw_value.
Returns
AI_TRANSFORM_ERR_CODE
AI_TRANSFORM_ERR_CODE MX_RTU_AI_Eng_to_Raw ( UINT32  range,
float  eng_value,
int *  raw_value 
)
Parameters
[in]rangeAI range
[in]eng_valueThe engineering value to transform.
[out]raw_valueThe raw value transformed form the input eng_value.
Returns
AI_TRANSFORM_ERR_CODE
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Raw_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 AI raw data for the corresponding channels.
[out]timeTimestamp of AI data.
Returns
MODULE_RW_ERR_CODE
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Eng_Value_Get ( UINT8  slot,
UINT8  start,
UINT8  count,
float *  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 AI engineering data for the corresponding channels.
[out]timeTimestamp of AI data.
Returns
MODULE_RW_ERR_CODE
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Range_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 AI range for the corresponding channels.
Returns
MODULE_RW_ERR_CODE
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Min_Raw_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 minimal AI raw data that have occurred for the corresponding channels.
Returns
MODULE_RW_ERR_CODE
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Max_Raw_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 maximal AI raw data that have occurred for the corresponding channels.
Returns
MODULE_RW_ERR_CODE
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Min_Eng_Get ( UINT8  slot,
UINT8  start,
UINT8  count,
float *  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 minimal AI engeering data that have occurred for the corresponding channels.
Returns
MODULE_RW_ERR_CODE
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Max_Eng_Get ( UINT8  slot,
UINT8  start,
UINT8  count,
float *  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 maximal AI engeering data that have occurred for the corresponding channels.
Returns
MODULE_RW_ERR_CODE
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Burnout_Value_Get ( UINT8  slot,
UINT8  start,
UINT8  count,
float *  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 burnout value for the corresponding channels.
Returns
MODULE_RW_ERR_CODE
Note
These values are valid only when the AI range is 4-20mA
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Status_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 AI status for the corresponding channels.
Returns
MODULE_RW_ERR_CODE
Note
These values are valid only when the AI range is 4-20mA
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Range_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 AI range for the corresponding channels.
Returns
MODULE_RW_ERR_CODE
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Min_Raw_Reset ( UINT8  slot,
UINT32  channel 
)
Parameters
[in]slotslot 0: Built-in IO Ports, slot 1 ~ 9: Expansion IO Ports.
[in]channelReset the minimal AI raw data that have occurred for the specified channel. The bit 0 represents channel 0 will be reset and so on.
Returns
MODULE_RW_ERR_CODE
Note
This API only reset the RAW value, reset is setting the Min value to be current value.
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Max_Raw_Reset ( UINT8  slot,
UINT32  channel 
)
Parameters
[in]slotslot 0: Built-in IO Ports, slot 1 ~ 9: Expansion IO Ports.
[in]channelReset the maximal AI raw data that have occurred for the specified channel. The bit 0 represents channel 0 will be reset and so on.
Returns
MODULE_RW_ERR_CODE
Note
This API only reset the RAW value, reset is setting the Max value to be current value.
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Min_Eng_Reset ( UINT8  slot,
UINT32  channel 
)
Parameters
[in]slotslot 0: Built-in IO Ports, slot 1 ~ 9: Expansion IO Ports.
[in]channelReset the minimal AI engeering data that have occurred for the specified channel. The bit 0 represents channel 0 will be reset and so on.
Returns
MODULE_RW_ERR_CODE
Note
This API only reset the ENG value, reset is setting the Min value to be current value.
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Max_Eng_Reset ( UINT8  slot,
UINT32  channel 
)
Parameters
[in]slotslot 0: Built-in IO Ports, slot 1 ~ 9: Expansion IO Ports.
[in]channelReset the maximal AI engeering data that have occurred for the specified channel. The bit 0 represents channel 0 will be reset and so on.
Returns
MODULE_RW_ERR_CODE
Note
This API only reset the ENG value, reset is setting the Max value to be current value.
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Burnout_Value_Set ( UINT8  slot,
UINT8  start,
UINT8  count,
float *  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 burnout value for the corresponding channels.
Returns
MODULE_RW_ERR_CODE
Note
These values are valid only when the AI range is 4-20mA