LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Collect Data from DAQ for user inputted time interval

Hello,

 

I am fairly new to labview and for part of a work project, I am trying to collect Data from a DAQ for a user inputted time interval in order to average that data over that given time interval. Also, the DAQ cannot be contained in a separate loop, as this would interfere with the rest of the program and its functions. 

 

The process also needs to be continually reset and restarted, with the results being stored in an array for the user to see and compare with the previous results.

 

Is it possible to index into a loop for a certain amount of time rather than until the index reaches a certain size? Unfortunately, I am unable to upload the Vi for work confidentiality reasons.

 

Thank you!

 

0 Kudos
Message 1 of 4
(2,473 Views)

Look in the NI Example Finder with the search term DAQmx. Located under the Help Menu.

 

You should be able to find a single loop example there. You will need to communicate to your loop to start and stop it.

 

Otherwise without seeing your VI it is hard to offer suggestions. (You may be able to make a simpler case to post).

 

mcduff

Message 2 of 4
(2,447 Views)

Here is a simple case/example that works and does what I want it do inside a while loop. The issue is that I need the DAQ to be outside of both loops in order to effectively incorporate it into the main VI.

 

 

I will look into the NI Example Finder for a solution as well.

 

Thank you so much for your help!

0 Kudos
Message 3 of 4
(2,441 Views)

The issue is that I need the DAQ to be outside of both loops in order to effectively incorporate it into the main VI.

 

Also, the DAQ cannot be contained in a separate loop, as this would interfere with the rest of the program and its functions. 

 

Again, not sure what exactly you want. Usually I make separate loops so parts of the program can operate in parallel without interfering with each other. If the DAQ and parts of your other program are in the same loop they will run at whatever determines the rate, that is, the slowest part of your program. They may be depending on each other when they don't need to.

 

Suggestions, you will need to learn basic DAQmx functions, that is get rid of the Express VIs.

See

http://www.ni.com/product-documentation/2835/en/

 

Also learn how to communicate between loops using queues, user events, etc.

 

Check out the many tutorials available. For me, the examples in the example finder are usually a good source of inspiration.

 

Good luck.

 

mcduff

0 Kudos
Message 4 of 4
(2,431 Views)