Clearing log cache without closing DAQFactory


zenith92

Recommended Posts

Hey, first post here, I have a curious little problem. I'm trying to log different values using my sequences, the data is being logged multiple times per second (about 5 times per). Different log files are created every time I run a new "case". So this is the problem:

If I am going to log two different cases, I might get 100 rows of data. If there's one minute (or whatever interval) between the time of logging the two cases, case 1's last rows of data are always also logged into the first couple of rows of case 2. So if someone doesn't pay attention they might blindly use the data of case 2 thinking it's only data from case 2, meanwhile there's some rows at the top containing rows from case 1 as well. Quick example:
 

Quote

 

Case 1

Time, data

10:28:01, 1

...

10:28:59, 7

10:29:00, 6

10:29:01, 3

10:29:02, 2

 

Quote

 

Case 2

Time, data

(cached or leftover case 1 data in case 2 log file)

10:29:03, 1

10:29:04, 2

10:29:05, 8

10:29:06, 0

10:29:07, 3

(start actual case 2 data)

10:37:33, 1

10:37:34, 1

10:37:35, 2

...

...

 

After some toying around, I found out that this doesn't occur when I close DAQFactory in between running the two cases, therefore I thought some data were being stored temporarily somewhere and being written as soon as a new case is ran.

My question is, is there a way to avoid this? Maybe there's a function or setting? Thanks in advance, let me know if something isn't clear.

Link to comment
Share on other sites

Logging sets aren't the best for stopping and starting at exact times, much for the reasons you saw.  Its usually better to either use an export set with some basic script, or use a little more script with the File. functions and just create the files yourself.

However, you might be able to get around this problem by renaming the log file to junk.csv or something, then rename it to the desired name once you want logging to start.  Let the logging set run continuously through this, or at least let it run 2 seconds after the rename, and start it 2 seconds before you rename to your desired file name.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.