08-19-2014 07:29 AM
I have created my own menu bar and a Event structure to execute some functions when item was selected by user.
Now, I want to select programmatically the same item of the menu bar. I don't want to use simulation of keyboard because it doesn't work if PC is logged.
I have found the VI Scripting application method node "User Interaction.Invoke Menu Item". Description in LabVIEW Help is:
Simulates the user selecting a menu item. In general, this method works on global menu items but not document-specific menu items, in which case the method fails silently.
That seems to be the right thing. But when I test the code with my Development System nothing happens. The Event structure is not executed.
I'm new in VI Scripting and need some help.
Best regards,
Ben_B.
08-19-2014 07:47 AM
Please post your code so we can take a look. There are a lot of things that can go wrong. Some common ones:
I have done all of these and more, but we can't tell unless you post your code .
08-19-2014 08:04 AM
Hi DFGray,
In the attachment you can find the VI.
Thanks in advance for your effort.
Mit freundlichen Grüßen / Best regards,
Ben_B.
08-19-2014 08:51 AM
Thanks for the code. Unfortunately, the Invoke Menu Item Method does not work for custom menu items. From the LabVIEW help "In general, this method works on global menu items but not document-specific menu items, in which case the method fails silently." There is also no similar method to invoke for VI specific menu items. There are workarounds.
I realize this does not get you exactly where you want to be, but it should work. Let me know if you have further questions.