LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Keithley 2420 sourcemeter interrupt error

I am now trying to write a program to remote control my Keithley 2420 source meter by using LabWindows/CVI 8.0.

 

When I sent the commands into the source meter via GPIB interface, the source meter displays "Error: 410" - Query Interrupted. It seems that I have sent a command to the instrument before reading the response to the first command.

 

e.g. In my program,

 

Fmt (command, ":SOURce:VOLTage %f", i);

ibwrt (DeviceSMU, command, StringLength(command));

 

Delay (0.2);

 

Fmt (command, ":MEASure?");

ibwrt (DeviceSMU, command, StringLength(command));

 

How can I solve this interrupt error?

 

Thank you very much!

0 Kudos
Message 1 of 9
(6,697 Views)

Hi Maggie,

 

I remember having a similar problem with another instrument in our lab.

 

Probably, the instrument puts something on the bus as a result of the first command.

When you send the MEASURE? command the previous data is overwritten since you did not read it.

 

Can you try sending a ibrd before the second ibwrt?

For quick trials like these I recommend using NI-MAX's simple GPIB communicator instead of running your code each time.

 

Sometimes the instruments just send an acknowledge data to every command you send.

But, I guess it is possible to configure the instrument to turn this feature off.

If you do that you do not have to do a ibrd after every ibwrt.

 

Hope this helps, 

Message Edited by ebalci on 09-23-2009 10:19 AM
S. Eren BALCI
IMESTEK
0 Kudos
Message 2 of 9
(6,691 Views)

Maggie,

 

Fmt (command, ":SOURce:VOLTage %f", i);

ibwrt (DeviceSMU, command, StringLength(command));

 

Delay (0.2);

 

Fmt (command, ":MEASure?");

ibwrt (DeviceSMU, command, StringLength(command));

 

The ":sour:volt" command doesn't need you to do a read. Are you sure you are not sending a command that ends in a "?" before you send the ':meas?" command?

 

Have you switched the source output on?

 

If all else fails then try using the Ke24xx VXIPnP driver on the Keithley web site. Use NI-SPY to see what commands it is sending.

0 Kudos
Message 3 of 9
(6,678 Views)

Hi Eren and Cymrieg,

 

Thanks for your suggestion. I have tried to send a ibrd before the second ibwrt, and also ensure that I have not send a "?" command before sending the ":meas?" command and the source output have already switched on.

 

However, the interrupt problem still happens. I will try to use NI-SPY to see what happens.

 

Again, thank you all!

 

Maggie

0 Kudos
Message 4 of 9
(6,661 Views)

Maggie,

 

Do you have a manual that specifies exactly what does that error code really stand for?

It will be easier to solve it if we know what the instrument is complaining about.

 

Actually, I'm still confident that it is about some data left on the instrument buffer.

So; 

  How many bytes did you read when you put the ibrd before second ibwrt?

  Was the read successful?

  Did you receive anything into the buffer from that ibrd call?

  If yes, there may be more data in the instrument. Are you sure you read them all?

S. Eren BALCI
IMESTEK
0 Kudos
Message 5 of 9
(6,653 Views)

Here is an excerpt from 2400 series user manual

 

---------- 

page B-8: Eliminating common SCPI errors

 

-410, “Query INTERRUPTED”

This error occurs when you have sent a valid query to the instrument, and then send it 

another command or query, or a Group Execute Trigger (GET) before it has had a chance 

to send the entire response message (including the line-feed/EOI terminator). The most 

likely causes are:

 

1. Sending a query to the instrument and then sending another command or query 

before reading the response to the first query. For example, the following sequence 

of commands will cause an error -410:

:SYST:ERR?

*OPC?

 

This sequence generates an error because you must read the response to 

:SYST:ERR? before sending the *OPC? query.

 

 

2. Incorrectly configured IEEE-488 driver. The driver must be configured so that 

when talking on the bus it sends line-feed with EOI as the terminator, and when lis-

tening on the bus it expects line-feed with EOI as the terminator. See the reference 

manual for your particular IEEE-488 interface.

---------- 

 

 

Item-1 above is what I was trying to verify in my previous posts.

Item-2 is something you have to consider seriously if you haven't performed any successful communcation with the instrument.

If you are using the NI-GPIB board use NI-MAX to configure your GPIB hardware according to the recommended settings above. 

Message Edited by ebalci on 09-24-2009 10:18 AM
S. Eren BALCI
IMESTEK
0 Kudos
Message 6 of 9
(6,648 Views)

Hi S. Eren BALCI,

 

Thank you very much for your great effort.

 

I have tried to send ibrd to read the data left on the instrument buffer. However, I cannot read the data buffer by sending ibrd command. The program is "hang", which may due to my wrong setting on the data buffer size.

 

In my program, I have sent

ibrd (DeviceSMU, data, 50);

 

Even I changed to the byte count down to 10, 20...it is still unsuccessful to read the data buffer.

 

How can I read the data buffer if I don't know the byte court?

 

Again, thank you!

 

Maggie

 

 

0 Kudos
Message 7 of 9
(6,643 Views)

The last parameter to ibrd specifies the maximum number of data bytes.

So you can enter a value that is suitable to your buffer array size.

 

If the program hangs, it is possibly because there is no data to read.

Otherwise it would read as much as it can and return without a hang.

 

In this case, apply the other solution given in the manual.

Open NI-MAX, select your GPIB hardware (I assume your card is NI) and configure your board such that:

"it sends line-feed with EOI as the terminator, and when listening on the bus it expects line-feed with EOI as the terminator"

 

Hope this helps, 

 

NoteCymrieg's suggestion is also valid.

Using a tested driver from the vendor may solve most of your problems and you do not have to deal with low level issues and SCPI command strings. 

Message Edited by ebalci on 09-24-2009 11:59 AM
S. Eren BALCI
IMESTEK
0 Kudos
Message 8 of 9
(6,641 Views)

Maggie,

 

I use these functions and they work OK on my Keithley 2420 when measuring IV behavior of a resistor.

 

str_buffer[100]; 

double IV[5];

 

Fmt (set_sense_cmd, "%s<Sens:Func 'Curr:DC'\n");           // measure current

ibwrt (KE2400, set_sense_cmd, strlen(set_sense_cmd));

Fmt (set_volt_cmd, "%s<:Sour:Volt %f;:Output On\n", desired_V);  //output voltage

ibwrt (KE2400, set_volt_cmd, strlen(set_volt_cmd));

ibwrt (KE2400, ":Read?\n", 6);

ibrd (KE2400, str_buffer, 99);

Scan(str_buffer, "%s>%5f[x]", IV);

 

The returned string from the ibrd contains 5 long double numbers.  You

need find out what you want from them. 

Message Edited by dcl9000 on 10-08-2009 05:24 PM
0 Kudos
Message 9 of 9
(6,555 Views)