LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Events in subpanels

Hallo,
 
I have B.vi with an event structure. In one of this events A.vi will be opened and showing up its frontpanel. A has also EventStructure. When I click Exit-Button in A.vi the event gets fired, A.vi terminates and returns to B.vi. This is no problem, nested event loops are working fine, although opinions are different.
 
Next step: Same scenario as above, but now B.vi has a subpanel where A.vi is inserted. And now it fucks up. A.vi is shown in the subpanel of B.vi but you can't click the exit button in A.vi anymore, neither any buttons in B.vi
 
I have tried the subpanel version with either, static events and dynamic event registration, neither works.
 
Are there problems to fire frontpanel events in a vi that is inserted in a subpanel? Is there a way to work around this. If I can't go for the solution "Nested EventStructure and subpanels" it would be result in much more programming work, which I want to avoid. This solution would be the simplest and best for my application.
 
I've attached code of my three examples.
 
Best regards
 
Oli
0 Kudos
Message 1 of 8
(3,369 Views)

"olifr" <x@no.email> wrote in message
news:1202377209877-650601@exchange.ni.com...
> Hallo,
> &nbsp;
> I have B.vi with an event structure. In one of this events A.vi will be
opened and showing up its frontpanel. A has
> also EventStructure. When I click Exit-Button in A.vi the event gets
fired, A.vi terminates and returns to B.vi.
> This is no problem, nested event loops are working fine, although opinions
are different.

It is no problem to have a sub vi with an event structure in an event
structure. Nested event structures means to put an event structure directly
in an event structure. That won't work. It will also not work if you put to
event structures in parallel of each other, and let them listen to the same
event. So in short: avoid two event structures in one diagram.

In your situation, keep in mind that while A.vi is running, B.vi can't
handle it's events. So if there are still events generated (if A.vi isn't
modal, or if you send user events to B.vi), all these events could be
executed when A.vi finishes.

> &nbsp;
> Next step: Same scenario as above, but now B.vi has a subpanel where A.vi
is inserted. And now it fucks up. A.vi is shown in the subpanel of B.vi but
you can't click the exit button in A.vi anymore, neither any buttons in B.vi
> &nbsp;
> I have tried the subpanel version with either, static events and dynamic
event registration, neither works.
> &nbsp;
> Are there problems to fire frontpanel events in a vi that is inserted in a
subpanel? Is there a way to work around
>this. If I can't go for the solution "Nested EventStructure and subpanels"
it would be result in much more
>programming work, which I want to avoid. This solution would be the
simplest and best for my application.

I can't open your code right now, but I do this all the time. Could it be
that you've put "lock front panel until the event case for this event
completes" is on? This also disables the content of the subpanel.

Disabling this option creates the problem I described earlier. You should tr
y to start the subpanel VI dinamically, or to start it parallel to the event
loop. You'll have to find a way to comunicate between the two VI's, like
user events, queues, or buffers.

Regards,

Wiebe.


0 Kudos
Message 2 of 8
(3,345 Views)
"And now it f***s up"

Let's keep the threads PG-rated, please.

>

"There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal
Message 3 of 8
(3,341 Views)


Wiebe@CARYA wrote:

Could it be that you've put "lock front panel until the event case for this event
completes" is on? This also disables the content of the subpanel.



Hi Oli,
that´s the problem. If you change it like i do in your code it works.
Mike
Download All
0 Kudos
Message 4 of 8
(3,334 Views)
Another option is that if you have one VI running in a subpanel of the second, and the first subpanel VI has another subpanel that includes original shell, you cannot display the front panel of a VI twice unless it is reentrant.
 
0 Kudos
Message 5 of 8
(3,327 Views)

Hallo,

 

thanks for the replies, I will try out. And I promise not to use the phrase "it f***s up" anymore. Alternatively I will call it " not working the way that it would turn me into a happy software developer".

Regards and thanks

 

Oli

0 Kudos
Message 6 of 8
(3,289 Views)

Have you found any solution for this issue.

 

I have problems handling events from an VI that is subpaneled.

 

Thx.

0 Kudos
Message 7 of 8
(2,584 Views)

Create a user event which you send to both vi's and register as events, thus they can both send and react to the event.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 8 of 8
(2,573 Views)