LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create Progress bar for duration of program

Solved!
Go to solution

KJ26_1-1656404791598.png

Hello all

 

Im looking to create a progress bar for the duration of my program from when it starts to when it finishes 

 

Thanks

 

 

 

0 Kudos
Message 1 of 11
(1,152 Views)

Hi KJ,

 


@KJ26 wrote:

Im looking to create a progress bar for the duration of my program from when it starts to when it finishes 


What have you tried and where are you stuck?

How do you define the progress? (Is the "duration" of your program always the same?)

 

Recommendation:

Before adding more code to your VI I suggest to cleanup the current code!

  • Why do you copy the value of those controls into their own local variables?
  • Why are there indicators without labels in the block diagram?
  • What about left-to-right wiring with straight wires?
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 11
(1,147 Views)

Recommendation: these are for my own reasons

Before adding more code to your VI I suggest to cleanup the current code!

  • Why do you copy the value of those controls into their own local variables?
  • Why are there indicators without labels in the block diagram?
  • What about left-to-right wiring with straight wires?

 

In regards to the progress bar - I want the duration of progress bar to increment when each state is completed from the start to finish 

0 Kudos
Message 3 of 11
(1,132 Views)

Divide loop steps by (maximum loop steps/100) and wire this result to a horizontal progress bar.

check.png

 

note: this only works for this VI, if you want progress bar in another VI you'll need to use some kind of a global variable.

0 Kudos
Message 4 of 11
(1,125 Views)
Solution
Accepted by topic author KJ26

Hi KJ,

 


@KJ26 wrote:

I want the duration of progress bar to increment when each state is completed from the start to finish 


Use a shift register to hold the progress value.

Add an increment in each state.

Update the progress indicator after (or before) the actual state…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 11
(1,121 Views)

@KJ26 wrote:

Recommendation: these are for my own reasons

Before adding more code to your VI I suggest to cleanup the current code!

  • Why do you copy the value of those controls into their own local variables?
  • Why are there indicators without labels in the block diagram?
  • What about left-to-right wiring with straight wires?

 

In regards to the progress bar - I want the duration of progress bar to increment when each state is completed from the start to finish 


Are you suggesting that GerdW's suggestions weren't valid? He was suggesting that you adopt good coding practices for your application. In the long wrong you and any person who must work with this code will thank you. One should always try to write good, clean code. Bad coding practices are bad coding practices. There is no valid reason for continuing to use them.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 6 of 11
(1,088 Views)

You have a state machine, which, if properly implemented(!) can go from any state to any other state ad infinitum. There should not be a defined downward spiral, else you would not even need a state machine. 

If there is a subsequence of states (known number and order), you can create a progress bar for that section. There should not be a progress bar in the idle state.

 

Please be very specific in your question and actually attach some code. Pictures are NOT code.

 

As Gerd already pointed out, you have some silly bad habits that tell us that you are a beginner. Wiring a local variable to its own terminal is just plain wrong!!! Do you understand why? Do you know what a local variable really is?

Message 7 of 11
(1,067 Views)

no - if you can read and see what was said then maybe you can understand.

 

I did not state that his recommendation wasn't correct, I simply stated that these are for my own reasons so retract your comments. Do you know how to read English? obviously not.

0 Kudos
Message 8 of 11
(1,004 Views)

@KJ26 wrote:

no - if you can read and see what was said then maybe you can understand.

 

I did not state that his recommendation wasn't correct, I simply stated that these are for my own reasons so retract your comments. Do you know how to read English? obviously not.


It is not clear which post you are responding to but it is probably not about the English language. Your VI itself is pure gibberish!

 

(Note that you can ask a moderator to edit your post and remove the completely unnecessary personal attacks. This is a technical forum and we try to keep it professional. Nobody will help you if you keep attacking top contributors)

0 Kudos
Message 9 of 11
(982 Views)

@KJ26 wrote:

no - if you can read and see what was said then maybe you can understand.

 

I did not state that his recommendation wasn't correct, I simply stated that these are for my own reasons so retract your comments. Do you know how to read English? obviously not.


I know this was in response to me. While you may be doing your code "your way for your reason" it doesn't mean that it is the correct way. My advice that I gave was to help you with your general coding skills and to help you write better code. Bad code may work but it is still bad code.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 10 of 11
(979 Views)