Teledyne T3DSO1000, T3DSO2000 Programming Manual

1
Programming Guide
T3DSO1000 and T3DSO2000 Digital
Oscilloscopes Programming Guide
Manual Version 1.2
Digital Oscilloscope Series
2
This chapter indicates the modifications of commands in the most recent release of the programming guide version.
Introduction
Manual version 1.2 describes all the currently available commands. Some of the commands vary between the oscilloscope series, and these will be annotated in the description of command.
The following are the main revisions: w Delete the Table of Commands & Queries, and all the instructions are
classified according to the functional modules.
w Removed incorrect instructions, added instructions for GEN and DIGITAL
modules.
w Add two new communication features: Telnet and Socket, visible in
“Programming Overview-Remote Control”.
w Detailed programming instances for instructions (WF?/SCDP) to make
it easier to understand.
w Support obtaining waveform data of Digital channel and Math.
Digital Oscilloscope Series
3
Content
Programming Overview ....................................... .......................................... .... 6
Establishing Communications ....................................... ................................. 6
Install NI-VISA ....................................... ......................................... .......... 6
Connect the Instrument.................. ......................................... .................. 10
Remote Control ........................................... ......................................... ........ 11
User-defined Programming......................................... .............................. 11
Send SCPI Commands via NI-MAX ....................................... ................. 11
Using SCPI with Telnet.................................. .......................................... 11
Using SCPI with Sockets............................................... ........................... 13
Introduction to the SCPI Language ....................................... ........................... 14
About Commands & Queries........................... ............................................. 14
Description ........................................... ........................................................ 14
Usage................................................................................... ......................... 14
Command Notation....................................................................................... 15
Commands & Queries ...................................................................................... 17
COMMON (*) Commands ................................................. .......................... 18
COMM_HEADER Commands ....................................... ............................. 22
ACQUIRE Commands ....................................... ......................................... . 24
AUTOSET Commands........................................ ......................................... 38
CHANNEL Commands .............................................. .................................. 40
CURSOR Commands................................... ......................................... ....... 50
DIGITAL Commands......... .......................................................................... 58
DISPLAY Commands ................................ ........................................ .......... 68
HISTORY Commands................... ........................................ ....................... 74
Digital Oscilloscope Series
4
MATH Commands......................................... ......................................... ......79
MEASURE Commands........................ .........................................................96
PASS/FAIL Commands ............................... ........................................ .......110
PRINT Commands................................... ........................................ ...........122
RECALL Commands ..................................... ......................................... ....124
REFERENCE Commands............. ........................................ ...................... 128
SAVE Commands ...................................................................................... .138
STATUS Commands.............................. .....................................................145
SYSTEM Commands........ ......................................... ................................. 148
TIMEBASE Commands.............. ................................................................ 153
TRIGGER Commands ....................................... ......................................... 161
WAVEFORM Commands ....................................... ................................... 178
WGEN Commands.............................. ........................................ ................19 2
Programming Examples ................................................................................. 199
VISA Examples................................... ......................................... ...............200
VC++ Example........................................................................................ 200
VB Example....... ............................................ ......................................... 207
MATLAB Example........... ......................................................................213
LabVIEW Example .................................... .............................................215
C# Example............ ................................................................................. 218
Examples of Using Sockets......................................................................... 221
Python Example ......................................................................................221
C Example............. ..................................................................................224
Common Command Examples............................................................ ........226
Read waveform data (WF) Example .......................................................226
Digital Oscilloscope Series
5
Screen Dump (SCDP) Example................... ........................................... 228
Index................... ......................................... ....................................... ............ 229
Digital Oscilloscope Series
6
Programming Overview
This chapter introduces how to build communication between the instrument and the PC. It also introduces how to configure a system for remote instrument control. By using USB and LAN interfaces, in combination with NI-VISA and programming languages, users can remotely control the instruments. Through LAN interface, VXI-11, Sockets and Telnet protocols can be used to communicate with the instruments.
Establishing Communications
Install NI-VISA
Before programming, you need to install the National Instruments NI-VISA library, which you can download from the National Instruments web site. Currently, NI-VISA is packaged in two versions: a full version and a Run-Time Engine version. The full version includes the NI device drivers and a tool named NI MAX which is a user interface to control and test remotely connected devices. The Run-Time Engine is recommended, as it is a much smaller download than the full version and includes the necessary tools for basic communication to instruments.
For example, you can get the NI-VISA 5.4 full version from: http://www.ni.com/download/ni-visa-5.4/4230/en/.
You also can download NI-VISA Run-Time Engine 5.4 to your PC and install it as the default selection. Its installation process is similar with the full version.
After you downloaded the file, follow these steps to install NI-VISA (The full version of NI-VISA 5.4 is used in this example. Newer versions are likely, and should be compatible with Teledyne Test Tools instrumentation. Download the latest version available for the operating system being used by the controlling computer):
a. Double click the visa540_full.exe, dialog shown as below:
Digital Oscilloscope Series
7
b. Click Unzip, the installation process will automatically launch after unzipping
files. If your computer needs to install .NET Framework 4, it may auto start.
c. The NI-VISA installing dialog is shown above. Click Next to start the
installation process.
Digital Oscilloscope Series
8
d. Set the install path, default path is “C:\Program Files\National Instruments\”,
you can change it. Click Next, dialog shown as above.
e. Click Next twice, in the License Agreement dialog, select the “I accept the
above 2 License Agreement(s).”,and click Next, dialog shown as below:
Digital Oscilloscope Series
9
f. Click Next to begin installation.
g. Now the installation is complete. Reboot your PC.
Digital Oscilloscope Series
10
Connect the Instrument
Depending on the specific model, your oscilloscope may be able to communicate with a PC through the USB or LAN interface.
Connect the instrument and the USB Host interface of the PC using a USB cable. Assuming your PC is already turned on, turn on your oscilloscope, and then the PC will display the “Device Setup” screen as it automatically installs the device driver as shown below.
Wait for the installation to complete and then proceed to the next step.
Digital Oscilloscope Series
11
Remote Control
User-defined Programming
Users can use SCPI commands via a computer to program and control the digital oscilloscope. For details, refer to the introductions in "Programming Examples".
Send SCPI Commands via NI-MAX
NI-Measurement and Automation eXplorer (NI-MAX) is a program created and maintained by National Instruments. It provides a basic remote control interface for VXI, LAN, USB, GPIB, and Serial communications. It is a utility that enables you to send commands one-at-a-time and also retrieve data from connected devices. It is a great tool for troubleshooting and testing command sequences. The oscilloscopes can be controlled remotely by sending SCPI commands via NI-MAX.
Using SCPI with Telnet
Telnet provides a means of communicating with the oscilloscopes over a LAN connection. The Telnet protocol sends SCPI commands to the oscilloscopes from a PC and is similar to communicating with the oscilloscopes over USB. It sends and receives information interactively: one command at a time. Windows operating systems use a command prompt style interface for the Telnet client. The steps are as follows:
1. On your PC, click Start > All Programs > Accessories > Command Prompt.
2. At the command prompt, type in telnet.
3. Press the Enter key. The Telnet display screen will be displayed.
Digital Oscilloscope Series
12
4. At the Telnet command line, type:
open XXX.XXX.XXX.XXX 5024
Where XXX.XXX.XXX.XXX is the instrument‘s IP address and 5024 is the port. You should see a response similar to the following:
5. At the SCPI> prompt, input the SCPI commands such as *IDN? to return the company name, model number, serial number, and firmware version number.
Digital Oscilloscope Series
13
6. To exit the SCPI> session, press the Ctrl+] keys simultaneously.
7. Type quit at the prompt or close the Telnet window to close the connection to the instrument and exit Telnet.
Using SCPI with Sockets
Socket API can be used to control the T3DSO series via LAN without installing any other libraries. This can reduce the complexity of programming.
SOCKET ADDRESS IP address + port number IP ADDRESS T3DSO IP address PORT NUMBER 5024
Please see section "Examples of Using Sockets" for the details.
Digital Oscilloscope Series
14
Introduction to the SCPI Language
About Commands & Queries
This section lists and describes the remote control commands and queries recognized by the instrument. All commands and queries can be executed in either local or remote state.
The description for each command or query, with syntax and other information, begins on a new page. The name (header) is given in both long and short form at the top of the page, and the subject is indicated as a command or query or both.
The commands are given in long format for the “COMMAND SYNTAX“ and “QUERY SYNTAX“ sections and they are used in a short form for theEXAMPLE” .
Queries perform actions such as obtaining information, and are recognized by the question mark (?) following the header.
Description
In the description, a brief explanation of the function performed is given. This is followed by a presentation of the formal syntax, with the header given in upper case characters and the short form derived from it. Where applicable, the syntax of the query is given with the format of its response.
Usage
The commands and queries listed here can be used for the T3DSO1000 and T3DSO2000 Digital Oscilloscope Series.
Digital Oscilloscope Series
15
Command Notation
The following notations are used in the commands: < > Angular brackets enclose words that are used as placeholders, of which there
are two types: the header path and the data parameter of a command.
:= A colon followed by an equals sign separates a placeholder from the
description of the type and range of values that may be used in a
command instead of the placeholder. { } Braces enclose a list of choices, one of which one must be made. [ ] Square brackets enclose optional items. … An ellipsis indicates that the items both to its left and right may be repeated
for a number of times.
As an example, consider the syntax notation for the command to set the vertical input sensitivity: <channel>:VOLT_DIV <v_gain> <channel>:={C1,C2,C3,C4} <v_gain>:= 2 mV to 10 V
The first line shows the formal appearance of the command, with <channel> denoting the placeholder for the header path and <v_gain> the placeholder for the data parameter specifying the desired vertical gain value. The second line indicates that one of four channels must be chosen for the header path. And the third explains that the actual vertical gain can be set to any value between 2 mV and 10 V.
Digital Oscilloscope Series
16
Digital Oscilloscope Series
17
Commands & Queries
This chapter introduces each command subsystem of the Teledyne Test Tools Digital Oscilloscope Series command set. The contents of this chapter are shown as below:
w COMMON (*) Commands w COMM_HEADER Commands w ACQUIRE Commands w AUTOSET Commands w CHANNEL Commands w CURSOR Commands w DIGITAL Commands w DISPLAY Commands w HISTORY Commands w MATH Commands w MEASURE Commands w PASS/FAIL Commands w PRINT Commands w RECALL Commands w REFERENCE Commands w SAVE Commands w STATUS Commands w SYSTEM Commands w TIMEBASE Commands w TRIGGER Commands w WAVEFORM Commands w WGEN Commands w Obsolete Commands for Old Models
Digital Oscilloscope Series
18
COMMON (*) Commands
The IEEE 488.2 standard defines some general commands for querying the basic information of an instrument or performing common basic operations. These commands usually start with *, and the command key length is 3 characters.
w*IDN? (Identification Number) w*OPC (Operation Complete) w*RST (Reset)
Digital Oscilloscope Series
19
COMMON (*)
*IDN?
Query
DESCRIPTION
The *IDN? query identifies the instrument type and software version. The response consists of four different fields providing information on the manufacturer, the scope model, the serial number and the firmware revision.
QUERY SYNTAX
*IDN?
RESPONSE FORMAT
Teledyne Test Tools,<model>,<serial number>,<firmware> <model>:= the model number of the instrument. <serial number>:= A 14-digit decimal code. <firmware>:= the software revision of the instrument
EXAMPLE
The query identifies the instrument type and software version. Command message:
*IDN?
Response message:
Teledyne Test Tools, T3DSO1204 ,NDS1EBAC0L0098,7.6.1.15
Digital Oscilloscope Series
20
COMMON (*)
*OPC
Command/Query
DESCRIPTION
The *OPC command sets the operation complete bit in the Standard Event Status Register when all pending device operations have finished.
The *OPC? query places an ASCII "1" in the output queue when all pending device operations have completed. The interface hangs until this query returns.
COMMAND SYNTAX
*OPC
QUERY SYNTAX
*OPC?
RESPONSE FORMAT
*OPC 1
Digital Oscilloscope Series
21
COMMON (*)
*RST
C o mm a nd
DESCRIPTION
The *RST command initiates a device reset. This is the same as pressing [Default] on the front panel.
COMMAND SYNTAX
*RST
EXAMPLE
This example resets the oscilloscope. Command message:
*RST
Digital Oscilloscope Series
22
COMM_HEADER Commands
wCHDR
Digital Oscilloscope Series
23
COMM_HEADER
COMM_HEADER | CHDR
Command/ Query
DESCRIPTION
The COMM_HEADER command controls the way the oscilloscope formats response to queries. This command does not affect the interpretation of messages sent to the oscilloscope. Headers can be sent in their long or short form regardless of the CHDR setting.
Examples of the three response formats to “C1:VDIV?”:
CHDR RESPONSE
LONG C1:VOLT_DIV 1.00E+01V SHORT C1:VDIV 1.00E+01V OFF 1.00E+01
COMMAND SYNTAX
COMM_HEADER <mode> <mode>:={SHORT,LONG,OFF}
SHORT — response starts with the short form of the header word.
LONG — response starts with the long form of the header word.
OFF — header is omitted from the response and units in numbers are suppressed.
Note:
Default is the SHORT response format.
QUERY SYNTAX
COMM_HEADER?
RESPONSE FORMAT
COMM_HEADER <mode>
EXAMPLE
The following command sets the response header format to SHORT. Command message:
CHDR SHORT
Digital Oscilloscope Series
24
ACQUIRE Commands
The ACQUIRE subsystem controls the way in which waveforms are acquired. These commands set the parameters for acquiring and storing data.
w ARM w STOP w ACQW w AVGA w MSIZ w SAST? w SARA? w SANU? w SXSA w XYDS
Digital Oscilloscope Series
25
ACQUIRE
ARM_ACQUISITION | ARM
Command
DESCRIPTION
The ARM_ACQUISITION command starts a new signal acquisition.
COMMAND SYNTAX
ARM_ACQUISITION
EXAMPLE
The following steps show the effect of ARM.
Note:
INR bit 13 (8192) = Trigger is ready. INR bit 0 (1) = New Signal Acquired.
Step 1: Set the trigger mode to single, and input a signal which can be triggered. Once triggered, you can see the state of acquisition changes to stop. Send the query.
Query message:
INR?
Response message:
INR 8193(trigger ready)
Step 2: Send the query again to clear the register.
Query message:
INR?
Response message:
INR 0
Step 3; Now, send the command to start a new signal acquisition.
Command message:
ARM
Step 4: Send the query to see the effect of ARM.
Query message:
INR?
Digital Oscilloscope Series
26
Response message:
INR 8193
RELATED COMMANDS
STOP TRMD INR?
Digital Oscilloscope Series
27
ACQUIRE
STOP
Command
DESCRIPTION
The STOP command stops the acquisition. This is the same as pressing the Stop key on the front panel.
COMMAND SYNTAX
STOP
EXAMPLE
The following command stops the acquisition process. Command message:
STOP
RELATED COMMANDS
ARM TRMD
Digital Oscilloscope Series
28
ACQUIRE
ACQUIRE_WAY | ACQW
Command /Query
DESCRIPTION
The ACQUIRE_WAY command specifies the acquisition mode.
The ACQUIRE_WAY? query returns the current acquisition mode.
COMMAND SYNTAX
ACQUIRE_WAY <mode>[,<time>]
<mode>:={SAMPLING,PEAK_DETECT,AVE RAGE,HIGH_RES}
<time>:={4,16,32,64,128,256,512,…}
SAMPLING — sets the oscilloscope in the normal mode.
PEAK_DETECT — sets the oscilloscope in the peak detect mode.
AVERAGE — sets the oscilloscope in the averaging mode.
HIGH_RES — sets the oscilloscope in the enhanced resolution mode (also known as smoothing). This is essentially a digital boxcar filter and is used to reduce noise at slower sweep speeds.
Note:
The [HIGH_RES] option is valid for T3DSO models. See models on page 14.
<time>:={4,16,32,64,128,256,512,…} when <mode> = AVERAGE.
Options vary from models. See the data sheet or the acquire menu of the oscilloscope.
QUERY SYNTAX
ACQUIRE_WAY?
RESPONSE FORMAT
ACQUIRE_WAY <mode>[,<time>]
EXAMPLE
The following command sets the acquisition mode to average mode and also sets the average time to 16. Command message:
Digital Oscilloscope Series
29
ACQW AVERAGE,16
RELATED COMMANDS
AVGA
Digital Oscilloscope Series
30
ACQUIRE
AVERAGE_ACQUIRE | AVGA
Command /Query
DESCRIPTION
The AVERAGE_ACQUIRE command selects the average times of average acquisition.
The AVERAGE_ACQUIRE? query returns the currently selected count value for average mode.
COMMAND SYNTAX
AVERAGE_ACQUIRE <time>
<time>:= {4,16,32,64,128,256,…}
Note:
Options of <time> vary from models. See the data sheet or the acquire menu of the oscilloscope for details.
QUERY SYNTAX
AVERAGE_ACQUIRE?
RESPONSE FORMAT
AVERAGE_ACQUIRE <time>
EXAMPLE
The following command turns the average times of average acquisition to 16. Command message:
AVGA 16
RELATED COMMANDS
ACQW
Loading...
+ 203 hidden pages