Specifications

Appendix E
Generating User Defined Functions
Introduction
The VT1419A Multifunction
Plus
Measurement and Control Module has a limited set
of mathematical operations such as add, subtract, multiply and divide. Many
control applications require functions such a square root for calculating flow rate or
a trigonometric function to correctly transition motion of an actuator from a start to
ending position. In order to represent a sine wave or other transcendental functions,
one could use a power series expansion to approximate the function using a finite
number of algebraic expressions. Since the above mentioned operations can take
from 1.5 µsto4µs for each floating point calculation, a complex waveform such as
sine(x) could take more than 100 µs to get the desired result. A faster solution is
desirable and available.
The VT1419A provides a solution to approximating such complex waveforms by
using a piece-wise linearization of virtually any complex waveform. The technique
is simple. The CD ROM supplied with the VT1419A contains the Agilent VEE
program “fn_1419.vee” that builds user defined functions and loads them into the
VT1419A. The VEE module calls a ‘C’ function (source code supplied) that
actually calculates 128 Mx+B segments over a specified range of values for the
desired function. Supply the function; the program generates the segments in a
table. The “fn_1419.vee” program can be merged into the Agilent VEE application
program. Another Agilent VEE example program, “eufn1419.vee,” shows how to
apply “fn_1419.vee.” Up to 32 functions can be created for use in algorithms. At
runtime where the function is passed an ‘x’ value, the time to calculate the Mx+B
function is approximately 18 µs.
The VT1419A actually uses this technique to convert volts to temperature, strain,
etc. The accuracy of the approximation is really based upon how well the range is
selected over which the table is built. For thermocouple temperature conversion,
the VT1419A fixes the range to the lowest A/D range (±64 mV) so that small
microvolt measurements yield the proper resolution of the actual temperature for a
non-linear transducer. In addition, the VT1419A permits Custom Engineering Unit
conversions to be created for user transducers so that, when the voltage
measurement is actually made, the EU conversion takes place (see
SENS:FUNC:CUST). Algorithms deal with the resulting floating point numbers
generated during the measurement phase and may require further complex
mathematical operations to achieve the desired result.
With some complex waveforms, it may be beneficial to break up the waveform into
several functions in order to get the desired accuracy. For example, suppose square
root function is needed for both voltage and strain calculations. The voltages are
only going to range from 0 to ±16 volts, worst case. The strain measurements
return numbers in microstrain which range in the 1000’s. Trying to represent the
square root function over the entire range would severely impact the accuracy of the
approximation. Remember, the entire range is broken up into only 128 segments of
Appendix E 377
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com