Status and Events
Thesamecomman
d sequence using the *OPC command for synchronization
looks like this
/* Set up condi
tional acquisition */
ACQUIRE:STATE OFF
SELECT:CH1 ON
ACQUIRE:MODE SAMPLE
ACQUIRE:STOPAFTER SEQUENCE
/* Enab le the st atus registers */
DESE 1
*ESE 1
*SRE 32
/* Acqu ire waveform data */
ACQUIRE:STATE ON
/* Set up the measurement parameters */
MEASURE
MENT:IMMED:TYPE AMPLITUDE
MEASUREMENT:IMMED:SOURCE CH1
/* Wait until the acquisi tion is complete before taking the
measurement*/
*OPC
The program can now do different tasks such as talk to other devices. The SRQ,
when it comes, interrupts those tasks and returns control to this task.
/* Take amplitude measurement */
MEAS
UREMENT:IMMED:VALUE?
This technique is efficient but requires sophisticated programming.
Usi
ng the *OPC? Query
The *OPC? query is the most s imple synchronization method. It does not require
you to set registers or poll, and it does not change the operation of subsequent
commands or queries.
The *OPC? query places a 1 in the Output Queue once an operation that generates
an OPC message is complete. A time out could occur if you try to read the output
queue before there is any data in it.
The same command sequence using the *OPC? query for synchronization looks
like this:
/* Set up conditional acq uisition */
ACQUIRE:STATE OFF
SELECT:CH1 ON
ACQUIRE:MODE SAMPLE
ACQUIRE:STOPAFTER SEQUENCE
/* Acqu ire waveform data */
ACQUIRE:STATE ON
/* Set up the measurement parameters */
MEASUREMENT:IMMED:TYPE AMPLITUDE
MEASUREMENT:IMMED:SOURCE CH1
MSO2000B, DPO2000B, MSO2000 and DPO2000 Series Oscilloscopes Programmer Manual 3-11