4-9
IM DLM4038-17EN
Programming Overview
1
2
3
4
5
6
App
Index
• Using the *OPC? Query
The
*OPC?
query generates a response when an
overlapping operation is completed.
Example
:COMMunicate:OPSE #H0040;:
FILE:LOAD:SETup:EXECute
"CASE1";*OPC?<PMT>
(Read the response to
*OPC?
)
:CHANnel1:VDIV?<PMT>
The
COMMunicate:OPSE
command is used to
select which command to apply
*OPC?
to. Here, it is
applied to the media access command.
Because
*OPC?
does not generate a response
until the overlapping operation is completed, the file
loading will have been completed by the time the
response to
*OPC?
is read.
Note
Most commands are sequential commands. Overlap
commands are indicated as such in chapter 5. All other
commands are sequential commands.
Achieving Synchronization without Using
Overlap Commands
Even with sequential commands, synchronization
with non-communication events such as triggers is
sometimes required to correctly query the measured
data.
For example, if the following program message is
transmitted to query waveform data acquired with the
trigger mode set to single, the
WAVeform:SEND?
command may be executed regardless of whether or
not the acquisition has been completed and may result
in a command execution error.
TRIGger:MODE NORMal;:STARt;:WAVeform:
SEND?<PMT>
If this happens, you must use the following method to
synchronize to the end of waveform acquisition.
• Using the STATus:CONDition? query
STATus:CONDition?
is used to query the
contents of the condition register (see page 6-5
for details). You can determine whether or not
waveform acquisition is in progress by reading bit
0 in the condition register. If the bit is 1, waveform
acquisition is in progress. If the bit is 0, waveform
acquisition is not in progress.
Example
TRIGger:MODE NORMal;:
STARt<PMT>
:STATus:CONDition?<PMT>
(Read the response. If bit 0 is 1, return to
the previous command.)
:WAVeform:SEND?<PMT>
WAVeform:SEND?
is not executed until bit 0 in the
condition register becomes
0
.
• Using the Extended Event Register
The changes in the condition register can be
reflected in the extended event register (see page
6-5 for details).
Example
:STATus:FILTer1 FALL;:STATus:
EESE 1;EESR?;*SRE 8;:TRIGger:
MODE NORMal;:STARt<PMT>
(Read the response to
STATus:EESR?
)
(Wait for a service request)
:WAVeform:SEND?<PMT>
The
STATus:FILTer1 FALL
command sets the
transition filter so that bit 0 in the extended event
(FILTer1) is set to
1
when bit 0 in the condition
register changes from
1
to
0
.
The
STATus:EESE 1
command is used to only
change the status byte based on bit 0 in the
extended event register.
The
STATus:EESR?
command is used to clear the
extended event register.
The
*SRE 8
command is used to generate service
requests based only on the changes in the extended
event register bits.
The
WAVeform:SEND?
command is not executed
until a service request is generated.
• Using the COMMunicate:WAIT command
The
COMMunicate:WAIT
command is used to wait
for a specific event to occur.
Example
:STATus:FILTer1 FALL;:STATus:
EESR?;:TRIGger:MODE NORMal
<PMT>
(Read the response to
STATus:EESR?
)
:COMMunicate:WAIT
1;:WAVeform:SEND?<PMT>
For a description of
STATus:FILTer1 FALL
and
STATus:EESR?
, see the previous section about the
extended event register.
The
COMMunicate:WAIT 1
command specifies
that the program will wait for bit 0 in the extended
event register to be set to
1
.
WAVeform:SEND?
is not executed until bit 0 in the
extended event register becomes
1
.
4.5 Synchronization with the Controller