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.
  For details, please refer to [Visual Studio Launch Screen].

Include Class Library

In order to use the functions of Impedance Meter Driver in Visual C#, the class library file CzmCS.CS is required.
Add the CzmCS.CS file from [Project]-[Add Existing Item].

Modify the Project Setting

Impedance Meter Driver supports callbacks, so you need to change the project settings.

Open the project properties and select [Build] on the left side of the dialog.
Check [Allow unsafe code blocks] and click the [OK] button.

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

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 CzmCs;

Create Class Instance

In order to use ZM class library, create an 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
{

Czm  zm = new Czm(); //<- add

How to Use Class Library Methods

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

The methods in the class library are defined as the original functions without the prefix,
so call them accordingly.

For example, when using ZmInit function

Ret = zm.Init ( ・・・・

For example, when using ZmSingleCMeasure function

Ret = zm.SingleCMeasure ( ・・・・