LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do i get a boolean indicator to trigger a event structure

Solved!
Go to solution

I have two parallel loops running, and i need to use a boolean value, one that comes out from an OR gate, to trigger an event in the parallel, event structure loop.  I've attached a simplified version of the loop.  Is there a way to get this done?  I've tried using local variables, value(signaling), etc. and they haven't worked

0 Kudos
Message 1 of 16
(15,962 Views)

Well, primarily you would need to create a value change event for the boolean for which you are writing to the value(sgnl) property.

 

Overall, your code seems extremely convoluted and weird, but I will assume for now that is due to the simplications you did for isolating the problem into a simple VI. 😉 I don't understand the value change event for "x+1". Since this is a plain indicator, it will never trigger.

 

You should also be aware that a signaling value property will uncoditionally fire an associated event. This is probably not what you want.

Message 2 of 16
(15,954 Views)

I am trying to make it so that, when that LED turns from off to on, that triggers an event.  Basically, when that boolean goes from false to true.

0 Kudos
Message 3 of 16
(15,947 Views)

Here is a revised version of your VI. I modified the mechanical actino of the stop button so it kept it's value until it was read. In addition, I added a delay to your upper loop. Without a delay it was running too fast to actually see the button press. I modifed the event in the the event structure to trigger on a value change of Boolean.

 

You don't really need the outer loop since it will only run a single time in all instances. On the first execution of that loop it will be sitting in the turn inner loops. Once you exit the two inner loops your outer loop will always exit. Therefore, it serves no purpose.

 

Your OR in the upper loop is completely uses. It serves no purpose since the result will always be equal to the value of the Stop button.

 

There are better ways of triggering events. a preferred method would be to use a user event and simply generate the event at the appropriate time. This has the advantage of not requiring additional controls/indicators simply to cause an event to occur.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 4 of 16
(15,943 Views)

can you send it as a screen cap or as 8.6 please? thanks

0 Kudos
Message 5 of 16
(15,938 Views)

Here is a revised version saved for 8.6.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 6 of 16
(15,925 Views)

i took it, and added a case structure with a shift register.  is this a viable solution for my problem?

0 Kudos
Message 7 of 16
(15,921 Views)

you only want to write to the signaling property when the boolean changes, and not with every iteration of the upper loop.

 

Here's a quick draft, see if it makes sense....

 

 

Message 8 of 16
(15,916 Views)

Your case structure and shift register serve no purpose. The example I posted is all you need. Your logic will ALWAYS be comparing two false values until the value of Stop is true. Once that happens you exit. No need for the case structure or the shift register. Now, if you wanted some other comparison to set the value of Boolean then you may need the shift register. You still don't need the case structure. Simply wire the result of the comparison to the property node.

 

It is still unclear exactly what you are trying to do though so it is difficult to give you the right answer.

 



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 9 of 16
(15,912 Views)

I've tried wiring it without the case structure, and the event structure triggers that the comparison has changed, even though it goes from false - false - false, and so on.

 

I need the output of an or-gate in one loop to trigger the the event in the other loop. so the event structure is running in parallel to the other while loop.  When the 'or' gate in the while loop changes from false to true, i want the event structure to trigger and stop.  hope that makes sense

0 Kudos
Message 10 of 16
(15,909 Views)