VXI VT1422A User Manual
Page 243

VT1422A Command Reference 241
ALGorithm
•
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. Examples:
ALG:DEF 'ALG1','O108=I100;' or ALG:DEF 'ALG3','PIDA(I100,O124)'
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:
#
Where the value of
The value of
ALG:DEF 'ALG1',#211O108=I100;Ø (where "Ø" is a null byte)
Note
For Block Program Data, the Algorithm Parser requires that the
end with a null (0) byte. The null byte must be appended to the end of the block's
and account for it in the byte count
byte is not included or
contain termination '\0'" will be generated.
Indefinite Length Block Program Data: This form terminates the data transfer
when it receives an End Identifier with the last data byte. Use this form only when it
is certain that the controller platform will include the End Identifier. If it is not
included, the ALG:DEF command will "swallow" whatever data follows the
algorithm code. The syntax for this parameter type is:
#0
Example from "Quoted String" above:
ALG:DEF 'ALG1',#0O108=I100;Ø (where "Ø" is a null byte)
Note
For Block Program Data, the Algorithm Parser requires that the
end with a null (0) byte. The null byte must be appended to the end of the block's
. The null byte is sent with the End Identifier. If the null byte is not
included, the error "Algorithm Block must contain termination '\0'" will be generated.