ASSOCIATED RESEARCH LINECHEK 2 Series IVI Driver Leakage Current Tester User Guide

September 3, 2024
ASSOCIATED RESEARCH

Table of Contents

LINECHEK 2 Series IVI Driver Leakage Current Tester

“`html

Specifications

  • Product: LINECHEK 2 series(620L)
  • Manufacturer: IKONIX Group
  • IVI Driver Version: 1.1
  • Location of Help Document: IVI
    FoundationIVIDriversARI620L

Product Usage Instructions

1. IVI Driver Setup

Follow the steps below to set up the IVI Driver:

  1. Download the IVI Driver from the manufacturer’s website.

  2. Run the self-extracting setup file to start the installation
    wizard.

  3. If prompted, download the latest IVI Shared Components from the
    IVI Foundation Website.

  4. Install the shared components and continue with the
    installation process.

  5. Once the IVI Shared Components are installed, follow the
    on-screen instructions to complete the installation.

  6. If necessary, choose to install the source code of the IVI
    Driver.

  7. The IVI driver will be installed under the path of IVI
    FoundationIVI. The *.dll files will be located in the Bin folder,
    and help documents will be in the folder ..DriversARI620L.

2. Getting Started with C

To begin using the IVI Driver with C#, follow these steps:

  1. Make sure you have the following requirements:

    • 620L IVI Driver

    • IVI Shared Components: Download
      Link

    • VISA (Virtual Instrument Software Architecture) driver:

      Download Link

    • Microsoft Visual Studio or other compatible IDEs

    • LINECHEK 2 Line Leakage Tester, 620L

  2. Import the IVI-COM driver and write a program to control the
    device step-by-step.

  3. We recommend using an IVI-COM interop for easier program
    development.

FAQ

Q: Where can I find more information about IVI drivers?

A: For more information about IVI drivers, please refer to the
website of IVI Foundation.

Q: How can I establish communication with the instrument using

different programming languages?

A: You can establish communication with the instrument using C#,
C++, Python, or LabVIEW programming languages by following the
provided tutorials in the user manual.

“`

Document Version 1.1
IVI Driver Getting Started Guide
For LINECHEK 2 series(620L),
Overview
This application note will describe the installing instructions and several programming examples for IVI Instrument Driver of LINECHEK 2 series. To understand more about the IVI drivers, please refer to the website of IVI Foundation. For more detail of the LINECHEK 2 IVI driver, please check the help document, ARI620L.chm, located at the path of IVI FoundationIVIDriversARI620L.
1. IVI Driver Setup
Instructions on downloading and Installing IVI Instrument Drivers from website. Download and install Shared Components from IVI Foundation Website.
2. Getting Started with C#
A tutorial using IVI driver establishes communication with the instrument by C# programming.
3. Getting Started with C++
A tutorial using IVI driver establishes communication with the instrument by C++ programming.
4. Getting Started with Python
A tutorial using IVI driver establishes communication with the instrument by Python programming.
5. Getting Started with LabVIEW
A tutorial using IVI driver establishes communication with the instrument by LabVIEW programming.
28105 N. Keith Drive Lake Forest, IL 60045 USA Toll Free: 1-800-858-8378 US/Canada Phone: 1-847-367-4077 | Fax: 1-847-367-4080 | www.arisafety.com

1. IVI Driver Setup
After downloading the IVI Driver, run the self-extracting setup file and you will see the installation wizard to start setup. Please follow the below instruction to complete the installation.
The setup will detect if IVI Shared Components are installed. If prompted with the following screen, click on Download, The IVI Foundation Website will be opened.
Please download the latest IVI Shared Components either 32-bit or 64-bit version. After downloading, install the shared components and continue the installation.
28105 N. Keith Drive Lake Forest, IL 60045 USA Toll Free: 1-800-858-8378 US/Canada Phone: 1-847-367-4077 | Fax: 1-847-367-4080 | www.arisafety.com

After the IVI Shared Components are installed, please follow the steps to complete installation.
There are options for installing the source code of the IVI Driver, if it is necessary.
The IVI driver would be installed under the path of “IVI FoundationIVI”. For the files with “*.dll” extension name would be located in the “Bin” folder. And the necessary help documents will be in the folder of “..DriversARI620L”.
28105 N. Keith Drive Lake Forest, IL 60045 USA Toll Free: 1-800-858-8378 US/Canada Phone: 1-847-367-4077 | Fax: 1-847-367-4080 | www.arisafety.com

2. Getting Started with C#
Introduction
This chapter describes the procedures of using the IVI-COM driver of IKONIX Group by C# programming language. In this exercise, the programmer could import the driver and complete a short program controlling the device step-by step.
The C# could use IVI-C driver, either. However, we suggest that an IVI-COM interop would be easier for you to develop the program.
Requirements
620L IVI Driver IVI Shared Components, https://www.ivifoundation.org/shared_components/Default.aspx VISA (Virtual Instrument Software Architecture) driver,
https://www.ni.com/en/support/downloads/drivers/download.ni-visa.html Microsoft Visual Studio or other IDEs A LINECHEK 2 Line Leakage Tester, 620L
Download the Drivers
Please go to the website of the Associated Research to download the latest version of IVI drivers or contact the vendors. Follow the steps and instructions in Chapter 1 to complete the installation.
References
On the website of IVI Foundation, there are documentations you might be interested while implementing controlling the devices. You could find the resources of developing with an IVI driver, https://www.ivifoundation.org/resources/default.aspx. The IVI Shared Components could be download from https://www.ivifoundation.org/shared_components/Default.aspx. There are several documents on the website for understanding the IVI.
In the installed directory, there are several documents for your reference understanding the LINECHEK 2 IVI Driver. A help file, ARI620L.chm, would be located at the path of IVI FoundationIVIDriversARI620L. In this help file, you could find all of the provided functions and their hierarchy.
There are four types of sample code for your reference which are located at the path of IVI FoundationIVIDriversARI620LExamples, including C#, C++, Python and LabVIEW as well.
28105 N. Keith Drive Lake Forest, IL 60045 USA Toll Free: 1-800-858-8378 US/Canada Phone: 1-847-367-4077 | Fax: 1-847-367-4080 | www.arisafety.com

Development
1 Create a C# project 1.1 Open Visual Studio IDE and create a new C# console project.
2 Import Libraries 2.1 Right-click on the reference and select Add Reference in the solution explorer 2.2 Click on the Browse button and go to the path of “IVI FoundationIVIBinPrimary Interop Assemblies” and choose AssociatedResearch.ARI620L.Interop.dll and Ivi.Driver.Interop.dll.
2.3 Declare to use the name spaces for the interop assemblies that are specified to reference in the previous section.
using AssociatedResearch.ARI620L.Interop;
3 Start programming 3.1 Create an object of the driver and use the initialize method to build up the connection.
//Initialize // var driver = new ARI620L(); string resourceName = “ASRL4::INSTR”; string optionString = “DriverSetup=BaudRate=9600”; driver.Initialize(resourceName, true, false, optionString);
For more detail for the parameters of the Initialize() method, please refer to the help document, ARI620L.chm, which is located at “IVI FoundationIVIDriversARI620L”. The first parameter ResourceName is a string type and indicates the interfaces type and address of the connection. The resource name,”ASRL4::INSTR”, represents a serial port with address 4. For example, a GPIB connection could be “GPIB0::8::INSTR”. For TCP/IP connection, it will be in the format of “TCPIP0::192.168.0.1::10001::SOCKET”. The 10001 is the TCP/IP connection port of 620L.
28105 N. Keith Drive Lake Forest, IL 60045 USA Toll Free: 1-800-858-8378 US/Canada Phone: 1-847-367-4077 | Fax: 1-847-367-4080 | www.arisafety.com

If you use serial port to connect to device, please follow the above example, “DriverSetup=BaudRate=9600”, to setup the baud rate. There are other parameters for the option of the Initialize() method, please refer to the ARI620L.chm for more details.

3.2 Create file and setup test

//Create and edit test file

//

try

{

driver.Files.Create(1, “IviTest”);

}

catch

{

int totalFiles = driver.Files.TotalFiles;

for (int i = 0; i <= totalFiles; i++)

{

if (driver.Files.QueryFileName(i).Contains(“IviTest”))

{

driver.Files.Delete(i);

driver.Files.Create(i, “IviTest”);

break;

}

}

}

//Add Run test item and edit the parameters

driver.Steps.AddRunTestWithDefaults();

// Add a RUN test step

driver.Parameters.VoltageHighLimit = 125; // Edit Voltage High Limitation

driver.Parameters.VoltageLowLimit = 0;

// Edit Voltage Low Limitation

driver.Parameters.CurrentHighLimit = 10; // Edit Current High Limitation

driver.Parameters.CurrentHighLimit = 0;

// Edit Current Low Limitation

driver.Parameters.Delay = 0.5;

// Edit Delay Time

driver.Parameters.Dwell = 0.5;

// Edit Dwell Time

driver.Parameters.LeakageHigh = 10;

// Edit Leakage Current High Limitation

driver.Parameters.LeakageLow = 0;

// Edit Leakage Current Low Limitation

driver.Parameters.PowerHigh = 1000;

// Edit Power High Limitation

driver.Parameters.PowerLow = 0;

// Edit Power Low Limitation

driver.Parameters.PowerFactorHigh = 1;

// Edit Power Factor High Limitation

driver.Parameters.PowerFactorLow = 0;

// Edit Power Factor Low Limitation

//driver.Parameters.PLCControl = ARI620LPlcMemoryEnum.ARI620LPlcMemoryM1;

// Configure

the PLC Memory if the option was enabled.

driver.Parameters.Continuous = false;

// Configure Continuous

//Add LLT test item and edit the parameters

driver.Steps.AddLLTTestWithDefaults();

// Add a Line Leakage Test step

driver.Parameters.LeakageMode = ARI620LLeakageModeEnum.ARI620LLeakageModeRMS;

//

Configure the Leakage measuring method

driver.Parameters.LeakageHigh = 6000;

// Edit Leakage Current High Limitation

driver.Parameters.LeakageLow = 0;

// Edit Leakage Current Low Limitation

driver.Parameters.VoltageHighLimit = 125; // Edit Voltage High Limitation

driver.Parameters.VoltageLowLimit = 0;

// Edit Voltage Low Limitation

driver.Parameters.Delay = 0.5;

// Edit Delay Time

driver.Parameters.Dwell = 0.5;

// Edit Dwell Time

//driver.Parameters.LeakageOffset = 0;

// Edit Offset if the option was enabled

driver.Parameters.Neutral = ARI620LRelayStateEnum.ARI620LRelayStateClose;

// Configure

the Neutral relay

driver.Parameters.Reverse = false;

// Configure the Reverse

driver.Parameters.Ground = ARI620LRelayStateEnum.ARI620LRelayStateClose;

// Configure

the Ground relay

driver.Parameters.MeasureDevice =

ARI620LMeasureDeviceEnum.ARI620LMeasureDeviceUL544NP;

// Configure the Measure Device

driver.Parameters.Probe = ARI620LProbeEnum.ARI620LProbeGroundToLine;

// Configure

the Probe points

driver.Parameters.ExtendMeter = false;

// Configure Extend Meter

28105 N. Keith Drive Lake Forest, IL 60045 USA Toll Free: 1-800-858-8378 US/Canada Phone: 1-847-367-4077 | Fax: 1-847-367-4080 | www.arisafety.com

driver.Parameters.Filter = ARI620LFilterEnum.ARI620LFilterACDC;

//

Configuring the coupling of AC or DC

driver.Parameters.RangingMode = ARI620LRangingModeEnum.ARI620LRangingModeAuto; //

Configuring the Ranging Mode

driver.Parameters.Continuous = false;

// Configure the Continuous

//driver.Parameters.Scanner = “HOOOLOOO”; // Configure the Scanner if the scanner was

installed.

//driver.Parameters.PLCControl = ARI620LPlcMemoryEnum.ARI620LPlcMemoryM1;

// Configure

the PLC control if the option was enabled.

driver.Files.Save();

// Save file

To create a file, the file name should not be existed. Therefore, there is a try-catch process to handle creating files with the name might be existed. For the 620L, all of the test parameters would be within a file. Therefore, you need to create a file first and then setup the parameters. We could add the steps with default values using the AddRunTestWithDeafults() and AddLLTTestWithDeafults() and then modify the parameters. The 620L also provides a command “ADD” for adding a step with all of the configurations, however, the configurations vary with the options which might make it complex to setup. Therefore, it is recommended adding a default step first and then editing the parameters.

3.3 Load file and start a test
//Output // driver.Execution.Execute();
Before running output, you have to select a file to load using driver.files.Load(). And then invoke driver.Execution.Execute() method to start a test.

3.4 Measure during test
bool lastOpcStatus = false; while (true) {
Console.WriteLine(driver.Execution.ReadTestDisplayRaw()); driver.System.WriteString(“*OPC?n”); string opcStatus = driver.System.ReadString(); if (opcStatus.Contains(“1”) && lastOpcStatus)
break; lastOpcStatus = opcStatus.Contains(“1”); Thread.Sleep(100); }
This while loop would run with the condition of state is testing. Using the methods of
Execution.ReadTestDisplayRaw() could let you read the immediate readings.

3.5 Close the session
driver.Execution.Abort(); driver.Close(); Console.WriteLine(“Done – Press Enter to Exit”); Console.ReadLine();
Close() would close the I/O session to the instrument.
28105 N. Keith Drive Lake Forest, IL 60045 USA Toll Free: 1-800-858-8378 US/Canada Phone: 1-847-367-4077 | Fax: 1-847-367-4080 | www.arisafety.com

4 Completed example The completed sample code could be found at the path of “IVI FoundationIVIDriversARI620LExamples”.
28105 N. Keith Drive Lake Forest, IL 60045 USA Toll Free: 1-800-858-8378 US/Canada Phone: 1-847-367-4077 | Fax: 1-847-367-4080 | www.arisafety.com

3. Getting Started with C++
Introduction
This chapter describes the procedures of using the IVI-COM driver of IKONIX Group by C++ programming language. In this exercise, the programmer could import the driver and complete a short program controlling the device step-by step.
Requirements
LINECHEK 2 IVI Driver IVI Shared Components, https://www.ivifoundation.org/shared_components/Default.aspx VISA (Virtual Instrument Software Architecture) driver,
https://www.ni.com/en/support/downloads/drivers/download.ni-visa.html Microsoft Visual Studio or other IDEs A LINECHEK 2 series LLT Tester, 620L
Download the Drivers
Please go to the website of the Associated Research to download the latest version of IVI drivers or contact the vendors. Follow the steps and instructions in Chapter 1 to complete the installation.
References
On the website of IVI Foundation, there are documentations you might be interested while implementing controlling the devices. You could find the resources of developing with an IVI driver, https://www.ivifoundation.org/resources/default.aspx. The IVI Shared Components could be download from https://www.ivifoundation.org/shared_components/Default.aspx. There are several documents on the website for understanding the IVI.
In the installed directory, there are several documents for your reference understanding the LINECHEK 2 IVI Driver. A help file, ARI620L.chm, would be located at the path of IVI FoundationIVIDriversARI620L. In this help file, you could find all of the provided functions and their hierarchy.
There are three types of sample code for your reference which are located at the path of IVI FoundationIVIDriversARI620LExamples, including C#, C++ and Python as well.
28105 N. Keith Drive Lake Forest, IL 60045 USA Toll Free: 1-800-858-8378 US/Canada Phone: 1-847-367-4077 | Fax: 1-847-367-4080 | www.arisafety.com

Development
1 Create a C++ project 1.1 Open Visual Studio or any other IDEs and create a new C++ console project.
2 Include Directories 2.1 Right-click on the project and select properties. 2.2 Expand the Configuration Properties and select VC++ Directories on the left menu. 2.3 Click on the drop-down column of the Include Directories and select <Edit..> to open the edit window.
2.4 Select the New Line button to add an include directories. There will be two necessary paths need to be added. IVI FoundationIVIBin $(VXIPNPPATH)VisaCom
2.5 Click OK to complete including the directories. 2.6 Use the #import operator to import the necessary DLLs
28105 N. Keith Drive Lake Forest, IL 60045 USA Toll Free: 1-800-858-8378 US/Canada Phone: 1-847-367-4077 | Fax: 1-847-367-4080 | www.arisafety.com

include “stdafx.h” #include #include #import

no_namespace #import no_namespace #import no_namespace 3 Start programming 3.1 Create an instance of the driver by pointer and use the initialize method to build up the connection. HRESULT hr = ::CoInitialize(NULL); IARI620LPtr driver(__uuidof(ARI620L)); driver->Initialize(“ASRL4::INSTR”, true, false, “DriverSetup=BaudRate=9600”); For more detail for the parameters of the Initialize() method, please refer to the help document, ARI620L.chm located at “IVI FoundationIVIDriversARI620L”. The first parameter ResourceName is a string type and indicates the interfaces type and address of the connection. The resource name,”ASRL4::INSTR”, represents a serial port with address 4. For example, a GPIB connection could be “GPIB0::8::INSTR”. For TCP/IP connection, it will be in the format of “TCPIP0::192.168.0.1::10001::SOCKET”. The 10001 is the TCP/IP connection port of 620L. The second argument should be set with false value for not identifying the model names. If you use serial port to connect to device, please follow the above example, “DriverSetup=BaudRate=9600”, to setup the baud rate. There are other parameters for the option of the Initialize() method, please refer to the ARI620L.chm for more detail.

3.2 Create file and setup test

//Create file and config the parameters try {
driver->Files->Create(1, “IviTest”); } catch (…) {
int totalFiles = driver->Files->GetTotalFiles(); for (int i = 1; i <= totalFiles; i++) {
std::string fileName = driver->Files->QueryFileName(i); if (fileName == “IviTest”) {
driver->Files->Delete(i); driver->Files->Create(i, “IviTest”); break; } } }

//Add Run test item and edit the parameters

driver->Steps->AddRunTestWithDefaults(); // Add a RUN test step

driver->Parameters->VoltageHighLimit = 125; // Edit Voltage High Limitation

driver->Parameters->VoltageLowLimit = 0; // Edit Voltage Low Limitation

driver->Parameters->CurrentHighLimit = 10; // Edit Current High Limitation

driver->Parameters->CurrentHighLimit = 0; // Edit Current Low Limitation

driver->Parameters->Delay = 0.5;

// Edit Delay Time

driver->Parameters->Dwell = 0.5;

// Edit Dwell Time

28105 N. Keith Drive Lake Forest, IL 60045 USA Toll Free: 1-800-858-8378 US/Canada Phone: 1-847-367-4077 | Fax: 1-847-367-4080 | www.arisafety.com

driver->Parameters->LeakageHigh = 10;

// Edit Leakage Current High Limitation

driver->Parameters->LeakageLow = 0;

// Edit Leakage Current Low Limitation

driver->Parameters->PowerHigh = 1000;

// Edit Power High Limitation

driver->Parameters->PowerLow = 0;

// Edit Power Low Limitation

driver->Parameters->PowerFactorHigh = 1; // Edit Power Factor High Limitation

driver->Parameters->PowerFactorLow = 0;

// Edit Power Factor Low Limitation

//driver->Parameters->PLCControl = ARI620LPlcMemoryEnum::ARI620LPlcMemoryM1;

// Configure the PLC Memory if the option was enabled.

driver->Parameters->Continuous = false;

// Configure Continuous

//Add LLT test item and edit the parameters

driver->Steps->AddLLTTestWithDefaults(); // Add a Line Leakage Test step

driver->Parameters->LeakageMode = ARI620LLeakageModeEnum::ARI620LLeakageModeRMS;

// Configure the Leakage measuring method

driver->Parameters->LeakageHigh = 6000;

// Edit Leakage Current High Limitation

driver->Parameters->LeakageLow = 0;

// Edit Leakage Current Low Limitation

driver->Parameters->VoltageHighLimit = 125; // Edit Voltage High Limitation

driver->Parameters->VoltageLowLimit = 0; // Edit Voltage Low Limitation

driver->Parameters->Delay = 0.5;

// Edit Delay Time

driver->Parameters->Dwell = 0.5;

// Edit Dwell Time

//driver->Parameters->LeakageOffset = 0; // Edit Offset if the option was enabled

driver->Parameters->Neutral = ARI620LRelayStateEnum::ARI620LRelayStateClose;

// Configure the Neutral relay

driver->Parameters->Reverse = false;

// Configure the Reverse

driver->Parameters->Ground = ARI620LRelayStateEnum::ARI620LRelayStateClose;

// Configure the Ground relay

driver->Parameters->MeasureDevice =

ARI620LMeasureDeviceEnum::ARI620LMeasureDeviceUL544NP; // Configure the Measure Device

driver->Parameters->Probe = ARI620LProbeEnum::ARI620LProbeGroundToLine;

// Configure the Probe points

driver->Parameters->ExtendMeter = false; // Configure Extend Meter

driver->Parameters->Filter = ARI620LFilterEnum::ARI620LFilterACDC;

// Configuring the coupling of AC or DC

driver->Parameters->RangingMode = ARI620LRangingModeEnum::ARI620LRangingModeAuto;

// Configuring the Ranging Mode

driver->Parameters->Continuous = false;

// Configure the Continuous

//driver->Parameters->Scanner = “HOOOLOOO”; // Configure the Scanner if the scanner was

installed.

//driver->Parameters->PLCControl = ARI620LPlcMemoryEnum::ARI620LPlcMemoryM1;

// Configure the PLC control if the option was enabled.

driver->Files->Save();

// Save file

To create a file, the file name should not be existed. Therefore, there is a try-catch process to handle creating files with the name might be existed. For the 620L, all of the test parameters would be within a file. Therefore, you need to create a file first and then setup the parameters. We could add the steps with default values using the AddRunTestWithDeafults() and AddLLTTestWithDeafults() and then modify the parameters. The 620L also provides a command “ADD” for adding a step with all of the configurations, however, the configurations vary with the options which might make it complex to setup. Therefore, it is recommended adding a default step first and then editing the parameters.

3.3 Load file and start a test
//Output driver->Execution->Execute();
Before running output, you have to select a file to load using driver->files->Load(). And then invoke driver->Execution->Execute() method to start a test.
28105 N. Keith Drive Lake Forest, IL 60045 USA Toll Free: 1-800-858-8378 US/Canada Phone: 1-847-367-4077 | Fax: 1-847-367-4080 | www.arisafety.com

3.4 Measure during test
bool lastOpcStatus = false; while (true) {
std::cout << driver->Execution->ReadTestDisplayRaw() << std::endl; driver->System->WriteString(“*OPC?n”); std::string opcStatus = driver->System->ReadString(); if (opcStatus.find(“1”) != std::string::npos && lastOpcStatus)
break; lastOpcStatus = opcStatus.find(“1”) != std::string::npos; Sleep(100); }
This while loop would run with the condition of state is testing. Using the methods of Execution.ReadTestDisplayRaw() could let you read the immediate readings. 3.5 Close the session
driver->Execution->Abort(); driver->Close(); std::cout << “Done – Press Enter to Exit” << std::endl; std::cin.get();
Close() would close the I/O session to the instrument. 4 Completed example
The completed sample code could be found at the path of “IVI FoundationIVIDriversARI620LExamples”.
28105 N. Keith Drive Lake Forest, IL 60045 USA Toll Free: 1-800-858-8378 US/Canada Phone: 1-847-367-4077 | Fax: 1-847-367-4080 | www.arisafety.com

4. Getting Started with Python
Introduction
This chapter describes the procedures of using the IVI-COM driver of IKONIX Group by Python programming language. In this exercise, the programmer could import the driver and complete a short program controlling the device step-by step.
Requirements
ARI620L IVI Driver IVI Shared Components, https://www.ivifoundation.org/shared_components/Default.aspx VISA (Virtual Instrument Software Architecture) driver,
https://www.ni.com/en/support/downloads/drivers/download.ni-visa.html Python IDE Comtypes Library ( pip install comtypes) A LINECHEK 2 series safety tester, 620L
Download the Drivers
Please go to the website of the Associated Research to download the latest version of IVI drivers or contact the vendors. Follow the steps and instructions in Chapter 1 to complete the installation.
References
On the website of IVI Foundation, there are documentations you might be interested in while implementing controlling the devices. You could find the resources of developing with an IVI driver, https://www.ivifoundation.org/resources/default.aspx. The IVI Shared Components could be download from https://www.ivifoundation.org/shared_components/Default.aspx. There are several documents on the website for understanding the IVI.
In the installed directory, there are several documents for your reference understanding the LINECHEK 2 IVI Driver. A help file, ARI620L.chm, would be located at the path of IVI FoundationIVIDriversARI620L. In this help file, you could find all of the provided functions and their hierarchy.
There are three types of sample code for your reference which are located at the path of IVI FoundationIVIDriversARI620LExamples, including C#, C++ and Python as well.
28105 N. Keith Drive Lake Forest, IL 60045 USA Toll Free: 1-800-858-8378 US/Canada Phone: 1-847-367-4077 | Fax: 1-847-367-4080 | www.arisafety.com

Development
1 Install the Comtypes library pip install comtypes
In order to call an external com DLL in Python, you will need comtypes library installed.
2 Create a Python file 2.1 Open any IDE of Python and create a new Python file.
3 Import Libraries 3.1 Import the comtypes library and ARI620L_64.dll
import time import comtypes import comtypes.client as cc

Import the IVI-COM DLL cc.GetModule(‘ARI620L_64.dll’) from comtypes.gen

import ARI620LLib
4 Start programming 4.1 Create an object of the driver and use the initialize method to build up the connection.
driver = cc.CreateObject(‘ARI620L.ARI620L’, interface=ARI620LLib.IARI620L) # Initialize Driver and make connection driver.Initialize(‘ASRL4::INSTR’, True, False, ‘DriverSetup=BaudRate=9600’)
For more detail for the parameters of the Initialize() method, please refer to the help document, ARI620L.chm located at “IVI FoundationIVIDriversARI620L”. The first parameter ResourceName is a string type and indicates the interfaces type and address of the connection. The resource name,”ASRL3::INSTR”, represents a serial port with address 3. For example, a GPIB connection could be “GPIB0::8::INSTR”. For TCP/IP connection, it will be in the format of “TCPIP0::192.168.0.1::10001::SOCKET”. The 10001 is the TCP/IP connection port of 620L. If you use serial port to connect to device, please follow the above example, “DriverSetup=BaudRate=9600”, to setup the baud rate. There are other parameters for the option of the Initialize() method, please refer to the ARI620L.chm for more detail. For example, “QueryInstrStatus=true” makes the session automatically query the error status for each command was sent.
4.2 Create file and setup test

Create file try:

driver.Files.Create(1, “IviTest”) except:
files = driver.Files.TotalFiles; for i in range(1,files+1):
if ‘IviTest’ in driver.Files.QueryFileName(i): driver.Files.Delete(i) 28105 N. Keith Drive Lake Forest, IL 60045 USA Toll Free: 1-800-858-8378 US/Canada Phone: 1-847-367-4077 | Fax: 1-847-367-4080 | www.arisafety.com

driver.Files.Create(i, ‘IviTest’) break

Add Run test item and edit the parameters

driver.Steps.AddRunTestWithDefaults();

Add a RUN test step

driver.Parameters.VoltageHighLimit = 125; # Edit Voltage High Limitation

driver.Parameters.VoltageLowLimit = 0;

Edit Voltage Low Limitation

driver.Parameters.CurrentHighLimit = 10; # Edit Current High Limitation

driver.Parameters.CurrentHighLimit = 0;

Edit Current Low Limitation

driver.Parameters.Delay = 0.5;

Edit Delay Time

driver.Parameters.Dwell = 0.5;

Edit Dwell Time

driver.Parameters.LeakageHigh = 10;

Edit Leakage Current High Limitation

driver.Parameters.LeakageLow = 0;

Edit Leakage Current Low Limitation

driver.Parameters.PowerHigh = 1000;

Edit Power High Limitation

driver.Parameters.PowerLow = 0;

Edit Power Low Limitation

driver.Parameters.PowerFactorHigh = 1;

Edit Power Factor High Limitation

driver.Parameters.PowerFactorLow = 0;

Edit Power Factor Low Limitation

driver.Parameters.PLCControl = ARI620LLib.ARI620LPlcMemoryM1;

Configure the PLC

Memory if the option was enabled.

driver.Parameters.Continuous = False;

Configure Continuous

Add LLT test item and edit the parameters

driver.Steps.AddLLTTestWithDefaults();

Add a Line Leakage Test step

driver.Parameters.LeakageMode = ARI620LLib.ARI620LLeakageModeRMS;

Configure the

Leakage measuring method

driver.Parameters.LeakageHigh = 6000;

Edit Leakage Current High Limitation

driver.Parameters.LeakageLow = 0;

Edit Leakage Current Low Limitation

driver.Parameters.VoltageHighLimit = 125; # Edit Voltage High Limitation

driver.Parameters.VoltageLowLimit = 0;

Edit Voltage Low Limitation

driver.Parameters.Delay = 0.5;

Edit Delay Time

driver.Parameters.Dwell = 0.5;

Edit Dwell Time

driver.Parameters.LeakageOffset = 0;

Edit Offset if the option was enabled

driver.Parameters.Neutral = ARI620LLib.ARI620LRelayStateClose; # Configure the Neutral

relay

driver.Parameters.Reverse = False;

Configure the Reverse

driver.Parameters.Ground = ARI620LLib.ARI620LRelayStateClose; # Configure the Ground relay

driver.Parameters.MeasureDevice = ARI620LLib.ARI620LMeasureDeviceUL544NP; # Configure the

Measure Device

driver.Parameters.Probe = ARI620LLib.ARI620LProbeGroundToLine;

Configure the

Probe points

driver.Parameters.ExtendMeter = False;

Configure Extend Meter

driver.Parameters.Filter = ARI620LLib.ARI620LFilterACDC;

Configuring the coupling

of AC or DC

driver.Parameters.RangingMode = ARI620LLib.ARI620LRangingModeAuto;

Configuring

the Ranging Mode

driver.Parameters.Continuous = False;

Configure the Continuous

driver.Parameters.Scanner = “HOOOLOOO”; # Configure the Scanner if the

scanner was

installed.

driver.Parameters.PLCControl = ARI620LLib.ARI620LPlcMemoryM1; # Configure the

PLC control

if the option was enabled.

driver.Files.Save();

Save file

To create a file, the file name should not be existed. Therefore, there is a try-catch process to

handle creating files with the name might be existed.

For the 620L, all of the test parameters would be within a file. Therefore, you need to create

a file first and then setup the parameters. We could add the steps with default values using

the AddRunTestWithDeafults() and AddLLTTestWithDeafults() and then modify the

parameters. The 620L also provides a command “ADD” for adding a step with all of the

configurations, however, the configurations differs on the options which might make it

complex to setup. Therefore, it is recommended adding a default step first and then editing

the parameters.

28105 N. Keith Drive Lake Forest, IL 60045 USA Toll Free: 1-800-858-8378 US/Canada Phone: 1-847-367-4077 | Fax: 1-847-367-4080 | www.arisafety.com

4.3 Load file and start a test

Start test driver.Execution.Execute()

Before running output, you have to select a file to load using driver->files->Load(). And then invoke driver->Execution->Execute() method to start a test.
4.4 Measure during test

Measure lastOpcStatus = False while(True):

print(driver.Execution.ReadTestDisplayRaw()) driver.System.WriteString(“*OPC?n”) opcStatus = driver.System.ReadString() if (‘1’ in opcStatus and lastOpcStatus):
break lastOpcStatus = ‘1’ in opcStatus time.sleep(0.1)
This while loop would run with the condition of state is testing. Using the methods of Execution.ReadTestDisplayRaw() could let you read the immediate readings.
4.5 Close the session

Reset test and close connection driver.Execution.Abort() driver.Close()

print(“Done – Press Enter to Exit”)
Close() would close the I/O session to the instrument.
5 Completed example The completed sample code could be find at the path of “IVI FoundationIVIDriversARI620LExamples”.
28105 N. Keith Drive Lake Forest, IL 60045 USA Toll Free: 1-800-858-8378 US/Canada Phone: 1-847-367-4077 | Fax: 1-847-367-4080 | www.arisafety.com

5. Getting Started with LabVIEW
Introduction
This chapter describes the procedures of using the IVI-COM driver of IKONIX Group by LabVIEW programming language. In this exercise, the programmer could learn how to import the driver and complete a short program controlling the device step-by step.
Even though the programmers could control the device by IVI Driver. For the LabVIEW programmer, we suggest that using LabVIEW plug & play driver would be easier for your programming and debugging. The LabVIEW driver from IKONIX Group are all made up with commands directly, so you could clearly check how the commands were sent to instruments.
Requirements
LINECHEK 2 IVI Driver IVI Shared Components, https://www.ivifoundation.org/shared_components/Default.aspx VISA (Virtual Instrument Software Architecture) driver,
https://www.ni.com/en/support/downloads/drivers/download.ni-visa.html National Instruments LabVIEW (This example was written in LabVIEW 2014) A LINECHEK 2 series safety tester, 620L
Download the Drivers
Please go to the website of the Associated Research to download the latest version of IVI drivers or contact the vendors. Follow the steps and instructions in Chapter 1 to complete the installation.
References
On the website of IVI Foundation, there are documentations you might be interested while implementing controlling the devices. You could find the resources of developing with an IVI driver, https://www.ivifoundation.org/resources/default.aspx. The IVI Shared Components could be download from https://www.ivifoundation.org/shared_components/Default.aspx. There are several documents on the website for understanding the IVI.
In the installed directory, there are several documents for your reference understanding the LINECHEK 2 IVI Driver. A help file, ARI620L.chm, would be located at the path of IVI FoundationIVIDriversARI620L. In this help file, you could find all of the provided functions and their hierarchy.
There are three types of sample code for your reference which are located at the path of IVI FoundationIVIDriversARI620LExamples, including C#, C++ and Python as well.
28105 N. Keith Drive Lake Forest, IL 60045 USA Toll Free: 1-800-858-8378 US/Canada Phone: 1-847-367-4077 | Fax: 1-847-367-4080 | www.arisafety.com

1 Open a new vi. 2 Import the DLL component.

Development

Open the Function Palette by right-clicking on the block diagram. Then select Connectivity -> ActiveX. Select or drop the Automation Open function on the block diagram. 3 Right-clicking on the Automation Open and select Select ActiveX Class -> Browse will open a window for choosing the DLL. 4 Select the Browse button and select the file ARI620L_64.dll located at IVI FoundationIVIBin. The IVI ARI620L Type Library would be added into the Type Libraries drop down menu. 5 Select IARI620L and then click OK to complete creating an object of 620L driver instance.
The Labview will automatically generate an Automation refnum of ARI620LLib.ILINECHEK 2 control and connect to the Automation Open function.
28105 N. Keith Drive Lake Forest, IL 60045 USA Toll Free: 1-800-858-8378 US/Canada Phone: 1-847-367-4077 | Fax: 1-847-367-4080 | www.arisafety.com

6 Create an Invoke Node function and connect the reference to the output of Automation Refnum and then click on the Method and select Initialize to initialize the connection with device.
For more detail for the parameters of the Initialize() method, please refer to the help document, ARI620L.chm located at “IVI FoundationIVIDriversARI620L”. The first parameter ResourceName is a string type and indicates the interfaces type and address of the connection. The resource name, “ASRL4::INSTR”, represents a serial port with address 4. For example, a GPIB connection could be “GPIB0::8::INSTR”. For TCP/IP connection, it will be in the format of “TCPIP0::192.168.0.1::10001::SOCKET”. The 10001 is the TCP/IP connection port of 620L. If you use serial port to connect to device, please follow the above example, “DriverSetup=BaudRate=9600”, to setup the baud rate. There are other parameters for the option of the Initialize() method, please refer to the ARI620L.chm for more detail.
6.1 Create file and setup test
28105 N. Keith Drive Lake Forest, IL 60045 USA Toll Free: 1-800-858-8378 US/Canada Phone: 1-847-367-4077 | Fax: 1-847-367-4080 | www.arisafety.com

Use the Property Node to get reference of the sub-system of IARI620L class. For example, Files is one of the sub-class of IARI620L, and then we could use the Create method under Files to create a file in the device. To create a file, the file name should not be existed. Therefore, there is a try-catch process to handle creating files with the name might be existed. For the 620L, all of the test parameters would be within a file. Therefore, you need to create a file first and then setup the parameters. We could add the steps with default values using the AddRunTestWithDeafults() and AddLLTTestWithDeafults() and then modify the parameters. The 620L also provides a command “ADD” for adding a step with all of the configurations, however, the configurations differ on the options which might make it hard to setup. Therefore, it is recommended adding a default step first then editing the parameters.
28105 N. Keith Drive Lake Forest, IL 60045 USA Toll Free: 1-800-858-8378 US/Canada Phone: 1-847-367-4077 | Fax: 1-847-367-4080 | www.arisafety.com

6.2 Start a test and measure
Before running output, you have to select a file to load. And then invoke Execute method to start a test under Execution class. The Execution class is one property of the IARI620L class. This for loop would run with polling the state and meters. Using the methods of ReadTestDispalyRaw() could let you read the immediate readings. ReadTestDispalyRaw() is one method of IARI620L.Execution. There is another commands querying states of the device, polling “*OPC?” could get the running status. Please be noted that the status between step and step might be OFF for a shot moment. To avoid reading wrong status, we use shift register comparing the status.
28105 N. Keith Drive Lake Forest, IL 60045 USA Toll Free: 1-800-858-8378 US/Canada Phone: 1-847-367-4077 | Fax: 1-847-367-4080 | www.arisafety.com

6.3 Close the session
Close method in IARI620L class would close the I/O session to the instrument. Also, all of the references should be closed using the Close Reference function. 7 Completed example
The completed example with the state machine design pattern for your reference which are located at the path of IVI FoundationIVIDriversARI620LExamples, including C#, C++ and Python as well. However, we suggest that using LabVIEW plug & play driver would be easier for LabVIEW developers. If you need a LabVIEW driver, please download it from the website of Associated Research or contact the vendor.
28105 N. Keith Drive Lake Forest, IL 60045 USA Toll Free: 1-800-858-8378 US/Canada Phone: 1-847-367-4077 | Fax: 1-847-367-4080 | www.arisafety.com

References

Read User Manual Online (PDF format)

Read User Manual Online (PDF format)  >>

Download This Manual (PDF format)

Download this manual  >>

Related Manuals