LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Show custom runtime menu when debugging and executable application

My application has a custom runtime menu, which has an associated *.rtm file.  The application is built into an exe with debugging enabled.  The exe runs as expected when not using the debugger, but when debugging the application (using menu item Operate->Debug Application or Shared Library... from the LabVIEW project), the custom menu is replaced with the default menu.  This is a problem because much of the application's functionality is accessed through the custom menu.  I have tried setting the menu when the application is running using the RT Menu Path property, but this does not work when debugging (the menu is still the default menu).  I have worked around this by building the menu at runtime using the LabVIEW menu functions such as Insert Menu Items, but this can be pretty painful for large menus.  Is there an easier way to have my custom menu still work when debugging an executable.  It would be nice to still be able to use the menu editor to create my custom menu.

0 Kudos
Message 1 of 8
(2,650 Views)

My application has a custom runtime menu, which has an associated *.rtm file.  The application is built into an exe with debugging enabled.  The exe runs as expected when not using the debugger, but when debugging the application (using menu item Operate->Debug Application or Shared Library... from the LabVIEW project), the custom menu is replaced with the default menu.  This is a problem because much of the application's functionality is accessed through the custom menu.  I have tried setting the menu when the application is running using the RT Menu Path property, but this does not work when debugging (the menu is still the default menu).  I have worked around this by building the menu at runtime using the LabVIEW menu functions such as Insert Menu Items, but this can be pretty painful for large menus.  Is there an easier way to have my custom menu still work when debugging an executable.  It would be nice to still be able to use the menu editor to create my custom menu.

0 Kudos
Message 2 of 8
(2,642 Views)

cbfsystems, 

 

I was unable to reproduce your issue on my computer. Could you try and recreate a sample project that only has one or two items and see if it behaves similarly? If you haven't already forced recompile, I would suggest doing that as well. 

0 Kudos
Message 3 of 8
(2,595 Views)

A small project demonstrating the issue is attached to the second post above.  An executable is included.  If you run it first, without debugging, you will see the expected menu behaviour (the menu is changed while it runs).  When I run it using the debugger, the menu is just the default menu.  I tried forcing a recompile as suggested, but that did not change the behaviour.

0 Kudos
Message 4 of 8
(2,589 Views)

Hello cbfsystems, 

 

I attempted to replicate this issue using the provided zip file as well as on an example project I built locally and was unable to see this issue. What are the steps that you are using to create the debuggable executable?

 

-Michael

0 Kudos
Message 5 of 8
(2,580 Views)

I create the debuggable executable using the "Custom menu" build specification in the project.

If I run the executable without using the debugger (double click on "Custom menu.exe then click the run button in the application window) the menu shows "Another menu" for one second, then changes to "My menu" for one second, then changes back to "Another menu" for two more seconds, then the application stops.

To run the application using the debugger, I use the following steps:

  • Start LabVIEW.
  • Open the executable by double clicking "Custom menu.exe", but don't click run.
  • Open the debugger dialog box by selecting Operate->Debug Application or Shared Library from the project explorer menu.
  • Select "Custom menu.exe" in the Application or shared library ring control.
  • Click connect.
  • Click the run button of the application window that opens (remote debugging session).

In this case the application menu is the default menu for the four seconds that the application runs.

Is there anything else that you are wanting to know about how I created the debuggable executable or what I was doing when I observed the lack of custom menu?

0 Kudos
Message 6 of 8
(2,573 Views)

Cbfsystems,

 

Have you tried running the application and then connecting it to the debugger?

 

Michael

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

@MichaelFay wrote:

Cbfsystems,

 

Have you tried running the application and then connecting it to the debugger?

 

Michael


I tried running the application before connecting to the debugger and that almost does what I want.  It appears that the menu used in the remote debugging session is the menu that is shown at the time the remote debugger is connected.  If the application is not running when the debugger is connected, then the menu is the default menu.  If the application is running and is showing a custom menu when the debugger is connected, then this custom menu will be shown.  So far so good.  Unfortunately, the runtime menu cannot be changed in a simple way by using the RT Menu Path node after the debugger is started.  Changing the menu is sometimes needed such as in a device configuration application that we have written.  In this application, the menu options change depending on the firmware version of the device that is connected.  The menu can be changed when the debugger is running by using the LabVIEW menu functions such as Insert Menu Items, but this is a bit painful.

I am attaching another simple project that demonstrates the menu behaviour.  The menu can be changed at runtime using the radio buttons.  Clicking on the menu item will display a dialog box with the appropriate message.

0 Kudos
Message 8 of 8
(2,533 Views)