beautypg.com

Parameter type definitions avg, Returns, Function usage – Measurement Computing Data Acquisition Systems rev.10.4 User Manual

Page 160: Prototypes, Program references

background image

Parameter Type Definitions

avg

Definition

Description

avg = 0

Specifies block averaging--all scans are averaged together to compute a single value for each channel

avg = 1

Specifies no averaging--each scan’s readings are converted into measured signals

avg

≥ 2

Specifies moving average--each scan’s readings are averaged with the avg-1 preceding scans’ readings
before conversion.

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 daqCvtLinearSetupConvert combines the functions of the both the daqCvtLinearConvert
function and the daqCvtLinearSetup function.

Moving Averages

To better illustrate the moving average feature of the avg parameter, suppose the avg value is set to 3. Since
each scan’s readings are averaged with the preceding scan, the results from the first scan (which has no
preceding scan) are not averaged at all. However, the results from the second scan are averaged with the first
scan, and the results from the third scan are averaged with the preceding two scans. After the third scan, each
subsequent scan is averaged with the preceding two scans (since the avg value is 3, and avg-1 is two). In
another instance, if the avg value is set to 5, then each scan after the fifth scan would be averaged with the
four preceding it.

Prototypes

C/C++

daqCvtLinearSetupConvert(DWORD nscan, DWORD readingsPos, DWORD nReadings,
FLOAT signal1, FLOAT voltage1, FLOAT signal2, FLOAT voltage2, DWORD avg,
PWORD counts, DWORD scans, PFLOAT fValues, DWORD nValues);

Visual BASIC

VBdaqCvtLinearSetupConvert&(ByVal nscan&, ByVal readingsPos&, ByVal
nReadings&, ByVal signal1!, ByVal voltage1!, ByVal signal2!, ByVal
voltage2!, ByVal avg&, counts%, ByVal scans&, fValues!, ByVal nValues&)

Program References

None

4.3-34 Daq API Command Reference

908494

Programmer’s

Manual