LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I run multiple channels in the same VI?

I am trying to analyze two signals, one temp, the other strain.  I have configured my two tasks using MAX, and written separate VIs which work fine when run independently.  Now I want to measure the two signals and output the data on two separate graphs within one VI, but when I run the VI I keep getting an error stating that the "resource is already reserved" (or something to that effect).  I tried adding a channel to an existing task, and building the VI but that didn't work (both signals showed up on both graphs).  I also tried using two separate tasks but that when I get the aforementioned error.  How do I get each channel to show up on different graphs?
 
I am using: M-Series DAQ card 6259, SC-2345 and SCC modules, with Labview 8.0
0 Kudos
Message 1 of 7
(4,212 Views)
Does the following VI come close to what you wanted to do ?


0 Kudos
Message 2 of 7
(4,210 Views)
This is perfect...except one question.  This assumes that you are running both samples at the same rates, with the same triggering.  The settings you choose are universal for both channels.  How can you make these independent?  I tried to add an additional DAQ assistant, but now I get a run-time error saying that the "task cannot be performed because the resources are already reserved".  I also tried putting the two tasks in separate while loops, but I get the same error.  A solution to this would allow multiple channels to be collected and graphed simultaneously, but on different graphs.
0 Kudos
Message 3 of 7
(4,158 Views)
You cannot setup different sampling rates for multiple channels. Your board has a single A/D that is muxed to the different channels. You also can't have more than one task of the same type active. Taking different channels and plotting them on separate graphs is simple. If the data is being returned as either a 2D numeric array or a 1D array of waveforms, you use the Index Array function to get each channel and then wire the outputs to the separate graphs. If you are using the DAq Assistant for multiple channels, it is is returning a signal data type and you can use the Split Signals function on that.
Message 4 of 7
(4,152 Views)
How frustrating is that??  If the channels are multiplexed together and you have to sample each one at the same rate, then how do you set up complex measurements simultaneously?  For example, I need to measure pressure spikes so I need a large sample size and fast rate to capture the full gamut of the spike.  I also want to set triggering so I can get the period, amplitude, etc during certain ranges of pressure.  But for my temperature task, I just need a slow rate to collect average temperature.  There's no way to do both?
0 Kudos
Message 5 of 7
(4,149 Views)
You could go out and buy a different DAQ board from NI that has a separate A/D per channel but you'll pay a lot more. Just because you've got a large sample rate and size for some channels doesn't mean you have to use all of the data for the other channels. You can decimate the array for the temperature channels or only pass the data to it's graph when you want (i.e. with a case statement and a timer). In effect, you can do both.
0 Kudos
Message 6 of 7
(4,141 Views)
One solution would be to decimate your data sample array on the desired channel !
ie For your amplitude, pressure peak samples -then sample at highest rate.
while for your te,perature or stain gauge just take every 10 or 100 th sample !(these figures are
plucked and not gospel in any respect)

Of course you suffer a high overhead of memory use, but you have a chose of either dumping all data to a file or just the particular samples you require!!

xseadog


0 Kudos
Message 7 of 7
(4,139 Views)