Values Missing In Log File


SteveMyres

Recommended Posts

I have a logging set that's doing two things I can't figure out.

The first thing is that there is one channel that comes up in the "Available Channels" box, I add it and click Apply. Yet the next time I come back to the logging config, it's back in the Available Channels box again.

Second issue is that the lines aren't all created equal. In some cases fields that are closer in time than the align threshold aren't combined into the same line, and also fields seem to be missing for no reason I can discern. The points are derived from data arriving on a serial device, and during testing, all the values seem to appear in sequence every time, and trigger the section of sequence with the AddValue() call, but not all the fields are logged.

Here's a section of a log file

1364293414.1,,,,,4200,,,4200,4200,,,,,4200,4200,840,,4200,4200,,4200,4200
1364293415.1,4250,,,4250,,,4250,,,,840,840,840,,4250,,,,,,,
1364293416.1,,,,,4250,,,4250,4250,,,,,4250,,850,,4250,4250,,4250,4250
1364293417.1,4300,,,4300,,,4300,,,,850,850,850,,4300,,,,,,,
1364293418.1,,,,,4300,,,4300,4300,,,,,4300,,860,,4300,4300,,4300,4300
1364293419.0,4350,,,4350,,,4350,,,,860,860,860,,4350,,,,,,,[/CODE]

As you can see, the pattern of what gets logged is close to repetitive. Align threshold is set at 3.

Link to comment
Share on other sites

I don't think an alignment threshold above 1 does much because the logging set loops every second. So, every second, it looks at what has accumulated since the last time, applies the alignment, then clears the buffer. That's why you get a line every second. Really, if you are slower than 1 hz you probably should just use snapshot mode.

Link to comment
Share on other sites

I parse the serial data, which yields a bunch of values in an array that have to be gone through and packed to the relevant channels as appropriate. So I have a for() loop that does one value at a time with a slight delay between loops. By making the delay very small, I can get all the fields to log simultaneously. Since the data is streaming, it may make sense to make a protocol out of it rather than service it entirely in sequence.

I'd like to have the logging running synchronously with the receipt of the serial data. Since DAQ Factory doesn't seem to close the log file when you stop logging and reopen it when you start, it should be feasible on receipt to stop logging, pack the channels, and restart logging. What happens on the off-to-on transition? Does the logging set check and log immediately and then wait 1 second or does it wait first, then check? Also, if you want to access the log file while DAQ Factory is still running, is there a way to force close the file?

What about that weird channel that keeps popping itself back into the "available" category? Do you have any ideas what's going on with it?

Link to comment
Share on other sites

Consider using a variable to hold your timestamp determined outside the loop so all your channels inside the data processing loop get the same time stamp.

As for the rest of the logging set questions, if you want to do more advanced logging, you really should just use the File. functions and do it yourself. This will give you total flexibility on how the logging works. Logging sets are a higher level function and they work how they work and you don't get a lot of choice. They are designed really to run continuously and to work with continuous data. DAQFactory locks up the file for performance reasons. The only way to unlock it is to change the logging set file name (while running). Again, if you need more flexibility, use File. functions.

Link to comment
Share on other sites

Archived

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