Data Aquistion


goldfronts1

Recommended Posts

I am trying to collect more data points for my graphs. When I go into my channels on the "main" tab. I change the timing to 0.01 secs and the plot looks very choppy. Is this the area where I need to adjust in order to collect more data points so that I can have a smooth plot?

Thanks

Link to comment
Share on other sites

What do you mean by choppy? Vertical choppy, or horizontal? I'm assuming vertical. If you want to oversample, set the timing to 0.01, but then check the Average box and specify an average count. So, you could put 10 there and have it oversample 0.01 second data to 0.1 seconds. This will smooth it out somewhat, but its important to understand the source of the noise before you try smoothing it in software, otherwise you might smooth out something that is real.

Link to comment
Share on other sites

Are you familiar with Stream mode in DAQFactory?

Not understanding this code as my channels are 0 and 1. How do I change this code to get information from channels 0 and 1? Don't understand AddRequest and eGet?

// standard initialization:

using("device.labjack")

include("c:\program files\LabJack\Drivers\labjackud.h")

// setup stream:

// set scan rate:

AddRequest(0, LJ_ioPUT_CONFIG, LJ_chSTREAM_SCAN_FREQUENCY, 1000, 0, 0)

// setup channels to stream:

AddRequest(0, LJ_ioCLEAR_STREAM_CHANNELS, 0, 0, 0, 0)

AddRequest(0, LJ_ioADD_STREAM_CHANNEL, 2, 0, 0, 0)

AddRequest(0, LJ_ioADD_STREAM_CHANNEL, 3, 0, 0, 0)

GoOne(0)

// start the stream:

global scanrate = 0

eGet(0,LJ_ioSTART_STREAM, 0, @scanrate, 0)

// scanrate now has the actual scanrate, which you can display on the screen if you want.

Link to comment
Share on other sites

You need to do two things:

1) change the lines with ADD_STREAM_CHANNEL from 2 and 3 to 0 and 1.

2) create two LabJack channels with the appropriate D# (ID of your labjack, 0 if you use the above code), Type A/D, Channel #'s 0 and 1, timing = 0.

Once you start the stream, the data should appear in those channels.

Link to comment
Share on other sites

A few things:

1) you have to hit your "Reset" button to define starttime

2) your history length on Voltage2 is only 3600 long, so only shows the last 3.6 seconds of data (at 1khz rate)

3) you should set the align threshold for the bottom axis to -1 to turn off alignment. The "starttime" variable is throwing the time stamp on the bottom axis and causing it to align incorrectly.

Link to comment
Share on other sites

Yes, you have to click the "reset" button because that is where you define starttime, and without that your graph expression is invalid.

The align threshold will resolve the issue where time is getting pulled from starttime, yes. It won't fix the requirement that you define starttime (which you do when you click the reset button). I personally would suggest declaring and initializing starttime in an auto-start sequence.

Link to comment
Share on other sites

I updated the items as you suggested and was able to stream data. However, my data is still noisy. I have attached images of what I mean. Do you have any suggestions on how to smooth out the plots. I want to collect a lot of data points but the plot should be a smooth continuous plot.

Thanks

post-8150-1328221906_thumb.jpg

post-8150-1328221913_thumb.jpg

Link to comment
Share on other sites

Well, the noise is real, so my first suggestion is to try and quiet the signal in hardware. Look for unshielded wiring and the other standard sources of noise. This is not software noise and appears to be mostly in the Voltage channel. You can smooth the curve out using the smooth() function, but, this is just masking the real problem.

Link to comment
Share on other sites

Archived

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