ioPAC RTU Controllers
C/C++ Sample Code Programming Guide
|
Modules | |
RELAY_MODE | |
Sample Code:
relay.c
MODULE_RW_ERR_CODE MX_RTU_Module_Relay_Value_Get | ( | UINT8 | slot, |
UINT32 * | value | ||
) |
[in] | slot | slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports. |
[out] | value | A bitwise value to indicate all channels' values. The bit 0 represents channel 0's value and so on. |
MODULE_RW_ERR_CODE MX_RTU_Module_Relay_Mode_Get | ( | UINT8 | slot, |
UINT8 | start, | ||
UINT8 | count, | ||
UINT8 * | buf | ||
) |
[in] | slot | slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports. |
[in] | start | The first channel to get. |
[in] | count | The number of channels to get. |
[out] | buf | The RELAY modes for the corresponding channels. |
MODULE_RW_ERR_CODE MX_RTU_Module_Relay_SigW_L_Get | ( | UINT8 | slot, |
UINT8 | start, | ||
UINT8 | count, | ||
UINT32 * | buf | ||
) |
MODULE_RW_ERR_CODE MX_RTU_Module_Relay_SigW_H_Get | ( | UINT8 | slot, |
UINT8 | start, | ||
UINT8 | count, | ||
UINT32 * | buf | ||
) |
MODULE_RW_ERR_CODE MX_RTU_Module_Relay_PWM_Start_Get | ( | UINT8 | slot, |
UINT32 * | start | ||
) |
[in] | slot | slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports. |
[out] | start | A bitwise value to indicate all channels PWMs' status. The bit 0's value represents channel 0's PWM is started or not and so on (0: stop, 1: start). |
MODULE_RW_ERR_CODE MX_RTU_Module_Relay_PWM_Count_Get | ( | UINT8 | slot, |
UINT8 | start, | ||
UINT8 | count, | ||
UINT32 * | buf | ||
) |
[in] | slot | slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports. |
[in] | start | The first channel to get. |
[in] | count | The number of channels to get. |
[out] | buf | The numbers of PWM count for the corresponding channels. |
MODULE_RW_ERR_CODE MX_RTU_Module_Relay_PWM_Config_Get | ( | UINT8 | slot, |
UINT8 | start, | ||
UINT8 | count, | ||
float * | frequency, | ||
float * | dutyCycle | ||
) |
[in] | slot | slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports. |
[in] | start | The first channel to get. |
[in] | count | The number of channels to get. |
[out] | frequency | The RELAY PWM frequency (Hz) for the corresponding channels. Range = 0.01Hz ~ MAX supported freqency. |
[out] | dutyCycle | The RELAY PWM ON duty cycle (%) for the corresponding channels. Range = 0.1% ~ 99.9%. |
MODULE_RW_ERR_CODE MX_RTU_Module_Relay_Total_Count_Get | ( | UINT8 | slot, |
UINT8 | start, | ||
UINT8 | count, | ||
UINT32 * | buf | ||
) |
[in] | slot | slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports. |
[in] | start | The first channel to get. |
[in] | count | The number of channels to get. |
[out] | buf | The numbers of relay total count for the corresponding channels. |
MODULE_RW_ERR_CODE MX_RTU_Module_Relay_Current_Count_Get | ( | UINT8 | slot, |
UINT8 | start, | ||
UINT8 | count, | ||
UINT32 * | buf | ||
) |
[in] | slot | slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports. |
[in] | start | The first channel to get. |
[in] | count | The number of channels to get. |
[out] | buf | The numbers of relay current count for the corresponding channels. |
MODULE_RW_ERR_CODE MX_RTU_Module_Relay_Value_Set | ( | UINT8 | slot, |
UINT32 | value | ||
) |
[in] | slot | slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports. |
[in] | value | A bitwise value to indicate all channels' values. The bit 0 represents channel 0's value and so on. |
MODULE_RW_ERR_CODE MX_RTU_Module_Relay_Mode_Set | ( | UINT8 | slot, |
UINT8 | start, | ||
UINT8 | count, | ||
UINT8 * | buf | ||
) |
[in] | slot | slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports. |
[in] | start | The first channel to set. |
[in] | count | The number of channels to set. |
[in] | buf | The RELAY modes for the corresponding channels. |
MODULE_RW_ERR_CODE MX_RTU_Module_Relay_SigW_L_Set | ( | UINT8 | slot, |
UINT8 | start, | ||
UINT8 | count, | ||
UINT32 * | buf | ||
) |
MODULE_RW_ERR_CODE MX_RTU_Module_Relay_SigW_H_Set | ( | UINT8 | slot, |
UINT8 | start, | ||
UINT8 | count, | ||
UINT32 * | buf | ||
) |
MODULE_RW_ERR_CODE MX_RTU_Module_Relay_PWM_Start_Set | ( | UINT8 | slot, |
UINT32 | start | ||
) |
[in] | slot | slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports. |
[in] | start | A bitwise value to indicate all channels PWMs' status. The bit 0's value represents channel 0's PWM will start or not and so on (0: stop, 1: start). |
MODULE_RW_ERR_CODE MX_RTU_Module_Relay_PWM_Stop_Set | ( | UINT8 | slot, |
UINT32 | stop | ||
) |
[in] | slot | slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports. |
[in] | stop | A bitwise value to indicate all channels PWMs' status. The bit 0's value represents channel 0's PWM will stop or not and so on (0: ignore, 1: stop). |
MODULE_RW_ERR_CODE MX_RTU_Module_Relay_PWM_Count_Set | ( | UINT8 | slot, |
UINT8 | start, | ||
UINT8 | count, | ||
UINT32 * | buf | ||
) |
[in] | slot | slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports. |
[in] | start | The first channel to set. |
[in] | count | The number of channels to set. |
[in] | buf | The numbers of PWM count for the corresponding channels. |
MODULE_RW_ERR_CODE MX_RTU_Module_Relay_PWM_Config_Set | ( | UINT8 | slot, |
UINT8 | start, | ||
UINT8 | count, | ||
float * | frequency, | ||
float * | dutyCycle | ||
) |
[in] | slot | slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports. |
[in] | start | The first channel to get. |
[in] | count | The number of channels to get. |
[in] | frequency | The RELAY PWM frequency (Hz) for the corresponding channels. Range = 0.01Hz ~ MAX supported freqency. |
[in] | dutyCycle | The RELAY PWM ON duty cycle (%) for the corresponding channels. Range = 0.1% ~ 99.9%. |
MODULE_RW_ERR_CODE MX_RTU_Module_Relay_Current_Count_Set | ( | UINT8 | slot, |
UINT8 | start, | ||
UINT8 | count, | ||
UINT32 * | buf | ||
) |
[in] | slot | slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports. |
[in] | start | The first channel to get. |
[in] | count | The number of channels to get. |
[in] | buf | The numbers of relay current count for the corresponding channels. |