0% found this document useful (0 votes)
108 views82 pages

T3afg Programming Guide

This document provides a programming guide for T3AFG series arbitrary waveform generators. It discusses initializing communication via VISA and remote control using SCPI commands over various interfaces. The SCPI command syntax and over 30 specific commands are described, covering functions like waveform generation, arbitrary waveform loading, and synchronization of multiple devices. Programming examples for initializing VISA communication in VC++ are also included.

Uploaded by

Malburg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
108 views82 pages

T3afg Programming Guide

This document provides a programming guide for T3AFG series arbitrary waveform generators. It discusses initializing communication via VISA and remote control using SCPI commands over various interfaces. The SCPI command syntax and over 30 specific commands are described, covering functions like waveform generation, arbitrary waveform loading, and synchronization of multiple devices. Programming examples for initializing VISA communication in VC++ are also included.

Uploaded by

Malburg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 82

T3AFG Series

Function / Arbitrary Waveform Generators


Programming Guide
Contents
1 PROGRAMMING OVERVIEW ...................................................................................................1

1.1 INITIATE COMMUNICATION VIA VISA ................................................................................................... 1


1.1.1 Install NI-VISA ......................................................................................................................... 1
1.1.2 Connect the instrument ........................................................................................................... 5
1.2 REMOTE CONTROL .............................................................................................................. .............6
1.2.1 User-defined Programming .....................................................................................................6
1.2.2 Using SCPI via NI-MAX..............................................................................................................6
1.2.3 Using SCPI over Telnet...............................................................................................................6
1.2.4 Using SCPI over Socket .............................................................................................................8

2 INTRODUCTION TO THE SCPI LANGUAGE ........................................................................9

2.1 ABOUT COMMANDS & QUERIES ......................................................................................................... 9


2.2 DESCRIPTION .................................................................................................................................. 9
2.3 USAGE ........................................................................................................................................... 9
2.4 COMMAND NOTATION ...................................................................................................................... 9
2.5 TABLE OF COMMAND & QUERIES ...................................................................................................... 10

3 COMMANDS AND QUERIES ..................................................................................................12

3.1 IEEE 488.2 COMMON COMMAND INTRODUCTION.............................................................................. 12


3.1.1 *IDN .........................................................................................................................................12
3.1.2 *OPC .......................................................................................................................................13
3.1.3 *RST........................................................................................................................................14
3.2 COMM_HEADER COMMAND ........................................................................................................... 14
3.3 OUTPUT COMMAND ....................................................................................................................... 15
3.4 BASIC WAVE COMMAND ................................................................................................................. 16
3.5 MODULATE WAVE COMMAND ......................................................................................................... 19
3.6 SWEEP WAVE COMMAND ................................................................................................................ 23
3.7 BURST WAVE COMMAND ................................................................................................................ 25
3.8 PARAMETER COPY COMMAND .......................................................................................................... 28
3.9 ARBITRARY WAVE COMMAND .......................................................................................................... 28
3.10 SYNC COMMAND ........................................................................................................................... 30
3.11 NUMBER FORMAT COMMAND .......................................................................................................... 31
3.12 LANGUAGE COMMAND ................................................................................................................... 31
3.13 CONFIGURATION COMMAND ............................................................................................................ 32
3.14 BUZZER COMMAND ........................................................................................................................ 32
3.15 SCREEN SAVE COMMAND ................................................................................................................ 33
3.16 CLOCK SOURCE COMMAND .............................................................................................................. 33
3.17 FREQUENCY COUNTER COMMAND .................................................................................................... 34
3.18 INVERT COMMAND ........................................................................................................................ 35
3.19 COUPLING COMMAND .................................................................................................................... 36

I
3.20 OVER-VOLTAGE PROTECTION COMMAND ............................................................................................37
3.21 STORE LIST COMMAND ....................................................................................................................38
3.22 ARB DATA COMMAND .....................................................................................................................40
3.23 VIRTUAL KEY COMMAND ..................................................................................................................42
3.24 IP COMMAND ................................................................................................................................44
3.25 SUBNET MASK COMMAND ...............................................................................................................45
3.26 GATEWAY COMMAND ......................................................................................................................46
3.27 SAMPLING RATE COMMAND .............................................................................................................46
3.28 HARMONIC COMMAND ....................................................................................................................47
3.29 WAVEFORM COMBINING COMMAND ..................................................................................................48
3.30 MODE SELECT COMMAND ................................................................................................................49
3.31 MULTI-DEVICE SYNC .......................................................................................................................49
3.32 IQ COMMANDS ..............................................................................................................................50
3.32.1:IQ:CENTerfreq ......................................................................................................................... 50
3.32.2:IQ:SAMPlerate ......................................................................................................................51
3.32.3:IQ:SYMBolrate ......................................................................................................................51
3.32.4:IQ:AMPLitude.........................................................................................................................51
3.32.5:IQ:IQADjustment:GAIN ........................................................................................................... 52
3.32.6:IQ:IQADjustment:IOFFset........................................................................................................ 52
3.32.7:IQ:IQADjustment:QOFFset...................................................................................................... 53
3.32.8:IQ:IQADjustment:QSKew ........................................................................................................ 53
3.32.9:IQ:TRIGger:SOURce ............................................................................................................... 53
3.32.10 :IQ:WAVEload:BUILtin.......................................................................................................... 54
3.32.11 :IQ:WAVEload:USERstored ................................................................................................. 54
3.32.12 :IQ:FrequencySampling........................................................................................................ 55

4 PROGRAMMING EXAMPLES................................................................................................. 56

4.1 EXAMPLES OF USING VISA ...............................................................................................................56


4.1.1 VC++ Example ......................................................................................................................... 56
4.1.2 VB Example ............................................................................................................................63
4.1.3 MATLAB Example..................................................................................................................... 68
4.1.4 LabVIEW Example.................................................................................................................... 70
4.1.5 Python Example ....................................................................................................................... 72
4.2 EXAMPLES OF USING SOCKETS ...........................................................................................................75
4.2.1 Python Example ....................................................................................................................... 75

5 INDEX ....................................................................................................................................... 77

Unless otherwise specified, all materials and processes are compliant with RoHS
Directive 2011/65/EU in its entirety, inclusive of any further amendments or modifications
of said Directive.

II
1 Programming Overview
By using USB and LAN interfaces, in combination with NI-VISA and programming
languages, users can remotely control the waveform generator. Through the LAN
interface, VXI-11, Sockets and Telnet protocols you can communicate with the
instruments. This chapter introduces how to initiate communication between the
instrument and the PC. It also introduces how to configure a system for remote
instrument control.

1.1 Initiate communication via VISA

1.1.1 Install NI-VISA


Before programming, please make sure that you have properly installed the latest
version of National Instruments NI-VISA Software.

NI-VISA is a communication library that enables computer communication for


instrumentation. There are two available VISA packages: A full version and the Run-
Time Engine. The full version includes NI device drivers and a tool named NI MAX; a
user interface to control the device. While the drivers and NI MAX can be useful, they
are not required for remote control. The Run-Time Engine is a much smaller file and is
recommended for remote control.

For convenience, you can obtain the latest version of the NI-VISA run-time engine or
full version from the National Instruments website. The installation process is similar
for bothversions.

Follow these steps to install NI-VISA (The full version of NI-VISA 5.4 is used in this
example):

i. Download the appropriate version of NI-VISA (the Run-time engine is


recommended)

ii. Double click the visa540_full.exe, dialog shown as below:

1
iii. Click Unzip, the install process will launch after unzipping files. If your
computer needs to install the .NET Framework 4, it may auto start.

iv. The NI-VISA install dialog is shown above. Click Next to start the installation
process.

2
v. Set the install path, default path is “C:\Program Files\National
Instruments\”, you can change it, if you prefer. Click Next, dialog as shown
above.

vi. Click Next twice, in the License Agreement dialog, select the “I accept the
above 2 License Agreement(s).”,and click Next, dialog as shown below:

3
vii. Click Next to begin installation.

viii.Now the installation is complete. Reboot your PC.

4
1.1.2 Connect the instrument
Depending on the specific model, the arbitrary waveform generator may be able
to communicate with a PC through the USB or LAN interface.

Connect the arbitrary waveform generator and the USB Host interface of the PC
using a USB cable. Assuming your PC is already turned on, turn on the T3AFG,
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.

5
1.2 Remote Control

1.2.1 User-defined Programming


Users can send SCPI commands via a computer to program and control the
arbitrary waveform generator. For details, refer to the introductions in
"Programming Examples".

1.2.2 Using SCPI via NI-MAX


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
communication. The T3AFG can be controlled remotely by sending SCPI
commands via NI-MAX.

1.2.3 Using SCPI over Telnet


Telnet provides a means of communicating with the T3AFG over the LAN. The
Telnet protocol sends SCPI commands to the T3AFG from a PC and is similar to
communicating with the T3AFG over USB. It sends and receives information
interactively: one command at a time. The Windows operating system uses 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.

6
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.

7
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.

1.2.4 Using SCPI over Socket


Socket API can be used to control the T3AFG series by LAN without installing
any other libraries. This can reduce the complexity of programming.

SOCKET ADDRESS IP address + port


number
IP ADDRESS T3AFG IP address
PORT NUMBER 5025

Please see section 4.2 "Examples of Using Sockets" for the details.

8
2 Introduction to the SCPI Language
2.1 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
static. Each command or query, with syntax and other information, has some examples
listed. The commands are given in both long and short format at “COMMAND SYNTAX”
and “QUERY SYNTAX”, and the subject is indicated as a command or query or both.
Queries perform actions such as obtaining information, and are recognized by the
question mark (?) following the header.

2.2 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-and-Lower-Case
characters and the short form derived from it in ALL UPPER-CASE characters. Where
applicable, the syntax of the query is given with the format of its response.

2.3 Usage

The commands and queries listed here can be used for T3AFG Series Arbitrary
Waveform Generators.

2.4 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 must be made.
[] Square brackets enclose optional items.

9
… An ellipsis indicates that the items both to its left and right may be
repeated for a number of times.

2.5 Table of Command & Queries


Short Long Form Subsystem What Command/Query does
*IDN *IDN SYSTEM Gets identification from device.
*OPC *OPC SYSTEM Gets or sets the OPC bit (0) in theEvent
Status Register (ESR).
*RST *RST SYSTEM Initiates a device reset.
CHDR COMM_HEADER SIGNAL Sets or gets the command returned format
OUTP OUTPUT SIGNAL Sets or gets the output state.
BSWV BASIC_WAVE SIGNAL Sets or gets the basic wave parameters.
MDWV MODULATEWAVE SIGNAL Sets or gets the modulation parameters.
SWWV SWEEPWAVE SIGNAL Sets or gets the sweep parameters.
BTWV BURSTWAVE SIGNAL Sets or gets the burst parameters.
PACP PARACOPY SIGNAL Copies parameters from one channel to the
other.
ARWV ARBWAVE DATA Changes arbitrary wave type.
SYNC SYNC SIGNAL Sets or gets the synchronization signal.
NBFM NUMBER_FORM SYSTEM Sets or gets the data format.
AT
LAGG LANGUAGE SYSTEM Sets or gets the language.
SCFG SYS_CFG SYSTEM Sets or gets the power-on system setting
way.
BUZZ BUZZER SYSTEM Sets or gets the buzzer state.
SCSV SCREEN_SAVE SYSTEM Sets or gets the screen save state.
ROSC ROSCILLATOR SIGNAL Sets or gets the state of clock source.
FCNT FREQCOUNTER SIGNAL Sets or gets the frequency counter
parameters.
INVT INVERT SIGNAL Sets or gets the polarity of current channel.
COUP COUPLING SIGNAL Sets or gets the coupling parameters.
VOLTPRT VOLTPRT SYSTEM Sets or gets the state ofover-voltage
protection.
STL STORELIST SIGNAL Lists all stored waveforms.
WVDT WVDT SIGNAL Sets and gets the arbitrary wave data.
VKEY VIRTUALKEY SYSTEM Sets the virtual keys.
SYST:CO SYSTEM:COMMU SYSTEM The Command can set and get system IP
MM:LAN:I NICATE:LAN:IPAD address.
PAD DRESS
SYST:CO SYSTEM:COMMU SYSTEM The Command can set and get system

10
Short Long Form Subsystem What Command/Query does
MM:LAN:S NICATE:LAN:SMA subnet mask.
MAS SK
SYST:CO SYSTEM:COMMU SYSTEM The Command can set and getsystem
MM:LAN:G NICATE:LAN:GAT Gateway.
AT EWAY
SRATE SAMPLERATE SIGNAL Sets or gets the arbitrary wavemode,
sampling rate and interpolation method.
HARM HARMonic SIGNAL Sets or gets the harmonic information.
CMBN CoMBiNe SIGNAL Sets or gets the wave combine information.
MODE MODE SIGNAL Sets or gets the waveform phase mode
CASCADE CASCADE SYSTEM Set up multi-device synchronization
IQ:CENT IQ:CENTerfreq SIGNAL Sets the I/Q modulator center frequency.
IQ:SAMP IQ:SAMPlerate SIGNAL Sets the I/Q sample rate.
IQ:SYMB IQ:SYMBolrate SIGNAL Sets the I/Q symbol rate.
IQ:AMPL IQ:AMPLitude SIGNAL Sets the I/Q amplitude.
IQ:IQAD:G IQ:IQADjustment: SIGNAL Adjusts the ratio of I to Q while preserving
AIN GAIN the composite.
IQ:IQAD:I IQ:IQADjustment:I SIGNAL Adjusts the I channel offset value.
OFF OFFset
IQ:IQAD:Q IQ:IQADjustment: SIGNAL Adjusts the I channel offset value.
OFF QOFFset
IQ:IQAD:Q IQ:IQADjustment: SIGNAL Adjusts the phase angle between the I
SK QSKew and Q vectors by increasing or
decreasing the Q phase angle.
IQ:TRIG:S IQ:TRIGger:SOUR SIGNAL Sets the I/Q trigger source.
OUR ce
IQ:WAVE: IQ:WAVEload:BUI SIGNAL Selects the I/Q wave from built in wave list.
BUIL Ltin
IQ:WAVE: IQ:WAVEload:USE SIGNAL Select the I/Q wave from user stored
USER Rstored waveforms.
:IQ: :IQ: SIGNAL Sets the I/Q Frequency sampling rate.
Frequency FrequencySamplin
Sampling g

11
3 Commands and Queries

3.1 IEEE 488.2 Common Command Introduction

The IEEE standard defines the common commands used for querying the basic
information of the instrument or executing basic operations. These commands usually
start with "*" and the length of the keywords of the command is usually 3 characters.

3.1.1 *IDN

DESCRIPTION The *IDN? query causes the instrument to identify itself.


The response is comprised of the manufacturer, model,
serial number and firmware version.

QUERY SYNTAX *IDN?

RESPONSE FORMAT Format 1: *IDN, <deviceid>, <model>, <serialnumber>,


<firmware version>, <hardwareversion>
Format 2: <manufacturer>,<model>,<serial number>,
<firmware version>

<device id>:= “xxx” is used to identify instrument.


<model>:= A model identifier less than 14 characters, should
not contain the word “MODEL”.
<serial number>:= The serial number.
<firmware version>:= The firmware version number.
<hardware version>:= The hardware level field,containing
information about all separately revisable subsystems.

EXAMPLE Reads version information:


*IDN?
Return:
LECROY, T3AFGxxx, XXXXXXXXXXXX, X.X.X.XX
(It may differ from each version)

12
Notes:
1. The table below shows the available response format of the command in each
T3AFG series.

Parameter
T3AFG5, 10 T3AFG30, 40, 60, 80,
/command 120, 200, 350, 500
Response Format Format1 Format2

2. Format of <hardware version>: value1-value2-value3-value4-


value5. value1: PCB version.
value2: Hardware version.
value3: Hardware subversion.
value4: FPGA version.
value5: CPLD version.

3.1.2 *OPC
DESCRIPTION The *OPC (Operation Complete) command sets the OPC
bit (bit 0) in the standard Event Status Register (ESR). This
command has no other effect on the operation of the device
because the instrument starts parsing a command or query
only after it has completely processed the previous
command or query. The *OPC? query always responds with
the ASCII character 1 because the device only responds to
the query when the previous command has been entirely
executed.

COMMAND SYNTAX *OPC

QUERY SYNTAX *OPC?

RESPONSE FORMAT Format 1: *OPC 1


Format 2: 1

Note: The table below shows the available response format of the command in each
T3AFG series.

Parameter
T3AFG5, 10 T3AFG30, 40, 60, 80,
/command 120, 200, 350, 500
Response Format Format1 Format2

13
3.1.3 *RST
DESCRIPTION The *RST command initiates a device reset and recalls
the default setup.

COMMAND SYNTAX *RST

EXAMPLE This example resets the signal generator to the default


setup:
*RST

3.2 Comm_Header Command


DESCRIPTION This command is used to change the query command returned
format. “SHORT” parameter returns short format. “LONG”
parameter returns long format. “OFF” returns nothing.

COMMAND SYNTAX Comm_HeaDeR <parameter>


<parameter>:= {SHORT,LONG,OFF}.

QUERY SYNTAX Comm_HeaDeR?

RESPONSE FORMAT CHDR <parameter>

EXAMPLE Set query command format to long:


CHDR LONG

Read query command format:


CHDR?
Return:
COMM_HEADER LONG

Note: The table below shows the availability of the command in each T3AFG series.

Parameter
T3AFG5, 10 T3AFG30, 40, 60, 80,
/command 120, 200, 350, 500
CHDR Yes No

14
3.3 Output Command
DESCRIPTION This command enables or disables the output port(s) at the front panel. The query
returns “ON” or “OFF” and “LOAD”, “PLRT”, “RATIO” parameters.

COMMAND <channel>:OUTPut ON|OFF,LOAD,<load>,PLRT, <polarity>


SYNTAX <channel>:= {C1, C2}.
<load>:= {see the note below}. The unit is ohm.
<polarity>:= {NOR, INVT}, in which NOR refers to normal, and INVT refers to invert.

NoiseSum: to add noise to the channel with specified signal-to-noise ratio.


<channel>:NOISE_ADD STATE,ON|OFF,RATIO,<S/N>.
or
<channel>:NOISE_ADD STATE,ON|OFF,RATIO_DB,<S/N(dB)>.
<S/N>:= {2.1-100000000}.
<S/N (dB)>:= {3.24886-80}.

Max Amplitude Output: to limit the maximum amplitude output.


<channel>:BSWV MAX_OUTPUT_AMP, <Amplitude>
<Amplitude>:={1-20}, Maximum output amplitude peak-to-peak voltages.

QUERY <channel>:OUTPut?
SYNTAX <channel>:NOISE_ADD?
<channel>:BSWV?

RESPONSE <channel>:OUTP ON|OFF,LOAD,<load>,PLRT, <polarity>


FORMAT <channel>:NOISE_ADDSTATE,ON|OFF,RATIO,<S/N >,RATIO_DB,<S/N (dB)>
<channel>:BSWV WVTP,<type>,FRQ,
<frequency>,PERI,<period>,AMP,<amplitude>,AMPVRMS,<Amplitude>,MAX_OUTPUT
_AMP, OFST, <offset>, HLEV, <high level>, LLEV, <low level>, PHSE, <phase>

EXAMPLE Turn on CH1:


C1:OUTP ON

Read CH1 output state:


C1:OUTP?
Return:
C1:OUTP ON,LOAD,HZ,PLRT,NOR

Set the load of CH1 to 50 ohm:


C1:OUTP LOAD,50

Set the load of CH1 to HiZ:

15
C1:OUTP LOAD,HZ

Set the polarity of CH1 to normal:


C1:OUTP PLRT,NOR

Turn on NoiseSum and set the signal-to-noise ratio


C1:NOISE_ADD STATE,ON,RATIO,120

Set the maximum output amplitude


C1:BSWV MAX_OUTPUT_AMP,5

Note: The table below shows the availability of the command in each T3AFG series.
Parameter
T3AFG5, T3AFG30, 40, 60, 80,
/command 10 120, 200, 350, 500
<channel> no yes

LOAD 50, HZ 50~100000 HZ

* "HZ" refers to High Z.

3.4 Basic Wave Command


DESCRIPTION This command sets or gets the basic wave parameters.

COMMAND SYNTAX <channel>:BaSic_WaVe <parameter>,<value>


<channel>:={C1, C2}.
<parameter>:= {a parameter from the table below}.
<value>:={value of the corresponding parameter}.

Parameters Value Description


:= {SINE, SQUARE, RAMP, PULSE, NOISE, ARB, DC,
WVTP <type> PRBS, IQ}. If the command doesn’t set basic waveform
type, WVPT will be set to the current waveform.
:= frequency. The unit is Hertz “Hz”. Refer to the data
FRQ <frequency> sheet for the range of valid values. Not valid when WVTP
is NOISE or DC.
:= period. The unit is seconds "s". Refer to the data sheet
PERI <period> for the range of valid values. Not valid when WVTP is
NOISE or DC.
:= amplitude. The unit is volts, peak-to-peak "Vpp". Refer
AMP <amplitude> to the data sheet for the range of valid values. Not valid
when WVTP is NOISE or DC.

16
:= offset. The unit is volts "V". Refer to the data sheet for
OFST <offset> the range of valid values. Not valid when WVTP is
NOISE.
:={0 to 100}. Symmetry of RAMP. The unit is "%". Only
SYM <symmetry>
settable when WVTP is RAMP.
:= {0 to 100}. Duty cycle. The unit is "%". Value depends
DUTY <duty> on frequency. Only settable when WVTP is SQUARE or
PULSE.
:= {0 to 360}. The unit is "degree". Not valid when
PHSE <phase>
WVTP is NOISE, PULSE or DC.
:= standard deviation of NOISE. The unit is volts "V".
STDEV <stdev> Refer to the data sheet for the range of valid values.
Only settable when WVTP is NOISE.
:= mean of NOISE. The unit is volts "V". Refer to the
MEAN <mean> data sheet for the range of valid values. Only settable
when WVTP is NOISE.
:= positive pulse width. The unit is seconds "s". Refer to
WIDTH <width> the data sheet for the range of valid values. Only
settable when WVTP is PULSE.
:= rise time (10%~90%). The unit is seconds "s". Refer
RISE <rise> to the data sheet for the range of valid values. Only
settable when WVTP is PULSE.
:= fall time (90%~10%). The unit is seconds "s". Refer to
FALL <fall> the data sheet for the range of valid values. Only
settable when WVTP is PULSE.
:= pulse delay. The unit is seconds "s". Refer to the data
DLY <delay> sheet for the range of valid values. Only settable when
WVTP is PULSE.
:= high level. The unit is volts "V". Not valid when WVTP
HLEV <high level>
is NOISE or DC.
:= low level. The unit is volts "V". Not valid when WVTP
LLEV <low level>
is NOISE or DC.
<bandwidth
BANDSTATE := {ON,OFF}. Only settable when WVTP is NOISE.
switch >
:= noise bandwidth. The unit is Hertz "Hz". Refer to the
BANDWIDT <bandwidth
data sheet for the range of valid values. Only settable
H value>
when WVTP is NOISE.
<prbs :={3~32}. Actual PRBS length = 2LENGTH-1. Only settable
LENGTH
length> when WVTP is PRBS.
:= rise/fall time of PRBS. The unit is seconds "s". Refer
<prbs
EDGE to the data sheet for the range of valid values. Only
rise/fall>
settable when WVTP is PRBS.
DIFFSTATE <prbs :={ON, OFF}. State of PRBS differential mode. Only

17
differential settable when WVTP is PRBS.
switch>
:= PRBS bit rate. The unit is bits-per-second "bps". Refer
<prbsbit
BITRATE to the data sheet for the range of valid values. Only
rate>
settable when WVTP is PRBS.
<prbs
LOGICLEVE :={ TTL_CMOS, LVTTL_LVCMOS, ECL,LVPECL,
logiclevel
L LVDS }. Only settable when WVTP is PRBS.
rate>
AMPVRMS <amplitude> := amplitude. The unit is Vrm.
AMPDBM <amplitude> := amplitude. The unit is dBm.

QUERY SYNTAX <channel>: BaSic_WaVe?


<channel>:= {C1, C2}.

RESPONSE FORMAT <channel>:BSWV <parameter>


<parameter>:= {All the parameters of the current
basic waveform}.

EXAMPLE Change the waveform type of C1 to Ramp:


C1:BSWV WVTP,RAMP

Change the frequency of C1 to 2000 Hz:


C1:BSWV FRQ,2000

Set the amplitude of C1 to 3 Vpp:


C1:BSWV AMP,3

Return parameters of C1 from the device:


C1:BSWV?
Return:
C1:BSWV WVTP,SINE,FRQ,100HZ,PERI,0.01S,AMP,2V,
OFST,0V,HLEV,1V,LLEV,-1V,PHSE,0

Set noise bandwidth of C1 to 100 MHz:


C1:BSWV BANDWIDTH,100E6
or
C1:BSWV BANDWIDTH,100000000

Set output amplitude of C1 to 3dBm:


C1:BSWV AMPDBM,3

Set the logic level of C1 to TTL_CMOS:


C1:BSWV LOGICLEVEL,TTL_CMOS

18
Notes:
1. The table below shows the availability of some command parameters in each
T3AFG series.

Parameter T3AFG5, T3AFG30, T3AFG40, T3AFG200,


/command 10 60 80, 120 350, 500

<channel> no yes yes yes


RISE yes yes yes yes
FALL yes yes yes yes
DLY no yes yes yes
BANDSTATE no no yes yes
BANDWIDTH no no yes yes
LENGTH no no no yes
EDGE no no no yes
DIFFSTATE no no no yes
BITRATE no no no yes
LOGICLEVEL no no no yes
AMPDBM no yes yes yes

2. In the T3AFG30 and T3AFG60 if Wave Combine is enabled, WVTP cannot be


set to SQUARE.

3.5 Modulate Wave Command


DESCRIPTION This commend sets or gets the modulation parameters.

COMMAND SYNTAX <channel>:MoDulateWaVe <type>


<channel>:MoDulateWaVe <parameter>,<value>
<channel>:={C1, C2}

<type>:= {AM,DSBAM,FM,PM,PWM,ASK,FSK,PSK}.
<parameter>:= {a parameter from the table below}.
<value>:= {value of the corresponding parameter}.

19
Parameters Value Description
:={ON, OFF}. Enable or disable modulation.
STATE <state> STATE must be set to ON before you set or
read other parameters of the modulation.
AM, SRC <src> := {INT, EXT}. AM signal source.
:= {SINE, SQUARE, TRIANGLE,
UPRAMP, DNRAMP, NOISE, ARB}.
AM, MDSP <mod wave shape>
AM modulation wave. Only settable when
SRC is INT.
:= AM frequency. The unit is Hertz "Hz". Refer
AM, FRQ <AM frequency> to the data sheet for the range of valid values.
Only settable when SRC is INT.
:= {0 to 120}. AM depth. The unit is "%". Only
AM, DEPTH <depth>
settable when SRC is INT.
DSBAM, SRC <src> := {INT, EXT}. DSBAM signal source.
:= {SINE, SQUARE, TRIANGLE,UPRAMP,
DSBAM, DNRAMP, NOISE, ARB}.
<mod wave shape>
MDSP DSB AM modulation wave. Only settable
when SRC is INT.
:= DSB AM frequency. The unit is Hertz "Hz".
<DSB-AM
DSBAM, FRQ Refer to the data sheet for the range of valid
frequency>
values. Only settable when SRC is INT.
FM, SRC <src> := {INT, EXT}. FM signal source.
:= {SINE, SQUARE, TRIANGLE,
UPRAMP, DNRAMP, NOISE, ARB}.
FM, MDSP <mod wave shape>
FM modulation wave. Only settable when
SRC is INT.
:= FM frequency. The unit is Hertz "Hz". Refer
FM, FRQ <FM frequency> to the data sheet for the range of valid values.
Only settable when SRC is INT.
:= {0 to carrier frequency}.
FM frequency deviation. The value depends
<FMfrequency
FM, DEVI on the difference between the carrier
deviation >
frequency and the bandwidth frequency. Only
settable when signal source is INT.
PM, SRC, <src> := {INT, EXT}. PM signal source.
:= {SINE, SQUARE, TRIANGLE,
UPRAMP, DNRAMP, NOISE, ARB}.
PM, MDSP <mod wave shape>
PM modulation wave. Only settable when
SRC is INT.
:= PM frequency. The unit is Hertz "Hz". Refer
PM, FRQ <PM frequency> to the data sheet for the range of valid values.
Only settable when SRC is INT.

20
:= {0 to 360}. PM phase deviation. The unit is
PM, DEVI <PM phase offset>
"degree". Only settable when SRC is INT.
PWM, SRC <src> := {INT, EXT}. PWM signal source.
:= PWM frequency. The unit is Hertz "Hz".
PWM, FRQ <PWM frequency> Refer to the data sheet for the range of valid
values. Only settable when SRC is INT.
:= Duty cycle deviation. The unit is "%". Value
PWM, DEVI <PWM dev>
depends on the carrier duty cycle.
:= {SINE, SQUARE, TRIANGLE,
UPRAMP, DNRAMP, NOISE, ARB}.
PWM, MDSP <mod wave shape>
PWM modulation wave. Only settable when
SRC is INT.
ASK, SRC <src> := {INT, EXT}. ASK signal source.
:= ASK key frequency. The unit is Hertz "Hz".
ASK, KFRQ < key frequency> Refer to the data sheet for the range of valid
values. Only settable when SRC is INT.
FSK, SRC <src> := {INT, EXT}. FSK signal source.
:= FSK key frequency. The unit is Hertz "Hz".
FSK, KFRQ < key frequency> Refer to the data sheet for the range of valid
values. Only settable when SRC is INT.
:= FSK hop frequency. The same with basic
FSK, HFRQ <FSK_hop_freq> wave frequency. The unit is Hertz "Hz". Refer
to the data sheet for the range of valid values.
PSK, SRC <src> := {INT, EXT}. PSK signal source.
:= PSK key frequency. The unit is Hertz "Hz".
PSK, KFRQ < key frequency> Refer to the data sheet for the range of valid
values. Only settable when SRC is INT.
:= {SINE, SQUARE, RAMP, ARB,PULSE}.
CARR, WVTP <wave type>
Carrier waveform type.
:= carrier frequency. The unit is Hertz "Hz".
CARR, FRQ <frequency> Refer to the data sheet for the range of valid
values.
:= {0 to 360}. Carrier phase. The unitis
CARR, PHSE <phase>
"degree".
:= carrier amplitude. The unit is volts, peak-
CARR, AMP <amplitude> to-peak "Vpp". Refer to the data sheet for the
range of valid values.
:= carrier offset. The unit is volts "V". Refer to
CARR, OFST <offset>
the data sheet for the range of valid values.
:= {0 to 100}. Carrier symmetry whenthe
CARR, SYM <symmetry>
carrier is RAMP. The unit is "%".
:= {0 to 100}. Carrier duty cycle when the
CARR, DUTY <duty>
carrier is SQUARE or PULSE. The unit is "%".

21
:= rise time when the carrier is PULSE. The
CARR, RISE <rise> unit is seconds "s". Refer to the data sheet for
the range of valid values.
:= fall time when the carrier is PULSE. The
CARR, FALL <fall> unit is seconds "s". Refer to the data sheet
for the range of valid values.
:= pulse delay when the carrier is PULSE.
CARR, DLY <delay> The unit is seconds "s". Refer to the dat
a sheet for the range of valid values.
Notes:
1. Modulation is not available if the carrier wave is Noise.
2. Range of some parameters depends on the model. Refer to the data sheet for details.

QUERY SYNTAX <channel>:MoDulateWaVe? <channel>:={C1, C2}.

RESPONSE FORMAT <channel>:MDWV <parameter>


<parameter>:= {all parameters of the current modulation}.

EXAMPLE Set CH1 modulation state to on:


C1:MDWV STATE,ON

Set CH1 modulation type to AM:


C1:MDWV AM

Set modulation to AM, and the modulating wave type tosine


wave:
C1:MDWV AM,MDSP,SINE

Read CH1 modulation parameters when STATE is ON:


C1:MDWV?
Return:
C1:MDWV AM,STATE,ON,MDSP,SINE,SRC,INT,FRQ,100HZ,
DEPTH,100,CARR,WVTP,RAMP,FRQ,1000HZ,AMP,4V,
AMPVRMS,1.15473Vrms,OFST,0V,PHSE,0,SYM,50

Read CH1 modulate wave parameters when STATE is OFF:


C1:MDWV?
Return:
C1:MDWV STATE,OFF

22
Set CH1 FM frequency to 1000 Hz:
C1:MDWV FM,FRQ,1000

Set CH1 carrier to SINE:


C1:MDWV CARR,WVTP,SINE

Set CH1 carrier frequency to 1000 Hz:


C1:MDWV CARR,FRQ,1000

Note: The table below shows the availability of some command parameters in each
T3AFG series.
Parameter T3AFG5, T3AFG30, 40, 60, 80, 120,
/command 10 200, 350, 500
<channel> no yes
<type>, SRC no yes
CARR, DLY no yes
CARR, RISE yes yes
CARR, FALL yes yes
<type>:= {AM, FM, PM, FSK, ASK, PSK, DSBAM, PWM}.

3.6 Sweep Wave Command


DESCRIPTION This command sets or gets the sweep parameters.

COMMAND SYNTAX <channel>:SweepWaVe <parameter>,<value>


<channel>:={C1, C2}
<parameter>:= {a parameter from the table below}
<value>:={value of the corresponding parameter}

Parameters Value Description


STATE <state> :={ON, OFF}. Enable or disable sweep.
STATE must be set to ON before you set or read
other parameters of the sweep.
TIME <time> := sweep time. The unit is seconds "s". Refer to
the data sheet for the range of valid values.
START <start_freq> := start frequency. The same with basicwave
frequency. The unit is Hertz "Hz".
STOP <stop_freq> := stop frequency. The same with basicwave
frequency. The unit is Hertz "Hz".
SWMD <sweep_mode> := {LINE, LOG}, in which LINE refers to Linear and

23
LOG refers to Logarithmic.
DIR <direction> := {UP, DOWN}. Sweep direction.
TRSR <trig_src> := {EXT, INT, MAN}. Trigger source. EXT refers to
External, INT refers to Internal and MAN refers to
Manual.
MTRIG := send a manual trigger. Only valid when TRSR
is MAN.
TRMD <trig_mode> := {ON, OFF}. State of trigger output. If TRSR is
EXT, the parameter is invalid.
EDGE <edge> :={RISE, FALL}. Available trigger edge. Only valid
when TRSR is EXT or MAN.
:= {SINE, SQUARE, RAMP, ARB}. Carrier
CARR, WVTP <wave type> waveform type. Modulation is not available if the
carrier is PULSE, NOISE or DC.
:= carrier frequency. The unit is Hertz "Hz". Refer
CARR, FRQ <frequency>
to the data sheet for the range of valid values.
CARR, PHSE <phase> := {0 to 360}. Carrier phase. The unit is "degree".
:= carrier amplitude. The unit is volts, peak-to-
CARR, AMP <amplitude> peak "Vpp". Refer to the data sheet for the range
of valid values.
:= carrier offset. The unit is volts "V". Refer to the
CARR, OFST <offset>
data sheet for the range of valid values.
:= {0 to 100}. Carrier symmetry when the carrier is
CARR, SYM <symmetry>
RAMP. The unit is "%".
:= {0 to 100}. Carrier duty cycle when the carrier is
CARR, DUTY <duty>
SQUARE. The unit is "%".
MARK_STATE <state> := {ON, OFF}.
:= mark frequency. The unit is Hertz "Hz". The
MARK_FREQ <frequency> range is from the start frequency to the stop
frequency.

QUERY SYNTAX <channel>:SWeepWaVe?


<channel>:= {C1, C2}.

RESPONSE FORMAT <channel>:SWWV <parameter>


<parameter>:= {All parameters of the current sweep wave}

EXAMPLE Set CH1 sweep state to ON:


C1:SWWV STATE,ON

Set CH1 sweep time to 1 s:


C1:SWWV TIME,1

24
Set CH1 stop frequency to 1000 Hz:
C1:SWWV STOP,1000

Set trigger source of CH1 to Manual:


C1:SWWV TRSR,MAN
Send a manual trigger to CH1:
C1:SWWV MTRIG

Read CH2 sweep parameters when STATE is ON:


C2:SWWV?
Return:
C2:SWWV STATE,ON,TIME,1S,STOP,100HZ,START,100HZ,
TRSR,MAN,TRMD,OFF,SWMD,LINE,DIR,UP,CARR,WVTP,
SQUARE,FRQ,1000HZ,AMP,4V,OFST,0V,DUTY,50,PHSE,0

Read CH2 sweep parameters when STATE is OFF:


C2:SWWV?
Return:
C2:SWWV STATE,OFF

Set CH1 the FreqMarker of sweep to 1kHz


C1:SWWV MARK_STATE,ON,MARK_FREQ,1000
Note: The table below shows the availability of some command parameters in each T3AFG
series.
Parameter T3AFG5,10 T3AFG30, 40, 60, 80, 120,
/command 200, 350, 500
<channel> no yes
TRMD no yes
EDGE no yes

3.7 Burst Wave Command


DESCRIPTION This commend sets or gets the burst wave parameters.

COMMAND SYNTAX <channel>:BursTWaVe <parameter>,<value>


<channel>:= {C1, C2}.
<parameter>:= {a parameter from the table below}.
<value>:= {value of the corresponding parameter}.

Parameters Value Description


STATE <state> := {ON, OFF}. Enable or disable burst. STATE must
be set to ON before you set or read other parameters
of the burst.

25
PRD <period> := burst period. Refer to the data sheet for the range
of valid values. The unit is seconds “s”. Not valid
when:
� Carrier is NOISE
� GATE_NCYC is GATE (except "X" series)
� TRSR is EXT
STPS <start_phase> := {0 to 360}. Start phase of the carrier. The unit is
"degree". Not valid when the carrier is NOISE or
PULSE.
GATE_NCYC <burst_mode> := {GATE, NCYC}. Burst mode. Not valid when the
carrier is NOISE.
TRSR <trig_src> := {EXT, INT, MAN}. Trigger source. EXT refers to
External, INT refers to Internal and MAN refers to
Manual.
MTRIG := send a manual trigger. Only when TRSR is MAN,
the parameter is valid.
DLAY <delay> := trigger delay. The unit is seconds "s". Refer to the
data sheet for the range of valid values. Available
when GATE_NCYC is NCYC. Not validw h e n t h e
carrier is NOISE.
PLRT <polarity> := {NEG, POS}. Gate polarity. Negative or Positive.
TRMD <trig_mode> := {RISE, FALL, OFF}. Trigger out mode. Available
when GATE_NCYC is NCYC and TRSR is INT or
MAN. Not valid when the carrier is NOISE.
EDGE <edge> :={RISE, FALL}. Available trigger edge. Only valid
when TRSR is EXT or MAN.
EDGE <edge> := { RISE, FALL}. Available trigger edge. Available
when GATE_NCYC is NCYC and TRSR is EXT. Not
valid when the carrier is NOISE.
TIME <circle_ time> :={INF, 1, 2,..., M}, where M is the maximum
supported Ncycle number which depends on the
model; INF sets the burst to Infinite mode.
Available when GATE_NCYC is NCYC. Not valid
when the carrier is NOISE.
CARR, WVTP := {SINE, SQUARE, RAMP, ARB, PULSE, NOISE}.
<wave type>
Carrier waveform type.
:= carrier frequency. The unit is Hertz "Hz". Refer to
CARR, FRQ <frequency>
the data sheet for the range of valid values.
CARR,
<phase> := {0 to 360}. Carrier phase. The unit is "degree".
PHSE
:= carrier amplitude. The unit is volts, peak-to-peak
CARR, AMP <amplitude>
"Vpp". Refer to the data sheet for the range of valid

26
values.
:= carrier offset. The unit is volts "V". Refer to the data
CARR, OFST <offset>
sheet for the range of valid values.
:= {0 to 100}. Carrier symmetry when the carrier is
CARR, SYM <symmetry>
RAMP. The unit is "%".
CARR, := {0 to 100}. Carrier duty cycle when the carrier is
<duty>
DUTY SQUARE or PULSE. The unit is "%".
:= rise time when the carrier is PULSE. The unit is
CARR, RISE <rise> seconds "s". Refer to the data sheet for the range of
valid values.
:= fall time when the carrier is PULSE. The unit is
CARR, FALL <fall> seconds "s". Refer to the data sheet for the range of
valid values.
:= pulse delay when the carrier is PULSE. The unit is
CARR, DLY <delay> seconds “s”. Refer to the data sheet for the range of
valid values.
CARR, := standard deviation of NOISE. The unit is volts “V”.
<stdev>
STDEV Refer to the data sheet for the range of valid values.
CARR, := mean of NOISE. The unit is volts “V”. Refer to the
<mean>
MEAN data sheet for the range of valid values.

QUERY SYNTAX <channel>:BTWV(BursTWaVe)?


<channel>:={C1, C2}

RESPONSE FORMAT <channel>:BTWV <parameter>


<parameter>:={All parameters of the current burst wave.}

EXAMPLE Set CH1 burst state to ON


C1:BTWV STATE,ON

Set CH1 burst period to 1 s.


C1:BTWV PRD,1

Set CH1 burst delay to 1 s


C1:BTWV DLAY,1

Set CH1 burst to infinite


C1:BTWV TIME,INF

Read CH2 burst parameters when the STATE is ON.


C2:BTWV?
Return:
C2:BTWV STATE,ON,PRD,0.01S,STPS,0,TRSR,INT,

27
TRMD,OFF,TIME,1,DLAY,2.4e-07S,GATE_NCYC,NCYC,
CARR,WVTP,SINE,FRQ,1000HZ,AMP,4V,OFST,0V,PHSE,0

Read CH2 burst parameters when the STATE is OFF.


C2:BTWV?
Return:
C2:BTWV STATE,OFF

Note: The table below shows the availability of some command parameters in each
T3AFG series.
Parameter T3AFG5, T3AFG30, 40, 60, 80, 120,
/command 10 200, 350, 500
<channel> no yes
TRMD no yes
EDGE no yes
CARR, DLY yes yes
CARR, RISE yes yes
CARR, FALL yes yes

3.8 Parameter Copy Command


DESCRIPTION This command copies parameters from one channel to another.

COMMAND SYNTAX ParaCoPy <destination_channel>,<src_channel>


< destination_channel>:= {C1, C2}. <src_channel>:= {C1, C2}.
Note: the parameters C1 and C2 must be set to the device
together.

EXAMPLE Copy parameters from CH1 to CH2.


PACP C2,C1
Note: The table below shows the availability of the command in each T3AFG series.

Parameter T3AFG5, T3AFG30, 40, 60, 80, 120,


/command 10 200, 350, 500
PACP no yes

3.9 Arbitrary Wave Command


DESCRIPTION This command sets and gets the arbitrary waveform type. Note:
The index number in the command syntax and the response

28
format of query omit the character ‘M’,and directly uses the value
to represent the index number.
COMMAND SYNTAX <channel>:ArbWaVe INDEX,<index>
<channel>:ArbWaVe NAME,<name>
<channel>:= {C1, C2}.
<index>: the index of the arbitrary waveform from the table below.
<name>: the name of the arbitrary waveform from the table below.

.QUERY SYNTAX <channel>:ARbWaVe?


<channel>:= {C1, C2}.

RESPONSE FORMAT <channel>:ARWV INDEX,<index>,NAME,<name>

EXAMPLE Set CH1 current waveform by index 2:


C1:ARWV INDEX,2

Read CH1 current waveform:


C1:ARWV?
Return:
C1:ARWV INDEX,2,NAME,StairUp

Set CH1 current waveform to wave_1 by name.


C1:ARWV NAME,wave_1

RELATED COMMANDS STL

Index Name Index Name Index Name Index Name


0 Sine 12 Logfall 24 Gmonopuls 36 Triang
1 Noise 13 Logrise 25 Tripuls 37 Harris
2 StairUp 14 Sqrt 26 Cardiac 38 Bartlett
3 StairDn 15 Root3 27 Quake 39 Tan
4 Stairud 16 X^2 28 Chirp 40 Cot
5 Ppulse 17 X^3 29 Twotone 41 Sec
6 Npulse 18 Sinc 30 Snr 42 Csc
7 Trapezia 19 Gaussian 31 Hamming 43 Asin
8 Upramp 20 Dlorentz 32 Hanning 44 Acos
9 Dnramp 21 Haversine 33 Kaiser 45 Atan
10 Exp_fall 22 Lorentz 34 Blackman 46 Acot
11 Exp_rise 23 Gauspuls 35 Gausswin 47 Square
Note: This table is just an example, the index depends on the specific model. The “STL?”
command can be used to get the accurate mapping relationship between the index and
name.

29
Note: The table below shows the availability of some command parameters in each
T3AFG series.
Parameter T3AFG5, T3AFG30, 40, 60, 80, 120,
/command 10 200, 350, 500

<channel> no yes
yes (only built-in
INDEX yes waveforms)

yes (only user


defined
NAME yes
waveforms)

3.10 Sync Command


DESCRIPTION This command sets the synchronization signal.
COMMAND SYNTAX <channel>:SYNC <state>
<channel>:= {C1, C2}.
<state>:= {ON, OFF}. SYNC TYPE, <TYPE>
<TYPE>:={CH1,CH2,MOD_CH1,MOD_CH2}.

QUERY SYNTAX <channel>:SYNC? <channel>:= {C1, C2}.

RESPONSE FORMAT <channel>:SYNC <state>

EXAMPLE Turn on sync output and set the source as modulating signal of
CH1:
C1:SYNC ON,TYPE,MOD_CH1

Read state of CH1 sync.


C1:SYNC?
Return:
C1:SYNC ON,TYPE,MOD_CH1

Note: The table below shows the availability of the command in each T3AFG series.

Parameter T3AFG5, T3AFG30, 40, 60, 80, 120,


/command 10 200, 350, 500
SYNC no yes

30
3.11 Number Format Command
DESCRIPTION This command sets or gets the number format.

COMMAND SYNTAX NumBer_ForMat PNT,<pnt>, NumBer_ForMa SEPT,<sept>


<pnt>:= {Dot, Comma}. The point format. <sept>:=
{Space, Off, On}. The separator format.

QUERY SYNTAX NBFM?

RESPONSE FORMAT NBFM PNT,<pnt>, SEPT,<sept>

EXAMPLE Set point format to DOT:


NBFM PNT,DOT

Set separator format to ON:


NBFM SEPT,ON

Read the number format:


NBFM?
Return:
NBFM PNT, DOT, SEPT, ON

3.12 Language Command


DESCRIPTION This command sets or gets the system language.

COMMAND SYNTAX LAnGuaGe <language>


<language>:= {EN,CH,RU}, where EN is English, CH is Chinese
Simplified, and RU is Russian.

QUERY SYNTAX LAnGuaGe?

RESPONSE FORMAT LAGG <language>

EXAMPLE Set language to English:


LAGG EN

Read language
LAGG?

31
Return:
LAGG EN

Note: The table below shows the availability of some command parameters in each
T3AFG series.
Parameter T3AFG5, T3AFG30, 40, 60, 80, 120,
/command 10 200, 350, 500

RU no no

3.13 Configuration Command


DESCRIPTION This command sets or gets the the power-on system setting.

COMMAND SYNTAX Sys_CFG <mode>


<mode>:= {DEFAULT, LAST}

QUERY SYNTAX Sys_CFG?

RESPONSE FORMAT SCFG <mode>

EXAMPLE Set the power-on system setting to LAST:


SCFG LAST

3.14 Buzzer Command


DESCRIPTION This command turns on or off the buzzer.

COMMAND SYNTAX BUZZer <state> <state>:= {ON, OFF}.

QUERY SYNTAX BUZZer?

RESPONSE FORMAT BUZZ <state>

EXAMPLE Turn on the buzzer:


BUZZ ON

32
3.15 Screen Save Command
DESCRIPTION This commands turns off or sets the screen save time (the
unit is minutes).

COMMAND SYNTAX SCreen_SaVe <parameter>


<parameter>:= {OFF, 1, 5, 15, 30, 60, 120, 300}.

QUERY SYNTAX SCreen_SaVe?

RESPONSE FORMAT SCSV <parameter>

EXAMPLE Set screen save time to 5 minutes:


SCSV 5

Read the current screen save time:


SCreen_SaVe?
Return:
SCSV 5MIN

3.16 Clock Source Command


DESCRIPTION This command sets or gets the clock source.

COMMAND SYNTAX ROSCillator <src> <src>:= {INT, EXT}

ROSC 10MOUT,ON|OFF

QUERY SYNTAX ROSC?

RESPONSE FORMAT ROSC <src>,10MOUT,ON|OFF

EXAMPLE Set internal time base as the source:


ROSC INT

Enable 10MHz output:


ROSC 10MOUT,ON

Note: The table below shows the availability of the command in each T3AFG series.

Parameter T3AFG5, T3AFG30, 40, 60, 80, 120,


/command 10 200, 350, 500

ROSC no yes

33
3.17 Frequency Counter Command
DESCRIPTION This command sets or gets the frequency counter parameters.

COMMAND SYNTAX FreqCouNTer <parameter>,<value>


<parameter>:= {a parameter from the table below}.
<value>:= {value of the corresponding parameter}.

Parameters Value Description


:={ON, OFF}
STATE <state>
State of frequency counter.
Measured frequency. The unit is Hertz “Hz”.
FRQ <frequency>
Can’t be set.
Measured positive width. The unit is seconds “s”.
PW <pos_width>
Can’t be set.
Measured negative width. The unit is seconds “s”.
NW <neg_width>
Can’t be set.
Measured duty cycle. The unit is "%".
DUTY <duty>
Can’t be set.
Measured frequency deviation. The unit is "ppm".
FRQDEV <freq_dev>
Can’t be set.
Expected frequency, for calculating thefrequency
REFQ <ref_freq>
deviation. The unit is Hertz “Hz”.
Trigger level. The range of valid values depends on
TRG <triglev>
the model. The unit is volts “V”.
:={AC, DC}
MODE <mode>
Coupling mode.
:={ON, OFF}
HFR <HFR>
State of High Frequency Rejection.

QUERY SYNTAX FreqCouNTer?

RESPONSE FORMAT FCNT <parameter>


<parameter>:={All parameters of the frequency counter}

EXAMPLE Turn frequency counter on:


FCNT STATE,ON
Set reference freq to 1000 Hz:

34
FCNT REFQ,1000

Query frequency counter information:


FCNT?
Return:
FCNT STATE,ON,FRQ,10000000HZ,DUTY,59.8568,REFQ,
1e+07HZ,TRG,0V,PW,5.98568e-08S,NW,4.01432e-
08S,FRQDEV,0ppm,MODE,AC,HFR,OFF

Note: The table below shows the availability of the command in each T3AFG series.
Parameter T3AFG5, T3AFG30, 40, 60, 80, 120,
/command 10 200, 350, 500
FCNT no yes

3.18 Invert Command


DESCRIPTION This command sets or gets the polarity of specified channel.

COMMAND SYNTAX <channel>:INVerT <state>


<channel>:= {C1, C2}. <state>:= {ON, OFF}.

QUERY SYNTAX <channel>:INVerT? <channel>:={C1, C2}.

RESPONSE FORMAT <channel>:INVT <state>

EXAMPLE Set CH1 polarity to invert


C1:INVT ON

Read the polarity of CH1.


C1:INVT?
Return:
C1:INVT ON

Note: The table below shows the availability of some command parameters in each
T3AFG series.

Parameter T3AFG5, T3AFG30, 40, 60, 80,


/command 10 120, 200, 350, 500

<channel> no yes

35
3.19 Coupling Command
DESCRIPTION This command sets or gets the channel coupling parameters. The
other coupling parameters can only be set when TRACE is set to
OFF.

COMMAND SYNTAX COUPling <parameter>,<value>


<parameter>:= {a parameter from the table below}.
<value>:={value of the corresponding parameter}.

Parameters Value Description


:= {ON, OFF}
TRACE <track_enble>
State of channel tracking.
:= {ON, OFF}
STATE <state>
State of channel coupling.
:= {CH1,CH2}
BSCH <bsch>
Base channel.
:= {ON, OFF}
FCOUP <fcoup>
State of frequency coupling
:= frequency deviation between the 2 channels. The unit
FDEV <frq_dev>
is Hertz “Hz”.
FRAT <frat> := frequency ratio between the 2 channels.
:={ON, OFF}
PCOUP <pcoup>
State of phase coupling
:= phase deviation between the 2 channels. The unit is
PDEV <pha_dev>
“degree”.
PRAT <prat> := phase ratio between the 2 channels.
:= {ON, OFF}
ACOUP <acoup>
State of amplitude coupling
ARAT <arat> := amplitude ratio between the 2 channels.
:= amplitude deviation between the 2 channels. The unit
ADEV <adev>
is volts, peak-to-peak “Vpp”.

QUERY SYNTAX COUPling?

RESPONSE FORMAT COUP <parameter>


<parameter>:= { All parameters of coupling}.
EXAMPLE
Set coupling state to ON:
COUP STATE,ON

Set frequency coupling state to ON:

36
COUP FCOUP,ON

Set frequency deviation to 5 Hz:


COUP FDEV,5

Query coupling information.


COUP?
Return:
COUP TRACE,OFF,FCOUP,ON,PCOUP,ON,ACOUP,ON,FDEV,
5HZ,PRAT,1,ARAT,2

Note: The table below shows the availability of the command and some parameters in each
T3AFG series.

Parameter T3AFG5, T3AFG30, 40, 60, 80, 120,


/command 10 200, 350, 500

COUP no yes
TRACE no yes
STATE no no
BSCH no no
FCOUP no yes
FRAT no yes
PCOUP no yes
PRAT no yes
ACOUP no yes
ARAT no yes
ADEV no yes

3.20 Over-Voltage Protection Command


DESCRIPTION This command sets or gets the state of over-voltage protection.

COMMAND SYNTAX VOLTPRT <state> <state>:= {ON, OFF}

QUERY SYNTAX VOLTPRT?

RESPONSE FORMAT VOLTPRT <state>

Note: The table below shows the availability of the command in each T3AFG series.

Parameter T3AFG5, T3AFG30, 40, 60, 80, 120,


/command 10 200, 350, 500

VOLTPRT no yes

37
3.21 Store List Command
DESCRIPTION This command is used to read the stored waveforms list with indexes
and names. If the store unit is empty, the command will return
“EMPTY” string.

QUERY SYNTAX SToreList?


SToreList? BUILDIN|USER

EXAMPLE Read all arbitrary data saved in a T3AFG5, 10.


STL?
Return:
STL M0, sine, M1, noise, M2, stairup, M3, stairdn, M4, stairud, M5,
ppulse, M6, npulse, M7, trapezia, M8, upramp, M9, dnramp, M10,
exp_fall, M11, exp_rise, M12, logfall, M13, logrise, M14, sqrt, M15,
root3, M16, x^2, M17, x^3, M18, sinc, M19, gaussian,
M20, dlorentz, M21, haversine, M22, lorentz, M23,gauspuls, M24,
gmonopuls, M25, tripuls, M26, cardiac, M27, quake, M28, chirp,
M29, twotone, M30, snr, M31, EMPTY, M32, EMPTY, M33,
EMPTY, M34, hamming, M35, hanning, M36, kaiser,M37,
blackman, M38, gaussiwin, M39, triangle, M40, blackmanharris,
M41, bartlett, M42, tan, M43, cot, M44, sec, M45, csc, M46, asin,
M47, acos, M48, atan, M49, acot, M50, EMPTY, M51, EMPTY,
M52, EMPTY, M53, DDROPOUT, M54, FCLK1, M55,FSDA1, M56,
EMPTY, M57, EMPTY, M58, EMPTY, M59, EMPTY

Read built-in wave data from a T3AFG40, 80, 120, 200, 350, 500:
STL? BUILDIN
Return:
STL M10, ExpFal, M100, ECG14, M101, ECG15, M102,
LFPulse, M103, Tens1, M104, Tens2, M105, Tens3, M106, Airy,
M107, Besselj, M108, Bessely, M109, Dirichlet, M11, ExpRise,
M110, Erf, M111, Erfc, M112, ErfcInv, M113, ErfInv, M114,
Laguerre, M115, Legend, M116, Versiera, M117, Weibull, M118,
LogNormal, M119, Laplace, M12, LogFall, M120, Maxwell,
M121, Rayleigh, M122, Cauchy, M123, CosH, M124, CosInt,
M125, CotH, M126, CscH, M127, SecH, M128, SinH, M129,
SinInt, M13, LogRise, M130, TanH, M131, ACosH, M132,
ASecH, M133, ASinH, M134, ATanH, M135,

38
ACsch, M136, ACoth, M137, Bartlett, M138, BohmanWin, M139,
ChebWin, M14, Sqrt, M140, FlattopWin, M141, ParzenWin,
M142, TaylorWin, M143, TukeyWin, M144, SquareDuty01,
M145, SquareDuty02, M146, SquareDuty04, M147,
SquareDuty06, M148, SquareDuty08, M149, SquareDuty10,
M15, Root3, M150, SquareDuty12, M151, SquareDuty14,
M152, SquareDuty16, M153, SquareDuty18, M154,
SquareDuty20, M155, SquareDuty22, M156, SquareDuty24,
M157, SquareDuty26, M158, SquareDuty28, M159,
SquareDuty30, M16, X^2, M160, SquareDuty32, M161,
SquareDuty34, M162, SquareDuty36, M163, SquareDuty38,
M164, SquareDuty40, M165, SquareDuty42, M166,
SquareDuty44, M167, SquareDuty46, M168, SquareDuty48,
M169, SquareDuty50, M17, X^3, M170, SquareDuty52, M171,
SquareDuty54, M172, SquareDuty56, M173, SquareDuty58,
M174, SquareDuty60, M175, SquareDuty62, M176,
SquareDuty64, M177, SquareDuty66, M178, SquareDuty68,
M179, SquareDuty70, M18, Sinc, M180, SquareDuty72, M181,
SquareDuty74, M182, SquareDuty76, M183, SquareDuty78,
M184, SquareDuty80, M185, SquareDuty82, M186,
SquareDuty84, M187, SquareDuty86, M188, SquareDuty88,
M189, SquareDuty90, M19, Gaussian, M190, SquareDuty92,
M191, SquareDuty94, M192, SquareDuty96, M193,
SquareDuty98, M194, SquareDuty99, M195, demo1_375pts,
M196, demo1_16kpts, M197, demo2_3kpts, M198,
demo2_16kpts, M2, StairUp, M20, Dlorentz, M21, Haversine,
M22, Lorentz, M23, Gauspuls, M24, Gmonopuls, M25, Tripuls,
M26, Cardiac, M27, Quake, M28, Chirp, M29, Twotone, M3,
StairDn, M30, SNR, M31, Hamming, M32, Hanning, M33, kaiser,
M34, Blackman, M35, Gausswin, M36, Triangle, M37,
Bartlett-Hann, M38, Bartlett, M39, Tan, M4, StairUD, M40, Cot,
M41, Sec, M42, Csc, M43, Asin, M44, Acos, M45, Atan, M46,
Acot, M47, Square, M48, SineTra, M49,
SineVer, M5, Ppulse, M50, AmpALT, M51, AttALT, M52,
RoundHalf, M53, RoundsPM, M54, BlaseiWave, M55,
DampedOsc, M56, SwingOsc, M57, Discharge, M58, Pahcur,
M59, Combin, M6, Npulse, M60, SCR, M61, Butterworth, M62,
Chebyshev1, M63, Chebyshev2, M64, TV, M65, Voice, M66,
Surge, M67, Radar, M68, Ripple, M69, Gamma, M7, Trapezia,
M70, StepResp, M71, BandLimited, M72, CPulse, M73,
CWPulse, M74, GateVibr, M75, LFMPulse, M76, MCNoise,
M77, AM, M78, FM, M79, PFM, M8, Upramp, M80, PM, M81,
PWM, M82, EOG, M83, EEG, M84, EMG, M85, Pulseilogram,
M86, ResSpeed, M87, ECG1, M88, ECG2, M89, ECG3, M9,

39
Dnramp, M90, ECG4, M91, ECG5, M92, ECG6, M93, ECG7,
M94, ECG8, M95, ECG9, M96, ECG10, M97, ECG11, M98,
ECG12, M99, ECG13

Read wave data defined by user from a T3AFG30, 60:


STL? USER
Return:
STL WVNM,sinc_8M,sinc_3000000,sinc_1664000,
ramp_8M,sinc_2000000,sinc_50000,square_8M,sinc_5000,
wave1,square_1M

Note: The table below shows the availability of some command parameters in each
T3AFG series.
Parameter T3AFG5, T3AFG30, 40, 60, 80, 120,
/command 10 200, 350, 500

BUILDIN BUILDIN
STL? return
USER
BUILDIN no yes
USER no yes

3.22 Arb Data Command


DESCRIPTION This command sets and gets the arbitrary waveform data.

COMMAND SYNTAX <channel>:WVDT <index>,<parameter>,<value>


<channel>:= {C1, C2}.
<index>:= {Mn}. The waveform index. See note 2 below for the
details.
<parameter>:= {a parameter from the table below}.
<value>:= {value of the corresponding parameter}.

Parameters Value Description


WVNM <wave_name> := waveform name.
:= {0 to 5}
0 - common
1 - math
2 - engineering
TYPE <type>
3 - window
4 - triangle function
5 - user defined
This parameter is only valid for the T3AFG5, 10

40
:= the number of waveform bytes, the valid range
depends on the model. See note 1 below for the
LENGTH <length>
details.
This parameter is only necessary in the T3AFG5, 10
FREQ <frequency> := frequency. The unit is Hertz “Hz”.
AMPL <amplifier> := amplitude. The unit is volts, peak-to-peak “Vpp”.
OFST <offset> := offset. The unit is volts “V”.
PHASE <phase> := phase. The unit is "degree".
:= waveform data.
WAVEDATA <wave data>
The wave data needs to be read from a waveform file

QUERY SYNTAX Format 1: WVDT? Mn

Format 2: WVDT? USER,<wave_name>


<wave name>:={The name of user defined waveform}.

EXAMPLE See section 4.1.5 for the example.


Notes:
1. The table below shows the availability of some command parameters in each
T3AFG series.
Parameter T3AFG5, T3AFG30, 40, T3AFG200,
/command 10 60, 80, 120 350, 500

TYPE yes no no

<length> 32KB 4B~16MB 4B~40MB

USER no yes yes


Built-in: Built-in:
Format1 Format1
Format of
Format 1 User- User-
WVDT?
defined: defined:
Format2 Format2

2. The table below shows the details of Mn parameters in each T3AFG series.
Model Description of Mn
0<=n<=59.
T3AFG5, 10 M0~M49: build-in (32KB).
M50~M59: user-defined (32KB).

T3AFG30, 40, 60, 0<=n<=196.


80, 120, 200, 350,
500 M0~M196: build-in (32KB).
Not necessary when sending waveform data.

41
3.23 Virtual Key Command

DESCRIPTION This command is used to simulate pressing a key on the front panel.

COMMAND SYNTAX VirtualKEY VALUE,<value>,STATE,<state>


<value>:= {a Name or Index of the virtual keys from the table below}.
<state>:= {0,1}, where “1” is effective to virtualvalue, and “0” is
useless.

Name Index Name Index


KB_FUNC1 28 KB_NUMBER_4 52
KB_FUNC2 23 KB_NUMBER_5 53
KB_FUNC3 18 KB_NUMBER_6 54
KB_FUNC4 13 KB_NUMBER_7 55
KB_FUNC5 8 KB_NUMBER_8 56
KB_FUNC6 3 KB_NUMBER_9 57
KB_SINE 34 KB_POINT 46
KB_SQUARE 29 KB_NEGATIVE 43
KB_ RAMP 24 KB_LEFT 44
KB_PULSE 19 KB_RIGHT 40
KB_NOISE 14 KB_UP 45
KB_ARB 9 KB_DOWN 39
KB_MOD 15 KB_OUTPUT1 153
KB_SWEEP 16 KB_OUTPUT2 152
KB_BURST 17 KB_KNOB_RIGHT 175
KB_WAVES 4 KB_KNOB_LEFT 177
KB_UTILITY 11 KB_KNOB_DOWN 176
KB_PARAMETER 5 KB_HELP 12
KB_STORE_RECALL 70 KB_CHANNEL 72
KB_NUMBER_0 48
KB_NUMBER_1 49
KB_NUMBER_2 50
KB_NUMBER_3 51

42
Keys and Indices on the T3AFG30, 40, 60, 80, 120, 200, 350, 500

Keys and Indices on the T3AFG5, 10

43
Notes: The table below shows the availability of some command parameters in each
T3AFG series.

Parameter T3AFG5, T3AFG30, 40, 60, 80, 120,


/command 10 200, 350, 500

KB_FUNC6 no yes
KB_STORE_RECAL
yes yes
L
KB_HELP yes no
KB_CHANNEL no yes
KB_SINE yes no
KB_SQUARE yes no
KB_ RAMP yes no
KB_PULSE yes no
KB_NOISE yes no
KB_ARB yes no
KB_UP yes no
KB_DOWN yes no

3.24 IP Command
DESCRIPTION This command sets and gets the system IP address.

COMMAND SYNTAX SYSTem:COMMunicate:LAN:IPADdress


“<parameter1>.<parameter2>.<parameter3>.<parameter4>”

<parameter1>:={an integer value between 1 and 223}.


<parameter2>:={an integer value between 0 and 255}.
<parameter3>:={an integer value between 0 and 255}.
<parameter4>:={an integer value between 0 and 255}.

QUERY SYNTAX SYSTem:COMMunicate:LAN:IPADdress?

44
EXAMPLES Set IP address to 10.11.13.203:
SYST:COMM:LAN:IPAD “10.11.13.203”

Get the IP address:


SYST:COMM:LAN:IPAD?
Return:
“10.11.13.203”

Note: The table below shows the availability of the command in each T3AFG series.

Parameter T3AFG5, T3AFG30, 40, 60, 80, 120,


/command 10 200, 350, 500
SYST:COMM:LAN:I
no yes
PAD

3.25 Subnet Mask Command


DESCRIPTION This command sets and gets the system subnet mask.

COMMAND SYNTAX SYSTem:COMMunicate:LAN:SMASk


“<parameter1>.<parameter2>.<parameter3>.<parameter4>”

<parameter1>:={an integer value between 0 and 255}.


<parameter2>:={an integer value between 0 and 255}.
<parameter3>:={an integer value between 0 and 255}.
<parameter4>:={an integer value between 0 and 255}.

QUERY SYNTAX SYSTem:COMMunicate:LAN:SMASk?

EXAMPLES Set subnet mask to 255.0.0.0:


SYST:COMM:LAN:SMAS “255.0.0.0”

Get subnet mask:


SYST:COMM:LAN:SMAS?
Return:
“255.0.0.0”

45
Note: The table below shows the availability of the command in each T3AFG series.

Parameter T3AFG5, T3AFG30, 40, 60, 80, 120,


/command 10 200, 350, 500

SYST:COMM:LAN:S
no yes
MAS

3.26 Gateway Command


DESCRIPTION This command sets and gets the system gateway.

COMMAND SYNTAX SYSTem:COMMunicate:LAN:GATeway


“<parameter1>.<parameter2>.<parameter3>.<parameter4>”

<parameter1>:={an integer value between 0 and 223}.


<parameter2>:={an integer value between 0 and 255}.
<parameter3>:={an integer value between 0 and 255}.
<parameter4>:={an integer value between 0 and 255}.

QUERY SYNTAX SYSTem:COMMunicate:LAN:GATeway?

EXAMPLES Set Gateway to 10.11.13.5:


SYSTem:COMMunicate:LAN:GATeway “10.11.13.5”

Get gateway:
SYSTem:COMMunicate:LAN:GATeway?
Return:
“10.11.13.5”

Note: The table below shows the availability of the command in each T3AFG series.

Parameter
T3AFG5, T3AFG30, 40, 60, 80, 120,
/command 10 200, 350, 500

SYST:COMM:LAN:G
no yes
AT

3.27 Sampling Rate Command


DESCRIPTION This command sets or gets the Arb mode, sampling rate and

46
interpolation method. Sampling rate and interpolation method can only
be set when MODE is TARB.

COMMAND SYNTAX <channel>:SampleRATE MODE,<mode>,VALUE, <sample


rate>,INTER,<interpolation>

<channel>:= <C1, C2>.


<mode>:= {DDS, TARB}, where TARB is TrueArb.
<sample rate>:= sample rate. The unit is Sa/s.
<interpolation>:= {LINE, HOLD, SINC, SINC27, SINC13}, where LINE
is linear, and HOLD is zero-order hold. SINC, SINC27 and SINC13 are
only for T3AFG200, 350, 500.

QUERY SYNTAX <channel>:SRATE?

EXAMPLES Get the sampling rate of CH1:


C1:SRATE?
Return:
C1:SRATE MODE,DDS

Set CH1 to TureArb mode:


C1:SRATE MODE,TARB

Set sampling rate of CH1 to 1000000Sa/s:


C1:SRATE VALUE,1000000

Set CH1 to TureArb mode and set interpolation to SINC13


C1:SRATE MODE,TARB,INTER,SINC13

Note: The table below shows the availability of the command and some parameters in each
T3AFG series.
Parameter T3AFG5, T3AFG30, T3AFG40, T3AFG200,
/command 10 60 80, 120 350, 500

SRATE no no yes yes


INTER no no no yes

3.28 Harmonic Command


DESCRIPTION This command sets or gets the harmonic parameters. Only available
when the basic wave is SINE.

COMMAND SYNTAX <channel>:HARMonic HARMSTATE,<state>,HARMTYPE,

47
<type>,HARMORDER,<order>,<unit>,<value>,
HARMPHASE,<phase>

<state>:= <ON, OFF>.


<type>:= <EVEN, ODD, ALL>.
<order>:= {1,2,...,M}, where M is the supported maximum order.
<unit>:= < HARMAMP, HARMDBC>.
<value>:= amplitude of specified harmonic. The range of valid values
depends on the model. When <unit>= HARMAMP, the unit is volts,
peak-to-peak “Vpp”, and when <unit>= HARMDBC, the unit is "dBc".
<phase>:= {0~360}, the unit is "degree"

QUERY SYNTAX <channel>:(HARMonic?


<channel> : ={C1, C2}.

EXAMPLES Enable the harmonic function of CH1:


C1:HARM HARMSTATE,ON

Set the 2nd harmonic of CH1 to -6 dBc:


C1:HARM HARMORDER,2,HARMDBC,-6
Get the harmonic information of CH1:
C1:HARM?
Return:
C1:HARM ,HARMSTATE,ON,HARMTYPE,EVEN,HARMORDER,2,H
ARMAMP,2.004748935V,HARMDBC,-6dBc,HARMPHASE,0

Note: The table below shows the availability of the command in each T3AFG series.

Parameter T3AFG5, T3AFG30, 40, 60, 80, 120,


/command 10 200, 350, 500
HARM no yes

3.29 Waveform Combining Command


DESCRIPTION This command sets or gets the waveform combining parameters.

COMMAND SYNTAX <channel>:CoMBiNe <state>


<channel>:= {C1, C2}. <state>:= {ON, OFF}.

QUERY SYNTAX <channel>:CoMBiNe? <channel>:= {C1, C2}.

48
RESPONSE FORMAT <channel>:CMBN <state>

EXAMPLES Turn on the waveform combining of CH1:


C1:CMBN ON

Query the waveform combining state of CH2:


C2:CMBN?
Return:
C2:CMBN OFF

Note: The table below shows the availability of the command in each T3AFG series.

Parameter T3AFG5, T3AFG30, 40, 60, 80, 120,


/command 10 200, 350, 500
CMBN no yes

3.30 Mode Select Command

DESCRIPTION This command sets or gets the phase mode.

COMMAND SYNTAX MODE <parameter>


<parameter>:= {PHASE-LOCKED, INDEPENDENT}.

QUERY SYNTAX MODE?

RESPONSE FORMAT MODE <parameter>

EXAMPLE Set the phase mode to INDEPENDENT:


MODE INDEPENDENT

Note: The table below shows the availability of the command in each T3AFG series.

Parameter T3AFG5, T3AFG30, 40, 60, 80, 120,


/command 10 200, 350, 500
MODE no yes

3.31 Multi-Device Sync


DESCRIPTION This command set up synchronization between two ormore
instruments and achieve in-phase output

COMMAND SYNTAX CASCADE STATE,ON|OFF,MODE,<MODE>,DELAY,<DELAY>

49
<MODE>:={MASTER,SLAVE}
<DELAY>:={0-0.000025},UNIT=s,This parameter can only be
set in slave mode

QUERY SYNTAX CASCADE?

RESPONSE FORMAT Return from SLAVE MODE :


CASCADE STATE,ON,MODE,SLAVE,DELAY, <DELAY>
Return from MASTER mode :
CASCADE STATE,ON,MODE,MASTER

EXAMPLE Set the device as slave and the delay to 0.0000001s:


CASCADE STATE,ON,MODE,SLAVE,DELAY,0.0000001

3.32 IQ Commands
The table below shows the availability of IQ commands in each T3AFG series.

Parameter T3AFG5, 10, 30, 40, T3AFG200,


/command 60, 80, 120 350, 500

IQ no yes

3.32.1 :IQ:CENTerfreq
DESCRIPTION This command sets center frequency of the I/Q modulator.

COMMAND SYNTAX [:SOURce]:IQ:CENTerfreq <center_freq><unit>


<center_freq>:= the center frequency. Refer to the data sheet for
the range of valid values.
<unit>:= {Hz, kHz, MHz, GHz}. The default unit is Hertz “Hz”.

QUERY SYNTAX [:SOURce]:IQ:CENTerfreq?

RESPONSE FORMAT <center_freq> (expressed in Hz.)

EXAMPLE Set the center frequency to 1 kHz:


:SOURce:IQ:CENTerfreq 1000Hz

50
3.32.2 :IQ:SAMPlerate
DESCRIPTION This command sets the I/Q sampling rate.

COMMAND SYNTAX [:SOURce]:IQ:SAMPlerate <sample_rate><unit>


<sample_rate>:= sample rate. Refer to the data sheet forthe
range of valid values.
<unit>:= {Hz, kHz, MHz, GHz}. The default unit is Hertz “Hz”.

QUERY SYNTAX [:SOURce]:IQ:SAMPlerate?

RESPONSE FORMAT <sample_rate> (expressed in Hz.)

EXAMPLE Set the sample rate to 100 kHz:


:IQ:SAMPlerate 1000000
or:
:IQ:SAMP 100kHz

3.32.3 :IQ:SYMBolrate
DESCRIPTION This command sets the I/Q symbol rate.

COMMAND SYNTAX [:SOURce]:IQ:SYMBolrate <symb_rate><unit>


<symb_rate>:= symbol rate. Refer to the data sheet for the range
of valid values.
<unit>:= {S/s, kS/s, MS/s}. The default unit is symbols-per-second
“S/s”.

QUERY SYNTAX [:SOURce]:IQ:SYMBolrate?

RESPONSE FORMAT <symb_rate> (expressed in S/s.)

EXAMPLE Set the symbol rate to 1 MS/s:


:IQ:SYMB 1MS/s

3.32.4 :IQ:AMPLitude
DESCRIPTION This command sets the I/Q amplitude.

COMMAND SYNTAX [:SOURce]:IQ:AMPLitude <amplitude><unit>


<amplitude>:= amplitude. Refer to the data sheet for the range of
valid values.

51
<unit>:= {Vrms, mVrms, dBm}. The default unit is volts, root-
mean-square “Vrms”.

QUERY SYNTAX [:SOURce]:IQ:AMPLitude?

RESPONSE FORMAT <amplitude> (expressed Vrms.)

EXAMPLE Set the I/Q amplitude (sqrt(I2+Q2)) to 0.2 Vrms:


:IQ:AMPL 0.2

3.32.5 :IQ:IQADjustment:GAIN
DESCRIPTION This command adjusts the ratio of I to Q while preserving the
composite.

COMMAND SYNTAX [:SOURce]:IQ:IQADjustment:GAIN <gain_ratio>


<gain_ratio>:= Gain ratio of I to Q. The default unit is dB.

QUERY SYNTAX [:SOURce]:IQ:IQADjustment:GAIN?

RESPONSE FORMAT <gain_ratio> (expressed in unit of dB.)

EXAMPLE Set the gain ratio of I/Q to 0.1dB:


:IQ:IQADjustment:GAIN 0.1

3.32.6 :IQ:IQADjustment:IOFFset
DESCRIPTION This command adjusts the I channel offset value.

COMMAND SYNTAX [:SOURce]:IQ:IQADjustment:IOFFset


<offset><unit> <offset>:= I offset.
<unit>:= {V, mV, uV}. The default unit is volts “V”.

QUERY SYNTAX [:SOURce]:IQ:IQADjustment:IOFFset?

RESPONSE FORMAT <offset> (expressed V.)

EXAMPLE Set the I offset to 1 mV:


:IQ:IQADjustment:IOFFset 1mV

52
3.32.7 :IQ:IQADjustment:QOFFset
DESCRIPTION This command adjusts the Q channel offset value.

COMMAND SYNTAX [:SOURce]:IQ:IQADjustment:QOFFset <offset><unit>


<offset>:= Q offset.
<unit>:= {V, mV, uV}. The default unit is volts “V”.

QUERY SYNTAX [:SOURce]:IQ:IQADjustment:QOFFset?

RESPONSE FORMAT <offset> (expressed in V.)

EXAMPLE Set the Q offset to -1 mV:


:IQ:IQAD:QOFF -0.001V

3.32.8 :IQ:IQADjustment:QSKew
DESCRIPTION This command adjusts the phase angle (quadrature skew)
between the I and Q vectors by increasing or decreasing the Q
phase angle.

COMMAND SYNTAX [:SOURce]:IQ:IQADjustment:QSKew <angle>


<angle>:= angle. The unit is degree.

QUERY SYNTAX [:SOURce]:IQ:IQADjustment:QSKew?

RESPONSE FORMAT <angle> (expressed in unit of degree.)

EXAMPLE Set the Q angle to 1 degree:


:IQ:IQADjustment:QSKew 1.0

3.32.9 :IQ:TRIGger:SOURce
DESCRIPTION This command sets the I/Q trigger source.

COMMAND SYNTAX [:SOURce]:IQ:TRIGger:SOURce <src>


<src>:={INTernal,EXTernal,MANual}

QUERY SYNTAX [:SOURce]:IQ:TRIGger:SOURce?

RESPONSE FORMAT <src>

53
EXAMPLE Set the trigger source to INT:
:IQ:TRIGger:SOURce INTernal

3.32.10 :IQ:WAVEload:BUILtin
DESCRIPTION This command selects I/Q waveform from the built in waveform
list.

COMMAND SYNTAX [:SOURce]:IQ:WAVEload:BUILtin <wave_name>


<wave_name>:= {A waveform name from the table below}.

QUERY SYNTAX [:SOURce]:IQ:WAVEload?

RESPONSE FORMAT BUILtin|USERstored <wave_name>

EXAMPLE Set the I/Q waveform to built-in 2ASK:


:IQ:WAVE:BUIL 2ASK

2ASK 4ASK 8ASK BPSK 4PSK


8PSK DBPSK 4DPSK 8DPSK 8QAM
16QAM 32QAM 64QAM 128QAM 256QAM

3.32.11 :IQ:WAVEload:USERstored
DESCRIPTION This command selects I/Q waveform from the user
stored waveforms.

COMMAND SYNTAX [:SOURce]:IQ:WAVEload:USERstored “<wave_name>”


<wave_name>:= { A waveform name from the user
stored waveforms}.

QUERY SYNTAX [:SOURce]:IQ:WAVEload?

RESPONSE FORMAT BUILtin|USERstored <wave_name>

EXAMPLE Set the I/Q waveform to user stored UserIQ_1.arb:


:IQ:WAVEload:USERstored “UserIQ_1.arb”

54
3.32.12 :IQ:FrequencySampling
DESCRIPTION This command sets the I/Q Frequency sampling rate.
COMMAND SYNTAX [:SOURce]:IQ: FrequencySampling <sampling>
< sampling >:= {500-300000000}. The unit is S/s

QUERY SYNTAX [:SOURce]:IQ:FrequencySampling?


[:SOURce]:IQ:FrequencySamplingLimit?

RESPONSE FORMAT <sampling>


MAX,<max_sampling>,MIN,< min_sampling >

EXAMPLE Set the I/Q frequency sampling to 2000000:


:IQ:FrequencySampling 2000000

55
4 Programming Examples
This chapter provides some examples for the programmer. In these examples you can see
how to use VISA or sockets, in combination with the commands described above to control
the generator. By following these examples, you can develop many more applications.

4.1 Examples of Using VISA

4.1.1 VC++ Example


Environment: Windows 7 32-bit, Visual Studio.
Description: Query the instrument information using "*IDN?" command over NI-VISA,
with the access through USBTMC and TCP/IP separately.
Steps:
1. Open Visual Studio, create a new VC++ win32 console project.

2. Set the project environment to use the NI-VISA lib, there are two ways to specify
NI-VISA, static or automatic:
a) Static:
Find the files visa.h, visatype.h and visa32.lib in NI-VISA installation path, copy
them to the root path of the VC++ project, and add them into the project. In the
projectname.cpp file, add the following two lines:

#include "visa.h"
#pragma comment(lib,"visa32.lib")

b) Dynamic:
In "project---properties---c/c++---General---Additional Include Directories" set the
value to the NI-VISA installation path (e.g. C:\Program Files\IVI
Foundation\VISA\WinNT\include), as shown in the figure below:

56
In “Project---Properties---Linker---General---Additional Library Directories” set
the value to the NI-VISA installation path (e.g. C:\Program Files\IVI
Foundation\VISA\WinNT\include), as shown in the figure below:

In “Project---Properties---Linker---Command Line---Additional” set the value


to visa32.lib, as shown in the figure below:

57
Include visa.h file in the projectname.cpp file:

#include <visa.h>

3. Coding:
a) USBTMC:

int Usbtmc_test() {
/* This code demonstrates sending synchronous read & write commands */
/* to an USB Test & Measurement Class (USBTMC) instrument using */
/* NI-VISA */
/* The example writes the "*IDN?\n" string to all the USBTMC */
/* devices connected to the system and attempts to read back */
/* results using the write and read functions. */
/* The general flow of the code is */
/* Open Resource Manager */
/* Open VISA Session to an Instrument */
/* Write the Identification Query Using viPrintf */
/* Try to Read a Response With viScanf */
/* Close the VISA Session */ /
***********************************************************/
ViSession defaultRM;
ViSession instr;

58
ViUInt32 numInstrs;
ViFindListfindList;
ViStatus status;
char instrResourceString[VI_FIND_BUFLEN];
unsigned char buffer[100];
int i;
/** First we must call viOpenDefaultRM to get the manager
* handle. We will store this handle in defaultRM.*/
status=viOpenDefaultRM (&defaultRM);
if (status<VI_SUCCESS)
{
printf ("Could not open a session to the VISA Resource Manager!\n");
return status;
}
/* Find all the USB TMC VISA resources in our system and store the number of
resources in the system in numInstrs. */
status = viFindRsrc (defaultRM, "USB?*INSTR", &findList, &numInstrs,
instrResourceString);
if (status<VI_SUCCESS)
{
printf ("An error occurred while finding resources.\nPress 'Enter' to
continue.");
fflush(stdin); getchar();
viClose (defaultRM);
return status;
}
/** Now we will open VISA sessions to all USB TMC instruments.
* We must use the handle from viOpenDefaultRM and we must
* also use a string that indicates which instrument to open. This
* is called the instrument descriptor. The format for this string
* can be found in the function panel by right clicking on the
* descriptor parameter. After opening a session to the
* device, we will get a handle to the instrument which we
* will use in later VISA functions. The AccessMode and Timeout
* parameters in this function are reserved for future
* functionality. These two parameters are given the value VI_NULL.*/
for (i=0; i<int(numInstrs); i++)
{
if (i> 0) {

viFindNext (findList, instrResourceString);


}
status = viOpen (defaultRM, instrResourceString, VI_NULL, VI_NULL,

59
&instr);
if (status<VI_SUCCESS)
{
printf ("Cannot open a session to the device %d.\n", i+1);
continue;
}
/* * At this point we now have a session open to the USB TMC instrument.
* We will now use the viPrintf function to send the device the string
"*IDN?\n",
* asking for the device's identification. */
char * cmmand ="*IDN?\n";
status = viPrintf (instr, cmmand);
if (status<VI_SUCCESS)
{
printf ("Error writing to the device %d.\n", i+1);
status = viClose (instr);
continue;
}
/** Now we will attempt to read back a response from the device to
* the identification query that was sent. We will use the viScanf
* function to acquire the data.
* After the data has been read the response is displayed.*/
status = viScanf(instr, "%t", buffer);
if (status<VI_SUCCESS)
{
printf ("Error reading a response from the device %d.\n", i+1);
}
else
{
printf ("\nDevice %d: %s\n", i+1 , buffer); }
status = viClose (instr);

}
/** Now we will close the session to the instrument using
* viClose. This operation frees all system resources. */ status = viClose
(defaultRM);
printf("Press 'Enter' to exit.");
fflush(stdin);
getchar();
return 0;

int _tmain(int argc, _TCHAR* argv[])

60
{
Usbtmc_test();
return 0;
}

Run result:

C : \D o cument s a nd Se t t i ng s\ Vi sua l St ud i o P ro j e ct s\usb t m c_ test

Device 1: LECROY,T3AFG120,NDG2XCAX2R0232,2.01.01.35R3

Press ‘Enter’ to exit.

b) TCP/IP:

int TCP_IP_Test(char *pIP) {


char outputBuffer[VI_FIND_BUFLEN];
ViSession defaultRM, instr; ViStatus status;
/* First we will need to open the default resource manager. */
status = viOpenDefaultRM (&defaultRM);
if (status<VI_SUCCESS)
{

printf("Could not open a session to the VISA Resource Manager!\n");


}
/* Now we will open a session via TCP/IP device */
char head[256] ="TCPIP0::";
char tail[] ="::INSTR";
strcat(head,pIP);
strcat(head,tail);
status = viOpen (defaultRM, head, VI_LOAD_CONFIG, VI_NULL, &instr);
if (status<VI_SUCCESS)
{
printf ("An error occurred opening the session\n");
viClose(defaultRM);
}
status = viPrintf(instr, "*idn?\n"); status
= viScanf(instr, "%t", outputBuffer); if
(status<VI_SUCCESS)

61
{
printf("viRead failed with error code: %x \n",status);
viClose(defaultRM);
}
else
{
printf ("\nMesseage read from device: %*s\n", 0,outputBuffer);
}
status = viClose (instr); status
= viClose (defaultRM);
printf("Press 'Enter' to exit.");
fflush(stdin);
getchar();
return 0;
}

int _tmain(int argc, _TCHAR* argv[])


{
printf("Please input IP address:");
char ip[256];
fflush(stdin);
gets(ip);
TCP_IP_Test(ip);
return 0;

Run result:

C : \D o cument s a nd Se t t i ng s\ Vi sua l St ud i o P ro j e ct s\tcp _ i p _ test


Please input address:102.168.1.22

Messeage read from device: LECROY,T3AFG120,NDG2XCAX2R0232,2.01.01.35R3

Press ‘Enter’ to exit.

62
4.1.2 VB Example
Environment: Windows 7 32-bit, Microsoft Visual Basic 6.0

Description: Query the instrument information using "IDN?" command over NI-VISA,

with the access through USBTMC and TCP/IP separately.

Steps:
1. Open Visual Basic, and build a standard application program project.

2. Set the project environment to use the NI-VISA lib: Click the Existing tab of
Project>>Add Existing Item, search the visa32.bas file in the "include" folder under
the NI-VISA installation path and add the file, as shown in the figure below:

3. Coding:
a) USBTMC:

Private Function Usbtmc_test() As Long


' This code demonstrates sending synchronous read & write commands
' to an USB Test & Measurement Class (USBTMC) instrument using
' NI-VISA
' The example writes the "*IDN?\n" string to all the USBTMC
' devices connected to the system and attempts to read back
' results using the write and read functions.
' The general flow of the code is
' Open Resource Manager
' Open VISA Session to an Instrument

63
' Write the Identification Query Using viWrite
' Try to Read a Response With viRead
' Close the VISA Session Const MAX_CNT = 200

Dim defaultRM As Long


Dim instrsesn As Long
Dim numlnstrs As Long Dim findList As Long Dim retCount As Long Dim status As Long
Dim instrResourceString As String * VI_FIND_BUFLEN
Dim Buffer As String * MAX_CNT
Dim i As Integer

' First we must call viOpenDefaultRM to get the manager


' handle. We will store this handle in defaultRM.
status = viOpenDefaultRM(defaultRM)
If (status < VI_SUCCESS) Then
resultTxt.Text = "Could not open a session to the VISA Resource Manager!"
Usbtmc_test = status
Exit Function
End If

' Find all the USB TMC VISA resources in our system and store the
' number of resources in the system in numInstrs.
status = viFindRsrc(defaultRM, "USB?*INSTR", findList, numlnstrs, instrResourceString)
If (status < VI_SUCCESS) Then
resultTxt.Text = "An error occurred while finding resources." viClose(defaultRM)
Usbtmc_test = status
Exit Function
End If

' Now we will open VISA sessions to all USB TMC instruments.
' We must use the handle from viOpenDefaultRM and we must
' also use a string that indicates which instrument to open. This
' is called the instrument descriptor. The format for this string
' can be found in the function panel by right clicking on the
' descriptor parameter. After opening a session to the
' device, we will get a handle to the instrument which we
' will use in later VISA functions. The AccessMode and Timeout
' parameters in this function are reserved for future
' functionality. These two parameters are given the value VI_NULL.

64
For i = 0 To numInstrs If (i > 0) Then
status = viFindNext(findList, instrResourceString) End If
status = viOpen(defaultRM, instrResourceString, VI_NULL, VI_NULL, instrsesn)
If (status < VI_SUCCESS) Then
resultTxt.Text = "Cannot open a session to the device " + CStr(i + 1)
GoTo NextFind
End If

' At this point we now have a session open to the USB TMC instrument.
' We will now use the viWrite function to send the device the string "*IDN?",
' asking for the device's identification.
status = viWrite(instrsesn, "*IDN?", 5, retCount) If
(status < VI_SUCCESS) Then
resultTxt.Text = "Error writing to the device." status = viClose(instrsesn)
GoTo NextFind
End If

' Now we will attempt to read back a response from the device to
' the identification query that was sent. We will use the viRead
' function to acquire the data.
' After the data has been read the response is displayed.
status = viRead(instrsesn, Buffer, MAX_CNT, retCount) If
(status < VI_SUCCESS) Then
resultTxt.Text = "Error reading a response from the device." + CStr(i + 1)
Else
resultTxt.Text = "Read from device: " + CStr(i + 1) + " " + Buffer
End If
status = viClose(instrsesn)
Next i

' Now we will close the session to the instrument using


' viClose. This operation frees all system resources.
status = viClose(defaultRM)
Usbtmc_test = 0
End Function

b) TCP/IP:

Private Function TCP_IP_Test(ByVal ip As String) As Long


Dim outputBuffer As String * VI_FIND_BUFLEN

65
Dim defaultRM As Long
Dim instrsesn As Long
Dim status As Long
Dim count As Long

' First we will need to open the default resource manager.


status = viOpenDefaultRM(defaultRM)
If (status < VI_SUCCESS) Then
resultTxt.Text = "Could not open a session to the VISA Resource Manager!"
TCP_IP_Test = status
Exit Function
End If

' Now we will open a session via TCP/IP device


status = viOpen(defaultRM, "TCPIP0::" + ip + "::INSTR", VI_LOAD_CONFIG, VI_NULL,
instrsesn)
If (status < VI_SUCCESS) Then
resultTxt.Text = "An error occurred opening the session" viClose(defaultRM)
TCP_IP_Test = status
Exit Function
End If

status = viWrite(instrsesn, "*IDN?", 5, count) If (status < VI_SUCCESS) Then


resultTxt.Text = "Error writing to the device." End If
status = viRead(instrsesn, outputBuffer, VI_FIND_BUFLEN, count) If
(status < VI_SUCCESS) Then
resultTxt.Text = "Error reading a response from the device." + CStr(i + 1) Else
resultTxt.Text = "read from device:" + outputBuffer
End If
status = viClose(instrsesn)
status = viClose(defaultRM)
TCP_IP_Test = 0

End Function

c) Button control code:

Private Sub exitBtn_Click()


End

66
End Sub
Private Sub tcpipBtn_Click()
Dim stat As Long
stat = TCP_IP_Test(ipTxt.Text)
If (stat < VI_SUCCESS) Then
resultTxt.Text = Hex(stat)
End If
End Sub
Private Sub usbBtn_Click()
Dim stat As Long
stat = Usbtmc_test
If (stat < VI_SUCCESS) Then
resultTxt.Text = Hex(stat)
End If

End Sub

Run result:

67
4.1.3 MATLAB Example
Environment: Windows 7 32-bit, MATLAB R2013a

Description: Query the instrument information using "IDN?" command over NI-VISA,

with the access through USBTMC and TCP/IP separately.

Steps:

1. Open MATLAB, and modify the current directory. In this demo, the current directory

is modified to "D:\USBTMC_TCPIP_Demo".

2. Click File>>New>>Script in the Matlab interface to create an empty M file.

3. Coding:

a) USBTMC:

function USBTMC_test()
% This code demonstrates sending synchronous read & write commands
% to an USB Test & Measurement Class (USBTMC) instrument using
% NI-VISA

%Create a VISA-USB object connected to a USB instrument


vu = visa('ni','USB0::0xF4ED::0xEE3A:NDG2XCAX2R0232::INSTR');

%Open the VISA object created fopen(vu);

%Send the string "*IDN?",asking for the device's identification.


fprintf(vu,'*IDN?');

%Request the data outputbuffer = fscanf(vu); disp(outputbuffer);

%Close the VISA object


fclose(vu);
delete(vu);
clear vu;

end

Run result:

68
b) TCP/IP:

Write a function TCP_IP_Test:

function TCP_IP_test()
% This code demonstrates sending synchronous read & write commands
% to an TCP/IP instrument using NI-VISA

%Create a VISA-TCPIP object connected to an instrument


%configured with IP address.
vt = visa('ni',['TCPIP0::','10.11.13.32','::INSTR']);

%Open the VISA object created fopen(vt);

%Send the string "*IDN?",asking for the device's identification.


fprintf(vt,'*IDN?');

%Request the data outputbuffer = fscanf(vt); disp(outputbuffer);

%Close the VISA object


fclose(vt);
delete(vt);
clear vt;

end

Run result:

69
4.1.4 LabVIEW Example
Environment: Windows 7 32-bit, LabVIEW 2011

Description: Query the instrument information using "IDN?" command over NI-VISA,

with the access through USBTMC and TCP/IP separately.

Steps:
1. Open LabVIEW, and create a VI file.
2. Add controls. Right-click in the Front Panel interface, select and add VISA
resource name, error in, error out and some indicators from the Controls column.
3. Open the Block Diagram interface. Right-click on the VISA resource name,
select and add the following functions from VISA Palette from the pop-up menu:
VISA Write, VISA Read, VISA Open and VISA Close.
4. The connection is as shown in the figure below:

5. Select the device resource from the VISA Resource Name list box and run the

program.

In this example, the VI opens a VISA session to a USBTMC device, writes a "IDN?"

command to the device, and reads back the response. After all communication is

complete, the VI closes the VISA session.

70
6. Communicating with the device via TCP/IP is similar to USBTMC. But you need to
change VISA Write and VISA Read Function to Synchronous I/O. The LabVIEW
default is asynchronous I/O. Right-click the node and select Synchronous I/O
Mod>>Synchronous from the shortcut menu to write or read data synchronously.
7. The connection is as shown in the figure below:

8. Input the IP address and run the program.

71
4.1.5 Python Example

Environment: Python2.7, PyVISA 1.4

Please install PyVISA after installing Python2.7. Please refer to

https://pyvisa.readthedocs.io/en/stable/getting.html for PyVISA installation guide.

Description: Use Python script to build an 8-point 16-bit arbitrary waveform (0x1000,

0x2000, 0x3000, 0x4000, 0x5000, 0x6000, 0x7000, 0x7fff) and save the waveform

data in "wave1.bin", then download it to the instrument, finally read it back from the

instrument and save it as "wave2.bin".

Below is the code of the script:

#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-

import visa import time import binascii

#USB resource of Device


device_resource = "USB0::0xF4EC::0x1101::#15::INSTR"

#Little endian, 16-bit 2's complement


wave_points = [0x0010, 0x0020, 0x0030, 0x0040, 0x0050, 0x0060, 0x0070, 0xff7f]

def create_wave_file(): """create a file"""


f = open("wave1.bin", "wb") for a in wave_points:
b = hex(a)
b = b[2:]
len_b = len(b)
if (0 == len_b):
b = '0000'
elif (1 == len_b):
b = '000' + b elif (2 == len_b):
b = '00' + b elif (3 == len_b):

72
b = '0' + b
c = binascii.a2b_hex(b) #Hexadecimal integer to ASCii encoded string f.write(c)
f.close()

def send_wawe_data(dev):
"""send wave1.bin to the device"""
f = open("wave1.bin", "rb") #wave1.bin is the waveform to be sent data = f.read()
print 'write bytes:',len(data)
dev.write("C1:WVDT
WVNM,wave1,FREQ,2000.0,AMPL,4.0,OFST,0.0,PHASE,0.0,WAVEDATA,%s" %(data))
#T3AFG5, 10 and T3AFG40, 80, 120
dev.write("C1:ARWV NAME,wave1") f.close()

def get_wave_data(dev):
"""get wave from the devide"""
f = open("wave2.bin", "wb") #save the waveform as wave2.bin
dev.write("WVDT? user,wave1") #T3AFG5, 10 and T3AFG40, 80, 120
time.sleep(1)
data = dev.read()
data_pos = data.find("WAVEDATA,") + len("WAVEDATA,")
print data[0:data_pos]
wave_data = data[data_pos:]
print 'read bytes:',len(wave_data)
f.write(wave_data)
f.close()

if __name__ == '__main__': """"""


device = visa.instrument(device_resource, timeout=5000, chunk_size = 40*1024)
create_wave_file()
send_wawe_data(device)
get_wave_data(device)

73
Output waveform:

74
4.2 Examples of Using Sockets

4.2.1 Python Example


Python has a low-level networking module that provides access to the socket interface.
Python scripts can be written for sockets to do a variety of tests and measurement tasks.

Environment: Windows 7 32-bit, Python v2.7.5


Description: Open a socket, send a query, and repeat this loop for 10 times, finally close
the socket. Note that SCPI command strings must be terminated with a “\n” (new line)
character in programming.

Below is the code of the script:


#!/usr/bin/env python
#-*- coding:utf-8 –*-
#-----------------------------------------------------------------------------
# The short script is a example that open a socket, sends a query,
# print the return message and closes the socket.
#-----------------------------------------------------------------------------

import socket # for sockets


import sys # for exit
import time # for sleep

#-----------------------------------------------------------------------------

remote_ip = "10.11.13.40" # should match the instrument’s IP address


port = 5025 # the port number of the instrument service
count = 0

def SocketConnect(): try:


#create an AF_INET, STREAM socket (TCP)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) except socket.error:
print ('Failed to create socket.') sys.exit();
try:
#Connect to remote server s.connect((remote_ip , port))
except socket.error:
print ('failed to connect to ip ' + remote_ip)

75
return s

def SocketQuery(Sock, cmd): try :


#Send cmd string Sock.sendall(cmd) time.sleep(1)
except socket.error:
#Send failed
print ('Send failed') sys.exit()
reply = Sock.recv(4096) return reply

def SocketClose(Sock): #close the socket Sock.close() time.sleep(.300)

def main():
global remote_ip global port
global count

# Body: send the SCPI commands *IDN? 10 times and print the return message
s = SocketConnect()
for i in range(10):
qStr = SocketQuery(s, b'*IDN?\n')
print (str(count) + ":: " + str(qStr)) count = count + 1
SocketClose(s)
input('Press "Enter" to exit')

if __name__ == '__main__': proc = main()

Run result:

0:: LECROY,T3AFG120,#15,6.01.01.28

1:: LECROY,T3AFG120,#15,6.01.01.28

2:: LECROY,T3AFG120,#15,6.01.01.28

3:: LECROY,T3AFG120,#15,6.01.01.28

4:: LECROY,T3AFG120,#15,6.01.01.28

5:: LECROY,T3AFG120,#15,6.01.01.28

6:: LECROY,T3AFG120,#15,6.01.01.28

7:: LECROY,T3AFG120,#15,6.01.01.28

8:: LECROY,T3AFG120,#15,6.01.01.28

9:: LECROY,T3AFG120,#15,6.01.01.28

Press ‘Enter’ to exit.

76
5 Index
*IDN
*OPC
*RST

A
ARWV ArbWaVe

B
BSWV BaSic_WaVe
BTWV BursTWaVe
BUZZ BUZZer

C
CASCADE
CHDR Comm_HeaDeR
COUP COUPling
CMBN CoMBiNe

F
FCNT FreqCouNTer

H
HARM HARMonic

I
IQ:CENT IQ:CENTerfreq
IQ:SAMP IQ:SAMPlerate
IQ:SYMB IQ:SYMBolrate
IQ:AMPL IQ:AMPLitude
IQ:IQAD:GAIN IQ:IQADjustment:GAIN
IQ:IQAD:IOFFset IQ:IQADjustment:IOFFset
IQ:IQAD:QOFFset IQ:IQADjustment:QOFFset
IQ:IQAD:QSK IQ:IQADjustment:QSKew
IQ:TRIG:SOUR IQ:TRIGger:SOURce
IQ:WAVE:BUIL IQ:WAVEload:BUILtin
IQ:WAVE:USER IQ:WAVEload:USERstored
IQ:FrequencySampling IQ:FrequencySampling
IVNT INVERT

L
LAGG LAnGuaGe

77
M
MDWV MoDulateWaVe
MODE MODE

N
NBFM NumBer_ForMat

O
OUTP OUTPut

P
PACP ParaCoPy

R
ROSC ROSCillator

S
SCFG Sys_CFG
SCSV SCreen_SaVe
SWWV SweepWaVe
SYNC SYNC
STL StoreList
SYST:COMM:LAN:IPAD SYSTem:COMMunicate:LAN:IPADdress
SYST:COMM:LAN:SMAS SYSTem:COMMunicate:LAN:SMASk
SYST:COMM :LAN:GAT SYSTem:COMMunicate:LAN:GATeway
SRATE SampleRATE

W
WVDT WVDT

V
VOLTPRT VOLTPRT
VKEY VirtualKEY

78
ABOUT TELEDYNE TEST TOOLS

Company Profile
Teledyne LeCroy is a leading provider of oscilloscopes, protocol
analyzers and related test and measurement solutions that
enable companies across a wide range of industries to design
and test electronic devices of all types. Since our founding in
1964, we have focused on creating products that improve
productivity by helping engineers resolve design issues faster
and more effectively. Oscilloscopes are tools used by
designers and engineers to measure and analyze complex
electronic signals in order to develop high-performance
systems and to validate electronic designs in order to improve
time to market.
The Teledyne Test Tools brand extends the Teledyne LeCroy
product portfolio with a comprehensive range of test
equipment solutions. This new range of products delivers
a broad range of quality test solutions that enable engineers to
rapidly validate product and design and reduce time-to-
market. Designers, engineers and educators rely on Teledyne
Test Tools solutions to meet their most challenging needs for
testing, education and electronics validation.
Teledyne LeCroy
(US Headquarters)
Location and Facilities
700 Chestnut Ridge Road
Headquartered in Chestnut Ridge, New York, Teledyne Test Chestnut Ridge, NY. USA 10977-6499
Tools and Teledyne LeCroy has sales, service and
Phone: 800-553-2769 or 845-425-2000
development subsidiaries in the US and throughout Europe Fax Sales: 845-578-5985
and Asia. Teledyne Test Tools and Teledyne LeCroy products Phone Support: 1-800-553-2769
are employed across a wide variety of industries, including Email Sales: contact.corp@teledynelecroy.com
semiconductor, computer, consumer electronics, education, Email Support: support@teledynelecroy.com
Web Site: http://teledynelecroy.com/
military/aerospace, automotive/industrial, and
telecommunications.

Distributed by:
World wide support contacts can be found at:
h�ps://teledynelecroy.com/support/contact

teledynelecroy.com
© 2020 Teledyne Test Tools is a brand and trademark of Teledyne LeCroy Inc. All rights reserved. Specifications,prices,availability and delivery subject to change without notice.
Product brand or brand names are trademarks or requested trademarks of their respective holders.
T3 stands for Teledyne Test Tools. 931783 Rev3

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy