![Rohde & Schwarz 1307.9002K03 Quick Start Manual Download Page 157](http://html1.mh-extra.com/html/rohde-and-schwarz/1307-9002k03/1307-9002k03_quick-start-manual_1477765157.webp)
Controlling the R&S
FSVA/FSV Remotely
R&S
®
FSVA/FSV
142
Quick Start Guide 1321.3066.02 ─ 06
ErrorMessage = ""
If (status < 0) Then
'Query the error message from VISA
If (viStatusDesc(vi, status, ErrorMessage) = VI_SUCCESS) Then
Err.Description = ErrorMessage
End If
Err.Raise (status)
End If
End Sub
8.3.1.2
Initialization and Default State
At the start of each program, the global variables used by all subroutines must be
created. The remote control and the instrument settings will then be changed to a
defined default state. The two subroutines InitController and InitDevice are used
for this.
Creating Global Variables
In Visual Basic, global variables are stored in modules (data extension
.BAS
).
Thus, at least one module (e.g.
GLOBALS.BAS
) must be created that contains the
variables used by all subroutines, e.g. the variables for device addresses used by
the remote control driver.
For all example programs shown below, the file must contain the following
instructions:
Global analyzer As Long
Global defaultRM As Long
Initializing the Remote Control Session
REM ------------ Initializing the remote control session -------------------
Public SUB Initialize()
Dim status As Long
'CALL viOpenDefaultRM to get the resource manager handle
'Store this handle in defaultRM. The function viStatusDesc
'returns a text description of the status code returned by viOpenDefaultRM
status = viOpenDefaultRM(defaultRM)
status = viStatusDesc(defaultRM, status, Response)
'Open the connection to the device and store the handle
'Note: The timeout value in viOpen() applies only for opening the interface
'For setting the communication timeout, set the VI_ATTR_TMO_VALUE attribute
'timeout values are in milliseconds
'This example assumes the instrument IP address 10.0.0.10
Brief Introduction to Remote Control