Types of scpi messages, Moving among subsystems, Including common commands – Agilent Technologies 6631B User Manual

Page 14: Using queries

Advertising
background image

2 - Introduction to Programming

14

Moving Among Subsystems

In order to combine commands from different subsystems, you need to be able to reset the header path to
a null string within a message. You do this by beginning the command with a colon (:), which discards any
previous header path. For example, you could clear the output protection and check the status of the
Operation Condition register in one message by using a root specifier as follows:

OUTPut:PROTection:CLEAr;:STATus:OPERation:CONDition?

The following message shows how to combine commands from different subsystems as well as within the
same subsystem:

VOLTage:LEVel 20;PROTection 28; :CURRent:LEVel 3;PROTection:STATe ON

Note the use of the optional header LEVel to maintain the correct path within the voltage and current
subsystems, and the use of the root specifier to move between subsytems.

Including Common Commands

You can combine common commands with system commands in the same message. Treat the common
command as a message unit by separating it with a semicolon (the message unit separator). Common
commands

do not affect the header path; you may insert them anywhere in the message.

VOLTage:TRIGgered 17.5;:INITialize;*TRG

OUTPut OFF;*RCL 2;OUTPut ON

Using Queries

Observe the following precautions with queries:

Set up the proper number of variables for the returned data.

Read back all the results of a query before sending another command to the dc source. Otherwise
a

Query Interrupted error will occur and the unreturned data will be lost.

Types of SCPI Messages

There are two types of SCPI messages, program and response.

A

program message consists of one or more properly formatted SCPI commands sent from the

controller to the dc source. The message, which may be sent at any time, requests the dc source
to perform some action.

A

response message consists of data in a specific SCPI format sent from the dc source to the

controller. The dc source sends the message only when commanded by a program message
called a "query."

The following figure illustrates SCPI message structure:

Advertising
This manual is related to the following products: