LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How does labview implement this progress bar function that comes with windows?

Solved!
Go to solution

007.pngHow does labview implement this progress bar function that comes with windows?

0 Kudos
Message 1 of 13
(385 Views)

Hi WhiteSpace,

 


@留白 wrote:
How does labview implement this progress bar function that comes with windows?

I would use a waveform graph, with a cursor to show the average line with its label.

 

What have you tried so far?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 13
(382 Views)
Could you write a demo to learn from
0 Kudos
Message 3 of 13
(375 Views)

Hi WhiteSpace,

 


@留白 wrote:
Could you write a demo to learn from

Open the ExampleFinder and learn from "Graph Cursors" example VI…

 

(LabVIEW comes with a huge list of "demo" examples!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 13
(353 Views)

Here's a quick draft that you can modify according to your needs.

 

altenbach_0-1762190390526.png

 

Message 5 of 13
(296 Views)

@altenbach wrote:

Here's a quick draft that you can modify according to your needs.

 

altenbach_0-1762190390526.png

 


Here it is as an XControl

Message 6 of 13
(222 Views)

An alternative to replicating the Windows progress dialog box in LabVIEW is to have Windows show it.

 

This can be done using the Call Library Function node to call the Shell32.dll SHFileOperation function, albeit LabVIEW can't provide much automatic assistance creating the parameter it takes (a pointer to a structure that has, among other members, pointers to strings), but it can be created using the LabVIEW memory manager functions, for example.

 

It can also be done more simply by using one of the Microsoft.VisualBasic.FileIO.FileSystem .NET methods, such as CopyFile (which calls SHFileOperation under the hood), which I show an example of below that can be played with:

 

snippet.png

Message 7 of 13
(122 Views)
Let's share the DLL file
0 Kudos
Message 8 of 13
(112 Views)

I take it you're interested in seeing a solution that calls the Shell32.dll SHFileOperation function directly. Below is one of the simplest examples I could create, which will only work in LabVIEW 64-bit (because 32-bit requires 32-bit pointers, albeit hopefully this example can be generalised from).

 

To be able to understand the example and build upon it requires understand the following documentation for the SHFileOperation function, which is what I used to create the example: SHFileOperationA function (shellapi.h) - Win32 apps | Microsoft Learn. Also, I used Visual Studio to see the memory layout of the SHFILEOPSTRUCTA structure and determine appropriate member values.

 

This is more complex than using the .NET methods I mentioned in my previous post but has the benefit of offering more capabilities.

 

SHFileOperation snippet.png

0 Kudos
Message 9 of 13
(98 Views)

Could you share the source file VI

0 Kudos
Message 10 of 13
(90 Views)