Status and Events
Service Reques
t Method: Enable the OPC bit in the Device Event Status Enable
Register (DESER) and the Event Status Enable Register (ESER) using the DESE
and *ESE commands.
You can also enable service requests by setting the ESB bit in the Service Request
Enable Register (SRER) using the *SRE command. When the operation is
complete, the oscilloscope will generate a Service Request.
The same command sequence using the *OPC command for synchronization
looks like this
/* Set up conditional acq uisition */
ACQUIRE:STATE OFF
SELECT:CH1 ON
HORIZONTAL:RECORDLENGTH 1000
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 */
MEASUREMENT: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 */
MEASUREMENT:IMMED:VALUE
This technique is efficient but requires sophisticated programming.
Usingthe*OPC?Query
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 s
ame command sequence using the *OPC? query for synchronization looks
like this:
/* Set up conditional acq uisition */
ACQUIRE:STATE OFF
SELECT:CH1 ON
HORIZONTAL:RECORDLENGTH 1000
ACQUIRE:MODE SAMPLE
ACQUIRE:STOPAFTER SEQUENCE
MSO4000 and DPO4000 Series Programmer Manual 3-11