This content is not available in your preferred language.

The content is shown in another available language. Your browser may include features that can help translate the text.

Programmatically Changing the Label for a Control or Indicator in LabVIEW

Updated Aug 23, 2023

Reported In

Software

  • LabVIEW

Issue Details

I have a control on my front panel and I would like to change the label at run-time. I created a property node for the control and then selected Label.Text and wired in a new string to it. When I run the VI I receive the following error: Error 1073 occurred at Property Node (arg 1) in <VI Name> as seen below. Why can't I change the value of my label?

Solution

In LabVIEW, you cannot change the value of an owned label during run-time. These items can only be changed during development because it is used as the identifier for the control/indicator throughout the executing VI. Trying to change an owned label using property nodes will produce error 1073.

An easy way to change the label for a control/indicator would be to use the caption to identify the control/indicator instead of the label. You can change a caption at both run-time and development-time. To use the caption instead of the label as an identifier we can use three property nodes to make the caption visible, hide the label and change the text of the caption. The property nodes you would use to do this are: Caption.Visible,  Label.Visible and Caption.Text, respectively. 

It is possible to write to the Label.Text property programatically from another VI when the VI is not running.  

Additional Information

Before being able to set the caption properties of a front panel control or indicator, the caption must first be created by right-clicking the front panel item and selecting Visible Items > Caption. If this is not done before setting or getting the Caption.Visible and Caption.Text properties, you will receive the following error.

Error 1320: In run mode, LabVIEW cannot get or set a property for a control part that has not been created.