Visa Com Example In C - Agilent Technologies InfiniiVision 7000A Series Programmer's Manual

Table of Contents

Advertisement

12
Programming Examples
VisaComError:
End Sub

VISA COM Example in C#

To compile and run this example in Microsoft Visual Studio 2005:
1
2
3
4
5
6
For more information, see the VISA COM Help that comes with Agilent IO
Libraries Suite 15.
/*
* Agilent VISA COM Example in C#
* -------------------------------------------------------------------
* This program illustrates most of the commonly used programming
* features of your Agilent oscilloscopes.
* -------------------------------------------------------------------
*/
using System;
using System.IO;
using System.Text;
using Ivi.Visa.Interop;
using System.Runtime.InteropServices;
namespace InfiniiVision
{
822
myScope.FlushWrite (False)
myScope.FlushRead
End If
Exit Sub
MsgBox "VISA COM Error: " + vbCrLf + Err.Description
Open Visual Studio.
Create a new Visual C#, Windows, Console Application project.
Cut- and- paste the code that follows into the C# source file.
Edit the program to use the VISA address of your oscilloscope.
Add a reference to the VISA COM 3.0 Type Library:
a
Right- click the project you wish to modify (not the solution) in the
Solution Explorer window of the Microsoft Visual Studio
environment.
Choose Add Reference....
b
c
In the Add Reference dialog, select the COM tab.
d
Select VISA COM 3.0 Type Library; then click OK.
Build and run the program.
class VisaComInstrumentApp
{
Agilent InfiniiVision 7000A Series Oscilloscopes Programmer's Guide

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents