04-21-2010 09:42 AM
I have many events I want to react to based on Global buttons. How do I get the Event Structure to recognize a global button value change? This screen shot is one of my many attempts. So far my events only change with a real button on the FP.
Thanks in advance,
Doug
04-21-2010 10:09 AM - edited 04-21-2010 10:10 AM
It should work if you use the Value (Signaling) property node.
I'd use a Notifier rather than a Global and an Event Structure.
04-21-2010 10:47 AM
You also could use user events. You even can pass the reference of the 'global button' to the event registration and select the value change property.
Felix
04-21-2010 11:00 AM
Jim,
The Value (Signaling) does not work either.
I would rather not use a notifier, so maybe I need to get away from using an event structure.
Thanks
04-21-2010 11:07 AM
nonecure wrote:Jim,
The Value (Signaling) does not work either.
I would rather not use a notifier, so maybe I need to get away from using an event structure.
Thanks
It should work if your code was executing correctly. The image you posted...
may be the reason.
If you watch the code in execution highlighting it may help you figure what is happening.
1) There is no guarentee that "initialize" will be written to the local "State" before the loop starts running. Use a shift register to track your state from iteration to iteration.
Do you get any errors?
Ben
04-21-2010 11:35 AM
04-21-2010 11:50 AM
nonecure wrote:
The code works fine as long as I use a real start button. When I have the Start Global wired to the Value property node, the global start will not trigger that event. When I have the Start Global wired to the Value (Signaling) property node, the Start Test event runs continuously even know the global value is not changing.
Thanks for the clarification. I was a little woried the event was not firing.
Ben
04-21-2010 12:49 PM
I can't make this work and I think it should. I attached a small simple version to see what I am doing wrong.
Thanks
04-21-2010 12:58 PM
Well, every time you enter the idle state, the signaling is fireing the event. I'm pretty sure that you will see the 'New val' returning a false.
The quick and dirty fix is to have a case structure around the property node, so you only fire if it is true.
But I really suggest you to change to some other mechanism for firing the event (user events, notifiers, not using a global variable). You might get more troubles with that design.
Felix