05-18-2022 05:38 AM
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
Solved! Go to Solution.
05-18-2022 10:59 AM
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!)
05-19-2022 11:37 AM
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 ?
05-20-2022 12:58 AM
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.
Best Regards.
05-20-2022 10:41 AM
@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.)