LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with Button Menu VI Displaying Already Running Operator VIs

Hi,

I have developed a Button Menu VI that is designed to call various operator VIs based on the selected button (VI attached for your reference).

The VI functions correctly on the initial attempt—when a button is pressed, the corresponding operator front panel is displayed as expected. However, on subsequent attempts, if the same button is pressed again, LabVIEW generates the following error:

"Error 1000 occurred at Invoke Node in NT_HD_Bottom_V1.vi"
This error occurs because the VI being called is already running.

The intended functionality is as follows:

  • All individual operator VIs should be running in the background from the start, with their front panels initially hidden.

  • The Button Menu VI should be the only visible front panel.

  • When a button is pressed, the associated operator VI’s front panel should become visible.

  • Upon pressing another button, the currently visible front panel should be hidden, and the newly selected operator VI’s panel should be shown instead.

I would appreciate any guidance or suggestions on how to achieve this functionality without encountering runtime errors.

Best regards,

 

Serdar Akin

 

 

0 Kudos
Message 1 of 4
(101 Views)

Hi Serdar,

 


@AH_Serdar wrote:

The intended functionality is as follows:

  • All individual operator VIs should be running in the background from the start, with their front panels initially hidden.

  • The Button Menu VI should be the only visible front panel.

  • When a button is pressed, the associated operator VI’s front panel should become visible.

  • Upon pressing another button, the currently visible front panel should be hidden, and the newly selected operator VI’s panel should be shown instead.


  1. When the subVIs should be running all the time then you should run them right after starting the main VI!
    There should be NO "Run VI" invoke node inside the loop/event structure…
  2. When you want to show a subVI after button press then there should be a "Insert VI" invoke node inside each case of the event structure.
    (Maybe you can simplify the code by handling all buttons in just one event case.)
  3. There also is a "Remove VI" method, so you could remove one subVI before inserting the next one…

Generic advice:

  • You should NOT call the InsertVI method with an empty VI reference as it currently happens in the Timeout event.
  • Why is there a timeout event case when there is no timeout defined???
  • There's no way to end your main VI gracefully
  • You should not use absolute paths to define the subVIs, use the ApplicationDir file constant instead…
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(90 Views)

Hi Gerd,

Thank you for your prompt response and valuable advice.

I attempted to replace the Run VI invoke node with Insert VI, but unfortunately, the Insert VI option does not appear in the available list. I’ve attached a screenshot for your reference.

Could you please advise on how to proceed or suggest an alternative approach?

 

Best regards,

 

Serdar Akin

0 Kudos
Message 3 of 4
(53 Views)

Hi Serdar,

 


@AH_Serdar wrote:

I attempted to replace the Run VI invoke node with Insert VI, but unfortunately, the Insert VI option does not appear in the available list. I’ve attached a screenshot for your reference.

Could you please advise on how to proceed or suggest an alternative approach?


I did NOT recommend to "replace" the invoke nodes, but to place them differently 🙂

 

You already know the method/invoke node to insert a VI (reference) into a subpanel as it is used in your VI.

That "Insert" method is a method of the subpanel, it's not a method of the VI!

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 4
(51 Views)