Example Code

Programmatically change a Free Label in the Front Panel in LabIVEW

Code and Documents

Attachment

Download All

Overview:
The VI below shows how to programmatically select a Free Label in the Front Panel of LabVIEW and how to change the Text and if this wants to be visible.
Description:

There are many further options available in the property node for the user to select.

Requirements:

  • LabVIEW 2012 (or compatible)

Steps to Implement or Execute Code:

  1. Run the VI.

 Additional Information or References:Screenshot_1.png

 

 "**This document has been updated to meet the current required format for the NI Code Exchange.**" 

 

Many thanks for using the NI forums and I look forward to your reply.

Kind regards

David

Applications Engineer
National Instruments UK

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
Philip.k
NI Employee (retired)
on

This is brill i used it with a imported transparent image which i flash using the visible property


Philip
Applications Engineer
National Instruments
UK Branch

===If this fixes your problem, mark as solution!===
Mikael.Peterson
Member
Member
on
QFang
Active Participant
Active Participant
on

Any clever ways of identifying free labels if you have multiple decorations, controls and multiple free labels on the front panel?

I can check the type of each reference in the "Decos[]" array and filter out the free labels, but other than reading the text value of each free text label (and using that) I don't know of a way to uniquely identify one label over another.

Finding it by trial and error and then using a constant to index out the correct one only works until you add one or more objects to the front panel, since the deco list seems to "grow" by putting newly adde items to the 0-index of the array.

(and marginally related, wouldn't it be great if grouped controls/decorations could be programatically moved/positioned as a group? -but alas, I have not found any way to reference a "group" item.)

My solution so far has been to use classic simple string labels with transparant fore- and back- grounds to mimic free labels.

QFang
-------------
CLD LabVIEW 7.1 to 2016
SeanJ
Active Participant
Active Participant
on

I used area height but your way sounds better, although if you're changing the text value....  and there's an unclean abort without a reset....

 

Would be great if there was something like the numbering system in a type def to show the index associated with the decoration or assigning a value to the free text variable would be handier again.