![Rohde & Schwarz R&S FSV Quick Start Manual Download Page 169](http://html.mh-extra.com/html/rohde-and-schwarz/rands-fsv/rands-fsv_quick-start-manual_1477866169.webp)
Brief Introduction to Remote Control
R&S
®
FSVA/FSV
146
Quick Start Guide 1321.3066.02 ─ 05
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
7.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.
7.1.2.1
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
7.1.2.2
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
Basic Steps in Remote Control Programming
Summary of Contents for R&S FSV
Page 25: ......