Rohde & Schwarz SM300, UP350, FS315, AM300, UP300 Programming Manual

...
Products: Rohde&Schwarz Smart Instruments™ Family300 (SM300, FS300, FS315, AM300, UP300/350)
Rohde&Schwarz
Smart Instruments™ Family300
Basic Programming Guide
Introduction to the fundamentals of programming the R&S Smart Instruments™ Family 300 in different
development environments.
W.Blanz 06/2007 – 1MA73_07E
Table of Contents
R&S Smart Instruments™ Family300 Basic Programming Guide
1 Introduction ............................................................................................. 3
2 Basic Details about Smart Instruments™ ............................................... 3
3 Installing Instrument Drivers ................................................................... 4
4 Instrument Drivers................................................................................... 6
5 Integrating Drivers into a Project............................................................. 6
6 Using "FS300 Basic Measurement" for the First Time ......................... 15
7 "Resource String" and "Virtual Instrument Name" ................................ 17
8 Where to Find Help on the Driver Functions......................................... 19
9 Which Data Type to Use ....................................................................... 19
10 References............................................................................................ 21
11 Appendix: Contact our hotline............................................................... 22
12 Keywords .............................................................................................. 23
1MA73 2 Rohde & Schwarz
R&S Smart Instruments™ Family300 Basic Programming Guide
1 Introduction
Rohde&Schwarz provides instrument drivers available for all Smart Instruments™. These drivers allow you to access instruments from various programming environments under Microsoft Windows XP/2000. The "Smart Instruments™ Programming Guide" deals with programming the Smart Instruments™ Family300 utilising these drivers from within different programming languages (C/C++, Visual Basic, LabView, LabWindows/CVI). Use of this facility requires some basic prior knowledge of programming in the individual languages.
2 Basic Details about Smart Instruments™
The Smart Instruments™ Family300 is operated by remote control via the USB host port. This means that the operating system used for remote control purposes must provide in-house USB support. The drivers described below support the Microsoft Windows XP and Microsoft Windows 2000 operating systems.
Each Family300 instrument consists of two USB instruments, namely a measurement and/or generator module, and the system controller associated with the instrument platform in the power supply. A dedicated USB driver has to be installed in Windows for each of these USB instruments. Windows either asks you to install the appropriate device driver or continues automatically if a driver has already been installed for these instruments. The USB drivers are automatically installed in the Windows system when the instrument driver is installed (see 3 Installing Instrument Drivers).
Figure 1: Configuration for Smart Instruments™ (SM300)
1MA73 3 Rohde & Schwarz
R&S Smart Instruments™ Family300 Basic Programming Guide
3 Installing Instrument Drivers
The instrument drivers can be obtained from the Rohde&Schwarz web site (http://www.rohde-schwarz.de/drivers/overview.html latest versions of the instrument drivers together with examples and installations notes.
The following should be noted when installing and using the drivers: if a VISA library has been installed on your PC, the instrument drivers are embedded in its directory structure (e.g. C:\VXIPNP). If this is not the case, the path to be used must be specified on installation and must also be set in the development environments. The following document assumes that a VISA library has been installed; this is a component of all National Instruments development environments (e.g. LabWindows/CVI and LabView) and of Agilent VEE.
The Rohde&Schwarz web site offers you a choice of three different drivers for each instrument, but only two of the installation packages contain the complete drivers for control.
VXI Plug&Play Instrument Driver:
). The site contains the
This driver package installs the basic driver together with all the necessary DLLs, LIBs and Include files, plus the Windows USB drivers, for operating the instrument concerned by remote control.
LabView:
The driver package is configured in the same way as the VXIplug&play instrument driver package, but in this case libraries for use within National Instruments LabView are also included (see VXIplug&play Instrument Driver).
LabWindows/CVI:
In contrast to the two packages mentioned above, this driver package contains only the LabWindows/CVI function panel (fp) file, the C sources, a ReadMe file and the Help files. However, to be able to use the instrument driver, one of the two packages mentioned above must be installed first.
1MA73 4 Rohde & Schwarz
R&S Smart Instruments™ Family300 Basic Programming Guide
Directory structure:
After the instrument drivers are installed directory structures can differ, depending whether or not the VISA library is installed on your PC.
With VISA
In an installation with the VISA library you find the same directories and files in the sub-directory "WinNT" as you would find when VISA is not installed.
The following list of directories and files refers to the FS300 spectrum analyzer.
Directory
\bin Instrument driver DLL (e.g. rssifs_32.dll)
\lib Library files (e.g. rssifs.lib)
Without VISA (standard installation directory)
Contents
\bc (Borland C)
\msc (Microfsoft C)
\include Header files
- rssitype.h (type declarations for the Smart Instruments™ for C)
- SiControl.h (type declarations for the basic driver for C (internal to the driver))
- rssifs.h (FS300 type and function declarations for C)
- rssifs.bas (FS300 type and function declarations for Visual Basic)
\Kbase Empty by default
\rssifs (in this case for the FS300)
- license.pdf (license notices)
- readme.txt (release notes)
- rssifs.c (instrument driver sources)
- rssifs.chm (HTML based Help)
- rssifs.def (export description)
- rssifs.fp (LabWindows/CVI front panel file)
- RSSIFS.HLP (Windows Help)
1MA73 5 Rohde & Schwarz
R&S Smart Instruments™ Family300 Basic Programming Guide
4 Instrument Drivers
The Smart Instruments™ Family300 has instrument drivers which can be used within Windows in all programming languages that can access DLLs. The instrument drivers consist of different DLLs which carry out various control tasks. The USB driver rssifs.sys serves as an interface for Windows USB driver support. The SiControl DLL enables instrument-specific driver components to access measurement modules with the aid of a common interface. The instrument driver DLLs rssixx_32.dll (where xx stands for the particular instrument, e.g. rssifs_32.dll for the FS300 spectrum analyzer) provide the programmer with instrument-specific functions. The following sections cover these in particular.
- UnInst.isu (uninstall information)
\GWinNT LabView files
- rssifs.chm (HTML based Help)
- rssifs_xx.mnu (several LabView menu files)
- rssifs.llb (LabView library)
5 Integrating Drivers into a Project
The following section describes how to use instrument drivers in different programming environments within Windows using an FS300 spectrum analyzer as an example. Since development environments change in the course of time, the integration sequence may also change with the advent of a new version. The programming environment version is therefore specified at the beginning of each section.
Visual C/C++
The following process refers to Microsoft Visual C++ 6.0.
To use the instrument driver in a Visual C++ project, you can proceed in either of two ways:
o Use the LIB file as the interface for the DLL
o Import the DLL with the aid of LoadLibrary in runtime
The functions of the instrument driver are available to be called in either method.
Using the LIB file
To use the LIB file as the interface for the DLL, the file must be integrated into the project. Do this by following the menu sequence Project->Project
1MA73 6 Rohde & Schwarz
R&S Smart Instruments™ Family300 Basic Programming Guide
Settings->Link "Object/Library Modules" and entering the desired LIB file, e.g. rssifs.lib for the FS300 spectrum analyzer.
Figure 2: Adding the LIB file to the current project
The compiler must be notified of the path so that it can find the LIB file.
You therefore need to add a new search path for LIB files by using the menu sequence Tools->Options..->Directory. As mentioned above (section 3 Installing Instrument Drivers) the search path to the files can vary according to the type of installation.
Figure 3: Adding the search path for LIB files
In order to declare the functions and data types of the instrument driver within your project, you must integrate the C header files into your project and define the Include path if this has not already been done. Do this by proceeding as described in the case of the LIB file, but in this case choose "Include files".
1MA73 7 Rohde & Schwarz
+ 16 hidden pages