R&S ESU
Brief Introduction to Remote Control
Basic Steps in Programming using the VISA Interface
7.4
Quick Start Guide 1302.6163.62 - 04
Accessing the functions of the VISA32.DLL
To enable users to create Visual Basic control applications, the file dynamic link library
VISA32.DLL has to be added to the project using the
References
command in the
Project
menu. In addition, the file VISA32.BAS is being added to the project. This file contains
constants and definitions for error handling, time-out values, etc.
Declaring the DLL functions as procedures
All functions return a status variable that is defined as
Long
. Thus, all functions are declared
in the file VISA32.BAS as follows:
Declare Function xxx Lib "visa32.dll" ( ... ) As Long
Creating a response buffer
Since the DLL returns zero-terminated strings in responses, a string of sufficient length must
be created before the
viRead()
function is called, because Visual Basic inserts a length
specification in front of the strings and this specification is not updated by the DLL. The
following two means of creating the length specification for a string are provided:
Dim Rd as String * 100
Dim Rd as String
Rd = Space$(100)
7.1.2 Initialization and Default State
At the beginning of each program, the VISA resource manager has to be initialized. It opens
a connection to the VISA driver itself, which controls the interaction with all instruments.
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 handlers used by the VISA layer.
For all example programs shown below, the file must contain the following instructions:
Global analyzer As ViSession
Global defaultRM As ViSession
Const analyzerString = "GPIB0::20::INSTR"
Const analyzerTimeout = 10000
The constant analyzerString, specifies the instrument. "GPIB0" specifies the control, whereas
"20" specifies a certain instrument connected to the controller. Assuming the instrument was
connected via a LAN cable and assigned the IP address 192.168.1.1, the corresponding string
would read as:
Const analyzerString = "TCPIP::192.168.1.1::INSTR"
Содержание esu
Страница 1: ...R S ESU EMI Test Receiver Quick Start Guide Quick Start Guide Test Measurement 1302 6163 62 04 ...
Страница 26: ...R S ESU Contents 6 Quick Start Guide 1302 6163 62 04 ...
Страница 28: ......
Страница 32: ...R S ESU 0 4 Quick Start Guide 1302 6163 62 04 ...
Страница 88: ...R S ESU Preparing for Use Operating System Properties 2 38 Quick Start Guide 1302 6163 62 04 ...
Страница 104: ...R S ESU Basic Operation Setting Parameters 4 12 Quick Start Guide 1302 6163 62 04 ...
Страница 175: ...Quick Start Guide 1302 6163 62 04 6 33 R S ESU LAN Interface Manual Operation of the R S ESU with XP Remote Desktop ...
Страница 178: ...R S ESU LAN Interface Manual Operation of the R S ESU with XP Remote Desktop 6 36 Quick Start Guide 1302 6163 62 04 ...
Страница 201: ...Quick Start Guide 1302 6163 62 04 R S ESU Appendix Appendix ...
Страница 202: ...Quick Start Guide 1302 6163 62 04 R S ESU Appendix ...