06-28-2022 03:27 AM
Hello all
Im looking to create a progress bar for the duration of my program from when it starts to when it finishes
Thanks
Solved! Go to Solution.
06-28-2022 03:32 AM
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!
06-28-2022 03:47 AM
Recommendation: these are for my own reasons
Before adding more code to your VI I suggest to cleanup the current code!
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
06-28-2022 04:19 AM
Divide loop steps by (maximum loop steps/100) and wire this result to a horizontal progress bar.
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.
06-28-2022 04:23 AM
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…
06-28-2022 07:05 AM
@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.
06-28-2022 11:50 AM - edited 06-28-2022 11:52 AM
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?
06-29-2022 01:48 AM
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.
06-29-2022 10:34 AM
@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)
06-29-2022 10:39 AM
@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.