Decorations can be programmatically controlled in LabVIEW through property nodes. The steps below describe a method to obtain programmatic access to decorations:
- Add a VI Server Reference to the block diagram by right-clicking to show the Functions Palette » Application Control subpallete » VI Server Reference.
- Right click the VI Server Reference and select Create » Property for VI Class » Front Panel.
- Right-click the Front Panel Reference terminal and select Create » Property for Panel Class » Decorations[]. This gives you an array of reference to all of the decorations on the front panel.
- Place an Index Array, Programming » Array » Index Array on the block diagram.
- Create a constant to wire to the Index terminal and wire the Decorations[] terminal to the n-dimension array terminal.
- Right-click the output of the Index Array and select the desired property in the Create » Property for Decoration Class menu.
- Right-click the Decoration Class property node and select Change All To Write.
- Right-click the input to the desired property and select Create » Control.
Note: This image is a LabVIEW snippet which includes LabVIEW code that you can reuse in your project. To use a snippet right-click the image, save it to your computer and drag the file onto your LabVIEW diagram.
In order to specifically edit the text of a free label, follow steps 1-5 above and then continue with the following steps:
- Add a To More Specific Class VI to the block diagram. Right-click the block diagram and select Programming » Application Control » To More Specific Class.
- Right click the Target Class terminal and select Create » Constant.
- Specify the Text class by clicking the To More Specific Class and selecting Generic » GObject » Decoration » Text » Text.
- Right-click the Specific Class Reference terminal and select Create » Property for Text Class » Text.
Note: This image is a LabVIEW snippet which includes LabVIEW code that you can reuse in your project. To use a snippet right-click the image, save it to your computer and drag the file onto your LabVIEW diagram.