Example Code

Set vi icon 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

Overview
This program "Set vi icon" lets you easily and programmatically create and set simple icons for your subvis.

It is meant to speed up the process of editing the icons of one or more vis in which you only wish to insert header and/or text and change the color scheme (e.g. for the vis of a project library).

 

Description
The core vi is "set vi icon.vi":

You can call it from the vi of which you want to modify the icon

You can pass to it the path of a vi of which you want to modify the icon   

You can preview the icon before you actually set it to the vi ("Test" mode)

The project in the zip file contains the following:

  1. set vi icon.vi is the core subvi that edits and sets the icon
  2. test.vi is a very simple test that calls "set vi icon.vi" to modify its own icon
  3. iterate on folder.vi is a test program that shows how "set vi icon.vi" can be used to edit the icons of all the vis that are contained in a specified folder. As you run it, it will cycle through the vis inside "example folder": for each of these vis as you modify the colors and texts it will update the icon preview. When you are satisfied with it, press "set as vi icon" to set the preview as icon of the vi. The vi stops executing when all the vis in the folder have been processed. If you check their icons you will see they have been updated as you set them.
  4. example folder contains the three dummy vis of which you change programmatically the icons in "iterate on folder.vi"

 

Requirements

LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. Specify the vi path.
  2. Run the application.

 

Additional Information or References
VI Snippet

back.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.

Comments
CorraDIT
Active Participant
Active Participant
on

This is brilliant! Well done!