Visa Com Example In C - Agilent Technologies InfiniiVision 3000 Programmer's Manual

X-series
Hide thumbs Also See for InfiniiVision 3000:
Table of Contents

Advertisement

VisaComError:
End Sub

VISA COM Example in C#

To compile and run this example in Microsoft Visual Studio 2008:
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 a few commonly used programming
* features of your Agilent oscilloscope.
* -------------------------------------------------------------------
*/
using System;
using System.IO;
using System.Text;
using Ivi.Visa.Interop;
using System.Runtime.InteropServices;
namespace InfiniiVision
{
Agilent InfiniiVision 3000 X-Series Oscilloscopes Programmer's Guide
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
In the Add Reference dialog, select the COM tab.
c
Select VISA COM 3.0 Type Library; then click OK.
d
Build and run the program.
class VisaComInstrumentApp
{
private static VisaComInstrument myScope;
public static void Main(string[] args)
{
try
{
Programming Examples
1107
39

Advertisement

Table of Contents
loading

Table of Contents