LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing a boolean between loops

Hi Hawkme,

 

What aputman has put up will ensure the For loop runs on a TRUE state to the case structure. This, quite simply, is because the For loop is in the TRUE case of the Case Statement. By clicking the arrows on either side of the case value at the top of the structure, you can switch between cases. Otherwise, if you have a scroll wheel on your mouse you can roll when the cursor is inside the structure.

0 Kudos
Message 11 of 28
(1,383 Views)

So can I infer from your response that you believe this picture, the way it is weird, should pass the true value to the the case statement which will then execute the FOR loop?

0 Kudos
Message 12 of 28
(1,372 Views)

hmmm....okay, you are new at this...let me explain further so you can manage this.

 

In short - yes, to your question.

 

Why - because the boolean state of TRUE is being passed to the Case Selector (the question mark on the side of the case statement), which will run any code in the TRUE case. The FOR loop is in the TRUE case.

Message 13 of 28
(1,363 Views)

Haha, yes I am new, it's been a learn as I go kind of thing. Okay, that's what I wanted to know, if the true boolean could be passed this way while in a loop to another nested loop. I have been haivng trouble with this so I was unsure if my logic was wrong or something. I must have messed up some wiring that I'll have to check out.

0 Kudos
Message 14 of 28
(1,353 Views)

In the wired diagram Aputman put up there are a couple of housekeeping rules you'll need to follow, such as:

 

1) wire the While loop end condition (Red button at bottom right) to a boolean value or button. With the red dot you have a 'Stop If True' condition. Clicking on it it will change to a 'Stop if False' condition. Wire it up appropriately so you can always escape the loop (finish or close the program).

 

2) As it is wired, a TRUE value will always be sent to the Case Selector. This can be changed to a button, control, indicator, global, etc.

 

See how you go. 😉

0 Kudos
Message 15 of 28
(1,344 Views)

Since you are new to all of this, might I recommend some free online training...

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


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 16 of 28
(1,310 Views)

thanks Crossrulz, for your inspiring comment and inclusion in this +1 post fiesta. You are welcome to provide us further with your experience and great learning.

 

Sorry to single you out, there have been a few like yourself who enjoy posting threads of wisdom that help no-one. One day, I too hope to be an NI Knight, so that I may go forth and strike down the inexperienced.

0 Kudos
Message 17 of 28
(1,303 Views)
David,

That is an incredibly rude comment. You can continue to help students cheat or stay out of the forums. Providing links to tutorials is a way for lazy students to actually learn.
Message 18 of 28
(1,293 Views)

How is providing free tutorials "striking down the inexperienced"?  If I was new to this, those are the kinds of posts that i would welcome.  Show some respect man.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 19 of 28
(1,289 Views)

David_NMRSA wrote:

Sorry to single you out, there have been a few like yourself who enjoy posting threads of wisdom that help no-one.


Tell that to my ~1200 marked solutions.

 

I was trying to avoid this, but since a couple of others stood up for me...Look, the OP flat out said they were new.  I was trying to be helpful in letting them know there is training out there for FREE that they could go to and get a lot of their answers instead of going back and forth with us here.  So, in a way, that was actually cutting into my possible post count.


David_NMRSA wrote:  One day, I too hope to be an NI Knight, so that I may go forth and strike down the inexperienced.

Look closer.  I'm not a Knight of NI (yet).  I try very hard not to "strike down" anybody.  There are a few topics I will get animate about simply because they are major pet peeves of mine.  But simply telling somebody that there are other places for help is not "striking down" anybody.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 20 of 28
(1,276 Views)