LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic progress bar

Solved!
Go to solution

Hello labview community , 

i want a dynamic progress bar for my program ( file attached ) 

in each sequence state i want to update to the progress bar the percentage of time elapsed depending on the total estimated time of test until i reach the total estimated time ( 100%)  . 

Thank you so much 

0 Kudos
Message 1 of 5
(1,843 Views)

You probably need to start from scratch.

 

Your entire subVI needs to be rearchitected as a state machine. It is not reasonable to have a mile long sequence worm with long wait in-between, stalling the caller. Just create sub-states in the main VI using a second enum!

 

Why do you have indicators if they are exclusively used as controls, forcing the use of local variables? (If the user is not supposed to change them, you can disable them!)

0 Kudos
Message 2 of 5
(1,803 Views)

yes i'll start from the scratch but as a quick solution how can i do if i have the total estimated time of the test , and i have 4 sequences in this test . each sequence is realised in a state . and in every state before passing to the next state i claculate the elapsed time of that state . how can i update the loading bar dynamically having the total estimated time ?

0 Kudos
Message 3 of 5
(1,765 Views)
Solution
Accepted by topic author JASMIN185

Hi,

to develop an application you need to follow the following process :

 

Requirements Gathering -> Design -> Develop -> Testing -> Deployment.

in the Design part you need to choose the best Design pattern for your project (State Machine , State Machine Events , Producer Consumer Events .. ).

you need to know very well each design pattern (pros and Cons ) in order to used in the right way.

 

to answer your question about how to programmatically update the slide bar, using the property node you could update the slide bar.

                                             Emna20_0-1653026174830.png

Best Regards.

 

 

 

0 Kudos
Message 4 of 5
(1,738 Views)

@Emna20 wrote:

to answer your question about how to programmatically update the slide bar, using the property node you could update the slide bar.


No, you would not use a property node, but a local variable! *

 

Since the slide bar is an indicator, you typically just wire to it. circuitous updates should be reserved where wiring is not possible (e.g. if this is a control, being careful not to constantly fight the operator) You can keep its value in a shift register and update outside the state case so all states have a chance to modify the value.

 

*(property nodes are orders of magnitude less efficient because they execute synchronously and typically require a thread switch.)

 

(You only need to use a value property node if you want to update a control in the caller from within the subVI by supplying a reference on the subVI connector. But that just dramatically complicates things. There are typically better ways.)

0 Kudos
Message 5 of 5
(1,720 Views)