LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unique ID for all front panel object

Solved!
Go to solution

Hi guys,

I need now to the backward path:

from the UID to a control refnum.

How do I obtain it?

thanks

0 Kudos
Message 11 of 29
(2,130 Views)

Hi Pinco,

 

you seem to have a faible for reviving (very) old threads: please stick with your thread and avoid double posts...

 


@PincoG wrote:

I need now to the backward path:

from the UID to a control refnum.

How do I obtain it?


Build a LUT (look-up table) containing all UIDs and their refnums.

Then you can look for your UID in question to get the corresponding refnum!

 

(In former LabVIEW versions we used Variant attributes, now you should use Maps instead...)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 12 of 29
(2,122 Views)

The following VI can give you a GObject reference from a UID:

 

[LabVIEW 20xx]\vi.lib\VIServer\UID to GObject Reference.vi

Message 13 of 29
(2,097 Views)

Hi everybody,

but changing Caption Tipstrip and Description, cheange them in a way the UI is redrawn?

 

In other words, can I use this method to change the aspect of my UI in running mode?

0 Kudos
Message 14 of 29
(1,971 Views)

@PincoG wrote:

Hi everybody,

but changing Caption Tipstrip and Description, cheange them in a way the UI is redrawn?

 

In other words, can I use this method to change the aspect of my UI in running mode?


You don't need scripting for that, it's all plain VI server stuff.

 

However, you can't dynamically create a caption. If the caption has never been created during edit time, the caption is not a reference, and you can't get one with VI server or scripting.

 

One would usually make labels unique and hidden and show the captions on the UI. Yu can than use the unique labels to lookup the desired caption and\or description:

Set Caption And Description.png

 

You can use UIDs for this, but it isn't as convenient as labels:

Set Caption And Description UID.png

EDIT: The tip strip it there too:

wiebeCARYA_0-1694169383518.png

 

Message 15 of 29
(1,964 Views)

Yes,

i have done exactly as the second diagram you posted, but I cannot see any change in my UD. Why?

If I change the caption from a properti node of that control it works: tha caption changes immediatly on UI.

 

0 Kudos
Message 16 of 29
(1,950 Views)

@Darren wrote:

The following VI can give you a GObject reference from a UID:

 

[LabVIEW 20xx]\vi.lib\VIServer\UID to GObject Reference.vi


This function only works in the development environment, not with the runtime.

0 Kudos
Message 17 of 29
(1,943 Views)

Sorry,

was my error, the reference map was empty.

It's work perfectly.

Thanks to everybody

0 Kudos
Message 18 of 29
(1,932 Views)

@raphschru wrote:

[LabVIEW 20xx]\vi.lib\VIServer\UID to GObject Reference.vi


This function only works in the development environment, not with the runtime.


Correct. If you need code that works in a built EXE, you'll need to create a map of UIDs. Which is pretty easy to do.

uid.png

 

Message 19 of 29
(1,910 Views)

@PincoG wrote:

How can I obtain a reference from a number, to change some properties, caption, programmatically?

Thanks again


There is no ready made function for that. Enumerate all controls and search the UID in the list.

Rolf Kalbermatter
My Blog
0 Kudos
Message 20 of 29
(1,887 Views)