User Manual

Programming Examples
The following series of commands and queries illustrate many of the most
common commands and techniques.
To use these commands and queries over USB, you must use a program o r
routines that interface to the USBTMC driver on your PC. You can also use the
PC Communications software that came on the CD with your oscilloscope to get
the same data without having to write programs. For operating information, you
can launch the PC Communications software and refer to the online help.
To use these commands and queries over GPIB, you must use a program or
routines that interface to the GPIB hardware in your computer. The software is
usually supplied by the GPIB hardware manufactu
rer.
To use these commands and queries over RS-232, you must use a communications
program on your computer, such as tip in the Unix environment, or Hyperterminal
in the Microsoft Windows environment.
In these examples, data sent from the controller computer to the oscilloscope is
prefaced with the > symbol. Replies from the oscilloscope have no preface.
> R EM "Check for any messages, and clear them from the queue."
> *ESR?
128
> ALLEV ?
:ALLEV 401,"Power on; "
> REM "Set the o scilloscope to the default state."
>FACTORY
> REM "Set the oscilloscope parameters that differ from the defaults."
> CH1:VOLTS 2.0
> HOR:MAIN:SCALE 100e-6
> TRIG:MAIN:LEVEL 2.4
> REM "Start a single sequence acquisition."
> ACQUIRE:STOPAFTER SEQUENCE
> ACQUIRE:STATE ON
> REM "Wait for the acquisition to complete."
> REM "Note: your controller program time-out m ust be set long enough to
handle the wait."
>*OPC?
TDS200, TDS1000/2000, TDS1000B/2000B, TDS2000C, TPS2000 Programmer 4-1