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 #<d><length><data> where <d> is a single digit indicating the number of digits in <length>, <length> is the byte count, and <data> is the program text containing SCPI commands. (maximum 1023 characters)

Example

PROGDEF "STARTUP", #228OUTMODE 1,1,A,0,0;SETP 1,300[term]
Defines a program named “STARTUP” with 28 bytes of program text that sets output 1 to closed loop PID mode on input A and sets the setpoint to 300K.

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]
Returns the program text for the program named “STARTUP”.

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]
Executes the program named “STARTUP”.

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]
Returns all program names, for example: "STARTUP","TEST","","","SHUTDOWN","","",""[term]
This indicates programs are stored in slots 1 (STARTUP), 2 (TEST), and 5 (SHUTDOWN), 5 additional empty slots.

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]
Deletes the program named “STARTUP”.

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:

  • For the thermometry input feature: input channel (A, B, C1-C4, D1-D4, E1-E4, F1-F4, G1-G4, H1-H4, or NONE)

  • For output status feature: numeric output (1-10)

  • For function output feature: function ID (1-16)

  • For digital input feature: digital input number (1-2)

  • For system feature currently only warmup all (0) is implemented

  • For off and on feature: ignored (use 0)

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:

  • For thermometry input feature:

    0 = Low alarm active, 1 = High alarm active, 2 = Either alarm active, 3 = Both alarms active 4 = Threshold 1, 5 = Threshold 2, 6 = Threshold 3, 7 = Threshold 4, 8 = Sensor fault, 9 = Temperature fault, 10 = Temperature extrapolated

  • For output status feature:

    0 = Output load fault, 1 = Output stabilizing, 2 = Output stable, 3 = Output warm, 4 = Output setpoint ramping complete

  • For other features (generic conditions):

    0 = Condition is false, 1 = Condition is true

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]
Configures function 1 to execute program ALLOFF when input A has SFAULT (sensor fault) OR input B has TFAULT (temperature fault).

FUNC 2,4,1,1,AND,5,1,1,0,0[term]
Configures function 2 to when output 1 is STABLE AND output 1 is WARM. (This is used to set a status bit only, with no additional action.
This also can be used to control a relay if desired by setting the feature to function and the instance to the function ID.)

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]
Returns: 3,A,4,OR,3,B,5,0,1[term]
This indicates function 1 is configured with thermometry input feature on inputs A and B, evaluating SFAULT and TFAULT conditions, combined with OR operator, triggering program 1.

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.).