HP E1419A User Manual page 194

Measurement and control module
Table of Contents

Advertisement

Chapter 6
If included, <swap_size> specifies the number of words of memory to allocate
for the algorithm specified by <alg_name>. The HP E1419 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 you later send a replacement
algorithm (must be sent without the <swap_size> parameter), it will be placed
in "space2". You must send an ALG:UPDATE command for execution to
switch from the original, to the replacement algorithm. If you again change
the algorithm for <alg_name>, 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 HP E1419 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 HP E1419'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, we recommend 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" above:
HP E1419 Command Reference 193
ALGorithm

Advertisement

Table of Contents
loading

Table of Contents