NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

dynamically create and destroy custom menu item

Solved!
Go to solution

I have a standard TestStand platform that I am using across multiple systems.  On some systems, I have some calibration sequences and I would like to have the menu updated to have the RunSequence of these calibration sequences.  I know how to manually create these menu items, but they are only valid for certain sequence files.  I would like to use the SequenceFileLoad sequence to dynamically create the menu items, and the SequenceFileUnload to destroy these menu items.

 

I have played a bit with the API, but can't dtermine the right path to get to the create and destroy the custom menu items.  Does anyone know how this can be done?

 

Thanks,

Matthew

0 Kudos
Message 1 of 5
(3,700 Views)

There are two ways to create menu items (other than directly in the UI) in TestStand:

 

1) Process Model Entry Points - Both configuration and execution entry point sequences in the process model have special sequence settings in their sequence properties dialog box for specifying where, when and how they show up in the menus.

 

2) Tool Menu items - Choose the customize option to add menu items. Tool menu items can have expressions which determine when to show and dim them. They can run sequences or launch .exe files.

 

Hope this helps,

-Doug

Message 2 of 5
(3,692 Views)

Doug,

 

I essentially want to do option #2, but don't want the menu items visible all the time, nor have to update each station each time a new menu item is needed when a new sequence file is developed which has a new tool menu item.

 

Is there a way thorugh the ActiveX API to create and destroy these tool menu items?

 

Thanks,

Matthew

0 Kudos
Message 3 of 5
(3,688 Views)
Solution
Accepted by topic author Matthew_Kelton

Yes, see the online help for the following API members:

 

Engine.GetEditTimeToolMenuItems

EditTimeMenuItems

EditTimeMenuItem

 

Basically you get a collection of the tool menu items using Engine.GetEditTimeToolMenuItems(), then call EditTimeMenuItems.Insert() or EditTimeMenuItems.Remove(). If you insert one you get returned an EditTimeMenuItem object on which you can modify the settings.

 

Also, since there is an expression to hide the tool menu items, you don't necessarily need to destroy them, you can hide them instead.

 

Hope this helps,

-Doug

Message 4 of 5
(3,681 Views)

Thanks for the help.  I finally got to do this and it works like a charm.  I even got to use the visibility options, as my customer decided to hide certain menu items based on privileges.

 

0 Kudos
Message 5 of 5
(3,586 Views)