From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
05-19-2021 03:15 AM
Hi,
I am a seasoned LabVIEW developer (+20yrs), and for my current project, I have to make a multilingual GUI.
I've done this in the past, by displaying the caption of front panel controls and indicators, and changing this caption programmatically, based on the label text.
However, this approach (based on the label) has its disadvantages : it does not allow you change static texts on the front panel (as it does not have a diagram counterpart). Also I get in trouble when objects might have the same label name.
So now what I did was this : By getting the VIs Server "Front Panel"-ref property from a VI, and then getting the "Controls[ ]"-property from this front panel, I get a list of references to all front panel objects (including static texts). Each green refnum, I can typecast it to a U32! So I have unique ID's for each front panel object.
In my database, I then store all translation data, linked to this unique U32 number.
I tested that on exiting Labview and restarting the Labview application, the U32 values remained the same. They did, my ID's were remanent/persistant. Hurray!
However now after completely writing this language module, I see that the U32 refs have changed after all, probably when saving/recompiling from LabVIEW 2019 32-bit to LabVIEW 2019 64-bit.
Anybody have any tips to get a permanent GUID to each front panel object?
Solved! Go to Solution.
05-19-2021 03:43 AM - edited 05-19-2021 03:47 AM
Hi Thomas,
@ThomasV wrote:
Anybody have any tips to get a permanent GUID to each front panel object?
With scripting enabled you get additional properties for all FP elements: one of them is a (G)UID!
05-19-2021 03:49 AM
Wow, that's excellent!!!
Now I hope that these are persistent when recompiling a VI.
Will check it out immediatly
05-19-2021 08:31 AM
@ThomasV wrote:
Now I hope that these are persistent when recompiling a VI.
Yes, UIDs are unique, and persist for the lifetime of the object, across saves, compiles, VI copies, etc.
05-03-2023 05:50 AM
Hi GerdW,
what do you mean with the sentence "With scripting enabled"?
How do I enable scripting? How do I use?
How do I get the UID property?
Thanks
05-03-2023 05:56 AM
Hi Pinco,
@PincoG wrote:
Hi GerdW,
what do you mean with the sentence "With scripting enabled"?
In older LabVIEW versions you had to use a (more or less) secret INI key to enable scripting features.
Since several years there is a checkmark in the LabVIEW options to enable scripting, it's located in the VI server tab…
05-03-2023 08:21 AM
I'm trying to reproduce this code, extracting a ref for each control, but I see very few controls.
Maybe I'm loosing controls nested into containers.
Is that what I'm loosing, isn't it?
How can I find also controls that stay inside tab?
05-03-2023 08:29 AM
05-03-2023 11:17 AM
You can use the Traverse for GObjects VI, which will recurse into containers to retrieve nested objects. I prefer that approach to having to do the parsing myself with the properties Gerd mentioned.
05-04-2023 02:02 AM
Thankyou to everyone answered to this post.
I'm really near to the end solution.
Now I have to complete the backward path.
How can I obtain a reference from a number, to change some properties, caption, programmatically?
Thanks again