beautypg.com

Essentials for beginners, Program and response messages, Program and response – HP 8360 User Manual

Page 96: Messages

background image

Essentials for
Beginners

This subsection discusses elementary concepts critical to first-time
users of SCPI. Read and understand this subsection before going on
to another. This subsection includes the following topics:

Program and Response
Messages

These paragraphs introduce the
basic types of messages sent between

instruments and controllers.

Subsystem Command Trees

Subsystem Command Tables

Reading Instrument Errors

Example Programs

These paragraphs describe the
tree structure used in subsystem
commands.

These paragraphs present the
condensed tabular format used for
documenting subsystem commands.

These paragraphs explain how to read
and print an instrument’s internal
error messages.

These paragraphs contain two simple
measurement programs that illustrate
basic SCPI programming principles.

Program and Response

To understand how your instrument and controller communicate

Messages

using SCPI, you must understand the concepts of program and
response messages.

Program messages

are the formatted data sent

from the controller to the instrument. Conversely,

response messages

are the formatted data sent from the instrument to the controller.
Program messages contain one or more commands, and response
messages contain one or more responses.

The controller may send commands at any time, but the instrument
sends responses only when specifically instructed to do so. The
special type of command used to instruct the instrument to send
a response message is the query. All query mnemonics end with a
question mark. Queries return either measured values or internal

instrument settings. Any internal setting that can be programmed

with SCPI can also be queried.

Forgiving Listening and Precise Talking

SCPI uses the concept of forgiving listening and precise talking
outlined in IEEE 488.2. Forgiving listening means that instruments
are very flexible in accepting various command and parameter

formats. For example, the synthesizer accepts either : POWer : STATe

ON or :POWer:STATe

1

to turn RF output on.

Precise

means

that the response format for a particular query is always the same.
For example, if you query the power state when it is on
(using : POWer : STATe?), the response is always 1, regardless of
whether you previously sent : POWer : STATe 1 or : POWer : STATe ON.

1-66 Getting Started Programming