01-19-2011 05:56 PM
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
Solved! Go to Solution.
01-19-2011 06:20 PM - edited 01-19-2011 06:26 PM
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.
01-19-2011 06:26 PM
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.
01-19-2011 06:29 PM - edited 01-19-2011 06:32 PM
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.
01-19-2011 06:31 PM
can you send it as a screen cap or as 8.6 please? thanks
01-19-2011 06:35 PM
Here is a revised version saved for 8.6.
01-19-2011 06:43 PM
i took it, and added a case structure with a shift register. is this a viable solution for my problem?
01-19-2011 06:45 PM
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....
01-19-2011 06:50 PM
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.
01-19-2011 06:54 PM - edited 01-19-2011 06:56 PM
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