09-08-2011 02:33 AM - edited 09-08-2011 02:42 AM
Hi,
i'm using an Event Structure that should execute if the Control X is changed.
This X lies in a case structure; if only i press this X Control, die event structure is executed, this works fine.
Now, i want to make this indicator depending on an external file - the indicator should change and execute if a variable in the vi is changed,....
However, i don't succeed. Even if i change the Indicator to a Control and add another indicator to this: clearly the control is changed (numeric output, if i press the control), but my event structure doesn't respond to it!
I might be completly wrong, plz give me advice,....
Thx!
09-08-2011 05:50 AM
09-08-2011 07:22 AM
Hi, thanks for your reply.
I was kind of... difficult to understand.
Checkt he following example; as soon as the "numeric" field is set by a variable, die execute loop doesn't respond to it!
Only if i would enter as user directly into field "numeric".
That's it!!!
09-08-2011 07:57 AM
Hi max,
sorry, cannot open LV2011 VIs so far...
As said before: the event structure will only respond to "real" events (like user input). Writing a value to an indicator will not cause an event! To force an event you have to use a "value (signalling)" property node of the control (instead of a local variable)!
09-08-2011 08:53 AM - edited 09-08-2011 08:59 AM
For Gerd,
Here is a snippet.
Writing from a control to a local variable of itself serves no purpose. So there is no reason for the bit of code outside the loop. Inside the loop, you'd be better off reading from the control's terminal rather than a local variable of it.
Now it's not clear from your description what event you are really trying to trigger. The numeric value change case will never run. Because the numeric control is an indicator, the user can never change it. And because you aren't using a Value Signalling property node to write to it, the even is never programmatically fired either. Thus the Event Source 2 Val(sign) property node is never written to in that case.
Be careful about how you use value signalling property nodes when they are in the same loop as the event case. You could quickly cause cascading actions that could fill up the event queue. The while loop can only execute the event structure once. But if on every iteration of the loop you wind up queueing up multiple events, you'll quickly fall behind and fill up the event queue because it can't handle the events as quickly as you are generating them.