Example Code

Change Multiple Captions of a Front Panel Object Programmatically in LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview
This example code shows how to change the caption from different sources for an item on the front panel such as a control programmatically. 


Description
In LabVIEW you are able to concatenate different strings into the same caption, to work around the limitation of having a single caption for a front panel objectUsing property nodes for captions gives the ability to change text size, text color, box color, box size and much more programmatically. This example gives you the possibility to personalize the text and the color of the caption of a random object laying on the front panel.


Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. Download the attached files to your computer
  2. Open the VI "Change Captions Programmatically LV2012 NI Verified.vi"
  3. Run the program
  4. Change the captions in Caption 1 or Caption 2
  5. Change the Box Color of the caption
  6. Observe the caption change in Control - Label

 

Additional Information or References

VI Block Diagram

Change Captions Programmatically LV2012 NI Verified.png

 

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

 

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