Loggin Interval? or ?


PantsOn

Recommended Posts

Hello

I have been asked how to set the interval of logging? It seems that current DFLogger for LabJack Sample is logging in every seconds. How can I set this value? like 0.5 seconds, 0.1 seconds, 0.01 seconds.

Anybody can tell me how?

Thanks in advance.

Link to comment
Share on other sites

When the "All Data Points (aligned)" option is selected (the default) in a logging set, all data is logged. The interval is determined by the polling interval to the device. So if you are reading the LabJack once a second, you will get a line in the log once a second. If you are reading the LabJack twice a second, you will get two lines each second and so forth.

With this mode there is something called Alignment threshold, which by default is set to 0.05 seconds. This number determines how close two data points need to be to be considered happening at the same time. For example, lets say you are reading all 8 analog input channels with a timing of 1 and an offset of 0. It takes 20 ms (approx) to read the first 4 analog channels, and another 20ms to read the second. The second block with therefore have a time stamp that is 20ms later. Since the Alignment threshold is set to 0.05 or 50ms, all eight points will appear on the same log line.

The problem comes when you try and read faster than 20hz. Lets say you are streaming 4 channels at 300hz. In this case the difference in time between consecutive is 1/300th of a second or 0.0033 seconds. With the alignment threshold set to 0.05, only one in every 15 data points will be written. To fix this, you have to set the alignment threshold smaller than the acquisition rate, or in this case, you can just set it to 0 since all the streaming channels will have the same time stamp.

Link to comment
Share on other sites

Alternatively, you can set the logging set into Fixed Interval mode. This causes the logging set to go out at an interval specified in the logging set and either take a snapshot of the last read value of all the channels in the logging set, or average all the data points that have accumulated on each channel over the interval. This mode is often nice when you need to get your data on a particular time interval, but is not as precise and in many situations can create time noise, i.e. noise in your signal due to noise in how precisely time is recorded. DAQFactory records time to the microsecond to keep this at a minimum, but using fixed interval mode bypasses this as the time logged is the time the logging set happened to go out and collect the data to log and not the actual time of acquisition.

Link to comment
Share on other sites

The interval is determined by the polling interval to the device. So if you are reading the LabJack once a second, you will get a line in the log once a second. If you are reading the LabJack twice a second, you will get two lines each second and so forth.

<=== I unstand this, but I don't know how?,

How to read LabJack twice a second, 4 times a second, 10 times a second, or once in two seconds? I am using DFLogger for LabJack Sample.

Link to comment
Share on other sites

Archived

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