
Brief Introduction to Remote Control
R&S
®
FSVA/FSV
150
Quick Start Guide 1321.3066.02 ─ 05
MKmark$ = SPACE$(30) 'Provide text variable (30 characters)
CALL InstrWrite(analyzer, "CALC:MARK:X?;Y?")
'Query frequency and level
CALL InstrRead(analyzer, MKmark$, 30, retCount)
'Read value
REM --------- Displaying values in the Immediate window -------------------
Debug.Print "Marker frequency/level "; MKmark$,
END SUB
REM ************************************************************************
7.1.7
Command Synchronization
The synchronization methods used in the following example are described in the
Operating Manual on CD, chapter "Remote Control - Basics", section "Command
Sequence and Command Synchronization".
REM --------- Commands for command synchronization ------------------------
PUBLIC SUB SweepSync()
Dim retCount as Long
Dim SRQWaitTimeout As Long
Dim eventType As Long
Dim eventVi As Long
REM The command INITiate[:IMMediate] starts a single sweep if the
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) 'Provide space for *OPC? response
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") 'Enable Service Request for ESR
CALL InstrWrite(analyzer, "*ESE 1") 'Set event enable bit for operation
'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
Basic Steps in Remote Control Programming
Содержание R&S FSV
Страница 25: ......