com_SetDAHex
This function writes a complete word in hex to an analog output port of a
device by USB.
Declaration
BOOL com_SetDAHex(HANDLE hDevice,
UINT
dwPort,
UINT
dwValue
);
Parameters
hDevice
A valid device handle, previously obtained from hid_OpenDeviceDevice
dwPort
The index of the port on the card to manipulate. The first port has index 0.
dwValue
An unsigned hexical value to assign new value to DA channel
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_SetDAHEX ( hDevice, 0, dwState); // writes the state to the first analog output port
com_CloseDevice (hDevice);
}
Remarks
This function now only enable in USB_14ADDA and USB_16ADDA device. The range of dwPort is
from 0~15.