LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unique ID for all front panel object

Solved!
Go to solution

@Darren wrote:

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


If you use the function with UIDs that are not nesecerially verified, LabVIEW will crash occasionally. You can use this function to get references to sub objects, for instance the scrollbar of an array, or individual decorations in controls. However, if the UID doesn't exist, every now and than you will get a crash. 

 

 

0 Kudos
Message 21 of 29
(722 Views)

Darren,

 

I just bumped into a funky issue that's giving me a hard time:

Building a VI into a lvlibp with typedef controls appears to result in new UIDs being assigned to the typedef's controls.

This feels like a bug?

I wonder if this is happening due to the namespace change on the typedefs when built into the PPL, triggering a change in the assigned UID value.

0 Kudos
Message 22 of 29
(605 Views)

Ok, I'm evaluating a possible workaround to this issue:

Checking "disconnect type definitions" in the LVLIBP build spec protects the UIDs from being changed in the output LVLIBP.

I need to figure out if there are unintended consequences to this...

0 Kudos
Message 23 of 29
(589 Views)

I can't reproduce this behavior... in my testing the UIDs for typedef cluster controls and their elements match in the source code and the built PPL. They only change if I change the typedef between non-strict and strict before building.

 

If you want to PM me some sample code that reproduces the issue I can investigate further.

0 Kudos
Message 24 of 29
(566 Views)

Sure thing, let me see if I can zip up a demo

0 Kudos
Message 25 of 29
(562 Views)

Darren,

 

I managed to distill the issue down into a small, reproducible zipped folder of code, attached.

This was created with LV2021 SP1 64-bit.

 

Something that I learned from making this demo code here:
The issue only appears to happen when I have nested typedefs.

0 Kudos
Message 26 of 29
(557 Views)

I can reproduce the issue with your PPL, but if I re-build it in LV 2024 Q1 the issue no longer occurs... looks like it was a bug that was fixed at some point:

Untitled.png

0 Kudos
Message 27 of 29
(540 Views)

oh, cool!

That's good news.

It seems like "disconnect from typedef" is an acceptable workaround for me in Lv2021 SP1 as well.

But it's good to know that this becomes fixed when we upgrade our LabVIEW dev version.

 

Thanks!

0 Kudos
Message 28 of 29
(536 Views)

@brentjustice wrote:

oh, cool!

That's good news.


Yes, good news!

 

Not so cool that:

a) we need to find out about the bug like this and

b) that we need to find out the change (even if it's a fix) like this.

 

The tiniest change can, will and did ruin our programs.

 

Yes, we actually use LabVIEW (a lot)!

 

Hyrum's Law, anyone?

 

An open bug (and change) repository would be nice 😎.

Message 29 of 29
(504 Views)