LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Loop control

I am having issues trying to make my program Start and Stop accordingly.

 

What I want to do is to Start the loop when a button is pressed and Stop it either by a Button or by an Event. The events could be any of the Boolean on the code attached.

 

I have tried using an event structure with a while structure inside and then the loop but still things were not quite right: Start/Stop buttons were not working, etc.

 

if anyone could help me I will appreciate it.

 

regards

 

 

0 Kudos
Message 1 of 12
(3,329 Views)

Just a hint to all of you out there posting LV 2013 vis.  Since many people are only getting their DVDs maybe a week or so ago, you won't find much help unless you save as a previous version.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 12
(3,327 Views)

thanks for the hint 🙂

 

just uploaded a 2010 version of it. Hope it helps 🙂

0 Kudos
Message 3 of 12
(3,323 Views)

That helps a lot.  🙂  (Sorry for my last post - it wasn't meant to be as terse as it sounded).

 

How about something like this?

 

[edit] watch out - I forgot that I deleted the file stuff...

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 12
(3,315 Views)

that seems just like what I needed.

 

thanks a lot.

 

Just one more thing, if I need to also be able to stop (just like your toggle switch does) but when an event occurs, how can I implement that?

0 Kudos
Message 5 of 12
(3,302 Views)

@jjjohnson wrote:

that seems just like what I needed.

 

thanks a lot.

 

Just one more thing, if I need to also be able to stop (just like your toggle switch does) but when an event occurs, how can I implement that?


That will be a little more challenging.  New --> from template --> Producer/Consumer Design Pattern (Events) and adapt the code in your vi to fit into the consumer loop.  🙂

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 12
(3,295 Views)

Hi Bill,

 

When you say adapt the code, does that mean that I have to move everything from the other block diagram page to the new Producer/Consumer Design Pattern (Events) page?

 

can you give me some further hints on this?

 

thanks for the help. 

0 Kudos
Message 7 of 12
(3,265 Views)

@jjjohnson wrote:

Hi Bill,

 

When you say adapt the code, does that mean that I have to move everything from the other block diagram page to the new Producer/Consumer Design Pattern (Events) page?

 

can you give me some further hints on this?

 

thanks for the help. 


Roughly, yes that's about right.  However, study the architecture of the design pattern above to see how to adapt your code to run there.  You might have to massage the code a little, but it should survive fairly intact.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 8 of 12
(3,227 Views)

Hi,

 

I have been trying to understand the sequence of the producer/consumer loop. 

 

I have put my loop inside the producer loop (read NI-DAQ, data log, etc). I see that it doesn't run all the time, only when I press the queue button.

 

Apart from that, I would like to make the boolean LEDs to make the loop STOP if any of those go TRUE.

 

can you give me some further steps on how to proceed?

 

hope to hear from you soon

0 Kudos
Message 9 of 12
(3,190 Views)

attached more or less want I need to achieve even though I am not using the producer/consumer loop:

 

when the boolean goes high, stop the loop. But I don't know if its possible to make it like this.

 

hope to get some feedback soon.

0 Kudos
Message 10 of 12
(3,184 Views)