LabVIEW APIs Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Set TRUE/FALSE Image of a boolean control automatically using spripting ?!

Balze wrote:

BTW, are there any informations about the internal resource structure one can use to change the look?

I never saw a control you (vugie) used for the constant inside your vi .

It loos cool with the image attached to the left an shifting it when pressed.

Here is video on how to cook such a button.

How do you find these internal functions?

...

BTW, are there any informations about the internal resource structure one can use to change the look?


Well, Rolf inspired me to simply search for "Resource" string within LabVIEW folder

And there is no commonly known usable information about binary structure of resources.

0 Kudos
Message 11 of 23
(3,143 Views)

Hi, Colleagues!

WOW!!!

Now I able to replace all 6 images for buttons. This will save huge amount of time for me too! I was started already with "AutoIt" - based solution for reducing manual work, but proposed way is much better!

In additional after some hard experiments with parameters I was able to call appropriate LabVIEW API functions directly from VI (just for my understanding - whats going on)

Thanks Rainer for initiaite this discussion and thanks Rolf and vugie for great ideas!

That's one small step for a buttons, one giant leap for "VI Resource Editor"

In attachment - modified version of replacer. In general, the images resource not always places on the same index (and not always exists), so I tried to search appropriate resource index (see attached VI).

best regards,

Andrey.

0 Kudos
Message 12 of 23
(3,143 Views)

Hi Andrey,

nice that i can help you at least one time, even if it's just to start a discussion

IMHO the resources inside a control are very interesting. Maybe it's possible to "hack" these resources to find out how NI manages to include vector graphics with gradients in their controls (like the numeric knob).

Best regards,

Rainer

0 Kudos
Message 13 of 23
(3,143 Views)

The actual definitions for the 3D controls (those that are default since about LabVIEW 😎 are not part of the control itself, but are defined in the resource/models directory. Supposedly NI bought those graphics from some outside contractor, but I'm not sure if the just bought the graphics art or the entire 3D implementation including the OpenGL rendering interface. The ctl file simply contains the basic control definitions and references to the actual graphic model description.

The classic controls use however an internal vector grpahics format called PICC, which resembles the Macintosh PICT format with some 16 Bit to 32 Bit adaptions.The System Controls on the other hand seem to be drawn mostly in code directly, based on parameters retrieved from the OS theme settings.

Rolf Kalbermatter
My Blog
0 Kudos
Message 14 of 23
(3,143 Views)

Rolf,

that's interesting.

Do you think it will be possible (in some days/weeks/month/years/...) t ochange this resources?

Rainer

P.S.: I wish I had more time to dig in that deeper. Sadly my company does not see any benefit in that

0 Kudos
Message 15 of 23
(3,143 Views)

Balze wrote:

P.S.: I wish I had more time to dig in that deeper. Sadly my company does not see any benefit in that

I share their view. I did a lot of this investigations at a time where I was having much time on my hands and just for the fun of it. Any commercial use of this is hampered by a number of reasons.

- LabVIEW evolves and will change things over time

- Use of these undocumented features in commercial apps is a complete no go, both for the danger of breaking under unexpected situations as well as for legal reasons

- time invested can never possibly be recuperated in any commercial feasible way

Rolf Kalbermatter

Rolf Kalbermatter
My Blog
0 Kudos
Message 16 of 23
(3,143 Views)

Sad but true .... you're right.

It's my curiosity that drives me.

Maybe I have to supress too many of my desires.

Wasn't it curiosity that killed the cat ?

Regards,

Rainer

0 Kudos
Message 17 of 23
(3,143 Views)

rolfk schrieb:

Balze wrote:

P.S.: I wish I had more time to dig in that deeper. Sadly my company does not see any benefi

I share their view. I did a lot of this investigations at a time where I was having much time on my hands and just for the fun of it. Any commercial use of this is hampered by a number of reasons.

- LabVIEW evolves and will change things over time

- Use of these undocumented features in commercial apps is a complete no go, both for the danger of breaking under unexpected situations as well as for legal reasons

- time invested can never possibly be recuperated in any commercial feasible way

When I was young, then most of my toys was unscrewed, because for me was always interesting "What's inside?". Now I'm far away from 30 years old, and now I have another toys, but such interest still here. But I agree with you, Rolf, such thing should be used very carefully. The game just for fun, nothing more.

By the way:

- it works not only for *.ctl files, but also for *.vi

- it works also in Run-Time, without Develipoment Environment! It means, that its possible to replace icons on buttons just directly in application. Of course, the file should be placed outside of the applciation (because will be changed). In the attached quick and dirty example Button.vi loaded into SubPanel. Then we can change images on button, then reload it.

- also there are some interesting controls with logic inside (such as attached multi segment pipe). Probably we can do something similar.

- in some cases during controls customization I was unable to edit parts of controls (Window->Show parts Window). Probably these resources also can be changed...

Andrey.

Download All
0 Kudos
Message 18 of 23
(3,143 Views)

Thanks for the great information about the inner workings of the ctl files.  I have looked for this for many years.  I wish that scripting (or some other method) provided a quick method of automating the customization process.  We have a long way to go to bring up our pallettes to current standards.

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 19 of 23
(3,143 Views)

Just an update from the LAVAG community:

I've release some tools in the Code Repository under the name "UI Tools_<packages>" including a class to help create your own controls on the fly.

Thanks to Vugie and Rolf for their leads.

François.

GCentral ChampionCLA
0 Kudos
Message 20 of 23
(3,143 Views)