LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Somewhat new to LabVIEW, question regarding gui, while loops...

    I'm trying to create a while loop in a block diagram that can be started and stopped while the VI is running.  In other words, I'd like to have a button that initializes a while loop, or a set of commands after hitting the run button on the front panel.  Would placing my entire project in a while loop with a T/F switch work?  I apologize in advance if this is a rather simple question.


Message Edited by Jeanius on 03-13-2008 10:29 PM
0 Kudos
Message 1 of 6
(2,821 Views)

Although this VI would work as you asked for,

I would recommend that you rethink of your program's Logic and see how best can u use Even structurs inside a while loop, to perform your operations

Read about event structures here,  here and here

0 Kudos
Message 2 of 6
(2,810 Views)
Great!  That works wonderfully.  I have another question, if you'd be of assistance.

I'm using an NI USB-6008 DAQ and I'm wondering if it'd be possible to do two simultaneous acquisitions with 2 analog input channels.  I haven't yet tried this, but I'd like to know if it's do-able before I get into it.

Thanks!
0 Kudos
Message 3 of 6
(2,780 Views)
You should have no problem doing this, I recommend using DAQmx to get yourself started.  You can use DAQmx to create a task, setting parameters such as what/how many channels to sample from and at what rates (among others). 

Cheers!
0 Kudos
Message 4 of 6
(2,778 Views)
Would it be possible to set this up in the block diagram with 2 DAQ Assistant inputs in an event block?

Also, when graphing the acquired data, is there a way to change the color of the line at a specific point, or add a marker at a specific point, during the acquisition?

Thanks so much for your help.
0 Kudos
Message 5 of 6
(2,772 Views)
I would definitely NOT place while loops inside while loop for a simple task like that. All you need is a single while loop..
 
Here's a simple example using events.
 
0 Kudos
Message 6 of 6
(2,758 Views)