Daqdacwt – Measurement Computing Data Acquisition Systems rev.10.4 User Manual
Page 227

daqDacWt
Also See: daqDacWtMany
Format
daqDacWt(handle, deviceType, chan, dataVal)
Purpose
daqDacWt
sets the output value of a local or expansion DAC channel.
Parameter Summary
Parameter Type
Description
handle DaqHandleT Handle to the device whose channel value will be updated
deviceType DaqDacDeviceType
Specifies the DAC type
chan DWORD
D/A channel to output to the selected D/A channel
dataVal WORD
Value to output to the selected D/A channel
Parameter Values
handle:
obtained from the daqOpen function
deviceType:
see the table in the “Selecting the Output Channel” section below
chan:
valid values depend on the values chosen for the deviceType parameter; see the deviceType
table in the “Selecting the Output Channel” section below
dataVal:
valid values range from 0 to 65,535
Returns
DerrInvChan
Invalid channel
DerrInvDacVal
Invalid data value
DerrNoError
No error
For more details on error messages refer to the Daq Error Table.
Function Usage
The channel specified by the daqDacWt function must be an appropriate DAC channel type, and the channel
must have been configured as a direct output channel prior to calling this function. See
daqDacSetOutputMode
for setting the output mode to be direct (using the DdomVoltage value).
Setting the DAC Value
The value of the DAC channel is written using the dataVal parameter. This parameter is an integer value
ranging from 0 to 65,535. This is a 16-bit value, and it spans the range over which the output can vary,
depending upon the specified range of the port for the device.
Some devices use 16-bit D/A converters, in which case each bit in the 16-bit integer corresponds to one bit
programmed to the D/A converter. However, some devices have 12-bit D/A converters. In this case, the low
order nibble (4-bits) of the programmed dataVal value will be ignored when the D/A is programmed.
The specifications section of the device user’s manual provides the ranges and the associated resolution values
for the device.
Programmer’s Manual
908494
Daq API Command Reference 4.4-45