Specifications

ZVx Programming Examples
1043.0009.50 D.3 E-2
D.7 Command synchronization
The possibilities for synchronization implemented in the following example are described in Section
3.7.6, Command Order and Command Synchronization.
REM -------- Examples of command synchronization ---------
REM The command INITiate[:IMMediate] starts a single sweep if the command
REM INIT:CONT OFF was previously sent. It should be ensured that the next
REM command is only then executed when the entire sweep is complete.
CALL IBWRT(analyzer%, "INIT:CONT OFF")
REM -------- First possibility: Use of *WAI ---------
CALL IBWRT(analyzer%, "ABOR;INIT:IMM; *WAI")
REM -------- Second possibility: Use of *OPC? ---------
OpcOk$ = SPACE$(2) ’Space for *OPC? - Provide response
CALL IBWRT(analyzer%, "ABOR;INIT:IMM; *OPC?")
REM -------- here the controller can service other instruments ---------
CALL IBRD(analyzer%, OpcOk$) ’Wait for "1" from *OPC?
REM -------- Third possibility: Use of *OPC ---------
REM In order to be able touse the service request function in conjugation
REM with a National Instruments GPIB driver, the setting "Disable
REM Auto Serial Poll" must be changed to "yes" by means of IBCONF!
CALL IBWRT(analyzer%, "*SRE 32") ’Permit service request for ESR
CALL IBWRT(analyzer%, "*ESE 1") ’Set event-enable bit for
’operation-complete bit
ON PEN GOSUB OpcReady ’Initialization of the
’service request routine
PEN ON
CALL IBWRT(analyzer%, "ABOR;INIT:IMM; *OPC")
REM Continue main program here
STOP ’End of program
OpcReady:
REM As soon as the sweep has ended
, this subroutine is activated
REM Program suitable reaction to the OPC service request.
ON PEN GOSUB OpcReady ’Enable service request routine again
RETURN
REM ***********************************************************************