
88
RHIO_SndCmd_SetMACRO
Description :
Used to send the command to set/clear the MACRO of an input port
Function Prototype :
extern "C" __declspec(dllexport) bool RHIO_SndCmd_SetMACRO
(SRHIOSetting sSetData, int iPortNum);
Parameter :
SRHIOSetting sSetData : Data to set
SRHIOSetting.sInput.eMacro : Flag to determine to set or clear
(ESOF_CLEAR, ESOF_SETTING)
SRHIOSetting.sInput.cMacro : MACRO string
int iPortNum : Input port number to set
Return :
TRUE if successful, False if failed.
Parameter when reaction event is received :
WPARAM
: Comm and transfer status Flag (ESF_SET_MACRO)
LPARAM
: Control status flag of the command (False if Time Out Error)
(0x30:Normal operation, 0x39:Abnormal operation, 0x31:Not the Set Mode, 0x32:Not set)
eg. :
In case of Set command :
SRHIOSetting sSetData;
sSetData.sInput.eMacro = ESOF_SETTING;
memset(sSetData.sInput.cMacro, '\0', sizeof(sSetData.sInput.cMacro));
memcpy(sSetData.sInput.cMacro, "O2&O4|I1", 8);
RHIO_SndCmd_SetMACRO(sSetData, 1);
In case of Set Clear command :
SRHIOSetting sSetData;
sSetData.sInput.eMacro = ESOF_CLEAR;
RHIO_SndCmd_SetMACRO(sSetData, 1);