LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to set default value of all controls and indicators after first abort

Solved!
Go to solution
 
0 Kudos
Message 1 of 17
(11,724 Views)

What is "first abort". How does it get triggered? How many are there?

 

There is a VI method to reset all to defaults. ("Default Values: Reinitialize all to defaults")

Message 2 of 17
(11,721 Views)

I'm sorry! I don't post a message to that subject!

"first abort" is the main button that stop the program

When i test my program and i stop it (or even if i don't stop it) I want to test it with another values and the old, stored in the fields to be cleared 

0 Kudos
Message 3 of 17
(11,703 Views)

It would really help if you could attach a small example program, because your terminology is a bit unusual.

 

Is the "Main button that stop the program"...

 

  1. a control on your front panel?
  2. the abort button on the tool bar?
  3. or the [X] button in the upper right corner of the window.?

 

What are "fields"?

 

  1. Controls?
  2. Indicators?
  3. Both?

 

 

For controls: if you test with other values, you just change the values. No need to clear them first.

For indicators:  There is an execution option to "clear indicators when called". It will clear all indicators when you run the program.

 

I would also recommend not to constantly start and stop the program. Design it as a state machine instead that is always running unless you are editing code. 

0 Kudos
Message 4 of 17
(11,694 Views)

Thank you altenbach for REing me 🙂

I'm very new in Labview and my terminology may be is not so good yet.

About my problems:

-abort button on the tool bar 

-and yes both 

but I want to put control on the front panel which will do that thing:

i'm trying to simulate multiplication of binary fixed point and it is not good looking when the old values are still on the panel. There are just too many "0"s and "1"s 

I want to track every step in the proccess when i'm watching the front panel so it would be good old data to be not there 

 

I hope you understand me 🙂

 

0 Kudos
Message 5 of 17
(11,681 Views)
Solution
Accepted by topic author lu6ita

Use this snippet at the beginning of your code.  No matter how you stop your vi, when you run it again, it will load all default values into all controls and indicators.

 

Default.png

 

- tbob

Inventor of the WORM Global
Message 6 of 17
(11,669 Views)
at tbob:  ...and how can i find them? what's the name of that function( in the middle)? 
0 Kudos
Message 7 of 17
(11,652 Views)

The first icon is the Current VI Path found in File I/O -> File Contstants.

The next is Open VI Reference found in Application Control palette.

The last is the Invoke Method that I created by right clicking on the reference output of Open VI Reference, and selecting Create - Method for VI Class - Default - Reinitialize Alll to Default.

 

If you omit the Current VI Path, the code assumes the current vi for the Open VI Reference function.  Once I set it up, I have then deleted the first two icons, and it worked fine since the vi will use its current reference as a default.  I wish I could just create the last icon from a right click or a menu selection but I can't find a way to do it.  If there is a way, I would like someone to enlighten me.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 8 of 17
(11,648 Views)

tbob wrote:

I wish I could just create the last icon from a right click or a menu selection but I can't find a way to do it.  If there is a way, I would like someone to enlighten me.


 

 
Message Edited by altenbach on 04-19-2010 12:26 PM
Message 9 of 17
(11,639 Views)

YEah that's really works! Thank you 

Can i put some timer or event like "button pressed"  because now the reinit is too fast ?

0 Kudos
Message 10 of 17
(11,630 Views)