LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

[LabVIEW Bug Report] "Create All Constants" fails to create constant for controls when mixed with indicators

Solved!
Go to solution

The BD shortcut "Create All Constants" fails to create a constant for a control when it is mixed with indicators:

 

Screen Shot 2016-08-04 at 17.57.09.png

 

Palette Colors is an array control, the other two are indicators.

 

Screen Shot 2016-08-04 at 17.57.23.png

 

results in:

 

Screen Shot 2016-08-04 at 17.57.31.png

 

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

0 Kudos
Message 1 of 23
(5,448 Views)

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.

Matt J | National Instruments | CLA
0 Kudos
Message 2 of 23
(5,431 Views)

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.

0 Kudos
Message 3 of 23
(5,428 Views)

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.

0 Kudos
Message 4 of 23
(5,425 Views)

"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.

0 Kudos
Message 5 of 23
(5,410 Views)

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.

0 Kudos
Message 6 of 23
(5,384 Views)

@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?

0 Kudos
Message 7 of 23
(5,378 Views)
Solution
Accepted by X.

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

 

Wire All Core.png
 

Matt J | National Instruments | CLA
0 Kudos
Message 8 of 23
(5,364 Views)

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.

Message 9 of 23
(5,347 Views)

You have a talent for it and the quality of LabVIEW would increase if they had you on the Beta testing.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 10 of 23
(5,339 Views)