Operating instructions

Basic Steps of IEC/IEEE-Bus Programming R&S ESCI
1166.6004.12 7.6 E-1
Command Synchronization
The possibilities for synchronization implemented in the following example are described in Chapter 5,
Section "Command Order and Command Synchronization".
REM -------- Examples of command synchronization --------------------------
PUBLIC SUB SweepSync()
REM The command INITiate[:IMMediate] starts a single sweep if the command
REM INIT:CONT OFF was previously sent. It has to be ensured that the next
REM command is only executed when the entire sweep is complete.
CALL IBWRT(receiver%, "INIT:CONT OFF")
REM -------- First possibility: Use of *WAI ------------------------------
CALL IBWRT(receiver%, "ABOR;INIT:IMM; *WAI")
REM -------- Second possibility: Use of *OPC? ----------------------------
OpcOk$ = SPACE$(2) 'Space for *OPC? - Provide response
CALL IBWRT(receiver%, "ABOR;INIT:IMM; *OPC?")
REM -------- The controller can operate other instruments -------------
CALL IBRD(receiver%, OpcOk$) 'Wait for "1" from *OPC?
REM -------- Third possibility: Use of *OPC -----------------------------
REM In order to be able to use the service request function in conjunction
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(receiver%, "*SRE 32") 'Permit service request for ESR
CALL IBWRT(receiver%, "*ESE 1") 'Set event enable bit for
'operation complete bit
CALL IBWRT(receiver%, "ABOR;INIT:IMM; *OPC") 'Start sweep and
'synchronize to OPC
CALL WaitSRQ(boardID%,result%) 'Wait for service request
REM Continue main program.
END SUB
REM ***********************************************************************