Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

loops

I have a vi which uses a single loop to collect data from two instruments and then write them to the same file. I am using a milli second timer to run the loop at a frequency of 10 Hz. But only 5 readings are obtained from the instruments per second, instead of the 10 expected what could be wrong with it
any help in this direction
0 Kudos
Message 1 of 2
(3,081 Views)

The wait you have only delays the execution of the next iteration. It does not determine the absolute frequency of the execution. All of the code in your VI must take close to 100 msec and with a delay of another 100 msec, you get 200 msec total. If your code took 2 minutes to execute and you had a 100 msec delay, each iteration would be 2.1 minutes. There's a couple of subVIs that you didn't include that might be using up the time and the Write To Spreadsheet is not very effecient because it opens and closes the file each and every time it is run. You can use the profiler to see where the time is being spent. You could also try writing the data to file after the while loop terminates. Not related to perfromance, but you don't have a way to terminate the while loop except with the "Stop" button on the toolbar. This should not be used as the normal way to stop a VI.

Also, in the future, similar questions like this should be posted to the LabVIEW general forum. Nothing in this VI has anything to do with a digital I/O board.

Message 2 of 2
(3,073 Views)