Specifications

Calling User
Defined Functions
Access to user defined functions is provided to avoid complex equation calculation
within an algorithm. Essentially what is provided with the VT1419A is a method to
pre-compute user function values outside of algorithm execution and place these
values in tables, one for each user function. Each function table element contains a
slope and offset to calculate an mx+b over the interval (x is the value provided to
the function). This allows the DSP to linearly interpolate the table for a given input
value and return the function’s value much faster than if a transcendental function’s
equation were arithmetically evaluated using a power series expansion.
User functions are defined by downloading function table values with the
ALG:FUNC:DEF command and can take any name that is a valid ‘C’ identifier like
‘haversine’, ‘sqr’, ‘log10’, etc. To find out how to generate table values from a
function equation, see the Agilent VEE example program “fn_1419.vee”in
Chapter 5 page 156. For details on the ALG:FUNC:DEF command, see page 197 in
the Command Reference.
User defined functions are global in scope. A user function defined with
ALG:FUNC:DEF is available to all defined algorithms. Up to 32 functions can be
defined in the VT1419A. The functions can be called with the syntax
<func_name>(<expression>). Example:
for user function pre-defined as square root with name ‘sqrt’
O132 = sqrt( I100); /* channel 32 outputs square root of input channel 0’s value */
NOTE A user function must be defined (ALG:FUNC:DEF) before any algorithm is
defined (ALG:DEF) that references it.
Operating Sequence
This section explains another important factor in an algorithm’s execution
environment. Figure 4-2 shows the same overall sequence of operations seen in
Chapter 3, but also includes a block diagram to show which parts of the VT1419A
are involved in each phase of the control sequence.
Overall Sequence Here, the important things to note about this diagram are:
·
All algorithm referenced input channel values are stored in the Channel
Input Buffer (Input Phase) BEFORE algorithms are executed during the
Calculate Phase.
·
The execution of all defined algorithms (Calculate Phase) is complete
BEFORE output values from algorithms, stored in the Channel Output
Buffer, are used to update the output channel hardware during the Output
Phase.
The Algorithm Language and Environment
Operating Sequence
114 Chapter 4
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com