LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

slow and timeout error

Solved!
Go to solution

Hello forum members,

 

I have wrote a program in LV2010 and is working fine except for one final issue. 

The program runs very slow and sometimes show timeout error. In the program I send a voltage to Keithley 2400 and simultaneously measure current from Keithley 2400 and 2000. I sweep the voltage using a while loop. I have not used buffer.

 

Your kind help would be highly appreciated.

Thanks.

Pradeep

0 Kudos
Message 1 of 12
(4,780 Views)

What is "very slow"? What speed you need? What determines the loop rate?

 

Your description is insufficient to troubleshoot. Can you attach your VI?

Which function gives the timeout error?

0 Kudos
Message 2 of 12
(4,772 Views)

Oops! sorry. I forgot to mention the problem.

 

After scanning the measurements from 2400 and 2000, I plot it in a XYY graph. On excecuting, the graph plots the data very slowly. Sometimes it appears to struck at say 6 V, and waits for around 10 seconds. On repeatdly running the program, a timeout error is displayed.
There is  no wait command for the loop and I want the loop to be re-executed immediately.

Download All
0 Kudos
Message 3 of 12
(4,763 Views)

How many data points do you typically acquire. If the number is large, you might run into memory problems by constantly growning the arrays in the shift register.

 

Since you know the number of iterations from the start, you should use a FOR loop instead of a while loop (you can show the conditional terminal the stop prematurely with the button). Also, since you know the final size of the arrays, you should reallocate them (containing NaN, so they don't show in the graph), then use replace array subset to fill with real data. You can replace the bundle and array operaration with a "build cluster array". Fewer steps. (Personally, I would use complex arrays for the xy graph). What determines your loop rate?

0 Kudos
Message 4 of 12
(4,757 Views)

Try this quick draft with a few suggestions for code improvement. (LabVIEW 2010)

0 Kudos
Message 5 of 12
(4,743 Views)

I may at large need 20-40 (typically 10-20) data points. An timeout error is generated at KE2400 Read. Is it something connected with the size allocation of the memory? Can it be expanded, if so how?

 

Your suggestions were very useful in making the program look a little simple. Thank you.

0 Kudos
Message 6 of 12
(4,722 Views)

I also noticed that the KE 2400 instrument show error code -410 (Query interupted), -420 (Query Unterminated) and -113 (Undefined header) during the measurements.

0 Kudos
Message 7 of 12
(4,708 Views)

I am not familiar with these instruments. What are your timeout settings? What is your loop rate? You might need a small delay in the loop (as in my example). Maybe the instrument is not ready to receive another query right after sending data. Maybe you are simply hammering the instrument faster that it can handle it.

 

Also look at hardware issues, communication cables, etc.

Message 8 of 12
(4,677 Views)

For the 2400, you are not using the certified driver from NI and then you are mixing in a low level GPIB function instead of VISA. Where did you get the 2400 driver? I would suggest that you use a better driver and get rid of the silly GPIB function. It is also silly to use a string for the VISA Resource Name. After this, you need to look at the read functions for both instruments and review what they are doing and look up the functions in the manuals. It does not appear to be any problem with LabVIEW but with how they are configured.

Message 9 of 12
(4,668 Views)
Solution
Accepted by topic author pclab

A few things I noticed:

  1. You should not be mixing GPIB and VISA to talk to the same instrument.  You should just use the VISA Write to send your command.  But if there is a VI in the driver suite for the 2400 to set the source voltage, you should use that.
  2. If you insist on building your own SCPI command to set the source voltage, make sure the command structure is correct.  You may need to add a semicolon or an End of Line character to the end of the command.  This is what I am suspecting is causing the Undefined Header error.
  3. You really should add a wait between setting the voltage and then performing the reads.
  4. I don't like the idea of allowing two different VIs communicate over the same bus at the same time.  I've seen some weird things with GPIB.  You should sequence a little more so that you set the voltage, wait 500ms (nice round number to allow things to settle and the bus to talk), read the voltage from the 2400, read the current from the 2000.
  5. Your measurements seem backwards to me.  I normally use the 2400 (source meter) to source a voltage and read the current, then read the voltage at the unit under test with the 2000 (DMM).

GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 10 of 12
(4,663 Views)