VXI VT1422A User Manual

Page 243

Advertising
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:

#<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:

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

Note

For Block Program Data, the Algorithm Parser requires that the <source_code> data
end with a null (0) byte. The null byte must be appended to the end of the block's
<data byte(s)> and account for it in the byte count <digit(s)> from above. If the null
byte is not included or <digit(s)> 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<data byte(s)><null byte with End Identifier>

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 <source_code> data
end with a null (0) byte. The null byte must be appended to the end of the block's
<data byte(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.

Advertising
This manual is related to the following products: