08-04-2016 08:05 PM
The BD shortcut "Create All Constants" fails to create a constant for a control when it is mixed with indicators:
Palette Colors is an array control, the other two are indicators.
results in:
Using "Create constant" (which is another menu item altogether) works fine with the array control (of course, the constant is not connected to the terminal in this case).
Tested in LV 2016 64 bit on Windows 7
Solved! Go to Solution.
08-04-2016 08:40 PM
Isn't this expected behavior? I thought the create all constants and all controls and indicators were right click plugins which copy the functionality of the control+d quick drop shortcut.
08-04-2016 08:56 PM
It might, but then why would the "Create Constant" work with an indicator or a control separately but not simultaneously? It's called "Create All Constants", not "Create All Constants for all Indicators or all Controls but not Both at the Same Time".
Attempting to create constants for more than one control also fails, BTW.
08-04-2016 09:06 PM
Does that create constant command (I assume this is a newly added menu choice in 2016?) work if you only have a single control selected?
The behavior you are seeing is doing the same thing I see with Ctrl-Space Ctrl-Shift-D shortcut. The indicators get constants, the control doesn't. If I pick just one control and nothing else, I still don't get a constant for it.
It seems that this behavior is the same as it has been for the quick drop shortcut. Note that I'm not saying this shouldn't be changed. Just that it seems to be the same as it has been.
08-04-2016 11:43 PM
"Create All Constants" is a menu item which only appears when more than one object is selected. It acts differently than the old "Create Constant" menu, which is only available when a single object is selected. The former doesn't create constants for selected controls, the latter does. I call inconsistency, if not bug.
08-05-2016 08:22 AM
Okay, I just looked and saw that command exists in LV 2015. It must have been added as part of the 2015 enhancements to the right click menus.
08-05-2016 09:07 AM
@X. wrote:It might, but then why would the "Create Constant" work with an indicator or a control separately but not simultaneously? It's called "Create All Constants", not "Create All Constants for all Indicators or all Controls but not Both at the Same Time".
Attempting to create constants for more than one control also fails, BTW.
When I use the same method as you with only two controls, I get nothing created. Create All Constants appears to be doing what makes sense. It creates constants where you can wire one. You cannot wire from a control to a constant (as both are inputs). So, it creates all constants that make sense. It wouldn't be called the name you suggest because that name doesn't make sense. It doesn't create all constants for controls. It creates all constants for indicators (the places where it's reasonable to do so).
You're looking at two different functions. While you can right-click a single element and it creates the constant, that's not the same thing as the create all constants. Really, if anything were a bug in this, I'd believe it's creating a constant for the control. I'd expect Ravens is correct. The shortcut menu takes advantage of the quick drop shortcut rather than writing the same functionality twice (isn't that the point of functions in the first place?).
What use case are you thinking of where you want to create constants to wire into all of your indicators and then simultaneously appear sitting next to your controls?
08-05-2016 10:18 AM
You can change the functionality of the right-click plugin by opening the Wire All Terminals_core.vi in the following .llb and removing the case structure in the picture below (keep the method just remove the structure around it). It does what you wanted in the original post but isn't very helpful when you start using it on objects with multiple terminals (especially multiple output terminals). The code makes it seem pretty intended, it iterates through all terminals it finds and checks if it is an input or output terminal. If it's an input it creates a constant, if it's an output, it does nothing. The change I made just creates a constant regardless of whether it's an input or output.
<LabVIEW>\resource\plugins\PopupMenus\edit time panel and diagram\Wire All Unwired Terminals.llb
08-05-2016 01:06 PM
natasftw wrote:What use case are you thinking of where you want to create constants to wire into all of your indicators and then simultaneously appear sitting next to your controls?
Creating a cluster constant for one.
I am just pointing at the fact that this shortcut menu does not do what it says it does (Create ALL constants).
I understand the rationalization of old LVers, but it this kind of inconsistency that can drive people away from LV. You don't want to learn exception to rules, but instead assume that a function does what it literally says it will do.
08-05-2016 01:37 PM
You have a talent for it and the quality of LabVIEW would increase if they had you on the Beta testing.
Ben