Discussion:
Why are events on subvi front panel not processed?
(too old to reply)
ckis
2008-08-12 19:40:06 UTC
Permalink
Hello,I have a main vi and a subvi constantly running. Sometimes I want to open the subvi's front panel by selecting from the main vi's menue and then process events like "mouse down" on the subvi's front panel and close it afterwards again. But for some reason the events are not processed.It works fine if the subvi is normally stopped and I start it from a static vi reference with "run vi", open the front panel with "set front panel open" and stop it after processing the events.It does not work if I keep the subvi running even if I load it dynamically and use the same reference for loading and for opening the front panel.Has anybody an idea how to get that solved? Or is there sort of a standard how to do that?Thanks for any help,regards Clemens
TonP
2008-08-12 20:10:07 UTC
Permalink
I think your main VI is not ready to process the events, maybe the opening of the subVI is done in one of the other event-frames. Test this with execution highlighting.Ton
ckis
2008-08-13 08:40:18 UTC
Permalink
Hi Ton,thanks for your answer but that's not the problem: the event has to be processed inside the subvi, the main vi only has to open its front panel. I just found out that "register for events" of the subvi returns error 1001 "The vi front panel is not open".Is there any way to register for events of closed vis exept for having the front panel open when registering (as a workaround maybe transparent)? Regards ClemensP.S.: I forgot to say that I'm using LV8.0 on Suse Linux 
cschneider
2008-08-13 11:40:24 UTC
Permalink
Hi Ckis!You said if you start it via a static vi reference, you open the frontpanel by "set front panel open". Don't know if this is the problem, but I can process events in SubVIs. The difference is that I have set the Window appearance to "Dialog" in the preferences. This opens the frontpanel automatically. Perhaps you haven't defined your window as dialog and it only shows up by this "set front panel open"... If so, try selecting "Dialog" from the preferences... Greetings Christian
mikeporter
2008-08-14 03:10:07 UTC
Permalink
I do what you are wanting to do a lot and it works fine. Can you post some code? Mike... 
ckis
2008-08-14 07:10:09 UTC
Permalink
Hi @ all, here's some code to test. Run eventtestMain.vi and open the subvis front panel with the "Ok" button. If you click on the tab control of the subvi it should count the clicks- but it doesn't. If you click the "Count" button it does.  I think the problem is as written in my last post that the front panel isn't open when registering for events. So for the moment I'm using the workaround that you can find in the disabled case of the subvi.I didn't see the problem at first because of the different behaviour depending on how registering for the event (by reference <-> with the event structure dialog). Or do I have wrong settings somewhere? Regards Clemens 


eventtestMain.vi:
http://forums.ni.com/ni/attachments/ni/170/349212/1/eventtestMain.vi


eventtestSub.vi:
http://forums.ni.com/ni/attachments/ni/170/349212/2/eventtestSub.vi
altenbach
2008-08-14 07:40:23 UTC
Permalink
Using LabVIEW 8.5.1, things work fine once I change the dynamic tab "mouse down" event to something else and then change it back to "mouse down". Maybe something was corrupt in your original VI?
Loading...