LabVIEW Idea Exchange

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

Static control references

Status: New

Many versions ago, we got the "static VI reference", and it made our life easier. I am suggestion a similar "static control reference" that can be tied to e.g. a strict type definition *.ctl file so we can read certain properties.

 

I have several type definitions that are exclusively used as diagram constants. Since there is no control in sight, I cannot use a direct property node. It would be a shame to have to place a hidden instance on the front panel just to get to the properties.

 

Well, we can use a static VI reference to point to the *.ctl file and start peeling until I get to the actual control (top image). However, it would be nicer if the static control reference would directly give us access to the properties of the control, such as the strings of a strictly typed enum in my case here.

 

With my suggestion implemented, the same code could be done as shown (bottom image)

 

The current way to get a static reference to a *.ctl file via a static VI reference (as described above) should be retained, because sometimes we need access to other properties.

 

I am suggesting a new dedicated "static control reference" that would give direct access to the properties of the actual control in the *.ctl file.

 

(of course some properties (e.g. value) would not make a lot of sense if used this way. Maybe there is a much eaier way, but I haven't found it).

 

 

2 Comments
shb
Active Participant
Active Participant

I normally put an instance on the connector pane and use a reference to the instance.

 

For getting the strings of an enum I use this code:

Get Strings of Enum.png

There is the possibility that LabVIEW can optimize this code to a constant string array.

altenbach
Knight of NI

That's actually pretty cute for this particular case. 🙂

It might be more difficult for other properties.

 

I did not understand your first suggestion.