2 using a list to perform a series of operations, Using a list to perform a series of operations -8 – KEPCO KLP Series Developer's Guide, Rev 1 User Manual
Page 30

3-8
KLP-DEV 031113
3.3.2
USING A LIST TO PERFORM A SERIES OF OPERATIONS
The filename for this example is Clistexample.txt, located in the ivi\drivers\kepco\examples
folder (see Figure 3-2 for complete code).
This example is written in C# and applies to a KLP 75-33 (either-1200 or -1.2K). Step sizes may
need to be readjusted for other models.
Since the IVI-COM driver is a native application for the C# and the VB.NET environments, it is
the easiest to use. More information about the various programming environments can be found
in the kepcoDCPwr driver help file which is automatically installed during driver installation.
Initializing the driver is easy; only the driver name is required.
using System;
using KepcoDCPwr.Interop;
// Create driver instance.
KepcoDCPwr KLPdriver;
KepcoDCPwr.Interop.Output outputPtr;
KepcoDCPwr.Interop.IList listPtr;
KLPdriver = new KepcoDCPwrClass();
The connection between the host and the KLP is then established by the following code:
KLPdriver.Initialize("GPIB0::6::INSTR",
true,
true,
"Cache=true,InterchangeCheck=false,QueryInstrStatus=true,Simu-
late=false");//IVI options
// get references to the needed interfaces
outputPtr = KLPdriver.Outputs.get_Item(driver.Outputs);
listPtr = KLPdriver.List.get_Item(driver.Lists);
The list functionality uses arrays. The following code creates these arrays and then fills them
with data.
//create arrays for the ListPoints method
double[] voltList = new double [6];
double[] currList = new double [6];
double[] dwellTime = new double [6];
voltList[0] = 10;
voltList[1] = 20;
voltList[2] = 30;
voltList[3] = 40;
voltList[4] = 50;
voltList[5] = 60;
currList[0] = 2; // select max current for each step
currList[1] = 2;
currList[2] = 2;
currList[3] = 2;