LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Run two acquisitions in a repetitive sequence

Hello,

 

It's probably one of the most discussed and solved problems but I am just not finding the right path to solve it myself.....hopefully someone can point to the right "terms", "keywords" or maybe a tutorial that would help me:

 

I have setup a vi that collects and stores data from a channel in certain time increments. I now want to add acquisition from a thermocouple that's connected to a different port on the same BNC-2100.

Well, I can not run both at the same time....only one will work. So I want to design a sequence where the acquisition of the thermocouple starts after the first acquistion has been run once. This sequence shoulb be repeatet every 10 or 20 minutes.

 

Thx,

 

pfl

 

0 Kudos
Message 1 of 7
(2,807 Views)
As I'm sure that you've seen, you actually can acquire both channels at the same time. You simply add another DAQmx Create Channel to the existing task. You can discard the data from the second channel until the time has elapsed. Otherwise, you will have to stop and clear the first task before you start a second. The task for the first channel would then have to be restarted. I would suggest using a basic state machine. You do not want to do what your existing code does - keep initializing, stopping, clearing the task with each iteration.

p.s. The BNC 2100 is not a DAQ device. It is just a dumb terminal block. It is important to provide the model number of the actual device.
0 Kudos
Message 2 of 7
(2,793 Views)

Thank You for the response. I think I will rework all the components and do it the way you suggested.....   The actual DAQ device I am using is a PCI - 6255

 

I can post the result when I am done^^

 

Thank you very much,

 

pfl

0 Kudos
Message 3 of 7
(2,787 Views)

Well, integrating the second channel into the acquisition was successfull 🙂

 

But what bothers me a little about this solution is the fact that the thermocouple and the ultrasound acquistion rapidly decrease the available sampling rate. Wouldn't it be better to alternate the tasks so I can make use of the max. sampling rate for the ultrasound? The thermocouple does not have to be sampled at 0.5 ms/s....

Is there a keyword or term that would help me finding my way?

 

Best,

 

pfl

0 Kudos
Message 4 of 7
(2,762 Views)
Yes, the reduced sampling rate is one of the trade-offs. The advantage is that you can do continuous sampling of the channels. Your pick.
0 Kudos
Message 5 of 7
(2,752 Views)

In my case it doesn't have to be continues.....the experiment is designed to take samples in 10 or 20 minute increments. There is no problem with a time difference between the acquisition of both channels. Are you aware of an example (or keyword) that describes the alternating execution of two daq tasks? Would it be done using loops?

0 Kudos
Message 6 of 7
(2,745 Views)

state-machine is something mentioned before....I'll check that 🙂

0 Kudos
Message 7 of 7
(2,741 Views)