LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

run-time shortcut menu odd behaviour

Hi Chris,

 

let's tackle this from a different point of view:

- Let's assume you have a nice binary search tree and your user can add leaves to the tree identified by "tags".

- The user fails to add unique tags, providing information for two or more leaves under the same tag.

- Subsequently the user tries to get information from the tree providing those non-unique tags. Which leaves will you find in your tree?

 

I will not say I know/understand the underlying algorithm of the menu implementation in LabVIEW, but I assume it's a similar scheme as described here.

Make your own decision on how to handle the problem...

 

"we wouldn't have to worry about the issue of having identical sub-menu's"

This isn't an issue. You can present identical sub-menus to the user - as long as you use unique tags internally. There's a reason to differentiate between tags and names... (Well, it's the same with FP elements label and caption: you should not use the same label for different elements, but you may use the same caption anywhere.)

Best regards,
GerdW


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

Hi GerdW,

That is true if you are searching just on Tags, but I'm saying search on the COMPLETE path to that the Tag.

 

eg.  If I have these two Main Menu's each with the same identical sub-menu's:

 

ADD Facility

            1

            2

            3

 

REMOVE Facility

            1

            2

            3

 

What's wrong in LabVIEW returning ADD Facility:1  or REMOVE Facility:1?  Instead LabVIEW returns ADD Facility:1 regardless of which sub-menu item I select.

 

Chris

 

 

0 Kudos
Message 12 of 15
(926 Views)

Hi Chris,

 

the LabVIEW help says: use (unique) tags to identify menu items. (Yes, the tags are mandatory in Menu functions. No, the names are not...)

 

When you want to change that behaviour you're are free to add an idea to the LabVIEW idea exchange. I doubt, NI will change a behaviour where a lot of programmers rely on. The best you will probably get is a more precise documentation/context help...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 13 of 15
(924 Views)

I'm not going to debate whether a programmer should be forced to use unique tags, or LabVIEW is still able to return what the programmer wants if he does not use unique tags.

 

My question is that there seems to be a difference between the behavior for the menu at the top of that application (like in the link I posted) and an object's shortcut menu.

 

The application menu seems to automatically add a suffix such as (_1) in the event the programmer does not provided a unique tag.  But the shortcut menu does not automatically add a suffix.  It adds the duplicated tag (although they are different items under different branches of the menu tree.)  This behavior seems inconsistent.

0 Kudos
Message 14 of 15
(917 Views)

Hi Ravens Fan, 

 

It does seem that you have come across some strange behavior.  I'm going to look into this and see if I can get everybody a better answer.

Cole R.
National Instruments
Software Engineer
0 Kudos
Message 15 of 15
(895 Views)