Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

keithley 2602=>GPIB=>VISA=>data reading delay

Hi,

 

I'm programming Keithley to run a pulse sweep and give me measurements in real-time.  For example, the Keithley will take measurements every 5 milliseconds for ten seconds through the GPIB USB.  To read the measurements with LabView using VISA in syncron-mode, I'm using a "while"-loop.  The problem is that the Keithley device stops after exactly ten seconds, but the LabView program keeps reading the measurements, for another 5 or 10 seconds, as if there is some delay.  The total number of measurements shown in the diagram at the end of the process is correct, but the LabView program just takes longer.  So I'm trying to figure out what the cause of the delay is, and how to fix it, because I need to make sure that it's only 5 milliseconds between each measurement, and not longer.  Also, in the diagram, the measurements seem to have the same width (i.e., with no delay in between).

thanks,

 

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

Hi flafi,

 

In order to start analyzing the observed issue it would be good i we could have a look on your LabVIEW code first. Can you ZIP and upload your project here, if it is not to big? Also give some comments to your code and what you are doing.

 

Let's see what we can do ...! 🙂

 

Best regards,

 

Benjamin

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

It may be an issue of what commands you are using. If the instrument has a SCPI-compliant command set, you can send MEASure command (or anything like that) and then check the MAV bit getting 1 on the Status Byte (using Serial Polling function) in a while loop. When the MAV is set to 1, you can read the response data.

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

Hi Makoto,

 

The instrument actually has a SCPI-compliant set. I checked the MAV and it was ok. I found out that saving the data on my PC was the problem, because when I stopped saving the measurments in the while loop, it started working very well, without any delay! The saving rate was 1 measurment every 5ms( just like the reading Rate). Since I need to save this data, is there any way to do that without causing any delay on the reading process? 

I used the "Write to spread sheet File" function.

 

Thanks

 

 

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

Hi

You can do this in a parallel proces but be sure to only append data and not rewrite all data.

take a look at the producer consumer template and up you go

greetings from the Netherlands
0 Kudos
Message 5 of 12
(4,686 Views)

Hi Albert,

 

Thanks a lot for your info. I used that and it eliminates the delay. But I still have two problems. One is with writing the data to file and the other is with displaying it on the chart. When I use the "write to measurement file" function, it saves a different timestamp than it's supposed to. In other words, the timestamp between two readings is 5ms but in the Time column in the saved file it shows the same value of milliseconds for like 5 or 7 readings before it updates!! I need to use this function because I want to save the data in mutliple files. 

Also, when I display the data on the chart using a very long History (2000000), at some point the chart starts getting slower and the XscaleMultiplier for the time axis, which is 0.005 ( 5ms cycle time of the loop), becomes useless because of that delay in the chart. In other words, the time axis gets false values. 

Any suggestions would be great!

 

Thanks,

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

It looks like you use the timing from windows. The hardware timing of 5ms is correct but you probably use too little digits in writing.

Check this first. Or are you using the windows timestamping, with low resolution?

Second if you save so much data in a graph, it is no wonder it gets slow. Show only part of it and let the user select which part.

I've seen applications that read data from disk only when needed. So less data in memory. Somewhere on the forum or the examples is a link to graphs that show big datafiles. Maybe on LAVA but search with google on the ni forums first. 

Another idea is to post the project you are working on, Somebody could optimise it a bit.

greetings from the Netherlands
Message 7 of 12
(4,659 Views)

Hi,

 

When I use waveform graph, I can unselect autoscale X from the X axis options, and that allows me to pause the graph and look more closely at any section of it.  But I want to use the waveform chart with a big buffer (100000 points), because it allows me to stack plots.  So I'm wondering if there's any way to do this same pause on the waveform chart.  I've tried unselecting autoscale, the same way I did with the graph, but it keeps running.  Any ideas?!  

 

Thanks!

 

0 Kudos
Message 8 of 12
(4,631 Views)

This is a pure LAbVIEW question and does not belong in this thread.

Please post to the LabVIEW forum and don't hijack an old thread even when you started it yourself

greetings from the Netherlands
0 Kudos
Message 9 of 12
(4,608 Views)

Hi, I'm using Keithley 4200 and Agilent 81110a pulse generator,

I also need to take DC sweep measurement and control pulse generator by GPIB

 

But I'm totally begginner with the instruments and their program.

 

 

Could you shall your program code with me????? If one day I could succedd editng your code to mine, I will also shall with you.

 

 

Please help me~~~~~~~~~~

Thank you.

0 Kudos
Message 10 of 12
(4,359 Views)