LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ Assistant sampling issue

Solved!
Go to solution

Hi all,

 

I have attached a VI that I have been using to log data from a few different voltage and strain channels. All the channels and sensors work perfectly and the VI reads the data fine but will only log for roughly 9 seconds. I've found the reason for this is that within this time the amount of samples set to read is reached. I have also found that the reason for this is that instead of the DAQ assistant sampling at the stated 50 or 100 Hz it samples at a rate of roughly 1.6kHz (every 0.000620 seconds). Nothing I do seems to change the rate I sample at so if anybody has any ideas it would be much appreciated!:)

 

Many Thanks,

 

Andrew 

0 Kudos
Message 1 of 11
(8,783 Views)

That VI is confusing. You have programmed it to only write a single acquisition? I'm also not sure I like setting the samples to read to be so much higher than the sample rate. I would set to be no higher or equal. If equal, you would acquire 100 samples every second instead of every 150 seconds like you have now.

 

If you want to log all of the scans, then you are going to have to change your code. The simplest would be to place the file write inside the loop.

0 Kudos
Message 2 of 11
(8,781 Views)

Currently the VI writes a file containing data from all the channels in separate columns as required. The only issue is not being able to change the sample rate. The reason it is set to read 15,000 samples is because that works out at 5minutes of data logging at a sample rate of 50Hz. If setting the samples to read to equal the sample rate surely it would only read say 50 samples if the rate is 50Hz?

 

Thanks,

 

Andrew 

0 Kudos
Message 3 of 11
(8,773 Views)

It would read only 50 samples if you stopped it after 1 second. The way you have it now, you are throwing all samples except for the last scan. If you only want a single scan, get rid of the while loop. By taking samples in smaller chunks, you can still take 5 minutes worth of data if you just let the loop run for 5 minutes.The VI would actually be more responsive and you would actually be able to stop it. As it is, you would click on the stop button and it would not work for 5 minutes. That's really not good user interface design.

 

I also don't see a problem with setting the sample rate. What exactly is your proof that it is not correct?

0 Kudos
Message 4 of 11
(8,763 Views)

Andrew,

 

i have a real hard time to understand what you are seeing. Therefore i better explain what your VI does and you should compare that with "what you see".

Block Diagram.png

 

Your DAQ Assistant is configured to acquire 15000 samples at a rate of 100Hz. This is a finite acquisition. So the DAQ Assistant will wait about 150 seconds to acquire the amount of samples you configured. This will result in 8x15000 measurement values acquired withing 150 seconds. You write those values into the output tunnel, the acquisition will start again until the loop is stopped by pressing the stop button.

When you do so, the current value in the tunnel will be passed on to the Write To Measurement File. This is the reason why you only see as many samples per channels in the file as you have configured in the assistant. If you want to have more, you have to move the logging into the loop. This will of course insert a little delay between finish of the last acquisition and restart of the new.

 

I do not understand why you see any samples faster than 100 Hz per channel. You will see more than 100 samples per second in your measurement file because you have 100Hz per channel. So in the current setup, you will get 800 measurement values per second since you are using eight channels (so 100 samples per channel = 100*8 = 800). But this is not the samplerate per channel!

 

hope this helps,

Norbert

 

Edit: Please note that your Timeout in the DAQ Assistant is still set to 10 seconds. So you will get timeout errors all the time.

Message Edited by Norbert B on 03-11-2010 03:16 AM
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 5 of 11
(8,750 Views)

Hi all,

 

Thanks for all your responses, I just realised I didnt upload the exact VI that we were using so I have attached this and a file containing the data from one of the tests to clear a few things up.

 

My requirements for this VI are to record data from about 8 channels at a rate of 50Hz per channel. It needs to be able to record for up to a maximum of 5minutes (15000 points per channel) before it is stopped.

 

Hope this clears things up a bit!

 

Many Thanks,

 

Andrew Stalker

 

 

 

 

 

 

 

 

 

Download All
0 Kudos
Message 6 of 11
(8,729 Views)
What I did not notice is that you are running with a cDAQ module. Which one?
0 Kudos
Message 7 of 11
(8,720 Views)

Andrew,

 

i still do not understand why you got a logfile at all without running into timeout errors. I dare to say: The VI you have posted did not create the logfile. At least not using the settings your DAQ Assistant have right now.

Due to the timing of 0.00062s per sample (1.6kHz), 15000 samples would be acquired within 9.3s which is slightly below the timeout time of 10s. Reducing the sampling rate will introduce timeout errors leaving the DAQ Assistant NOT to pass data on to the logging. So 50Hz with a timeout of 10s will produce empty logfiles (regarding data)!

 

Norbert

 

 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 8 of 11
(8,719 Views)
Solution
Accepted by topic author Andy S

I think I can explain what is going on. In an earlier post, the op mentions using a 9237. That has a minimum sampling rate of 1.63 kS/s. That matches the rate in the file.

 

Andrew,

 

Reading the manual would have answered your question.

Message 9 of 11
(8,708 Views)

Hi again,

 

I decided to start from scratch and have now got a fully functioning VI that does exactly what I need it to do. The only thing I couldn't work out was the minimum sampling rate of 1613kHz but this has now been answered!

 

Thanks everyone for all your help!

 

Many Thanks,

 

Andrew 

0 Kudos
Message 10 of 11
(8,704 Views)