05-22-2006 12:23 PM
05-22-2006 02:04 PM
what are you streaming to file? how much data B/sec? what type of data binary/ascii? What else is the program doing Data acq/ time critical analysis and control. Usually I send my data to a second thread for file streaming and buffering. Do you want a new file each hour or do you just want to overwrite the file each hour? Sorry for all the questions but these are all valid considerations when thinking about how to architect the data streaming.
Paul
05-23-2006 06:24 AM
05-23-2006 07:22 AM
with such low bandwidth data this simplifies the streaming since you will not have to worry about data latancies of writing the data so you can have the data write to file inside of your data collection loop if you would like. Just format teh following string "%s\t%f\%f\r\n", time stamp, data1, data2. Then write the string to file using the append to true. Before each write check the system clock and test if more than 1 hour has passed since the last new file (a shift reg is nice here) if so set the append to false (this will rewrite the file from the begining). If you have to scale with lots of data (100KB+/sec or appending to large files) this approach should be changed to optomize for speed.
Paul
05-23-2006 07:40 AM
@Loue wrote:
Im having a really hard time. I am trying to continuously stream data into a file and then each hour have it dump itself and start the file over again. I am a beginner and cannot figure this one out.
05-23-2006 04:12 PM
Hi,
I was curious which ADE you are using. I noticed that a shift register was mentioned in the forum, so I am assuming that you are programming in LabVIEW, but I just wanted to make sure.
Regards,
Hal L.
05-24-2006 07:41 AM
sorry I assumed Labview (forgot this is the ctr/timer board not the labview board) a shift register is translated to any language as a (un-named) local variable to a loop.
Paul
05-24-2006 11:18 AM