LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

boolean problem

Solved!
Go to solution

I need the boolean when it changes from false to true and remain true to execute a group of elements once. When it remains true, I want it not to exectute these elements. Is there a possible way without using event structures. Any suggestions

0 Kudos
Message 1 of 8
(3,347 Views)

So when the button is pressed, you want to execute the code EXACTLY ONCE, correct?

 

Use a shift register to keep track of how many iterations the boolean has been true.

If it has been true for anything greater than 1 iteration, do not execute the code again.

Cory K
0 Kudos
Message 2 of 8
(3,332 Views)

shrek'sdonkey wrote:

I need the boolean when it changes from false to true and remain true to execute a group of elements once. When it remains true, I want it not to exectute these elements. Is there a possible way without using event structures. Any suggestions


place "group of elements to execute once" in the True case of a boolean case select. Put null code in the false case. Place a while loop around the case structure (remeber to create a stop button.) Set your execute button mechanical action to Latch when pressed and wire it from inside the loop to the selection terminal of the case.

 

Each time the "execute" button is pressed your true case executes once until the Stop button is pressed


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 8
(3,329 Views)

Hmmm.PNGfunest.png

 

Ta DA

 

Hmmmm..... Snippet converts string "Property node" to  a generic property node and adds a referance to String (why 2 tunnels?

Message Edited by Jeff Bohrer on 01-12-2010 11:54 AM
Message Edited by Jeff Bohrer on 01-12-2010 11:55 AM

"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 8
(3,326 Views)
Solution
Accepted by topic author shrek'sdonkey

If the Boolean stays true and you don't want to execute the case until it changes back to false and then true again, you could do this:

 

Message Edited by Dennis Knutson on 01-12-2010 11:03 AM
Message 5 of 8
(3,316 Views)
Nice suggestion. However, I have to use one while loop so I will be using the while loop for the whole vi. Does it work with other types of loops like for loop or others??
0 Kudos
Message 6 of 8
(3,299 Views)
after second noticing I realized it work. Thank you very much
0 Kudos
Message 7 of 8
(3,297 Views)
    OpenG Boolean Trigger VI.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 8 of 8
(3,263 Views)