Showing results for 
Search instead for 
Did you mean: 

Sampling rate problem



I am recording 7 channels using a VI of LabVIEW. The VI reads 3 analogue inputs from a DATAQ card (DI-158U) connected via USB and the 4 remaining channels from a PLC connected via Ethernet.


I created a while loop to update the indicators and plots every 2 seconds. Moreover, inside the while loop there is a case structure to record the samples into an Excel file (if the user switch on the option of recording).


The main problem is that after running this VI for several hours the sampling interval at the Excel file is not stable at 2 seconds. The first samples have an interval of 2 seconds, but the last ones have an internal of 16 seconds. Therefore, there is a source of delay which it is unknown.


I think it is related with the fact of the file's writing at each iteration, but I am not really sure. I would like to ask for suggestions where the delay could occur when the VI is running for several hours.



Download All
0 Kudos
Message 1 of 3

first thing i notice is, that you open the file in each loop-iteration.

don't do that.

If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 2 of 3

Apart from what jwscs says, you are using software timed acquisition and are executing Express VIs in every iteration of the loop.

0 Kudos
Message 3 of 3