com_SetDAMilli
This function writes a singed decimal value in millivolt to an analog output port
of a device by USB.
Declaration
BOOL com_SetDAMilli(HANDLE hDevice,
UINT
dwPort,
LONG
lnValue
);
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.
lnValue
An signed decimal 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_SetDAMilli ( 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.