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 m
x
+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
Содержание VT1419A Multifunction Plus
Страница 5: ...4 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 15: ...14 Contents Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 25: ...24 Chapter 1 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 173: ...Notes 172 Chapter 5 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 332: ...332 Appendix A Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 333: ...Appendix A 333 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 334: ...334 Appendix A Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 335: ...Appendix A 335 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 336: ...336 Appendix A Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 337: ...Appendix A 337 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 338: ...338 Appendix A Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 339: ...Appendix A 339 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 340: ...340 Appendix A Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 341: ...Appendix A 341 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 342: ...342 Appendix A Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 343: ...Appendix A 343 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 344: ...344 Appendix A Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 345: ...Appendix A 345 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 346: ...346 Appendix A Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 347: ...Appendix A 347 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 348: ...348 Appendix A Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 349: ...Appendix A 349 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 350: ...350 Appendix A Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 351: ...Appendix A 351 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 352: ...352 Appendix A Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 353: ...Appendix A 353 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 354: ...354 Appendix A Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 355: ...Appendix A 355 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 356: ...356 Appendix A Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 357: ...Appendix A 357 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 358: ...358 Appendix A Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 370: ...Notes 370 Appendix C Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...