07-08-2012 01:37 PM
Hello everyone, I'm having a problem with the file i/o VI's. I require my application to save serial data at constant five minute intervals. The problem I'm currently seeing is that on each save to a file a time offset is being added which eventually becomes seconds, then minutes and so on. Since this application is meant to be run for a whole year this is a serious problem.
Attached is the VI, an Arduino program simulating how the DAQ sends data and a file showing my time offset problem.
Any ideas/suggestions/fixes are appreciated.
Thanks
Jose Molina
P.S.
To run the VI upload the code to an Arduino, select it's serial port in the popup VI then click on Ok. The VI will wait for a time that is a modulo of 5 then create a folder structure inside the same location as the LLB. Inside this folder structure should be a file with the data which should be saved every five minutes if left at the default averaging time.
07-08-2012 03:06 PM
After your initial wait, there is no timing functions in your VI at all. Is the wait actually supposed to be happening with the arduino code? The text file shows a write happening every 20 seconds - not every 5 minutes.
07-08-2012 03:11 PM - edited 07-08-2012 03:19 PM
Sorry I forgot to mention that the averaging time is configurable in the pop up vi at the start. I tried 20 seconds because it's much faster for testing than 5 minutes. Timing is being done by a simple counter that increments each time data is received. So if I receive data the timer increments by 5 because data is sent every 5 seconds. Once the timer is equal to the averaging time the data is sent to the enqueue function and then the blocking dequeue function on the second loop sends the data to the file save vi which then saves the data to the file.
07-08-2012 11:44 PM
So I could'nt find a way to edit my first post but I forgot to add a couple of VI's to the LLB. Attached is the updated LLB.