MDO3000 Programmer Manual.pdf - 第32页

Command Syntax T able 2-2: Comm and Message Elements Symbol Meaning <Header> This is the basic command name. If the header ends with a question mark, the command is a query . The header may begin with a colon (:) c…

100%1 / 1158
Command Syntax
You can control the operations and functions of the oscilloscope through the
Ethernet port or the USB 2.0 high-speed (HS) device port using commands and
queries. The
related topics listed below describe the syntax of these commands
and queries. The topics also describe the conventions that the oscilloscope uses
to process them. See the Command Groups topic in the table of contents for a
listing of the commands by command group, or use the index to locate a specific
command.
Backus-Naur Form
Notation
This documentation describes the commands and queries using Backus-Naur
Form (BNF) notation. Refer to the following table for the symbols that are used.
Table 2-1: Symbols for Backus-Naur Form
Symbol Meaning
<>
Dened element
=
Is de ned as
| Exclusive OR
{ } Group; one element is required
[]
Optional; can be omitted
.. .
Previous element(s) may be repeated
Command and Query Structure
Commands consist of set commands and query commands (usually called
commands and queries). Commands modify oscilloscope settings or tell the
oscilloscope to perform a specific action. Queries cause the oscilloscope to return
data and status information.
Most commands have both a set form and a query form. The query form of the
command differs from the set form by its question mark at the end. For example,
the set command ACQuire:MODe has a query form ACQuire: MODe?.Notall
commands have both a set and a query form. Some commands have set only and
some have query only.
Messages
A command message is a command or query name followed by any information
the oscilloscope needs to execute the command or query. Command messages
may contain five element types, defined in the following table.
MDO4000/B/C, MSO/DPO4000B and MDO3000 Series Oscilloscopes Programmer Manual 2-1
Command Syntax
Table 2-2: Comm
and Message Elements
Symbol Meaning
<Header>
This is the basic command name. If the header ends with a question
mark, the command is a query. The header may begin with a colon
(:) c haracte
r. If the command is concatenated with other commands,
the beginning colon is required. Never use the beginning colon with
command headers beginning with a star (*).
<Mnemonic>
This is a header subfunction. Some command headers have only one
mnemonic. I
f a command header has multiple mnemonics, a colon (:)
character always separates them from each o ther.
<Argument
>
This is a qu
antity, quality, restriction, or limit associated with the header.
Some commands have no arguments while others have multiple
arguments. A <space> separates arguments from the header. A
<comma> se
parates arguments from each other.
<Comma> A single c
omma is used between arguments of multiple-argument
commands. Optionally, there may be white space characters before
and after the comma.
<Space>
A white space character is used between a command header and the
related argument. Optionally, a wh ite space may consist of multiple
white sp
ace characters.
Commands
Comman
ds cause the oscilloscope to perform a specific function or change one of
the settings. Commands have the structure:
[:]<H
eader>[<Space><Argument>[<Comma> <Argument>]...]
A command header consists of one or more mnemonics arranged in a hierarchical
or tr
ee structure. The first mnemonic is the base or root of the tree and each
subsequent mnemonic is a level or branch off the previous one. Commands at a
higher level in the tree may affect those at a lower level. The leading colon (:)
always returns you to the base of the command tree.
2-2 MDO4000/B/C, MSO/DPO4000B and MDO3000 Series Oscilloscopes Programmer Manual
Command Syntax
Queries
Queries cause t
he oscilloscope to return status or setting information. Queries
have the structure:
[:]<Header>
[:]<Header>[<Space><Argument> [<Comma><Argument>]...]
You can specify a query command at any level within the command tree unless
otherwise noted. These branch queries return information about all the mnemonics
below the specified branch or level.
Headers
Use the HEADer command to control whether the oscilloscope returns headers as
part of the query response. If header is on, the query response returns command
headers, then formats itself as a valid set command. When header is off, the
response includes only the values. This may make it easier to parse and extract the
information from the response. The table below shows the difference in responses.
Table 2-3: Comparison of Header Off and Header On Responses
Query Header Off Header On
TIME?
14:30:00 :TIME “14:30:00”
ACQuire:NUMAVg?
100
:ACQUIRE:NUMAVG 100
Clearing the oscilloscope
You can clear the Output Queue and reset the oscilloscope to accept a new
command or query by using the selected Device Clear (DCL) function.
Command Entry
The following rules apply when entering commands:
You can enter commands in upper or lower case.
You can precede any command with white space characters. White space
characters include any combination of the ASCII control characters 00 through
09 and 0B through 20 hexadecimal (0 through 9 and 11 through 32 decimal).
The oscilloscope ignores commands consisting of any combination of white
space characters and line feeds.
MDO4000/B/C, MSO/DPO4000B and MDO3000 Series Oscilloscopes Programmer Manual 2-3