LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

toggle between myDaq outputs

 Hi , im using my myDAQ for data acquisition from the lung and the heart(ECG) , 

i dont want that the two channels of the myDAQ will work simultaneously , i want to add a toggle that each time i will choose each of the channels.

now , i have something like this : Capture.JPG

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

Hi,

 

assuming that I understood you correctly I see 3 options:

1. Acquiring several channels in parallel and selecting between them, pretty much like you already do. For a size of this program I see nothing wrong with that.

2. Running two acquisition threads in parallel. I don't see anything but trouble with that.

3. Finally you could start and stop the lines whenever you need them. This will cost performance whenever you do this and will probably be a bit of a hassle with express VIs.

 

To sum this up, it looks like you're already on a good way. I think that your While loop runs only once, but I can't confirm since I don't have DAQmx installed. Because of this you probably don't properly stop the task either. Also your program runs once and then stops, which is OK for debugging, but in the end you should put everything into a loop.

 

I'm gonna go ahead and assume you're a student. I hope you know all the classes available for free:

3 Hour Introduction
6 Hour Introduction
LabVEW Basics
Self Paced training for students
Self Paced training beginner to advanced, SSP Required
LabVIEW Wiki on Training
Learning NI
Getting Started with NI Products



Remember Cunningham's Law
0 Kudos
Message 2 of 4
(2,837 Views)

I found a way to do it how i want , using "select" .

can you please explain how properly stop the task ?

 

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

To properly work with tasks I would suggest working with "real" VIs instead of express VIs.

 

Usually, when working with express VIs and configuring them to run continously, they take abit longer to start up in the first loop iteration. You usually wire through a stop button to tell it to deinitilize on the last iteration. What you did in your VI you start the task and abort the loop without deinitializing it, as you stop it when the button is false.

As I said before: For this to work properly and not cause problems in the future you need to run it in a loop.



Remember Cunningham's Law
0 Kudos
Message 4 of 4
(2,805 Views)