Operating instructions

R&S ESCI Basic Steps of IEC/IEEE-Bus Programming
1166.6004.12 7.1 E-1
7 Remote Control - Programming Examples
The following programming examples have a hierarchical structure, i.e. subsequent examples are
based on previous ones. It is thus possible to compile very easily an operational program from the
modules of the given examples.
Basic Steps of IEC/IEEE-Bus Programming
The examples explain the programming of the instrument and can serve as a basis to solve more
complex programming tasks.
VISUAL BASIC has been used as programming language. However, the programs can be translated
into other languages.
Including IEC-Bus Library for VisualBasic
Programming hints:
Output of texts using the "Print" function
The following programming examples are based on the assumption that all subroutines are part of a
form (file extension: .FRM). In this case the syntax
Print "Text"
is allowed.
If however the subroutines are stored as a so-called module (file extension: .BAS), the print
instruction should be preceded by the name of a form which has the required print method. If, for
example, there is a form with the name "Main", the associated print instruction is as follows:
Main.Print "Text".
Access to functions of GPIB.DLL
To create Visual Basic control applications, the file GPIB.BAS (as from VB 6.0 VBIB-32.BAS) is
added to a project so that the functions of the RSIB.DLL can be called. In addition, the file
NIGLOBAL.BAS is added to the project. This file contains constants and definitions for the
processing of errors, timeout values, etc.
Declaration of DLL functions as procedures
Since the functions all return an integer value, the functions in the file GPIB.BAS are all declared as
follows:
Declare Function xxx Lib "gpib.dll" ( ... ) As Integer
The function value with the status variables ibsta should be allocated a variable when it is called
up. Since this value is also returned via a reference parameter of the functions, the functions can be
declared as procedures as follows:
Declare Sub xxx Lib "rsib.dll" ( ... )