Block Program Data; Writing Multiple Commands On The Same Line; Scpi Termination And Separator Syntax Examples - Keysight N9000A Manual

Signal analyzers
Hide thumbs Also See for N9000A:
Table of Contents

Advertisement

Block Program Data

Some parameters consist of a block of data. There are a few standard types of block data. Arbitrary blocks of program
data can also be used.
Type
<trace>
<arbitrary block data>

Writing Multiple Commands on the Same Line

Multiple commands can be written on the same line, reducing your code space requirement. To do this:
Commands must be separated with a semicolon (;)
If the commands are in different subsystems, the key word for the new subsystem must be preceded by a colon (:)
If the commands are in the same subsystem, the full hierarchy of the command key words need not be included. The
second command can start at the same key word level as the command that was just executed.

SCPI Termination and Separator Syntax Examples

The following are some examples of valid and invalid commands. The examples are created from a theoretical instrument
with the simple set of commands indicated below:
[:SENSe]:POWer[:RF]:ATTenuation 40dB
:TRIGger[:SEQuence]:EXTernal[1]:SLOPe POSitive
Description
An array of rational numbers corresponding to displayed trace data. See the description of the FORMat:DATA
command in the "Programming the Analyzer" chapter of any X-Series Users and Programmers Reference or online
Help file for information about available data formats.
A SCPI command often refers to a block of current trace data with a variable name such as: Trace1, Trace2, or trace3,
depending on which trace is being accessed.
A block of data bytes. The first information sent in the block is an ASCII header beginning with #. The block is
terminated with a semi-colon. The header can be used to determine how many bytes are in the data block. There are
no units.
A data query returns each block of data in the following format:
#DNNN<nnn binary data bytes>;
where #DNNN is the header. To parse this data:
1.
Read two characters (#D), where D tells you how many N characters follow the D character,
2.
Read D characters, and convert to an integer that specifies the number of data bytes in the block,
3.
Read NNN bytes into a real array.
Example: Header value = #512320
The first numeric character/digit (5) tells you how many additional digits there are in the header.
The 12320 means that 12,320 data bytes follow the header.
Divide the number of data bytes by the bytes/data point of the current data format, which is 8 for REAL,64.
Thus, in this example, there are 12320/8 = 1540 data points in this block.
SCPI Programming Fundamentals
21
SCPI Language Basics

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

N9038aN9010aN9030aN9020a

Table of Contents