LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Time error when writing to Measurement File

I have created a program to write data from 4 channels on an A/D board to a measurement file.  I put a time delay in the program so the data is recorded at regular intervals to the measurement file.  This time delay can be adjusted on the front panel to any interval.  My problem is that when it records the data, there are random deviations from the regular time  intervals.  Does anyone knows what is causing this error and how to fix it?  Here is a picture of the error I am speaking about and my program.

 

Text file, recording data every 1 second.

 

4 channel recorded data.JPG

 

Program.

4channel data recorder labview.JPG

0 Kudos
Message 1 of 3
(2,610 Views)

Polymer - 

 

Are the AIn and the To Eng sub vi's that you have created for your program?  It's possible that some programming optimization could help with this jitter, but its also something inherent when an OS like Windows.  To see if some code modification would work, I would address the architecture of your acquisition and file I/O.  The second thing in addition to that would be to rid the Express VIs and program with the ms (wait) function instead of the Timing Express VI and using the low level File IO vis opposed to the Write to Measurement Express VI.   

 

I would recommend you check out the link here: http://zone.ni.com/devzone/cda/tut/p/id/3023.  To start a vi from a template you can go to File > New... > VI From Template > Producer/Consumer Design Pattern (Data).  The "producer" will be your data acquisition in this case and the "consumer" as writing or processing your data.  Please let me know if you decide to implement these changes and if the behavior remains the same.  

 

 

Regards,

 

Ben N.

National Instruments

Applications Engineering 

 

 

.   

Regards,

Ben N.
Applications Engineering
ni.com/support
0 Kudos
Message 2 of 3
(2,573 Views)

It looks to me like you are not taking into account your loop execution time.

Tim
GHSP
0 Kudos
Message 3 of 3
(2,567 Views)