Specifications
–
If included, <swap_size> specifies the number of words of memory to
allocate for the algorithm specified by <alg_name>. The VT1419A will then
allocate this much memory again, as an update buffer for this algorithm. Note
that this doubles the amount of memory space requested. Think of this as
“space1” and “space2” for algorithm <alg_name>. When a replacement
algorithm is sent later (must be sent without
the <swap_size> parameter), it
will be placed in “space2." An ALG:UPDATE command must be sent for
execution to switch from the original to the replacement algorithm. If the
algorithm for <alg_name> is again changed, it will be executed from
“space1” and so on. Note that <swap_size> must be large enough to contain
the original executable code derived from <source_code> and any subsequent
replacement for it or an error 3085 “Algorithm too big” will be generated.
–
If <swap_size> is not included, the VT1419A will allocated just enough
memory for algorithm <alg_name>. Since there is no swapping buffer
allocated, this algorithm cannot be changed until a *RST command is sent to
clear all algorithms. See “When Accepted and Usage.”
·
The <source_code> parameter contents can be:
–
When <alg_name> is ‘ALG1’ through ‘ALG32’, Algorithm Language source
code representing a user’s algorithm.
ALG:DEF ‘ALG5’,’if( First_loop ) O136=0; O136=O136+0.01;’
–
When <alg_name> is ‘GLOBALS’, Algorithm Language variable
declarations. A variable name must not be the same as an already define user
function.
ALG:DEF ‘GLOBALS’,’static float my_glob_scalar, my_glob_array[24];’
The Algorithm Language source code is translated by the VT1419’s driver into an
executable form and sent to the module.
·
The <source_code> parameter can be one of three different SCPI types:
Quoted String For short segments (single lines) of code, enclose the code
string within single (apostrophes) or double quotes. Because of string length
limitations within SCPI and some programming platforms, it is recommended that
the quoted string length not exceed a single program line. Example:
ALG:DEF ‘ALG1’,’static float outval=0;O132 = outval; outval = outval + 1;’
Definite Length Block Program Data For longer code segments (like
complete custom algorithms) this parameter works well because it specifies the
exact length of the data block that will be transferred. The syntax for this
parameter type is: #<non-zero digit><digit(s)><data byte(s)>
Where the value of <non-zero digit> is 1-9 and represents the number of
<digit(s)>. The value of <digit(s)> taken as a decimal integer indicates the
number of <data byte(s)> in the block. Example from “Quoted String”:
VT1419A Command Reference
ALGorithm
Chapter 6 189
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com










