beautypg.com

Daqcalsetconstants, Daqclose – Measurement Computing WaveBook rev.3.0 User Manual

Page 216

background image

D-20 daqX API - Command Reference,

6-24-99

WaveBook User’s Manual

daqCalSetConstants

DLL Function

daqCalSetConstants(DaqHandleT handle, DWORD channel, DaqAdcGain gain, DaqAdcRangeT

range, WORD gainConstant, SHORT offsetConstant );

C

daqCalSetConstants(DaqHandleT handle, DWORD channel, DaqAdcGain gain, DaqAdcRangeT

range, WORD gainConstant, SHORT offsetConstant );

Visual BASIC

VBdaqCalSetConstants(ByVal handle&, ByVal channel&, ByVal gain&, ByVal range&, ByVal

gainConstant%, ByVal offsetConstant% );

Delphi

daqCalSetConstants(handle: DaqHandleT;channel:DWORD; gain: DaqAdcGain; range:

DaqAdcRangeT; gainConstant:WORD; offsetConstant:SHORT );

handle

Handle to the device for which ADC transfer status is to be retrieved

channel

Channel number to apply the calibration settings

gain

Gain range to apply the calibration settings

range

A/D input range to apply the calibration settings

gain

Gain value to apply

Parameters

offset

Offset value to apply

Returns

DerrNoError

No error (see the API Error Codes table at the end of this chapter).

See Also

daqCalGetConstants,daqCalSelectCalTable,daqCalSelectInputSignal,daqCalSaveConstants

Program References

None

Used With

WaveBook/512, WaveBook/516 series

Description

daqCalSetConstants

sets the user-accessible calibration constants. These calibration constants are gains and offsets that are applied

to the input data. The data comes in, is multiplied by the gain, then the offset is added to it. The resulting data is the conversion between
the raw A/D data and the data that is presented during the acquisition. Each channel, gain, and bipolar/unipolar setting has a different pair
of gain and offset values. The first three parameters of the daqCalSetConstants function specify which set of constants are to be
changed. The last two parameters are the actual constants. These constants are in a particular binary format. The gain constant is
32768 times the gain. For a gain of ×1, the gain constant is 32768 or 0x8000. The maximum gain is approximately ×2 (65535/32768),
and the minimum gain is ×0 (0/32768). The offset (a left-justified signed 12-bit number) is added to the final result. A single least-
significant bit has an integer value of 16 or 0x0010. Setting the calibration constants affects subsequent acquisitions until another
daqOpen

is performed. After daqOpen, the original calibration constants are re-read from the NVRAM in the WaveBook and expansion

chassis; then, the working copy as set by daqCalSetCalConstants is overwritten.

daqClose

DLL Function

daqClose(DaqHandleT handle);

C

daqClose(DaqHandleT handle);

Visual BASIC

VBdaqClose&(ByVal handle&)

Delphi

daqClose(handle:DaqHandleT)

Parameters

handle

Handle to the device to be closed

Returns

DerrNoError

No error (see the API Error Codes table at the end of this chapter).

See Also

daqOpen

Program References

ADCEX1.C, DACEX1.C, DIGEX1.C, DYN32ENH.C, DAQEX.FRM (VB), ADCEX.PAS, ERREX.PAS (Delphi)

Used With

All devices

Description

daqClose

is used to close a Daq* device. Once the specified device has been closed, no subsequent communication with the device can

be performed. In order to re-establish communications with a closed device, the device must be re-opened with the daqOpen function.