10-8
IM 755601-01E
Using the *OPC? query
:
CMD$ =
"
COMM:OPSE #H2000
"
'
............(1)
CALL IBWRT(M7556%, CMD$)
CMD$ =
"
PRIN:EXEC;*OPC?
"
'
............(2)
CALL IBWRT(M7556%, CMD$)
A$ = SPACE$(8)
'
............(3)
CALL IBRD(M7556%, A$)
CMD$ =
"
MEAS ON
"
'
............(4)
CALL IBWRT(M7556%, CMD$)
:
(1) Make the completion of the external printer
operation subject to the
*OPC
query.
(2) Output to the external printer and wait for the
operation to complete.
(3) Read the response to the
*OPC?
query.
(4) Switch to the measurement mode.
Synchronization with Non-Overlap Commands
Even for sequential commands, synchronization is
sometimes required for non communication-related
reasons such as a trigger occurrence.
For example, if the
*TRG
command is used to generate
a trigger from the controller and then store the
measured data, there is no need to synchronize with
the controller. However, if measured data are to be
stored using the external trigger mode, the controller
cannot determine when the data store operation is
completed. Therefore, synchronization with the
controller is required in order to wait for the store
operation to complete.
To synchronize with the controller according to the
current internal condition of the instrument
(“Measurement data store complete,” for example), the
following commands that support the extended event
register are used.
:STATus:CONDition?
:STATus:FILTer<x>
:STATus:EESE
:STATus:EESR?
:COMMunicate:WAIT
:COMMunicate:WAIT?
The use of each command is explained in the following
example in which the measured data are stored or
recalled using the external trigger mode.
Using the external event register
:
CMD$ =
"
STOR:COUN 200
"
'
............(1)
CALL IBWRT(M7556%, CMD$)
CMD$ =
"
STOR ON
"
'
............(2)
CALL IBWRT(M7556%, CMD$)
'
CMD$ =
"
STAT:FILT10 FALL
"
'
............(3)
CALL IBWRT(M7556%, CMD$)
CMD$ =
"
STAT:EESE 512
"
'
............(4)
CALL IBWRT(M7556%, CMD$)
CMD$ =
"
STAT:EESR?
"
'
............(5)
CALL IBWRT(M7556%, CMD$)
N$ = SPACE$(8)
CALL IBRD(M7556%, N$)
CMD$ =
"
*SRE 8
"
'
............(6)
CALL IBWRT(M7556%, CMD$)
ON PEN GOSUB STEND
'
............(7)
PEN ON
'
............(8)
'
CMD$ =
"
TRIG:MODE EXT
"
'
............(9)
CALL IBWRT(M7556%, CMD$)
CMD$ =
"
MEAS ON
"
'
............(10)
CALL IBWRT(M7556%, CMD$)
LOOP1:
'
............(11)
GOTO LOOP1
'
STEND:
CMD$ =
"
MEAS OFF
"
'
............(12)
CALL IBWRT(M7556%, CMD$)
CMD$ =
"
REC:DATA?
"
'
............(13)
CALL IBWRT(M7556%, CMD$)
:
(1) Store 200 sets measured data.
(2) Enter the store start ready state.
(3) Set the external event register on the falling
edge of bit 9 (STR) of the status register.
(4) Reflect only bit 9 (STR) of the extended event
register to the status byte.
(5) Read the extended event register in order to
clear the register.
(6) Reflect the EES bit of the status byte register to
the generation of the service request.
(7) Specify the destination to jump to when an
interrupt occurs.
(8) Enable the SRQ interrupt.
(9) Set the trigger mode to external trigger.
(10) Switch to the measurement mode.
(11) Wait for the data store operation to complete.
(12) Exit from the measurement mode.
(13) Query all the measured data that have been
stored.
10.1 Before Programming