3 using queries, 4 structure of a scpi message – AMETEK 2001RP User Manual
Page 87
User and Programming Manual - Rev R
2001RP
77
9.3 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 AC source.
Otherwise a Query Error will occur and the non-returned data will be lost.
9.4 Structure of a SCPI Message
SCPI messages consist of one or more message units ending in a message terminator. The
terminator is not part of the syntax, but implicit in the way your programming language indicates
the end of a line (such as a newline or end-of-line character).
The Message Unit
The simplest SCPI command is a single message unit consisting of a command header (or
keyword) followed by a message terminator.
FREQuency?
VOLTage?
The message unit may include a parameter after the header. The parameter usually is numeric:
VOLTage 20
OUTPut 1
Combining Message Units
The following command message is briefly described here, with details in subsequent
paragraphs.
Data
Query Indicator
Message Unit
Header
SOUR:VOLT 80; FREQ 60; :CURR?
Header Message
Root
Message
Separator Unit Specifier Terminator
Separator
Figure 9-2: Command Message Structure
The basic parts of the above message are: