Program Command Reference
The Model 346 implements a program subsystem that allows users to create, edit, store, and run predefined SCPI strings on the instrument. Programs are used to automate sequences of commands, and to attach those sequences to functions monitoring system events within the Model 346.
This subsystem uses the IEEE 488 arbitrary block data format to transfer program text to and from the instrument.
This format allows for the transfer of special control characters such as semicolons, quotes, and line feeds
that would otherwise be interpreted as command delimiters by the instrument. The format is a single digit to
indicate the number of digits in the length field, followed by the length field itself, followed by the data. For example,
to transfer 1234 bytes of program text, the arbitrary block data format would be: #41234<program text>.
Additional errors that may be returned by the program commands are listed in the table below.
Error Code |
Description |
|---|---|
To Be Filled Later |
Description of the error code. |
PROGDEF Program Define Command
PROGDEF <name>, <program text>[term]
Parameters
Name |
Type |
Description |
|---|---|---|
name |
s |
Program name (maximum 15 characters) |
program text |
block |
Program body in IEEE 488 arbitrary block data format.
The format is |
Example
PROGDEF "STARTUP", #228OUTMODE 1,1,A,0,0;SETP 1,300[term]Remarks
Programs are stored non-volatilely and persist across power cycles, and are cleared on a DFLT 99. The arbitrary block data format allows for the inclusion of special characters such as semicolons, quotes, and line feeds that would otherwise be interpreted as command delimiters. Up to 8 programs can be stored on the instrument, and if all slots are allocated a SCPI_ERROR_CANNOT_CREATE_PROGRAM will be thrown. If a program with the specified name already exists, a SCPI_ERROR_ILLEGAL_PROGRAM_NAME will be thrown as the previous program must be deleted first, and no two programs can share a name. Names are case sensitive.
PROGDEF? Program Define Query
PROGDEF? <name>[term]
Parameters
Name |
Type |
Description |
|---|---|---|
name |
s |
Program name (maximum 15 characters) |
Returns
<program text>[term]
Program text is returned in IEEE 488 arbitrary block data format: #<d><length><data>
Example
PROGDEF? "STARTUP"[term]Remarks
The query can retrieve a program by its name and is case-sensitive. If the specified program does not exist, the error SCPI_ERROR_ILLEGAL_PROGRAM_NAME is returned. The returned program text uses the same arbitrary block data format as the PROGDEF command.
PROGEXE Program Execute Command
PROGEXE <name>[term]
Parameters
Name |
Type |
Description |
|---|---|---|
name |
s |
Program name (maximum 15 characters) |
Example
PROGEXE "STARTUP"[term]Remarks
Executes a stored program by its name. The program is executed as if the commands were sent over the remote interface used. If the specified program does not exist or the ID is out of range, a SCPI_ERROR_ILLEGAL_PROGRAM_NAME is returned. If a program is already running, a SCPI_ERROR_PROGRAM_ALREADY_RUNNING error is returned. This is uncommon, but prevents recursive program calls and re-calls by automated system functions.
PROGCAT? Program Catalog Query
PROGCAT?[term]
Parameters
None
Returns
<name 1>, <name 2>, ..., <name 8>[term]
Returns a comma-separated list of all 8 program names. Empty program slots return an empty string.
Example
PROGCAT?[term]"STARTUP","TEST","","","SHUTDOWN","","",""[term]Remarks
This query returns the names of all 8 program slots in order. Empty slots are represented by empty strings in the comma-separated list. This allows users to see which program slots are available and which programs are currently stored on the instrument.
PROGDEL Program Delete Command
PROGDEL <name>[term]
Parameters
Name |
Type |
Description |
|---|---|---|
name |
s |
Program name (maximum 15 characters) |
Example
PROGDEL "STARTUP"[term]Remarks
Deletes a stored program by its name. Names are case-sensitive. If the specified program does not exist, a SCPI_ERROR_ILLEGAL_PROGRAM_NAME will be thrown. After deletion, the slot becomes available for a new program to be defined via PROGDEF.
FUNC Function Command
FUNC <function id>, <feature 1>, <instance 1>, <condition 1>, <operator>, <feature 2>, <instance 2>, <condition 2>, <result type>, <result>[term]
Parameters
Name |
Type |
Description |
|---|---|---|
function id |
n |
Function slot number (1-16) |
feature 1 |
n |
Function input feature for first value: 0 = Off 1 = On 2 = Thermometry Input 3 = Output Status 4 = Digital Input 5 = System Status 6 = Function Output |
instance 1 |
n/a |
Function input instance for first value. Type depends on feature 1:
|
condition 1 |
n |
Condition to evaluate for first value. Valid values depend on feature 1 and for features “on” and “off” and “system status” is ignored and should be set to 0:
|
operator |
a |
Logical operator combining the two values: OR, AND, NOT, NOR, NAND, XOR, XNOR |
feature 2 |
n |
Function input feature for second value (see feature 1) |
instance 2 |
n/a |
Function input instance for second value (see instance 1) |
condition 2 |
n |
Condition for second value (see condition 1) |
result type |
n |
Type of result to trigger: 0 = None 1 = Program |
result |
n/s |
For none, a 0 should be entered, for program, the program name (max 15 characters) |
Example
FUNC 1,3,A,4,OR,3,B,5,1,"ALLOFF"[term]FUNC 2,4,1,1,AND,5,1,1,0,0[term]Remarks
Functions provide automated event-driven logic for the Model 346. Each function evaluates two input conditions using a logical operator and triggers an action (program execution or relay control) when the expression evaluates to true. Functions are evaluated every 100ms and can be used to implement complex automation sequences.
The condition parameter values must match the feature type - thermometry input feature uses input conditions, output status feature uses output conditions, and other features use generic conditions (FALSE/TRUE). Invalid condition values for the specified feature will result in a validation error.
When the NOT operator is used, only the first argument set is evaluated and the second argument set is ignored.
FUNC? Function Query
FUNC? <function id>[term]
Parameters
Name |
Type |
Description |
|---|---|---|
function id |
n |
Function slot number (1-16) |
Returns
<feature 1>, <instance 1>, <condition 1>, <operator>, <feature 2>, <instance 2>, <condition 2>, <result type>, <result>[term]
Returns the current configuration of the specified function in the same format as the FUNC command parameters.
Example
FUNC? 1[term]3,A,4,OR,3,B,5,0,1[term]Remarks
The query returns all function configuration parameters in the order they were set. For thermometry input feature inputs, the instance is returned as a channel letter (A, B, C1-C4, etc.). For other features, numeric values are returned. The operator is returned as a text mnemonic (OR, AND, NOT, etc.).