LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to reset to default value every time I click abort execution?

Solved!
Go to solution

Dear friends. 

 

Question: 

How to reset to default value every time I click abort execution?   

I do know how to reset to default by using invoke nodes, but I want to make this happen everything I abort the program (click the red dot bottom). Thank you.   

 

sorry about multiple posts here, there was an error. but i dont know how to delete it.   

0 Kudos
Message 1 of 14
(6,269 Views)

Dear friends. 

 

Question: 

How to reset to default value every time I click abort execution?   

I do know how to reset to default by using invoke nodes, but I want to make this happen everything I abort the program (click the red dot bottom). Thank you.   

0 Kudos
Message 2 of 14
(6,236 Views)
Solution
Accepted by topic author sunson29

You cannot do anything programatically when you abort the VI. It just stops in its tracks.

 

(If you would do a proper state machine, add a state to reset all to defaults and keep running, e.g. back to the idle state waiting for new user inputs)

 

 

0 Kudos
Message 3 of 14
(6,261 Views)
Solution
Accepted by topic author sunson29

To add: Abort Execution is not a feature intended to be used to normally stop your program; you should use a Stop Control and add logic to stop gracefully, which could also include calling those invoke nodes.

0 Kudos
Message 4 of 14
(6,243 Views)

@tyk007 wrote:

To add: Abort Execution is not a feature intended to be used to normally stop your program; you should use a Stop Control and add logic to stop gracefully, which could also include calling those invoke nodes.


Not to be confused with the Stop node stop.png which is exactly like pressing the abort button.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 14
(6,221 Views)

Yeah, I know that.  

I guess I cannot make it back to default every time if I abort the simulation.  What I have now is that reset will happen only after the simulation is over.  

 

But sometimes, I really don't want to the simulation to run completely. That's why I just keep abort it. Thanks though.   

0 Kudos
Message 6 of 14
(6,219 Views)

If you are only worried about the indicators containing stale values on the second run (until they are updated after the second simulation has completed), you can configure the VI to clear them with every new run (VI properties...execution...clear indicators when called).

 

Often, the controls are best left at the last used settings anyway.

0 Kudos
Message 7 of 14
(6,216 Views)
Drop this XControl on your front panel. Every time the VI stops, the current values will be made default.
"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 8 of 14
(6,166 Views)

lol. thanks. What do you mean by VI stops? I abort the VI or the vi finished all process? Thank you. 

0 Kudos
Message 9 of 14
(6,164 Views)

Hi Paul, 

 

I tried your VI, thank your for that.  I think it reset after the program finished all process, right?   Btw, it was not working, I do put it one front panel. But it seems that vi will keep loading something if I abort the execution.  so that I have to wait for 3- 5 sec to run it again.

0 Kudos
Message 10 of 14
(6,162 Views)