LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to handle main vi short cut menu event in subvi

I am making a thin GUI with a subVI to handle all the events including top VI UI events. I can get most of the events working but not with the short cut menu events. What I did was to pass the top VI control reference to a subVI and then registered for dynamic event. The event refnum is then passed on to another subVI next to it with the actual event structure where the top VI control's short cut event was handled. (using two separate subVIs definitely helped clean up the code, and I don't suspect it is the problem as other events worked fine in this structure)

 

After not able to get it to work, I also tried to register the dynamic event inside the event structure of the 2nd subVI mentioned above, which still not working. Your help is greatly appreciated.

0 Kudos
Message 1 of 6
(2,463 Views)

Works OK when I try it.

0 Kudos
Message 2 of 6
(2,458 Views)

Hi pcardinale:  Thank you for testing it out. I found out the problem being that I registered those menu events twice and I saw duplicates in the event structure dynamic event source list. After eliminating the problem, everything works out great!  Cheers.

0 Kudos
Message 3 of 6
(2,450 Views)

I do have another problem related to handling top VI events in a subVI:  as my top VI controls were set as "Latch When Released", they cannot be located inside the event structure anymore, the result is that even though I can have their events correctly handled, those controls will stay pressed and not returning to the latch state as previously when I had the event structure located in the top VI itself.

 

As I have to many controls, I dont want to change their mechanical action state and just wish to have an easier solution. Thanks.

0 Kudos
Message 4 of 6
(2,425 Views)

Unfortunately that is what you are going to have to do.  Since you have the reference to the control in your subVI, you can use the reference and a Value property node to reset it yourself in the dynamic event.

0 Kudos
Message 5 of 6
(2,422 Views)

OriolesFan, I guess you are right, my situation is not that bad considering the major hurdle was overcome with those events working. I can't complain too much, and actually I was very happy to have a thin UI and having the all the subVIs doing the "dirty" work.

0 Kudos
Message 6 of 6
(2,417 Views)