LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

dynamic channel selection and sampling rate

Hello,
I'm trying to develop a DAQ system that logs approx 60 channels (have all hardware set up to do this).  I plan to set up each channel as a global virtual channel.  I would like to be able to turn channels on and off on the fly as well as be able to adjust the sample/scan rate.  I was able to achieve this with various case structures as well as a Wait Until Next ms Multiple VI hooked up to a numeric control.
I need to be able to adjust the scan rate from 2 samples/channel/second to 1 sample/channel/10 minutes.  With the above set up the problem is that none of the controls change until the next loop iteration (ie if you change the system to sample once every 10 minutes, you have to wait 10 minutes to either stop the system or change to a higher sample rate).  This is unacceptable.  I need to be able to switch to a higher sample rate no matter what the previous sample rate was.  Please let me know if this is possible.  I was using the Analog 1D DBL NChan 1Samp Read VI and would prefer to continue to use this, if at all possible.  Thanks for your help.
 
-Sam Kirkpatrick
0 Kudos
Message 1 of 3
(2,520 Views)
Two ways I can think of. 
1st.  always sample at a high datarate, and decimate the data to the users preference.  This can be a big chore, and lot of data manipulation from the description of your system
2cd. Implement a two loop design.  One for your data acquisition and the other for the user interface.  If the user changes these settings.  Kill your daq tasks (this will be a bit tricky to deal with error handling, and passing parameters back and forth) and then set them up and fire away again. 

I realize that this is a high level answer, but if you got this thing working the way I think you do, you will figure it out in short order.

Paul
0 Kudos
Message 2 of 3
(2,516 Views)
Thanks a lot Paul, I had tried a two loop design before but wasn't killing off and restarting the tasks.  I think you have given me a viable solution.  I will try and see if I can get it to work.  Thanks again.
0 Kudos
Message 3 of 3
(2,506 Views)