Communication
Commands
10-11
IM 755601-01E
10
Setting the trigger
To trigger the measurement from the external controller
or by using the trigger function on the instrument, use
the following commands.
:TRIGger:MODE
:MEASure
*TRG
Group Execution Trigger (GET)
:READ?
Example 1
Set the trigger mode to external trigger and trigger
the measurement
:
CMD$ =
"
STAT:FILT1 RISE
"
'
............(1)
CALL IBWRT(M7556%, CMD$)
CMD$ =
"
STAT:EESE 1
"
'
............(2)
CALL IBWRT(M7556%, CMD$)
CMD$ =
"
STAT:EESR?
"
'
............(3)
CALL IBWRT(M7556%, CMD$)
N$ = SPACE$(8)
CALL IBRD(M7556%, N$)
CMD$ =
"*
SRE 8
"
'
............(4)
CALL IBWRT(M7556%, CMD$)
ON PEN GOSUB AVAIL
'
............(5)
PEN ON
'
............(6)
'
CMD$ =
"
TRIG:MODE EXT
"
'
............(7)
CALL IBWRT(M7556%, CMD$)
CMD$ =
"
MEAS ON
"
'
............(8)
CALL IBWRT(M7556%, CMD$)
LOOP1:
'
............(9)
GOTO LOOP1
'
AVAIL:
CMD$ =
"
READ?
"
'
............(10)
CALL IBWRT(M7556%, CMD$)
D$ = SPACE$(20)
CALL IBRD(M7556%, D$)
PRINT D$
CALL IBRSP(M7556%, SPR%)
'
............(11)
CMD$ =
"
STAT:EESR?
"
'
............(12)
CALL IBWRT(M7556%, CMD$)
CALL IBRD(M7556%, N$)
PEN ON
'
............(13)
RETURN
:
(1) Set the extended event register on the rising
edge of bit 0 (DAV) of the status register.
(2) Reflect only bit 0 (DAV) of the extended event
register to the status byte.
(3) Read the extended event register in order to
clear the register.
(4) Reflect the EES bit of the status byte register to
the generation of the service request.
(5) Specify the destination to jump to when an
interrupt occurs.
(6) Enable the SRQ interrupt.
(7) Set the trigger mode to external trigger.
(8) Switch to the measurement mode.
(9) Wait for the external trigger signal.
(10) Query the measured data.
(11) Clear the SRQ line.
(12) Read the extended event register in order to
clear the register.
(13) Enable the SRQ interrupt once again.
Example 2
Set the trigger to manual trigger and trigger the
measurement
:
CMD$ =
"
STAT:FILT1 RISE
"
'
............(1)
CALL IBWRT(M7556%, CMD$)
CMD$ =
"
STAT:EESE 1
"
'
............(2)
CALL IBWRT(M7556%, CMD$)
CMD$ =
"
STAT:EESR?
"
'
............(3)
CALL IBWRT(M7556%, CMD$)
N$ = SPACE$(8)
CALL IBRD(M7556%, N$)
CMD$ =
"*
SRE 8
"
'
............(4)
CALL IBWRT(M7556%, CMD$)
ON PEN GOSUB AVAIL
'
............(5)
PEN ON
'
............(6)
'
CMD$ =
"
TRIG:MODE MAN
"
'
............(7)
CALL IBWRT(M7556%, CMD$)
CMD$ =
"
MEAS ON
"
'
............(8)
CALL IBWRT(M7556%, CMD$)
LOOP1:
'
............(9)
V% = 0
CALL IBSRE(BD%, V%)
GOTO LOOP1
'
AVAIL:
CMD$ =
"
READ?
"
'
............(10)
CALL IBWRT(M7556%, CMD$)
D$ = SPACE$(20)
CALL IBRD(M7556%, D$)
PRINT D$
CALL IBRSP(M7556%, SPR%)
'
............(11)
CMD$ =
"
STAT:EESR?
"
'
............(12)
CALL IBWRT(M7556%, CMD$)
CALL IBRD(M7556%, N$)
PEN ON
'
............(13)
RETURN
:
(1) Set the extended event register on the rising
edge of bit 0 (DAV) of the status register.
(2) Reflect only bit 0 (DAV) of the extended event
register to the status byte.
(3) Read the extended event register in order to
clear the register.
(4) Reflect the EES bit of the status byte register to
the generation of the service request.
(5) Specify the destination to jump to when an
interrupt occurs.
(6) Enable the SRQ interrupt.
(7) Set the trigger mode to manual.
(8) Switch to the measurement mode.
(9) Wait for the [TRIG] key to be pressed.
(10) Query the measured data.
(11) Clear the SRQ line.
(12) Read the extended event register in order to
clear the register.
(13) Enable the SRQ interrupt once again.
10.1 Before Programming