08-19-2011 03:22 PM
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.
Program.
08-22-2011 03:00 PM
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
.
08-22-2011 03:05 PM
It looks to me like you are not taking into account your loop execution time.