beautypg.com

VXI VT1422A User Manual

Page 243

background image

VT1422A Command Reference 241

Chapter 7

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 is 1-9 and represents the number of .
The value of taken as a decimal integer indicates the number of byte(s)> in the block. Example from "Quoted String" above:

ALG:DEF 'ALG1',#211O108=I100;Ø (where "Ø" is a null byte)

Note

For Block Program Data, the Algorithm Parser requires that the data
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 from above. If the null
byte is not included or doesn't include it, the error "Algorithm Block must
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 data
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.

This manual is related to the following products: