08-16-2018 12:34 PM
Hello, I have a VI that logs data from a while loop. I let the user select how many seconds elapse before each sample is taken. It seems to work for 2 second intervals and greater, but when I set the control to 1 or lower, the minimum data interval is 2 seconds in the log file. I used to be able to collect the data in 1 second intervals when the VI was less developed so my theory is that when I added more content, it seems that the while loop cannot execute fast enough each iteration to keep up with the 1 second interval timing demand. Is this possible? Can there be any other reason for this?
Please see attached VI.
08-16-2018 12:39 PM
I can't open your VI because it's too new of LabVIEW version but...
If your instrument can not respond any faster than every 2 seconds that's all the faster it will respond.
I have a bunch of old Yokogawa WT230 power analyzers in our lab. Most of them only have 9600 baud serial communications, but a few have GPIB. The Serial ones can only be polled about once every 2 seconds, the GPIB ones can be polled as fast as the instruments update rate is set to.
08-16-2018 12:53 PM
@laps682 wrote:
... I used to be able to collect the data in 1 second intervals when the VI was less developed so my theory is that when I added more content,...
Please see attached VI.
I like that theory.
Producer/Consumer design pattern may allow for you to sample faster and keep the "other" stuff from slowing down how fast you collect data.
You may want to look into that approach.
Ben
08-16-2018 03:23 PM
It may be due to the fact that you run VISA Configure Serial Port for every iteration of the While Loop. Try moving this to the outside (left) of the loop, so you do it once, do many reads, then close when you exit the While.
Bob Schor