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 or
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 instrument 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 manufacturer.
In these examples, data sent from the controller computer to the instrument is
prefaced with the > symbol. Replies from the instrument have no preface.
> REM "Check for any messages, and clear them from the queue."
> *ESR?
128
> ALLEV ?
:ALLEV 401,"Power on; "
> REM "Set the instrument to the default state."
> FACTORY
> REM "Set the instrument 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 must be set long enough to
handle the wait."
> *OPC?
1
> REM "Use the instrument built-in measurements to measure the waveform you
acquired."
> MEASU:IMMED:TYPE MEAN
TBS2000 Series Programmer 295