4 using the vxi plug&play driver, 1 example 1: setting voltage and current, Using the vxi plug&play driver -3 – KEPCO KLR Series Developers Guide User Manual
Page 65: Example 1: setting voltage and current -3

KLR-DEV 060713
5-3
5.4
USING THE VXI plug&play DRIVER
The example programs are provided to illustrate how to operate the KLR via a remote interface.
The three examples show the following functions:
• Setting Voltage and Current (PAR. 5.4.1)
• Using the Power Supply to Create a Voltage Ramp (PAR. 5.4.2)
• Measurements
5.4.1
EXAMPLE 1: SETTING VOLTAGE AND CURRENT
The simple routine shown in Figure 5-1 sets the power supply to a specific value, then leaves it
at this value. It opens the driver, calls the proper functions and then closes the driver. Four pos-
sible id_str variable statements have been provided, depending on the interface being used.
The id_str statements for the interfaces not used must be commented out, otherwise errors will
result.
Calibration Restore
Kpklr_CalRestore
instrument receives calibration data in Intel hex format and replaces
the Working Calibration.
ARBITRARY WAVEFORM FUNCTIONS (Standalone configuration only)
Clear List
Kpklr_ListCl
Clears the list to prepare for adding points.
Add Volt Step Value
Kpklr_ListVolt
Add a single voltage entry to the end of a list.
Add Current Step Value
Kpklr_ListCurrent
Add a single current entry to the end of a list.
Add Step Time
Kpklr_ListDwell
Add a single time entry to the end of a list.
Add relay control step
value
Kpklr_ListControl
Add a single relay control entry to the end of a list.
Query How Many Points
Kpklr_Points
Determines the maximum number of points on the list.
Add waveform to a list
Kpbop_ListData
Add waveform to a list.
Set list execution cycles
Kpklr_ListCount
A list can be run from 1- 65535 times. It can also be run continuously
if the value is set to 0. The KLR defaults to 1 on a list clear.
Run/stop LIST program
Kpklr_Prog
Runs or stops LIST program.
LIST Program Run Status
Kpklr_Prog_Stat
Status of LIST program (running or stopped)
STATUS FUNCTIONS
Set SRQ Condition
Kpklr_SetSrqCond
Sets SRQ Condition Bit.
Display Status Message
Kpklr_getDisplay
Displays message in Status Display.
Initialize Status Registers
Kpklr_InitReg
Clears status Operation and Event registers
Get Questionable Event
Kpklr_StatQues
Tests and returns contents of Questionable Event register.
Wait for Operation to
Complete
Kpklr_WaitOPC~
Waits for operation to complete.
Wait for SRQ
Kpklr_WaitSrq
Waits for SRQ
TABLE 5-1. KLR VXI PLUG&PLAY DRIVER FUNCTIONS (CONTINUED)
Purpose
Function Name
Description