Visual C# (.NET Framework)


Create Project

Launch Visual Studio, select [New]-[Project] from [File] menu.
From the [Templates] of [New Project] dialog box, select [Windows Form Application] of [Visual C#],
and specify the name and location of the project to be created.
When click the [OK] button, the project will be created.

* Item names and commands may differ depending on the version of Visual Studio.

Include Class Library

In order to use the functions of GPIB driver in Visual C#, the class library file CgpibCs.cs is required.
Add the CgpibCs.cs file from [Project]-[Add Existing Item].

Add Name Space

Add name space to use the methods in class library.
At the beginning of the C# source code file (with .cs extension), please add the following line.

using CgpibCs;

Create Instance of Class

In order to use GPIB class library, create a instance of class.
In the C# source code file (with .cs extension), add the following lines at the beginning of form class.

public class Form1 : System.Windows.Forms.Form
{
Cgpib gpib = new Cgpib();// <- add

How to Use Class Library Methods

When using GPIB driver functions in C#, call class library method other than calling the function directly.
The functions of GPIB driver are called by calling the methods of class library.

All the methods in the class library are defined with the name by omitting the prefix [Gpib] of function name.
When using with C#, please use the method without prefix Gpib.

For example, when using GpibInit function

Ret = gpib.Init ( ....