®
R&S
FSVR
REM command INIT:CONT OFF has already been sent. The next command
REM must not be carried out until a full sweep has been completed.
CALL InstrWrite(analyzer, "INIT:CONT OFF")
REM --------- First method: Using *WAI ------------------------------------
CALL InstrWrite(analyzer, "ABOR;INIT:IMM; *WAI")
REM --------- Second method: Using *OPC? ----------------------------------
OpcOk$ = SPACE$(2)
CALL InstrWrite(analyzer, "ABOR;INIT:IMM; *OPC?")
REM --------- In this case, the controller can use other instruments ------
CALL InstrRead(analyzer, OpcOk$, 2, retCount)
'Wait for "1" from *OPC?
REM --------- Third method: Using *OPC ------------------------------------
REM In order for the Service Request function to be used with a GPIB
REM driver from National Instruments, the setting "Disable
REM Auto Serial Poll" must be set to "yes" with IBCONF!
CALL InstrWrite(analyzer, "*SRE 32")
CALL InstrWrite(analyzer, "*ESE 1")
'complete bit
CALL viEnableEvent(vi, VI_EVENT_SERVICE_REQ, VI_QUEUE, 0)
'Enable the event for service request
CALL InstrWrite(analyzer, "ABOR;INIT:IMM; *OPC")
'Start sweep with Synchronization to OPC
SRQWaitTimeout = 5000
'Now wait for the service request
CALL viWaitOnEvent(vi, VI_EVENT_SERVICE_REQ, SRQWaitTimeout, _
eventType, eventVi)
CALL viClose(eventVi)
CALL viDisableEvent(vi, VI_EVENT_SERVICE_REQ, VI_QUEUE)
'Disable subsequent events
REM Resume main program here.
END SUB
REM ************************************************************************
7.1.7.1
Lecture de la file d'attente de sortie
REM --------- Subroutine for the individual STB bits -----------------------
Public SUB Outputqueue()
Dim retCount as Long
result$ = SPACE$(100)
CALL InstrRead(analyzer, result$, 100, retCount)
Debug.Print "Contents of Output Queue : "; result$
END SUB
REM ************************************************************************
Guide de démarrage rapide 1311.0670.63 ─ 03
Brève introduction à la commande à distance
Étapes de base de la programmation en commande à distance
'Provide space for *OPC? response
'Allow 5s for sweep completion
'Close the context before continuing
'Reading the output queue
'Create space for response
'Enable Service Request for ESR
'Set event enable bit for operation
153