03-03-2015 07:14 AM
I have a zes lmg500 that I use. It has the option of continues measuring data, with a user control cycle loop (still using a while loop but the delay is coming from the instrument). The problem is that the loop time is not constant. Can I use a very short time (100ms) as the instrument cycle time but use a longer time delay in the while loop that collect the data?
I know many instrument offer the same abilities, so the question is relevant to all of them.
Thanks for any help
Solved! Go to Solution.
03-03-2015 07:30 AM
I'm not sure exactly what you are doing right now.
How does the instruments communicate (serial/VISA, TCP, etc.)?
How are you timing your loop right now?
Sounds like maybe you set it up and then the instrument sends data at fixed (or attempted fixed ) time intervals and you have a loop that simply waits on receiving input?
03-03-2015 07:47 AM
I'm usimg serial Visa. I'm ataching a picture with comment.
Now the loop is timed by the instrument .
I want to use 100ms as the loop time but use a 1 sec delay in the while loop
03-03-2015 07:54 AM
03-03-2015 07:56 AM
That is exactly my question. Are you sure that if I’ll use a longer delay then the loop time I’m not going to saturate the instrument buffer?
03-03-2015 07:59 AM
Does that measurement VI have built-in wait functionality and a timeout?
If not, then you are simply polling the VI at 1 kHz, but I suspect that this is not the case or your Waveform Chart probably wouldn't look as you expect (getting 0's put in everytime measurement data is not available).
I expect that if you have the instrument set up to send data at a fixed time interval (i.e. 100 ms), all the data that it is sending you will end up residing in your serial buffer (or the instrument driver will have taken it out and put it in another internal buffer), so if you come back to read it 1 sec later, then you will have 10 data points to go through. Whether you can read them all at once with the read VI or have to call it a whole bunch of times until empty I can't say.
What is your objective?
03-03-2015 08:04 AM
All i want is to read the data at one secont interval. But I want the one secont to be exact, If I use 1sec as the cycle time the actual loop time is 970ms-1040ms.
03-03-2015 08:04 AM
All i want is to read the data at one secont interval. But I want the one secont to be exact, If I use 1sec as the cycle time the actual loop time is 970ms-1040ms.
03-03-2015 08:10 AM
Another problem that might happen is that Ill collect and ‘old’ data – meaning every time I read instead of reading the last data points ill read the first one in the internal buffer
03-03-2015 08:15 AM