10-25-2015 09:40 AM
Hi everyone, I have a question regarding DAQ Assistant. I need to acquire some data at low rates (ca 10 Hz). I want to acquire let's say 100 samples. I would also like my chart to update ten times per second. But when I choose collect N samples (100) at 10 Hz, the chart updates just once - after 10 seconds. Is there any other way to collect N samples and be able to watch chart updating 10 times per second than using continuous samples (10 Hz, 1 sample to read) with timer that ends the while loop after 10 seconds?
When I use the last mentioned way and write data to file, I always acquire 101 samples, not 100. And I think, that it is not an ellegant solution to write data to file ten times per second (at higher sampling rates, LabView does not manage to write all samples to .xlsx file, with TDM(s) files it is better).
Maybe collecting 1 sample on demand would be ok, but so far I haven't had any experience with that.
Thanks for your replies
Pinca
Solved! Go to Solution.
10-25-2015 10:29 AM
First, read this excellent White Paper about DAQ-mx and stop using the DAQ Assistant, which does not have the flexibility that you need to do what you are describing.
Do you see what you want to do? You are asking to sample at 10 Hz, and want the Chart to update for every sample. So how many samples do you want to take before adding the sampled data to the chart?
Now using the knowledge of what you learned in the White Paper, put down a few (you can do it in one) DAQmx functions to start the Acquisition, in a For Loop (with what wired to N?) take the appropriate number of samples and send that to the Chart, then at the exit of the loop, stop the Acquisition. If you use Tasks (either created by MAX or by using the "New Task" command of LabVIEW Project), you should be able to accomplish this with as few as 3 DAQmx functions (I'd probably use 4) and a single For loop.
Bob Schor
10-25-2015 12:00 PM
Hi Bob, thanks for your reply. I use DAQ Assistant for dynamic data type, which is data type I use for various purposes.
So I tried to do it with DAQmx create channel, then I used a sample clock for specifying a rate (10 Hz) and I connected it to a for loop, where DAQmx Read (read 1 sample per channel) was wired to a chart. This loop was executed 100 times and then everything worked.
Thanks for help and have a nice day.
Pinca
10-25-2015 12:05 PM
Good for you! I did drop a few hints, but was hoping you'd figure it out once I pointed you in the right direction.
Your mention of Dynamic Data is another excellent reason to not use the DAQ Assistant -- I've never really understood the purpose of this Data Format, and always found its functions so complicated and non-intuitive ...
Bob Schor
10-25-2015 12:32 PM
10-25-2015 03:05 PM
Thanks for reply Dennis.
I do not need to do a single point acquisition, but when we are talking about the rates of 8-10 Hz, there is a difference in fluency of a chart if I choose to display every one sample or every 4 samples.
Have a nice day
Pinca
10-25-2015 03:11 PM
Your opinion about dynamic data type surprised me - I thought that this data type was built to simplify the whole data flow. Maybe it is the reason I use it - because I simply cannot imagine how to substitute Select Signals, Set Dynamic Data Atributes, Write to measurement file (maybe this one yes) or Merge or Split Signals Express VI. Thanks for your thoughts 🙂
10-25-2015 03:22 PM