beautypg.com

Programming examples, 1 example 1, 2 example 2 – KEPCO BHK-MG VISA Driver Manual (Both Full and 1/2 Rack) User Manual

Page 16

background image

16

BHK-MG-VISA 010906

3. PROGRAMMING EXAMPLES.

The following examples show the functions needed to set voltage to 15V, current to 2 Ma and output ON.

3.1 EXAMPLE 1:

ViByte ps_type;
ViSession BHK_Session;

Kpbhk_init ("GPIB0::6", 1, &ps_type, &BHK_Session); //init ps
Kpbhk_Set_Volt_Curr (BHK_Session, 15, 0.002);

//voltage and current

Kpbhk_OutputOnOff ( BHK_Session, 1);

//output on

3.2 EXAMPLE 2:

ViByte ps_type;
ViSession BHK_Session;

Kpbhk_init ("GPIB0::6", 1, &ps_type, &BHK_Session); //init ps
Kpbhk_SetValue (BHK_Session, 0, 15);

//voltage

Kpbhk_SetValue (BHK_Session, 1, 0.002);

//current

Kpbhk_OutputOnOff ( BHK_Session, 1);

//output on