LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
ozimmer

Possibility to manually assemble constant arrays of statically linked control references

Status: New

Sometimes it is interesting to programmatically operate front panel ctrols/indicators using not only references, but arrays of references to existing panel items.

 

Suprisingly, statically linked control references can be droped on the diagram and then programmatically combined into an array, BUT such an array can not be manually assembled at coding time.

 

It should be possible to do it (just like usual constant arrays can be made). It would be easier to code, and take much less room on the diagram.

 

Also, to make such a constant array easier to read (and gain diagram surface anywhere statically linked control references are used), why not replacing the type indication of the constant with the name ? Type can be checked by pointing at the output wire anyway...

 

ActualProposed

5 Comments
CrystalTech
Member

An array constant of references can be created by making a constant from the control on the diagram and the constant reference of each single control in the array is recognizable by LabVIEW.  So I agree, this being the case, NI should allow the references to be named accordingly.  Kudos.

MBohnet
Member

problem is: how should labview know which references should be added to the array? Just because of the naming scheme? Names of controlls can be changed at any point in the developement process. so what should happen then? should the array be kept or should it break, if you e.g. rename "IActSOL7" to "myNameIsDifferent4"?

ozimmer
Member


> problem is: how should labview know which references should be added to the array? Just because of the naming scheme?

Of course not !

You one would create the array as follows :
- drop an empty array constant on the diagram.
- create a reference with the required type (e.g. "(Digital Numeric Refnum (strict))") using the right-click method on an existing terminal.
- drop this constant into the array to let LabVIEW know the elements' type and default value.
- link array elements to their target control using a right-click "Link to" method as one does for standalone constant references.

If the "built array" implementation above is allowed (it is) then the "constants array" implementation is just another (semantically similar and more compact) way to produce exactly the same data for further processing.

> Names of controlls can be changed at any point in the developement process. so what should happen then? should the array be kept or should it break, if you e.g. rename "IActSOL7" to "myNameIsDifferent4"?

Array would be kept and the element automatically renamed. In the current implementation, constant refnums and local variables linked to a given control are automatically renamed when you rename the control. Just what one expects.

Having the linked control name appear in place of the type information is just a visual trick to save space. It is not meant to replace the existing method for linkage to a target control.

rpursley8
Active Participant

How about a right-click menu option to select between type info and name of linked control being displayed within the reference?

Randall Pursley
Jason_Harrigan
Member

I'd favor this idea but dropping the linked references into a cluster not an array. A named cluster is more specific to each static reference, and can be easily turned into an array with the cluster to array function.