Example Code

How to Create a Loading Bar 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

The example demonstrates how to use the ActiveX control ProgressBar to show the progress of an operation.

 

Description

The example uses a ActiveX control to implement a loading bar. The ActiveX object that is used for the Loading Bar is of the class ProgressBar (MSComctlLib.IProgressBar). The loading bar uses the property Max and the property Value of the ProgressBar object to configure and update the Loading Bar.

 

Requirements

 Software

  • LabVIEW 2012 Base Development System (or compatible)

 Hardware

  • No hardware is necessary to use this example VI

 

Steps to Implement or Execute Code

  1. Open the attached file
  2. Run the VI 

 

Additional Information or References

ActiveX ProgressBar Control - Front Panel 2.png

 

ActiveX ProgressBar Control - Block Diagram.png

 

Microsoft MDSN: ProgressBar-Klasse (System.Windows.Forms)
https://msdn.microsoft.com/de-de/library/system.windows.forms.progressbar(v=vs.110).aspx

 

**The code for this example has been edited to meet the new Community Example Style Guidelines. The edited copy is marked with the text 'NIVerified'. Read here for more information about the new Example Guidelines and Community Platform.**

Chris Van Horn
Applications Engineer

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

Comments
Todd S.
NI Employee (retired)
on

Thanks for posting! Could you rename your attachment to include the LabVIEW version?

Todd S.
LabVIEW Community Manager
National Instruments
Caneta
Member
Member
on

Thanks, very helpful. I would like create a progress bar where the Max iteration can be changed like a variable. This is important when you do not know the precise timing for a single iteration of a for loop. E.g. I would like to scan various files for specific data.  How do i set the Max of the progress bar to the Number of Files? I would like to see the progress of my scan. Howver, some files might contain more info and hence take more time to scan. I would like my progress bar to reflect this delay.