2 scpi command structure – B&K Precision 4078 - Manual User Manual

Page 46

Advertising
background image

- # - 0 – 8-bit byte – LF^EOI

Some Program Message Units either require, or can accept, more than one data element. Program data elements are
separated from each other by the Program Data Separator. It is defined as optional whitespace characters followed
by a comma (','), which in turn is followed by optional whitespace characters.

There are two types of Program Message Units: Command Message Units and Query Message Units. A Query
differs from a Command in that the Program Header is terminated with a question mark ('?'). For example, the
frequency might be queried with the following query:


FREQ?

Some Query Message Units accept data, giving the device more specific information about what is being queried. In
many cases the Query Message Unit may optionally be supplied with the MIN or MAX mnemonics as data. This
tells the device to return the minimum or maximum value to which the parameter may currently be set. For example,


FREQ? MAX


will return the maximum value to which the frequency may currently be set.

Not all Program Message units have query forms ( for example, STATUS:PRESET), and some Program Message
Units might have only the query form (for example SYSTEM:VERSION?).

The instrument puts the response to the query into the output queue, from where it may be read by the controller.
The Status Byte MAV bit is set to indicate to the controller that a response is ready to be read.


4.10.2 SCPI Command Structure

SCPI commands are based on a hierarchical structure. This allows the same instrument-control header to be used
several times for different purposes, providing that the mnemonic occurs in a unique position in the hierarchy. Each
level in the hierarchy is defined as a node. Mnemonics in the different levels are separated from each other by a
colon (':'). The first Program Message Unit, or command, in a Program Message is always referenced to the root
node. Subsequent commands are referenced to the same level as the previous command. A Program Message Unit
having a colon as its first character causes the reference to return to the root. This process is defined by IEEE 488.1,
section A.1.1. Consider the following examples:


a) The following command may be used to set the amplitude and the offset of the signal.


SOURCE:VOLTAGE:AMPLITUDE 5V;OFFSET 2V

Note that the offset command is referenced to the command preceding it: the OFFSET mnemonic resides at the
same node as the AMPLITUDE command.


b) This command set the frequency and the amplitude.


SOURCE:FREQUENCY 2KHZ;VOLTAGE:AMPLITUDE 4V


The FREQUENCY and VOLTAGE mnemonics are at the same level.

c) When Program Message Units describe different subsystems, a colon prefix must be used to reset the
command reference to the root. Here the frequency and the output state are set.


SOURCE:FREQUENCY 3KHZ;:OUTPUT:STATE ON

Advertising
This manual is related to the following products: