ioPAC RTU Controllers
C/C++ Sample Code Programming Guide
Modules | Functions
AO

Modules

 AO_RANGE
 
 AO_STATUS
 
 AO_WAVEFORM_TYPE
 

Functions

MODULE_RW_ERR_CODE MX_RTU_Module_AO_Enable_Get (UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
 
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Range_Get (UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
 
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Raw_Value_Get (UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
 
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Eng_Value_Get (UINT8 slot, UINT8 start, UINT8 count, float *buf)
 
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Status_Get (UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
 
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Type_Get (UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
 
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Config_Get (UINT8 slot, UINT8 start, UINT8 count, float *frequency, float *amplitude, float *offset)
 
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Count_Get (UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
 
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Start_Get (UINT8 slot, UINT32 *start)
 
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Enable_Set (UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
 
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Range_Set (UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
 
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Raw_Value_Set (UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
 
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Eng_Value_Set (UINT8 slot, UINT8 start, UINT8 count, float *buf)
 
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Type_Set (UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
 
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Config_Set (UINT8 slot, UINT8 start, UINT8 count, float *frequency, float *amplitude, float *offset)
 
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Count_Set (UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
 
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Start_Set (UINT8 slot, UINT32 start)
 
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Stop_Set (UINT8 slot, UINT32 stop)
 

Detailed Description

Sample Code:
ao.c

Function Documentation

MODULE_RW_ERR_CODE MX_RTU_Module_AO_Enable_Get ( UINT8  slot,
UINT8  start,
UINT8  count,
UINT8 buf 
)
Parameters
[in]slotslot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports.
[in]startThe first channel to get.
[in]countThe number of channels to get.
[out]bufThe enable status for the corresponding channels. 0: disable, 1: enable.
Returns
MODULE_RW_ERR_CODE
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Range_Get ( UINT8  slot,
UINT8  start,
UINT8  count,
UINT8 buf 
)
Parameters
[in]slotslot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports.
[in]startThe first channel to get.
[in]countThe number of channels to get.
[out]bufThe AO range for the corresponding channels.
Returns
MODULE_RW_ERR_CODE
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Raw_Value_Get ( UINT8  slot,
UINT8  start,
UINT8  count,
UINT32 buf 
)
Parameters
[in]slotslot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports.
[in]startThe first channel to get.
[in]countThe number of channels to get.
[out]bufThe AO raw data for the corresponding channels.
Returns
MODULE_RW_ERR_CODE
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Eng_Value_Get ( UINT8  slot,
UINT8  start,
UINT8  count,
float *  buf 
)
Parameters
[in]slotslot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports.
[in]startThe first channel to get.
[in]countThe number of channels to get.
[out]bufThe AO engineering data for the corresponding channels.
Returns
MODULE_RW_ERR_CODE
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Status_Get ( UINT8  slot,
UINT8  start,
UINT8  count,
UINT8 buf 
)
Parameters
[in]slotslot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports.
[in]startThe first channel to get.
[in]countThe number of channels to get.
[out]bufThe AO status for the corresponding channels.
Returns
MODULE_RW_ERR_CODE
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Type_Get ( UINT8  slot,
UINT8  start,
UINT8  count,
UINT8 buf 
)
Parameters
[in]slotslot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports.
[in]startThe first channel to set.
[in]countThe number of channels to set.
[out]bufThe waveform type for the corresponding channels.
Returns
MODULE_RW_ERR_CODE
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Config_Get ( UINT8  slot,
UINT8  start,
UINT8  count,
float *  frequency,
float *  amplitude,
float *  offset 
)
Parameters
[in]slotslot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports.
[in]startThe first channel to get.
[in]countThe number of channels to get.
[out]frequencyThe waveform frequency (Hz) for the corresponding channels. Range = 0.01Hz ~ MAX supported freqency.
[out]amplitudeThe waveform amplitude (engineering value) for the corresponding channels.
[out]offsetThe waveform offset (engineering value) for the corresponding channels. Range = -10V ~ 10V.
Returns
MODULE_RW_ERR_CODE
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Count_Get ( UINT8  slot,
UINT8  start,
UINT8  count,
UINT32 buf 
)
Parameters
[in]slotslot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports.
[in]startThe first channel to set.
[in]countThe number of channels to set.
[out]bufThe numbers of waveform count for the corresponding channels.
Returns
MODULE_RW_ERR_CODE
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Start_Get ( UINT8  slot,
UINT32 start 
)
Parameters
[in]slotslot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports.
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Enable_Set ( UINT8  slot,
UINT8  start,
UINT8  count,
UINT8 buf 
)
Parameters
[in]slotslot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports.
[in]startThe first channel to set.
[in]countThe number of channels to set.
[in]bufThe enable status for the corresponding channels. 0: disable, 1: enable.
Returns
MODULE_RW_ERR_CODE
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Range_Set ( UINT8  slot,
UINT8  start,
UINT8  count,
UINT8 buf 
)
Parameters
[in]slotslot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports.
[in]startThe first channel to set.
[in]countThe number of channels to set.
[in]bufThe AO range for the corresponding channels.
Returns
MODULE_RW_ERR_CODE
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Raw_Value_Set ( UINT8  slot,
UINT8  start,
UINT8  count,
UINT32 buf 
)
Parameters
[in]slotslot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports.
[in]startThe first channel to set.
[in]countThe number of channels to set.
[out]bufThe output value for the corresponding channels.
Returns
MODULE_RW_ERR_CODE
Note
The resolution of 86M-4420 is 12 bits. The corresponding values of each range show as follow:
AO_RANGE_10V:
0x800 0xC00 0x000 0x3FF 0x7FF
-10V -5V 0V 5V 10V
AO_RANGE_0_10V:
0x000 0x3FF 0x7FF 0xBFF 0xFFF
0V 2.5V 5V 7.5V 10V
AO_RANGE_0_20mA:
0x000 0x3FF 0x7FF 0xBFF 0xFFF
0mA 5mA 10mA 15mA 20mA
AO_RANGE_4_20mA:
0x000 0x3FF 0x7FF 0xBFF 0xFFF
4mA 8mA 12mA 16mA 20mA
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Eng_Value_Set ( UINT8  slot,
UINT8  start,
UINT8  count,
float *  buf 
)
Parameters
[in]slotslot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports.
[in]startThe first channel to set.
[in]countThe number of channels to set.
[out]bufThe output value for the corresponding channels.
Returns
MODULE_RW_ERR_CODE
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Type_Set ( UINT8  slot,
UINT8  start,
UINT8  count,
UINT8 buf 
)
Parameters
[in]slotslot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports.
[in]startThe first channel to set.
[in]countThe number of channels to set.
[in]bufThe waveform type for the corresponding channels.
Returns
MODULE_RW_ERR_CODE
Note
The AO waveform is avaliable only when the range is AO_RANGE_10V or AO_RANGE_0_10V .
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Config_Set ( UINT8  slot,
UINT8  start,
UINT8  count,
float *  frequency,
float *  amplitude,
float *  offset 
)
Parameters
[in]slotslot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports.
[in]startThe first channel to get.
[in]countThe number of channels to get.
[in]frequencyThe waveform frequency (Hz) for the corresponding channels. Range = 0.01Hz ~ MAX supported freqency.
[in]amplitudeThe waveform amplitude (engineering value) for the corresponding channels.
[in]offsetThe waveform offset (engineering value) for the corresponding channels. Range = -10V ~ 10V.
Returns
MODULE_RW_ERR_CODE
Note
The default value of the offset is 0.
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Count_Set ( UINT8  slot,
UINT8  start,
UINT8  count,
UINT32 buf 
)
Parameters
[in]slotslot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports.
[in]startThe first channel to set.
[in]countThe number of channels to set.
[in]bufThe numbers of waveform count for the corresponding channels.
Returns
MODULE_RW_ERR_CODE
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Start_Set ( UINT8  slot,
UINT32  start 
)
Parameters
[in]slotslot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports.
[in]startA bitwise value to indicate all channels waveforms' status. The bit 0's value represents channel 0's waveform will start or ignore and so on (0: ignore, 1: start).
Returns
MODULE_RW_ERR_CODE
Note
The AO waveform is avaliable only when the range is AO_RANGE_10V or AO_RANGE_0_10V .
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Stop_Set ( UINT8  slot,
UINT32  stop 
)
Parameters
[in]slotslot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports.
[in]stopA bitwise value to indicate all channels waveforms' status. The bit 0's value represents channel 0's waveform will stop or ignore and so on (0: ignore, 1: stop).
Returns
MODULE_RW_ERR_CODE