-
5.3. Access Optical Isolated Input
5.3.1. Get Optical Isolated Input Status
Function Description:
Get optical isolated status.
Function call:
BOOL IOC_GetOpticalInput(DWORD *pStatus);
Parameters(Output):
pStatus:
DWORD *
: Optical status
Return code:
TRUE = Success
FALSE = Unsupported
Note:
This function is similar to IOC_GetRelayStatus(pStatus), but with optical input status returned.
Macro OPTICAL1_BITS
…
OPTICAL4_BITS define which bit of *pStatus corresponds to which
input.
Example:
#include “ioc_ioctl.h”
…
DWORD dwStatus;
HANDLE gIOControlDriverHandle;
…
gIOControlDriverHandle = CreateFile(L"IOC1:”, GENERIC_READ |
GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, 0, 0);
If (gIOControlDriverHandle == INVALID_HANDLE_VALUE)
{
// IO device not found, function not supported,
// error process
}
…
IOC_GetOpticalInput(&dwStatus);
if ( dwStatus & OPTICAL1_BITS) {
// input 1 close
}
else {
// input 1 open
}
if (dwStatus & OPTICAL 2_BITS) {
// input 2 close
}
else {
// input 2 open
}
if (dwStatus & OPTICAL 3_BITS) {
// input 3 close
}
else {
// input 3 open
}
Содержание MR650
Страница 1: ...MR650 Programming Manual V 1 12 1 16 2008 ...
Страница 7: ... 7 13 FUNCTION KEY SETTING ON REGISTRY 65 14 UPDATE NOTES 66 ...
Страница 16: ... it is for internal use send messages ...
Страница 33: ... Be aware to release handles when program ends ...