10-28-2008 12:04 PM
Hi,
In the beginning I want to salute everybody and give us my sincere thanks for your help. After I want to expose my problem. I have the code you can see in the image enclose, like all the codes I see, I use a local variable (stop) to throw the event structure. I use the method "value change". I need change that local varible (stop) to a global variable (Parar medida) to throw the event structure.
To simplify I need throw the event structure with the method "value change" of a global variable. Can I make it? If I can make it, can use another method to throw the event structure with a global variable?
Bye.
10-29-2008 01:57 PM
Here are some options:
11-01-2008 07:39 AM
Hi,tst,
thank you, I will try your solution.
09-04-2009 07:49 AM
Hi everyone, just getting back in the Labview saddle on 'event handling': forgive me but I've spent a few hours hands-on on trying to solve this problem and I just cannot see (or find) the fix: it is related to dynamic event registration for a calling vi to a sub-vi containing an event handler.
Aim: I want to set-up an event (a control value change) on a front panel which is then detected in a sub-vi running an event handler.
Main problem: My code is working but locking out the front panel of the calling vi ...permanently during execution of the sub-vi.
Initial Attempt: I have followed as best I can the tips for dynamic event registration as per the Labview 2009 examples: I use the details of the calling vi's current path to open up a vi reference code and then I register the events using the 'register for events' function where the event source is an array of my front panel control references. I then pass the information for the control references to the sub-vi which contains an event handler set to detect a dynamic 'value change' in the calling vi front panel. I've set the event handler up in a While loop (etc) and it detects the first change (great!!) but then it locks out the calling front panel (not great!).
Problem: so the coding works as planned and detects the front panel control value change on the calling vi but it then locks the front panel of the controlling vi and will not let it go! I've tried many ways to unlock the panel but no such look.
Debug Attempts:
1) Unregistering the event (either inside or outside) of the while loop of the event handler in the sub-vi has no effect.
2) There is no check box option in the edit event handler option to 'unlock the front panel' - it is not shown at all for the 'edit event' on the dynamic value change
Accordingly, I'm a bit stumped at the moment and feel I'm missing an 'obvious' trick to unlock the front panel of the calling vi once the event is detected (...I'd like to be able to redetect another on the front panel....)
If anyone can help I'd be grateful - apols if its obvious or solved elsewhere.
Regards
Neil
09-04-2009 08:13 AM
09-04-2009 08:21 AM
Blueside wrote:...it detects the first change (great!!) but then it locks out the calling front panel (not great!).
Problem: so the coding works as planned and detects the front panel control value change on the calling vi but it then locks the front panel of the controlling vi and will not let it go! I've tried many ways to unlock the panel but no such look.
...
Neil
Set the "Lock Front Panel" when the event is registered.
Ben
09-04-2009 08:29 AM
Ben,
You can set that for dynamically registered events? I didn't know that. But only for Events for actual Controls, right?
Shane.
09-04-2009 08:41 AM
Intaris wrote:Ben,
You can set that for dynamically registered events? I didn't know that. But only for Events for actual Controls, right?
Shane.
I didn't know it either unitl I read the post and and went looking for the "Enabel..." in the Event Dialog box. When I did not find it there I desperately started right-clicking to find out where ....
That porpoerty seems to be available for "Panel Resize" and other VI related events so it is not just the controls. Is that what you are asking?
The above is in LV 2009 in the event that the version makes a difference.
Ben
09-04-2009 09:05 AM
Hi Ben, Shane,
Hi Ben, Shane,
Great response guys!
It worked!! And trust me I right clicked everything on the screen...until you showed me exactly where to right-click.
I think this code / technique is quite important so I've attached my finished code as a bitmap (....I need to suss how to include it here as code etc...and will do so soon as)
Thank you so much
Neil
PS: shane sorry for stupidly posting my reply into a tag field...its been that kind of day.
09-04-2009 09:19 AM
Here is my current version of the code: (note the very important right-click on the Reg Events 'Value Change' is not shown:!