How to use the RsSpecAn driver for RS®Spectrum Analyzers and

How to use the RsSpecAn
Driver for R&SВ®Spectrum
Analyzers and R&SВ®ESL EMI
Test Receiver
Driver Documentation
Products:
|
R&SВ®FSV
|
R&SВ®FSG
|
R&SВ®FSP
|
R&SВ®FSL
|
R&SВ®FSU
|
R&SВ®ESL
|
R&SВ®FSQ
|
R&SВ®FSH4/8
|
R&SВ®FSU
|
R&SВ®FSUP
Juergen Straub
July 14, 2009
Driver Documentation
How to use the LabVIEW,
LabWindows/CVI and VXIplug&play
drivers for VEE, C++, C#, Visual Basic,
Visual Basic .NET etc.
Table of Contents
Table of Contents
1 LabVIEW .............................................................................................. 3
1.1
Getting Started .............................................................................................................3
1.2
LabVIEW Settings ........................................................................................................3
1.2.1
LabVIEW 8.x .................................................................................................................4
1.2.2
LabVIEW 7 ....................................................................................................................4
1.3
Additional Help.............................................................................................................5
1.4
LabVIEW 7.1 driver ......................................................................................................5
1.5
LabVIEW 8.x .................................................................................................................5
1.6
How to use Attributes in LabVIEW?...........................................................................5
1.6.1
Repeated Capabilities .................................................................................................8
2 LabWindows/CVI............................................................................... 10
2.1
Getting Started ...........................................................................................................10
2.2
LabWindows/CVI Version .........................................................................................10
2.3
Additional Help...........................................................................................................10
2.4
How to use Attributes in LabWindows/CVI?...........................................................11
2.4.1
Repeated Capabilities ...............................................................................................13
3 VXIplug&play Instrument Driver for VEE, C++, C#, Visual Basic,
Visual Basic .NET etc. ...................................................................... 14
3.1
Getting Started ...........................................................................................................14
3.1.1
C# ................................................................................................................................14
3.1.2
Visual Basic.NET .......................................................................................................15
3.1.3
Agilent VEE Version ..................................................................................................15
3.2
Additional Help...........................................................................................................16
4 Remote control via LAN ................................................................... 17
Rohde & Schwarz How to use the RsSpecAn Driver for R&SВ®Spectrum Analyzers and R&SВ®ESL EMI Test Receiver 2
LabVIEW
Getting Started
1 LabVIEW
1.1 Getting Started
The LabVIEW drivers and examples can be downloaded from the Rohde & Schwarz
download area of the website:
http://www2.rohde-schwarz.com/en/service_and_support/Downloads/Drivers/
In order to use this driver as a LabVIEW instrument driver please copy the contents of
ZIP archive rsspecan_lv<Version>_<Revision>.zip into your LabVIEW directory
(C:\Program Files\National Instruments\LabVIEW<Version>\). After restarting your
LabVIEW development environment the driver will then be directly accessible from the
Instrument Driver function palette menu.
Figure 1: Path to LabVIEW instrument driver in the function palette of the Block Diagram
1.2 LabVIEW Settings
For optimal usage please turn off "Synchronize with directory" feature on Instrument
Drivers palette before installing any Rohde & Schwarz LabVIEW driver. If this feature is
turned on, it overwrites driver’s palette files with its own.
Rohde & Schwarz How to use the RsSpecAn Driver for R&SВ®Spectrum Analyzers and R&SВ®ESL EMI Test Receiver 3
LabVIEW
LabVIEW Settings
1.2.1 LabVIEW 8.x
Turn off "Synchronize with directory" feature:
Tools => Advanced => Edit palette set. Then find "Instrument I/O" palette
Right click on it and clear checkbox besides Synchronize with directory in context
menu and save the changes.
Figure 2: Turn off “Synchronize with directory” feature in LabView 8.x
1.2.2 LabVIEW 7
Turn off "Synchronize with directory" feature:
Tools => Advanced => Edit palette views. Then find "Instrument I/O" palette =>
Instr Drivers
Right click on it and clear checkbox besides Synchronize with directory in context
menu. Save the changes.
Figure 3: Turn off “Synchronize with directory” feature in LabView 7.x
Rohde & Schwarz How to use the RsSpecAn Driver for R&SВ®Spectrum Analyzers and R&SВ®ESL EMI Test Receiver 4
LabVIEW
Additional Help
1.3 Additional Help
In addition the instrument driver documentation is included in compressed the HTML
format (Windows CHM help file) and stored together with the LabVIEW driver sources.
Each VIs help is linked to the section in the help file that describes all the features of
the VI.
An additional help topic can be accessed directly by pressing "Click here for more
help" in the Context Help of LabVIEW.
1.4 LabVIEW 7.1 driver
Please use the LabVIEW 7 driver.
1.5 LabVIEW 8.x
Please use the LabVIEW 8 driver.
1.6 How to use Attributes in LabVIEW?
The new generation of Rohde & Schwarz' attribute-based instrument drivers gives
great flexibility and ease of use by combining low-level access to nearly every SCPI
command via attribute and well balanced high level functions and VIs, combining
several attributes. For those who don't want to learn new attribute concept, complete
functionality of instrument is covered by high level commands. In other words, you may
use attributes, but you don't have to. Of course it is possible to combine both low level
attributes and high level functions together exactly according to needs of every specific
application.
The following chapter shows how to use attributes in the RsSpecAn driver. This is only
necessary in rare cases, for instance if the driver is not supporting the functionality via
high level API.
Example: How to set the Frequency Start value by attributes
To select an attribute use the provided Express VI, included in instrument driver
package. This instrument driver Express VI can be found in:
User Libraries => Express User Libraries => rsspecan
Rohde & Schwarz How to use the RsSpecAn Driver for R&SВ®Spectrum Analyzers and R&SВ®ESL EMI Test Receiver 5
LabVIEW
How to use Attributes in LabVIEW?
Figure 4: Palette Menu of RsSpecAn driver
Drag and drop the rsspecan Attribute in your block diagram. After placing the express
VI the front panel of the Express VI will be opened (see Figure below)
Figure 5: Front panel of rsspecan_core_attribute_express Source.vi
Now you can select the desired attribute from tree structured list. Each attribute can
have different access type (read only, write only or read/write). Proper read/write
operation can be selected by "Attribute Operation" in the bottom left corner.
Repeated capabilities are set by using a string control at the bottom of the panel called
"Repeated Capabilities". The attribute value is entered using standard LabVIEW
controls for each data type (numeric, boolean, string or ring).
Rohde & Schwarz How to use the RsSpecAn Driver for R&SВ®Spectrum Analyzers and R&SВ®ESL EMI Test Receiver 6
LabVIEW
How to use Attributes in LabVIEW?
For example use in Basic operation "Set Frequency Start" value:
Figure 6: Configure "Set Frequency Start" example
1. Select the desired attribute. To find the designated attribute easily the
rsspecan.chm help file can be used to look for it. Be aware of the fact that the tree
structures in the help file and the Express VI are the same
2. Leave "Repeated Capabilities" empty
3. Type the desired frequency value in the text box "Value"
4. After clicking the "OK" button, a new instance attributed based VI is generated.
The name of the VI, predefined values and the help is also adapted.
The result is shown in following figure.
Rohde & Schwarz How to use the RsSpecAn Driver for R&SВ®Spectrum Analyzers and R&SВ®ESL EMI Test Receiver 7
LabVIEW
How to use Attributes in LabVIEW?
Figure 7: Instanced attribute based VI "Set Frequency Start"
The attribute and its features can be changed any time later by double clicking the VI,
which recalls Express VIs front panel.
1.6.1 Repeated Capabilities
Many instruments have capabilities which are duplicated. For example, an oscilloscope
might have several channels with identical functionality or a power supply may have
several outputs. For this reason repeated capabilities are introduced.
Repeated capability instances are specified by a string parameter for each property. It
also can be specified by a function which selects the active instance.
To define the usage of particular capability fill the text box "Repeated Capability" in the
front panel of the Express VI with the proper value. To use more than one repeated
capability in one attribute separate them with a comma.
See a marker example using repeated capabilities pictured in the following figure:
Rohde & Schwarz How to use the RsSpecAn Driver for R&SВ®Spectrum Analyzers and R&SВ®ESL EMI Test Receiver 8
LabVIEW
How to use Attributes in LabVIEW?
Figure 8: Example for "Repeated Capabilities"
Rohde & Schwarz How to use the RsSpecAn Driver for R&SВ®Spectrum Analyzers and R&SВ®ESL EMI Test Receiver 9
LabWindows/CVI
Getting Started
2 LabWindows/CVI
2.1 Getting Started
The LabWindows/CVI drivers and examples can be downloaded from the Rohde &
Schwarz download area of the website:
http://www2.rohde-schwarz.com/en/service_and_support/Downloads/Drivers/
In order to be able to compile an application it is required to add following files to your
LabWindows/CVI project:
в—Џ rsspecan.c
в—Џ rsspecan.h
в—Џ rsspecan.fp
в—Џ rsspecan_attributes.c
в—Џ rsspecan_attributes.h
в—Џ rsspecan_callbacks.c
в—Џ rsspecan_utility.h
в—Џ rsspecan_utility.c
в—Џ rsidr_core.c
в—Џ rsidr_core.h
To be able to use feature of a specific personality, as well the corresponding source
code is needed to add to the LabWindows/CVI project (e.g. rsspecan_<Personality>.c).
2.2 LabWindows/CVI Version
Use National Instruments LabWindows/CVI 6 or later.
2.3 Additional Help
The LabWindows/CVI instrument driver consists of a ZIP archive containing the driver
sources. In addition the instrument driver documentation is also included in
compressed HTML format (Windows CHM help file) and stored together with the driver
sources.
Rohde & Schwarz How to use the RsSpecAn Driver for R&SВ®Spectrum Analyzers and R&SВ®ESL EMI Test Receiver 10
LabWindows/CVI
How to use Attributes in LabWindows/CVI?
2.4 How to use Attributes in LabWindows/CVI?
The new generation of Rohde & Schwarz' attribute-based instrument drivers gives
great flexibility and ease of use by combining low-level access to nearly every SCPI
command via attribute and well balanced high level functions and VIs, combining
several attributes. For those who don't want to learn new attribute concept, complete
functionality of instrument is covered by high level commands. In other words, you may
use attributes, but you don't have to. Of course it is possible to combine both low level
attributes and high level functions together exactly according to needs of every specific
application.
The following chapter shows how to use attributes in the RsSpecAn driver. This is only
necessary in rare cases, for instance if the driver is not supporting the functionality via
high level API.
Note: The rsspecan.sub file has to be added to the project. This is mandatory for
browsing attributes.
Example: How to set the Frequency Start value by attributes
To select an attribute use the provided function panels, included in instrument driver
package. This instrument driver function panels can be found in:
Instruments=>R&S SpecAn=>Configuration=>Set/Get/Check Attribute/Repeated
Capabilities
Figure 9: Function panel for RsSpecAn driver attributes
To open the function panel double click on the desired function. In the figure below the
function panel of "rsspecan_SetAttributeViReal64" is pictured. By clicking on text box
"'Attribute ID" the "Select Attribute Constant" window will be opened.
Rohde & Schwarz How to use the RsSpecAn Driver for R&SВ®Spectrum Analyzers and R&SВ®ESL EMI Test Receiver 11
LabWindows/CVI
How to use Attributes in LabWindows/CVI?
Now you can select the desired attribute from tree structured list. Each attribute can
have different access type (read only, write only or read/write). Proper read/write
operation can be selected by selection the proper function panel, either Set Attribute,
Get Attribute, or Check Attribute.
Repeated capabilities are set by using identifier or identifier names within the function
panel called rsspecan_GetAttributeRepeatedCapabilityId[s|Names].
For example use in Basic operation "Set Frequency Start" value:
Figure 10: How to select a attribute in the "SetAttributeViReal64" function panel
1. Select the desired attribute. To find the designated attribute easily the
rsspecan.chm help file can be used to look for it. Be aware of the fact that the tree
structures in the help file and the Express VI are the same
2. Leave "Repeated Capabilities" string empty
3. Type the desired frequency value in the text box "Attribute Value", e.g. "1e+9"
4. Enter a valid instrument handle in the text box "Instrument Handle"
5. Optional you also can catch the return value of your function, if you type the name
of a declared integer variable in the text box "Status"
6. To include the function into your source code, you can copy the created function
string out of the window on the button of the function panel and insert it into the
source code.
Rohde & Schwarz How to use the RsSpecAn Driver for R&SВ®Spectrum Analyzers and R&SВ®ESL EMI Test Receiver 12
LabWindows/CVI
How to use Attributes in LabWindows/CVI?
The result is shown in following figure.
Figure 11: Build function string on the button of the "rsspecan_SetAttributeViReal64" function
panel
The attribute and its features can be changed any time later by double right clicking the
function and recall the function panel. See picture below:
Figure 12: Recalling the function panel to modify the attributes
2.4.1 Repeated Capabilities
Many instruments have capabilities which are duplicated. For example, an oscilloscope
might have several channels with identical functionality or a power supply may have
several outputs. For this reason repeated capabilities are introduced.
Repeated capability instances are specified by a string parameter for each property.
To define the usage of particular capability fill the text box "Repeated Capability Id" in
the front panel with the proper value. To use more than one repeated capability in one
attribute separate them with a comma.
See a marker example using repeated capabilities pictured in the following figure:
Figure 13: Example for "Repeated Capabilities" in LabWindows/CVI
Rohde & Schwarz How to use the RsSpecAn Driver for R&SВ®Spectrum Analyzers and R&SВ®ESL EMI Test Receiver 13
VXIplug&play Instrument Driver for VEE, C++, C#, Visual Basic, Visual Basic .NET etc.
Getting Started
3 VXIplug&play Instrument Driver for VEE,
C++, C#, Visual Basic, Visual Basic .NET
etc.
3.1 Getting Started
The VXIplug&play instrument driver and examples can be downloaded from the Rohde
& Schwarz download area of the website:
http://www2.rohde-schwarz.com/en/service_and_support/Downloads/Drivers/
3.1.1 C#
A wrapper is necessary to enable a direct access to the driver DLL. The rsspecan.cs
wrapper for C# is automatically installed in the ~VXIPnP\WinNT\include directory.
How to create a new Project in Microsoft Visual Studio 2005:
Create a new Project, e.g. File -> New -> Project
Figure 14: Create a new project in Visual Studio 2005
Select your Programming Language and your Template, e.g. Visual C# Windows
Application, or Console Application
Rohde & Schwarz How to use the RsSpecAn Driver for R&SВ®Spectrum Analyzers and R&SВ®ESL EMI Test Receiver 14
VXIplug&play Instrument Driver for VEE, C++, C#, Visual Basic, Visual Basic .NET etc.
Getting Started
Figure 15: Select your desired templaFigure 16:
te type
To access the R&S RsSpecAn driver it is necessary to include the VXIpnp wrapper for
C#, e.g. Project->Add Existing Item… ~VXIpnp\WinNT\include\rsspecan.cs
For accessing the RsSpecAn driver functionality the driver has to be included to the
current project with "using InstrumentDrivers". The result is shown in the picture below:
Figure 17: Include the RsSpecAn driver to your current project.
Now the development environment is configured in a proper way. For getting started
please have a look at the provided examples at your instruments VXIPnP driver
download site at:
http://www2.rohde-schwarz.com/en/service_and_support/Downloads/Drivers/.
3.1.2 Visual Basic.NET
A wrapper is necessary to enable a direct access to the driver DLL. The rsspecan.vb
wrapper for .NET is automatically installed in the ~VXIpnp\WinNT\include directory.
3.1.3 Agilent VEE Version
Please use Agilent VEE Version 6 or later. Please note that the browsing for attributes
is not possible in Agilent VEE due to a bug in Agilent VEE.
Rohde & Schwarz How to use the RsSpecAn Driver for R&SВ®Spectrum Analyzers and R&SВ®ESL EMI Test Receiver 15
VXIplug&play Instrument Driver for VEE, C++, C#, Visual Basic, Visual Basic .NET etc.
Additional Help
3.2 Additional Help
In addition the instrument driver documentation is also included in compressed HTML
format (Windows CHM help file) and stored together with the driver sources in the
~VXIpnp\WinNT\rsspecan directory.
For more information regarding the VXIplug&play instrument drivers, please read the
readme.txt file that comes with each driver.
Rohde & Schwarz How to use the RsSpecAn Driver for R&SВ®Spectrum Analyzers and R&SВ®ESL EMI Test Receiver 16
Remote control via LAN
Additional Help
4 Remote control via LAN
The Rohde & Schwarz instruments are preconfigured for networks using DHCP
(dynamic host configuration protocol). In these networks, the IP address is assigned
automatically and the instruments are identified via an unambiguous computer name in
the network.
For more Information please see the instrument specific "Compressed Online Help".
Download it from:
в—Џ R&SВ®FSV: http://www.rohde-schwarz.com/product/fsv/downloads_help.html
в—Џ R&SВ®FSP: http://www.rohde-schwarz.com/product/fsp/downloads_help.html
в—Џ R&SВ®FSQ: http://www.rohde-schwarz.com/product/fsq/downloads_help.html
в—Џ R&SВ®FSU: http://www.rohde-schwarz.com/product/fsu/downloads_help.html
в—Џ R&SВ®FSG: http://www.rohde-schwarz.com/product/fsg/downloads_help.html
в—Џ R&SВ®FMU: http://www.rohde-schwarz.com/product/fmu36/downloads_help.html
в—Џ R&SВ®FSL: http://www.rohde-schwarz.com/product/fsl/downloads_help.html
в—Џ R&SВ®ESL: http://www.rohde-schwarz.com/product/esl/downloads_help.html
The RSCommander software to helps you to easily discover your instrument IP
address or instrument resource name. This tool is available on the R&S website.
Using the Instrument Name as Resource Name:
By default the instrument name is composed of rs<Device><Serial number> (on the
rear panel of the instrument).
Example:
в—Џ Serial Number = 123456
в—Џ Instrument = RSESL6
в—Џ Resource Name = TCPIP::RSESL612345::INSTR
Using the IP Address as Resource Name:
Example:
в—Џ IP Address = 192.168.1.33
в—Џ Resource Name = TCPIP::192.168.1.33::INSTR
Rohde & Schwarz How to use the RsSpecAn Driver for R&SВ®Spectrum Analyzers and R&SВ®ESL EMI Test Receiver 17
About Rohde & Schwarz
Rohde & Schwarz is an independent group
of companies specializing in electronics. It is
a leading supplier of solutions in the fields of
test and measurement, broadcasting,
radiomonitoring and radiolocation, as well as
secure communications. Established 75
years ago, Rohde & Schwarz has a global
presence and a dedicated service network
in over 70 countries. Company headquarters
are in Munich, Germany.
Regional contact
Europe, Africa, Middle East
+49 1805 12 42 42* or +49 89 4129 137 74
[email protected]
North America
1-888-TEST-RSA (1-888-837-8772)
[email protected]
Latin America
+1-410-910-7988
[email protected]
Asia/Pacific
+65 65 13 04 88
[email protected]
Rohde & Schwarz GmbH & Co. KG
MГјhldorfstraГџe 15 | D - 81671 MГјnchen
Phone + 49 89 4129 - 0 | Fax + 49 89 4129 – 13777
www.rohde-schwarz.com