com_GetADHex
This function reads a complete word in hex from an analog input port of a
device by USB.
Declaration
BOOL com_GetADHex(HANDLE hDevice,
UINT
dwPort,
UINT
*lpdwValue
);
Parameters
hDevice
A valid device handle, previously obtained from com_OpenDevice
dwPort
The index of the port on the card to manipulate. The first port has index 0.
lpdwValue
A pointer to a variable of type UINT receiving the new state of the port
Return value
TRUE if successful, FALSE otherwise.
If an error occurred, GetLastError() may return the following values:
ERROR_INVALID_PARAMETER - The handle passed was invalid, or the port number was out of
range for the device selected.
Example
HANDLE hDevice = com_OpenDevice(card_id,card_number,10);
if (hDevice != INVALID_HANDLE_VALUE)
{
com_GetAnalogChannel ( hDevice, 0, &dwState); // reads the state of the first analog input port
com_CloseDevice (hDevice);
}
Remarks
This function now only enable in USB_14ADDA and USB_16ADDA device. The range of dwPort