Linear conversion – Measurement Computing Data Acquisition Systems rev.10.4 User Manual
Page 35

IntToUint = intval
Else
IntToUint = 65535 + CLng(intval) + 1
End If
End Function
Linear Conversion
Several DBKs use conversions from A/D
readings to corresponding values that are a
linear (straight-line) relationship. (Non-
linear relationships for RTDs and
thermocouples require special conversion
functions—refer to the Thermocouple and
RTD Linearization section later in this
chapter.) The linear conversion functions
are built into the API.
Six parameters are used to specify a linear
relationship: the A/D input range
(minimum and maximum values), and the
transducer input signal level and output
voltage at two points in the range.
Three functions are used to perform linear
conversions: daqCvtLinearSetup,
daqCvtLinearConvert, and
daqCvtLinearSetupConvert. These
functions are defined in the following
pages. After their definitions, parameter
examples and a program example show
how they work.
DBK7, programmed for 50 to 60 Hz:
Measurement
Signal
Voltage
1
50 Hz
-5 V
2
60 Hz
+5 V
The DBK7 output range is from -5 V to +5 V, and the Daq device must be configured for bipolar operation
at a gain of ×1 for the DBK7 channels. Thus, the input range -5 V to +5 V corresponds to the ADmin and
ADmax settings. When a DBK7 programmed for a 50 to 60 Hz range measures a 50 Hz input signal, it
outputs -5 V. With a 60 Hz input signal, it outputs +5 V. Thus, signal1 is 50, voltage1 is -5, signal2 is 60,
and voltage2 is 5.
Pressure-transducer:
Measurement
Signal
Voltage
1
0 psi
1 mV
2
1000 psi
4 mV
Assume that a pressure transducer outputs 1 to 4 mV to represent 0 to 1000 psi, and that a DBK13 with a
gain of ×1000 is used with a Daq device in bipolar mode to measure the signal. In bipolar mode, at a gain
of 1000, the analog signal input range is -5 to 5 mV and the output range from the DBK13 is -5 to 5 Volts.
Thus, ADmin is -5.000, and ADmax is 5.000. A pressure of 0 psi generates an output of 1 mV, and 1000
psi generates 4 mV. Thus signal1 is 0, voltage1 is 1.000, signal2 is 1000 and voltage2 is 4.000.
This program uses the linear conversion functions to convert voltage readings from a DBK7 frequency-to-
voltage card and a DBK13 voltage input card with a pressure transducer to actual frequencies (Hz) and
pressures (psi).
Programmer’s Manual
988594
API Programming, General Models 2-25