VXi VT1529A/B Manuale Utente

Pagina di 529
240 VT1422A Command Reference  
ALGorithm
The <swap_size> parameter is optional. Include this parameter with the first 
definition of <alg_name> when it is desired to change <alg_name> later while 
it is running. The value can range up to about 23k words (ALG:DEF will then 
allocate 46k words as it creates two spaces for this algorithm).
-- If included, <swap_size> specifies the number of words of memory to 
allocate for the algorithm specified by <alg_name>. The VT1422A 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 (it 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 VT1422A 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':
a. 'PIDA(<inp_channel>,<outp_channel>)' or
'PIDB(<inp_channel>,<outp_channel>,<alarm_channel>)'
<  _channel> parameters can specify actual input and output channels or 
they can specify global variables. This can be useful for inter-algorithm 
communication. Any global variable name used in this manner must have 
already been defined before this algorithm.
ALG:DEF 'ALG3','PIDB(I100,O124,O132.B2)'
b. Algorithm Language source code representing a custom algorithm.
ALG:DEF 'ALG5','if( First_loop ) O116=0; O116=O116+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 VT1422A's driver 
into an executable form and sent to the module. For 'PIDA' and 'PIDB' the 
driver sends the stored executable form of these PID algorithms.