From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to add a single Entry Point menu item to a LabVIEW OI menu?

Using the "TestStand - Insert Commands in Menu (Application Manager).vi" library VI, I can add all Configure menu items to a menu with the "CommandKind_ConfigurationEntryPoints_Set" option for the "Commands" input.  But the VI is missing an "Index" input to specify a single item from the collection.  (UnlikeThe "AplicationMgr.ConnectCommand()" function, which allows you to specify a single item with an index.)

 

The issue is the same for Execution Entry Points and Tools as it is for Configuration Entry Point--I can create a menu containing the entire collection, but not a single item.  I tried to delve into the VI to change it to allow specification of individual commands using an index using the Commands.Insert() function instead of the Commands.InsertKind() function, but without success.

 

As an aside, even when I add all Tools to a menu (using CommandKind_Tools_Set), TestStand exits with a warning that 12 "RunTimeMenuItem" objects were not released.  I'm wondering if I should be using the Engine.GetRunTimeToolMenuItems interface instead.  But if that's the case, I think I have to build the menu myself and can't use the TestStand library VIs to automatically run commands when their corresponding menu items are selected.  Maybe this is just a bug in the TestStand VIs?

 

I am using TestStand 2010 SP1 with LabVIEW 2014.

 

Any advice would be appreciated.  Thanks.

 

-Jeff

0 Kudos
Message 1 of 14
(5,185 Views)

Hi Jeff,

 

Unfortunately the Insert Commands in Menu VI only allows you to insert predefined sections of the menu, not individual menu items.  I am working with TestStand 2014 and LabVIEW 2014 and have also been unable to dive into the VIs and change the functionality successfully.   A crude workaround would be to create a custom process model and include only the desired execution and configuration entry points.  

 

As for the Tools menu warning, I would be curious to see what your code looks like.  

0 Kudos
Message 2 of 14
(5,157 Views)

jspeedz, thanks for your response.  I'm glad to hear I'm not the only one who couldn't figure it out.  I'm surprised that this can't be done--I would think it would be fairly common to want to include only the first execution entry point.

 

As for the Tools menu, I'm not doing anything unusual.  Here is a subVI of the menu building VI that is called in the "Menu Activation?" event case in my OI:

Build Tools Menu

 

0 Kudos
Message 3 of 14
(5,154 Views)

The code you posted seems fine.  How are you handling cleanup for your OI?

0 Kudos
Message 4 of 14
(5,112 Views)

I am closing the TestStand Engine, VI Refnum, Quit Application event, and Event Callback, just like in the example.  I get the TestStand unreleased reference error only if I call that VI to include the Tools menu.  The fact that the unreleased objects are "RunTimeMenuItem" objects also implies to me that the problem is specific to the Tools menu items.  Since Tools menus seem to have their own API (which involves RunTimeMenuItems), it seems to me that the VI (or the TestStand Engine?) is doing something with RunTimeMenuItems that I can't see, and is somehow losing track of them (because that VI gives me no visibility to any RunTimeMenuItem objects).  Is it possible that one should explicitly use RunTimeMenuItem objects instead of the menu VI when dealing with Tools menus?  (Maybe the error is due to my using TestStand 2010 SP1 on Windows 8.1, for which TestStand 2010 SP1 is not officially supported?)

0 Kudos
Message 5 of 14
(5,098 Views)

Jeff,

 

you can configure all entry points to be visible only in specific situations. For example, the NI parallel and batch models provide FOUR execution entry points (per model) but the EXECUTE menu item displays only TWO.

Refer to the sequence settings of the entry points of one of these models for further information (and refer to the sequence property dialog help!).

 

thanks,

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 6 of 14
(5,095 Views)

Norbert,

 

Actually, I am trying to do the opposite--I only want specific entry points to be displayed (e.g., only the first).  I can specify an index to assign a button to a specific entry point; I was hoping I could do something similar to assign a menu item to a specify entry point (or Tool menu item).

 

 

Jeff

0 Kudos
Message 7 of 14
(5,090 Views)

Jeff,

 

yes, i understand. But that is not possible for the menu. So i recommend you to configure all but the one execution entry point you want to include to NOT display in the menu:

EntryPointConfig.png

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 8 of 14
(5,086 Views)

Norbert,

 

Okay, I understand what you are getting at. Thanks.  I understand how to do that; but I'd like to avoid modifying the process model.

0 Kudos
Message 9 of 14
(5,073 Views)

So apparently it is not possible to include a single command from a collection in a menu.  Is this a TestStand API limitation, or a limitation of "TestStand - Insert Commands in Menu.vi"?

 

It seems like in the VI, I should be able to replace the Commands.Insert() function with a Manager.GetCommand() function (with index) and a Command.Insert() function.  But that doesn't work for me.

 

Original:

Original.PNG

Modified:

New.PNG

0 Kudos
Message 10 of 14
(5,069 Views)