04-03-2016 05:34 AM - edited 04-03-2016 05:36 AM
Hello,
I am trying to create a list and send it to the power supply Keithley 2200
This code should creates a list of 5 items and trigger OUTPUT
Ke2200_WriteString(instrumentHandle, "TRIG: SOUR BUS");
Ke2200_WriteString(instrumentHandle, "LIST: STEP 5\n");
Ke2200_WriteString(instrumentHandle, "SOURCE:LIST:MODE CONT");
Ke2200_WriteString(instrumentHandle, "SOURCE:LIST:COUT 2");
Ke2200_WriteString(instrumentHandle, "SOURCE:LIST:VOLT 1, 2V");
Ke2200_WriteString(instrumentHandle, "SOURCE:LIST:VOLT 2, 2V");
Ke2200_WriteString(instrumentHandle, "SOURCE:LIST:VOLT 3, 5V");
Ke2200_WriteString(instrumentHandle, "SOURCE:LIST:VOLT 4, 6V");
Ke2200_WriteString(instrumentHandle, "SOURCE:LIST:VOLT 5, 1V");
Ke2200_WriteString(instrumentHandle, "SOURCE:LIST:CURR 1, 5A");
Ke2200_WriteString(instrumentHandle, "SOURCE:LIST:CURR 2, 5A");
Ke2200_WriteString(instrumentHandle, "SOURCE:LIST:CURR 3, 3A");
Ke2200_WriteString(instrumentHandle, "SOURCE:LIST:CURR 4, 1A");
Ke2200_WriteString(instrumentHandle, "SOURCE:LIST:CURR 5, 3A");
Ke2200_WriteString(instrumentHandle, "SOURCE:LIST:WIDTH 1, 0.001S");
Ke2200_WriteString(instrumentHandle, "SOURCE:LIST:WIDTH 2, 0.001S");
Ke2200_WriteString(instrumentHandle, "SOURCE:LIST:WIDTH 3, 0.001S");
Ke2200_WriteString(instrumentHandle, "SOURCE:LIST:WIDTH 4, 0.001S");
Ke2200_WriteString(instrumentHandle, "SOURCE:LIST:WIDTH 5, 0.001S");
Ke2200_WriteString(instrumentHandle, "SOURCE:LIST: SAV 3");
Ke2200_WriteString(instrumentHandle, "OUTPUT ON");
Ke2200_WriteString(instrumentHandle, " "SOURCE:FUNC:MODE LIST");
Ke2200_WriteString(instrumentHandle, ""*TRG");
There is no errors, but the code doesn't work. Any idea why???
THANKS in advance
04-04-2016 06:55 AM - edited 04-04-2016 07:01 AM
Hello,
Some questions:
Do you use the GPIB bus to communicate with the instrument?
Do you use the NI-VISA library to communicate with the instrument ?
Do you test the communication (*IDN?) with the instrument with MAX (Measurement and Automation Explorer) ?
Your code:
I don't see the function to initialize the communication K2200_Init (...) --> The instrumentHandle variable is a valid Handle ?
What are the error code returned by the functions Ke2200_WriteString: error = Ke2200_WriteString(instrumentHandle, "TRIG: SOUR BUS");
There are some syntax error in your code (regarding the doc Example 3 List Mode.pdf downloadedd from the Keithley Web site:
Line 1: character : is missing between SOURCE and BUS
Ke2200_WriteString(instrumentHandle, "TRIG: SOUR BUS"); ==> Ke2200_WriteString(instrumentHandle, "TRIGGER: SOURCE:BUS");
Line 2:
Ke2200_WriteString(instrumentHandle, "LIST: STEP 5\n"); ==> Ke2200_WriteString(instrumentHandle, "SOURCE:LIST: STEP 5");
The 2 last lines: some " to delete...
Best regards.
04-04-2016 07:27 AM
Hello jm73,
Thanks for your reply
Do you use the GPIB bus to communicate with the instrument?
-I use both GPIB and USB it depends on the user preference.
Do you use the NI-VISA library to communicate with the instrument ?
-Yes
Do you test the communication (*IDN?) with the instrument with MAX (Measurement and Automation Explorer) ?
-Yes, and it works correctly
The 2 last lines: some " to delete...
-That was a mistake while writing the post 🙂
What are the error code returned by the functions Ke2200_WriteString: error = Ke2200_WriteString(instrumentHandle, "TRIG: SOUR BUS");
- No error code
04-04-2016 09:19 AM
I don't know the exact commands but you need to set the trigger count to the number of point s in the list and then to tell the instrument to go with a ":int" command
04-04-2016 11:24 AM
Hello cymrieg,
I checked the commands list reference, there isn't anything that does that " trigger count to the number of points"
04-05-2016 09:31 AM
This is from page 5-6 of the current reference manual for the 2280. I don't think you want to set the arm layer to Bus trigger though.
*RST
:SENS:CONC:NPLC 1
:LIST1:VOLT "1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0"
:LIST1:CURR "2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0"
:LIST1:DWEL "3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0"
:LIST:SAVE:INTE 1
:LIST:RCL 1
:ARM:SOUR BUS
:TRIG:SOUR IMM
:TRIG:COUN 10
:TRIG:SAMP:COUN 10
:TRAC:CLE
:TRAC:FEED:CONT NEXT
:TRAC:FEED SENS
:TRAC:POIN 100
:LIST:STAT ON
:INIT
*TRG
*WAI
:TRAC:DATA? "READ,SOUR"