LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trigger Menu via Events/Boolean

All

I have a custom run-time menu. One of the menu selection which performs task (A) is done through Event structure. I want to repeat (A) everytime I complete a task. Currently what I have done is replicate (A) into another event and use boolean value signalling.

Is there any way to programmatically trigger the menu event so I don't need to replicate (A) ?

Thanks

Kudos are the best way to say thanks 🙂
0 Kudos
Message 1 of 8
(3,409 Views)

"Maximus00" <x@no.email> wrote in message news:1154535012561-399493@exchange.ni.com...
All I have a custom run-time menu. One of the menu selection which performs task (A) is done through Event structure. I want to repeat (A) everytime I complete a task. Currently what I have done is replicate (A) into another event and use boolean value signalling.Is there any way to programmatically trigger the menu event so I don't need to replicate (A) ?Thanks


You don't have to replicate (A) if you trigger the boolean in the menu selection as well. So, if the menu item is chosen, change the boolean just like after a task.


Instead of using a boolean, you could use user events.


The code will be much cleaner then programmatically triggering the menu.


Regards,


Wiebe.
0 Kudos
Message 2 of 8
(3,401 Views)
Is there an example that you can point me to ? I am still not very clear on how to implement this ?

Thanks

Kudos are the best way to say thanks 🙂
0 Kudos
Message 3 of 8
(3,395 Views)
Perhaps I'm misunderstanding the requirements, but why not just put the behavior you want duplicated in a SubVI and call it from the menu handling case as well as wherever you finish the "tasks" you are doing?  While there are certainly ways to hack at event/event-structure usage to make this work, it seems like an unnecessary level of complexity.

J

Jason King
LabVIEW R&D
National Instruments
0 Kudos
Message 4 of 8
(3,394 Views)
Hello Jason

That's similar to what I am doing now except that the behavior is not embedded in a subVI. I am just tryin to see if I can use properties like boolean value signalling to trigger menu events programmatically.

Thanks

Kudos are the best way to say thanks 🙂
0 Kudos
Message 5 of 8
(3,390 Views)
Nope, no way to programmatically trigger menu selection events in LabVIEW.  Given what you've said (and obviously not having seen your application) I think moving the code you want to "reuse" into a SubVI and just calling it from multiple places is the best bet.  While using the event structure as you describe can be quite powerful, I don't think it's a very elegant solution in this case.

J

Jason King
LabVIEW R&D
National Instruments
0 Kudos
Message 6 of 8
(3,386 Views)

"Maximus00" <x@no.email> wrote in message news:1154623210277-400072@exchange.ni.com...
Hello Jason That's similar to what I am doing now except that the behavior is not embedded in a subVI. I am just tryin to see if I can use properties like boolean value signalling to trigger menu events programmatically.Thanks



You don't have to trigger the menu. Put the code you want to execute in the boolean value change event. If a task ends, send a value change (signalling). If the menu is selected, also send a value change (signalling).


There are shell activex objects that can trigger menu's. Please don't use them for this!


Regards,


Wiebe.
Message 7 of 8
(3,370 Views)
Thanks Wiebe. That worked. Simple and easy solution.

Kudos are the best way to say thanks 🙂
0 Kudos
Message 8 of 8
(3,365 Views)