beautypg.com

Commands from different subsystems, Message unit – Agilent Technologies N5700 User Manual

Page 60

background image

SCPI Commands – an Introduction

60

Series N5700 User’s Guide

path is defined as the characters that make up the keywords of the
previous command in the message up to and including the last colon
separator. An example of a message with two commands is:

OUTPut:STATe ON;PROTection:CLEar

which shows the use of the semicolon separating the two commands,
and also illustrates the command path concept. Note that with the
second command, the leading keyword OUTPut was omitted because
after the OUTPut:STATe ON command, the path became defined as
OUTPut, and thus the second command was interpreted as:

OUTPut:PROTection:CLEar

In fact, it would have been incorrect to include the OUTPut keyword
in the second command, because the result after combining it with
the command path would be:

OUTPut:OUTPut:PROTection:CLEar

which would result in a syntax error.

Commands from Different Subsystems

In order to combine commands from different subsystems, you need
to be able to reset the command path to a null string within a
message. Beginning the command with a colon (:), discards the
previous 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 7.5;PROTection 10;:CURRent 0.25

Note the use of the optional keyword LEVel to maintain the correct
path within the subsystems, and the use of the root specifier (:) to
move between subsystems.

Message Unit

The simplest SCPI command is a single message unit consisting of a
keyword followed by a message terminator. The message unit may
include a parameter after the keyword. The parameter can be
numeric or a string.

ABORt

VOLTage 20

VOLTage:TRIGgered MINimum

Colons (:) separate higher-level keywords from lower-level keywords.
Use a blank space to separate parameters from keywords. If a
command requires more than one parameter, use commas to
separate adjacent parameters.