Appendix D: Programming Example
The following series of commands and queries illustrate many of the most
common commands and techniques. In this example, data sent from the controller
computer to the oscilloscope is prefaced with the > symbol. Replies from the
oscilloscope have no preface.
> rem “Check for any messages, and clear them from the queue.”
>*esr?
128
> allev?
:ALLEV 401,”Power on; “
> rem “Set the scope to the default state.”
> factory
> rem “Set the scope parameters that differ from the defaults.”
> ch1:scale 2.0
> hor:m:scale 100e-6
> trig:a: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 oscilloscope built-in measurements to measure the waveform
you acquired.”
> measu:immed:type mean
> measu:immed:value?
:MEASUREMENT:IMMED:VALUE1.2767
MSO4000 and DPO4000 Series Programmer Manual D-1