Example Code

Label Translation for LabVIEW using 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

1. Overview
This example shows how to modify a subVI's front panel labels by calling a text file with them translated to another language.

 

2. Description
This example translates front panel captions associated with controls and indicators into a desired language. It works by programmatically calling the VI Strings Import method. This method reads from a .txt file created previously with the export strings utility in LabVIEW. Navigate to Tools > Advanced > Export Strings... LabVIEW will automatically pull all of the captions for the front panel objects of an open VI.

 

3. Requirements

  • NI LabVIEW Base Development System 2012 or compatible.

 

4. Steps to Implement or Execute Code

  1. Open the LabVIEW project "Label Translation LabVIEW 2012 NIVerified.lvproj".
  2. Open both the "Main.vi" and the "Example VI to Translate.vi" fron panels. Make sure you are able to view both front panels.
  3. Run the "Main.vi".
  4. Select a language from the drop down menu (enumerated strict type def control).
  5. See the names associated with the front panel objects on the "Example VI to Translate.vi" update to show the desired language.

 

5. Additional Information or References

 

Translator FP.jpg

 

Label Translation Screenshot.PNG

 

6. Credits

Rich R
Staff Marketing Engineer
National Instruments UK & Ireland

 

**The code for this example has been edited to meet the new Community Example Style Guidelines.**

Rich Roberts
Senior Marketing Engineer, National Instruments
Connect on LinkedIn: https://www.linkedin.com/in/richard-roberts-4176a27b/

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