NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to add checkmark to menu item

I am using TestStand 2012 and LabVIEW 2012. 

I am modifying the Full UI.  I have added a Menu item to the Debug menu (Activate Debug Mode).

 

The user should click on this menu item to activate the "Debug Mode" and then click on this menu item again to deactivate the "Debug Mode"

I would like to have a checkmark appear next to the menu item when the "Debug Mode" has been activated. I don't see this in any of the documentation or the knowledge base articles I have found thus far.  How do I accomplish this? Are there any examples?

 

Thanks,

D Johnson

0 Kudos
Message 1 of 11
(3,426 Views)

In LabVIEW open up your rtm file (run time menu) by going to Edit>>Run Time Menu.  Then on the item you want to check highlight it and select the checked option.

 

Hope this helps.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 11
(3,418 Views)

Hey D Johnson,

 

This can be accomplished by setting the IsToggle property of the menu item Command to True, and setting the ToggleState property to show or hide the checkmark. For further information on the use of these two properties, please see the Help page for the Command object: http://zone.ni.com/reference/en-XX/help/370052M-01/tsuiref/reftopics/command/

 

I hope this helps, and let us know if you have any further questions!

Daniel E.
TestStand Staff Product Support Engineer
National Instruments
CTA/CLD
0 Kudos
Message 3 of 11
(3,417 Views)

Thanks for the quick reply's.

We are getting close here. 

Jigg's suggestion does add a checkmark next to the submenue item.  The Check remains permanently.

I need to set the check when the user selects the Debug->Debug Mode Activation submenue and then uncheck when the user selects it again.

 

Daniel E, using your method, I'm not sure how to access the submenue item to then set the IsToggle?  I believe I should be referencing the submenue, "Debug Mode Activation" somehow and then set the IsToggle for that submenue.

I'll try to attach what I have so far.  What I ultimately would like is for the submenue to perform like the Execute->Tracing Enabled.

Thanks,

D Johnson

DebugIsToggle.JPG

 

 

 

 

 

 

0 Kudos
Message 4 of 11
(3,406 Views)

Here is a little example that shows how to handle the checking and unchecking in LV.

 

Let me know if this helps or if you have any questions.

 

Thanks,

 

 

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 5 of 11
(3,401 Views)

Jiggawax,

Thanks for the example.  It works well when you are modifying the menu of the current VI.  My VI is in the SequentialModel.seq

 

To add the submenu item I created a Configuration Entry Point Sequence.  Inside that sequence I have my vi.  I think your example will work great, but I need to find the "menu reference" to the TestStand menu items. Do you know where I can find that?

 

0 Kudos
Message 6 of 11
(3,386 Views)

In your first post you said that you were modifying the Full UI.  So I assumed you added the menu item to the Full UI.  Now you are saying it is in a subVI in something being called by the process model????

 

 

If your goal is to get information from the UI to process model you need to use UI Messages. 

 

In the Full UI you can get a menu reference by using the Current VI's Menubar node.

 

Can you please explain your intent more clearly?  That way we can help you out better.

 

Thanks,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 7 of 11
(3,384 Views)

Jiggawax, I can see how this would be confusing, sorry about that.

 

My project is to create a user interface.  To do so I'm modifying the Full UI.  I added a page to the tab control.  This page is what a normal operator will see when executing a "Test.seq".  

 

What I'm trying to accomplish: If a user has the debug privilege they may select "Debug Mode" from the Debug Menu in the UI. They will then see the sequence view, execution view, and report view as designed into the Full UI.  If they do not have the privilege then the page will stay on the Operator page during the execution.

 

What I've done:  To create the menu item I added a Configuration Entry Point to the SequentialModel.seq called "Debug Mode Activation" in this sequence I set a global variable called DebugMode.  This variable is used in the Full UI to determine if the tab control pages should be changed during execution as explained above.

 

What I need help with: I want the Debug Mode Activation Submenu to have a checkmark next to it when in debug mode.  I would like to do this in the Debug Mode Activation configuration entry point sequence in the SequentialModel.seq.  If there is no way to do so in the SequntialModel.seq then I will use the UI message and do it in the FullUI.

 

Thank you for your patience with me, I hope this is more clear.

 

0 Kudos
Message 8 of 11
(3,380 Views)

Ok that makes a whole lot more sense... Thanks.

 

I don't understand why you even need to use the SequentialModel for this at all.  Just have the UI hide the other tabs unless they check the box.  If the box is checked then reveal the other tabs.  You don't need the model or client sequence files to assist in any way.  In fact it is recommended against this because now your UI becomes coupled to the model.

 

You have the engine inside of the UI so just use the CurrentUserHasPrivilege method to determine if that user can or can't check the debug box.  Do it all in LV using the menu reference.

 

We do something similar to you where we have a debug entry point and a non-debug entry point.  Right click on the debug entry point and go to Sequence Properties.  On the second tab there is an option for allowing privileges.  You can also check the users privileges in there by setting Engine.CurrentUserHasPrivilege(Privilegename).  That way only certain individuals can execute that entry point.  By default that button will be grayed out on the UI if you used the activex TestStand buttons.

 

Hope this helps,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 9 of 11
(3,362 Views)

Jigg,

Thanks for the replies, I did get it to work using a method similar to your earlier example.  Once I learned where the menu vi's were I started playing with your example and came up with my own version, but the key is I put it in the UI ProcessUserMenus.vi  Giving it an extra case named the same as the Menu Tag item.

 

Thank you for showing me how to get to where I needed to go.

Daniel

0 Kudos
Message 10 of 11
(3,317 Views)