LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Updating on user input with DAQ

Hello all,
   I have a rather generic design question:  If you have an application where you continually display acquired data and would like to be able to allow the user change the way its displayed, what is the best method?  The specific example I have in mind:  I am trying to acquire N channels of N samples of analog data a few times per second, acquisition rate controlled by a software loop.  I would like the user to be able to choose which channels are displayed amongst many other things.  The simplest thing to do would be to just throw everything in the acquisition loop; that is check the controls every time.  I would like to be able to use an event structure to detect when controls are changed.  I don't think using the timeout of the event structure is an option since some events might take significant processing time.  I'm also having a hard time seeing a simple way to have parallel loops for data acquisition and the user interface event structure.  If both are in while loops how do I communicate (simply) between them?  My gut feeling would be to have the data acquisition loop "send" data to the user interface loop to be displayed as it is acquired (perhaps through a queue?) but then I get stuck on how to make the event structure respond to data arriving in the queue.  Thoughts?  Thanks,
 
Paul
0 Kudos
Message 1 of 6
(3,046 Views)

Hi Paul,

The best way to have a user select different channels while your program is collecting data, would be to use the "Select Signals" Express VI found in the Signal Manipulation Palette.  You can wire an array of numeric controls (number of numeric controls = total number of channels) to the Selector Input, and have the user specify the channels to display.  You can put this inside a while loop so that the channels being displayed can be selected while data is being collected.  This method will allow you to select channels, what other properties would you like the user to be able to change?

Download All
0 Kudos
Message 2 of 6
(3,018 Views)
Hi Meghan,
  I don't think this is quite what I was looking for.  Basically I would like to avoid polling controls and only make changes in the display when the user changes a button.  For example, if the DAQ is returning data 20 times a second it doesn't make sense to check for changes in each iteration of the while loop.   Thanks,

Paul
0 Kudos
Message 3 of 6
(3,013 Views)

Hi Paul,

I would suggest taking a look at the example titled Graph Events.vi found in the NI Example Finder.  This example shows how you can have two parallel loops running, one acquiring data and one with an event structure.  Let me know if this helps, thanks! 

0 Kudos
Message 4 of 6
(3,004 Views)

Hi Meghan,

  I can't seem to find an example called "Graph Events.vi" in the Example Finder.  I have Labview 7.1; is this something only available in 8?  Thanks,

Paul

0 Kudos
Message 5 of 6
(2,994 Views)
I think I found a satisfactory solution.  Thanks for the suggestions; part of the problem was that I wasn't completely clear (on the discussion board and in my own mind) what I needed to do.  I realized if something needs to be done every DAQ trigger (like selecting which signals to display) I'm not really "polling" for user input; the selected values have to come from somewhere anyway so I might as well check the control. 
  I ended up using two loops; one for DAQ and one for user input.  In the DAQ loop I acquire data on channels specified by the user, display the channels specified by the user in graphs and do other things that have to be done every trigger.  In the other loop I update things that only need to be set when they are changed such as plot names, scale multipliers and offsets, etc. 
0 Kudos
Message 6 of 6
(2,989 Views)