1484
Keysight InfiniiVision M9241/42/43A PXIe Oscilloscopes SCPI Programmer's Guide
40
Programming Examples
SCPI.NET Examples
These programming examples show how to use the SCPI.NET drivers that come
with Keysight's free Command Expert software.
While you can write code manually using SCPI.NET drivers (as described in this
section), you can also use the Command Expert software to:
• Connect to instruments and control them interactively using SCPI command
sets.
• Quickly prototype and test command sequences.
• Generate C#, VB.NET, or C/C++ code for command sequences.
• Find, download, and install SCPI command sets.
• Browse command trees, search for commands, and view command
descriptions.
The Command Expert suite also comes with Add-ons for easy instrument control
and measurement data retrieval in NI LabVIEW, Microsoft Excel, Keysight VEE, and
Keysight SystemVue.
For more information on Keysight Command Expert, and to download the
software, see:
http://www.keysight.com/find/commandexpert
•
•
"SCPI.NET Example in Visual Basic .NET"
•
"SCPI.NET Example in IronPython"
SCPI.NET Example in C#
To compile and run this example in Microsoft Visual Studio 2008:
1
Install the Keysight Command Expert software and the command set for the
oscilloscope.
2
Open Visual Studio.
3
Create a new Visual C#, Windows, Console Application project.
4
Cut-and-paste the code that follows into the C# source file.
5
Edit the program to use the address of your oscilloscope.
6
Add a reference to the SCPI.NET driver:
a
Right-click the project you wish to modify (not the solution) in the Solution
Explorer window of the Microsoft Visual Studio environment.
b
Choose
Add Reference...
.
c
In the Add Reference dialog, select the
Browse
tab, and navigate to the
ScpiNetDrivers folder.