Specifications
Determining an
Algorithm’s Size
In order to define an algorithm for swapping, it is necessary to know how much
algorithm memory to allocate for it or any of its replacements. This information can
be queried from the VT1419A. Use the following sequence:
1. Define the algorithm without swapping enabled. This will cause the
VT1419A to allocate only the memory actually required by the algorithm.
2. Execute the ALG:SIZE? <alg_name> command to query the amount of
memory allocated. The minimum amount of memory required for the
algorithm is now known.
3. Repeat 1 and 2 for each of the algorithms that will be swapped with the
original. From this, the minimum amount of memory required for the largest
is determined.
4. Execute *RST to erase all algorithms.
5. Re-define one of the algorithms with swapping enabled and specify
<swap_size> at least as large as the value from step 3 above (and probably
somewhat larger because as alternate algorithms declare different variables,
space is allocated for total of all variables declared).
6. Swap each of the alternate algorithms for the one defined in step 5, ending
with the one that will be run now. Remember not to send the <swap_size>
parameter with these. If an “Algorithm too big” error is not received, then
the value for <swap_size> in step 5 was large enough.
7. Define any other algorithms in the normal manner.
NOTES 1. Channels referenced by algorithms when they are defined are only placed in
the channel list before INIT. The channel list cannot be changed after INIT.
If an algorithm is redefined (by swapping) after INIT and it references
channels not already in the channel list, these channels will only return a
floating point zero. No error message will be generated. To make sure all
required channels will be included in the channel list, define <alg_name>
and re-define all algorithms that will replace <alg_name> by swapping them
before INIT is sent. This insures that all channels referenced in these
algorithms will be available after INIT.
2. The driver only calculates overall execution time for algorithms defined
before INIT. This calculation is used to set the default output delay (same as
executing ALG:OUTP:DELAY AUTO). If an algorithm is swapped after
INIT that take longer to execute than the original, the output delay will
behave as if set by ALG:OUTP:DEL 0, rather than AUTO (see
ALG:OUTP:DEL command). Use the same procedure from note 1 to make
sure the longest algorithm execution time is used to set ALG:OUTP:DEL
AUTO before INIT.
The Agilent VEE example program “swap1419.vee” shows how to swap algorithms
while the module is running. See Chapter 5 page 168.
The Algorithm Language and Environment
Defining Algorithms (ALG:DEF)
Chapter 4 119
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com










