beautypg.com

Daqcvtlinearconvert – Measurement Computing Data Acquisition Systems rev.10.4 User Manual

Page 155

background image

daqCvtLinearConvert

Also See: daqCvtLinearSetup,

daqCvtLinearSetupConvert, daqCvtSetAdcRange

Format

daqCvtLinearConvert(counts, scans, fValues, nValues)

Purpose

daqCvtLinearConvert

converts the ADC readings into floating point numbers using the linear

relationship that was specified with daqCvtLinearSetup.

Parameter Summary

Parameter Type

Description

counts PWORD

Acquired ADC readings to be converted

scans DWORD

Number of scans to be converted

fValues PFLOAT

Array to hold the converted readings

nValues DWORD

Size of the reading array

Parameter Values

counts:

valid pointer to an array of integer words (2 bytes) which contain the data to perform the linear

conversion

scans:

the number of scans to be converted, from 1 to the size of the counts array (in scans)

fValues:

valid pointer to an array of single precision floating point (4 bytes) values which will store the

converted readings upon return of this command

nValues:

the size of the fValues arrary should be at least equal to:

[scans * (channels in scan) * (the sample size, normally 2 bytes)]

Returns

DerrNoError

No

error

Function Usage

For all functions of the form daqCvt..., raw data to be converted must be unsigned
(i.e., the dafUnsigned value must be set using the daqAdcSetScan function).


For T/C and RTD conversion, users of Daq/2000 Series devices* and/or Daq PC Cards must
be sure that the main unit is using ten volt range gains settings, either unipolar (0 V to 10 V)
or bipolar (-5 V to +5 V).

See the “T/C Gains Settings” section in the daqCvtTCConvert function entry for the
appropriate settings.

*
Daq/2000 Series devices include DaqBook/2000 Series, DaqScan/2000 Series, DaqLab/2000

Series, and DaqBoard/2000 Series devices.

The

daqCvtLinearConvert function may be invoked repeatedly to perform multiple conversions, each

using the same linear relationship. For convenience, daqCvtLinearSetupConvert can perform both
setup and conversion.

Programmer’s Manual

908494

Daq API Command Reference 4.3-29