Programming Examples
40
Keysight InfiniiVision M9241/42/43A PXIe Oscilloscopes SCPI Programmer's Guide
1485
•
Windows XP: C:\Documents and Settings\All Users\Keysight\Command
Expert\ScpiNetDrivers
•
Windows 7: C:\ProgramData\Keysight\Command Expert\ScpiNetDrivers
d
Select the .dll file for your oscilloscope, for example
AgInfiniiVision3000X_02_00.dll
; then, click
OK
.
7
Build and run the program.
For more information, see the SCPI.NET driver help that comes with Keysight
Command Expert.
/*
* Keysight SCPI.NET Example in C#
* -------------------------------------------------------------------
* This program illustrates a few commonly used programming
* features of your Keysight oscilloscope.
* -------------------------------------------------------------------
*/
using System;
using System.IO;
using System.Text;
using Keysight.CommandExpert.ScpiNet.AgInfiniiVision3000X_02_00;
namespace InfiniiVision
{
class ScpiNetInstrumentApp
{
private static AgInfiniiVision3000X myScope;
static void Main(string[] args)
{
try
{
string strScopeAddress;
strScopeAddress =
"TCPIP0::10.112.94.136::hislip9-0.0::INSTR";
Console.WriteLine("Connecting to oscilloscope...");
Console.WriteLine();
myScope = new AgInfiniiVision3000X(strScopeAddress);
myScope.Transport.DefaultTimeout.Set(10000);
// Initialize - start from a known state.
Initialize();
// Capture data.
Capture();
// Analyze the captured waveform.
Analyze();
Console.WriteLine("Press any key to exit");
Console.ReadKey();
}
catch (System.ApplicationException err)