Sign in to follow this  
PantsOn

Loggin Interval? or ?

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.

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Go to the Channel Table and change the Timing parameter on the channels. For example, 0.5 would have it read twice a second.

We strongly recommend you go through the guided tour in the manual as it will go through these basics and only takes 30 minutes or so.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this