LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ assistant

Solved!
Go to solution

Hello, 

 

I am a beginner at using LabView. I get a problem regarding data acquisition. How can I set a time limit to collect my data? For example, I want to collect samples for 5s (from 0 to 5s). Because I used continuous sampling which the program will stop only when I click the stop button. And I also set a write to measurement file so I can import them into an excel spreadsheet. When I open the TDMS file of my data, it just got many datasheets. I tried to set a WDT Waveform duration as well to see whether I can set a time limit to collect my data or not but it failed. I know there is a way which is to change the continuous sample to N-sample which I don't prefer. Therefore, Is there any way to set a time limit to log data into my excel spreadsheet using continuous sampling mode? 

 

Cheers

0 Kudos
Message 1 of 7
(1,776 Views)

Did you try time elapse function which control timing limits ?

CLA
0 Kudos
Message 2 of 7
(1,773 Views)

No, because I don't have any idea to connect the elapse time block with the DAQ assistant. 

0 Kudos
Message 3 of 7
(1,766 Views)

you can send me the vi let me adjust it for you

CLA
0 Kudos
Message 4 of 7
(1,764 Views)
Solution
Accepted by topic author hihiSam

Using the Dreaded DAQ Assistant (DDA) will probably hinder your ability to understand and learn LabVIEW.  LabVIEW is not like most other Programming Languages, in that it uses the Principles of Data Flow to control program execution.  Another difference between LabVIEW and most Procedural languages is how the concept of Time is woven into many aspects of LabVIEW, especially where Data Acquisition (and Control) is concerned.

 

If you are currently taking a LabVIEW class, I hope your instructor has explained how Data Flow works, though I suspect this has not been emphasized because I don't see the Error Line (one of the most important LabVIEW "wires" being used.

 

I'm going to assume you are interested in learning about DAQ and LabVIEW, rather than asking us to do your homework for you.  I strongly recommend you download and read Learn 10 Functions in NI-DAQmx and Handle 80 Percent of your Data Acquisition Applications .  Do skip over the early entry on the DDA, but do learn about Tasks (start by creating them in MAX, and "graduate" to using other DAQmx functions to help you create them, or use tools in the LabVIEW Project).  Doing continuous acquisition, but being able to stop on a button press is not that difficult.  What might be slightly harder (I don't know -- I've never used DAQmx to save data) is spooling the data to disk.

 

Here's something you might not know -- many DAQ devices have (very accurate) "clocks" and counters, making continuous acquisition very easy, but imposing (at one level) a restriction that you "acquire in chunks", and thus your data size will reflect those chunks.  So if you acquire 1000 samples at 200 Hz, once you say "Start", the DAQ device will basically become unresponsive until the 200 samples are collected, i.e. after 5 seconds.  You might also find that it is worse than that -- once you start, you might find that the shortest acquisition time is 10 seconds, or 400 samples!  Yikes, why is that?  [Hint -- Principles of Data Flow].

 

For finer grain control of Sampling Time, one way is to collect the "bunch" of samples in less time by (a) sampling faster, or (b) taking fewer samples at one time.

 

What sort of DAQ device are you using?  Note that if you don't have a DAQ device, you can easily simulate one.  A For Loop with 200 (Sample Size) wired to N, with a Wait (ms) function inside with 1 wired to it (1 ms period means 1 kHz loop rate) and a Random Number generator inside wired to a indexing tunnel (the default output tunnel for For loops) simulates your DAQ device looking at noise.  Connect this to a Waveform Chart and see how it looks.  Play with this.  Learn.

 

Bob Schor

0 Kudos
Message 5 of 7
(1,720 Views)

I think I figured it out. Anyway cheers for that. 

0 Kudos
Message 6 of 7
(1,676 Views)

True, DAQ using LabView is kind of new to me, so ya I can explore it when I do it by myself. I didn't have class for Labview, to be honest. It's just my uni project. My project supervisor used LabView for his research data logging sometimes, so I just followed him. Therefore, I just came across LabView. The DAQ device I use is NI cDAQ-9178 and NI 9215.

0 Kudos
Message 7 of 7
(1,675 Views)