LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reinitialize All to Default BUTTON

Solved!
Go to solution

Hello, I am working on a gaming calculator and I need help creating a button. In this VI, i have set many Numerical Controls to "Reinitialize to Default" meaning every time I enter a number on the numeric control and run it, the number will automatically jump back to 0. Is there a way I can create a BUTTON that will reinitialize all these values instead of automatically reinitializing it? Thanks.

0 Kudos
Message 1 of 20
(4,099 Views)

Your VI has no toplevel loop and no execution order. All your code and init methods execute in random order. Are you using "continuous run"??? Don't!

Did you do some basic tutorials? THere is a lot of very questionable code, for example taking a bitwise OR of two DBLs makes no sense and LabVIEW will coerce the inputs to integers (see the red dots). What do you think this code fragment should actually do? I am sure there is a better way!

 

There is a method to initalize the entire VI to defaults. That's what you could use.

0 Kudos
Message 2 of 20
(4,063 Views)

This is a simple gaming calculator. Mostly just basic math like. So far, I have everything I needed. It simply takes numeric control numbers and then goes through a series of calculation to create an output on numeric indicators. I used Property Node-Visible in order to display the values only during specific inputs on the numeric control. I also set most of my numeric controls with a Invoke Node "Reinitialize to Default" in order to make all the values go back to 0 once I run the program.

What I'm asking is if there's a way to manually reinitialize to default, such as clicking a button on the front panel. This way, I can enter numbers, run, enter more numbers and then only reinitialize once I'm satisfied by clicking a specific button.

0 Kudos
Message 3 of 20
(4,045 Views)

Oh, so I found out if you go on the top bar on "Edit" > "Reinitialize Values to Default"
I see this works and changes all my values to default and it seem a Keyboard shortcut for it is "Alt E Z"
So my question is basically how can i create a button "like a Boolean Ok button" that will work for this instead of me having to do "Alt E Z" 

0 Kudos
Message 4 of 20
(4,039 Views)

So you ask for advice but totally ignore the person that tells you that you did it wrong? Just because you got it working the way you did does not mean that you got it working. You really need to listen to what you were told. You need to learn about loops. That is one of the most basic functions that you are going to use in LabVIEW. If you are not going to listen you are not going to get help.

 

There are far better ways to do what you are trying to achieve. You can set up a button to reset things and it is very easy as long as you do things correctly. Fix the first problem of not having a loop and then come back for help.

Tim
GHSP
0 Kudos
Message 5 of 20
(4,028 Views)

@aeastet wrote:

So you ask for advice but totally ignore the person that tells you that you did it wrong? Just because you got it working the way you did does not mean that you got it working. You really need to listen to what you were told. You need to learn about loops. That is one of the most basic functions that you are going to use in LabVIEW. If you are not going to listen you are not going to get help.

 

There are far better ways to do what you are trying to achieve. You an set up a button to reset things and it is very easy as long as you do things correctly. Fix the first problem of not having a loop and then come back for help.


Near my cubicle (which I haven't been to in a while), I have posted some "translations".  One of them is:

"But it works".   Translation: "I know it's crap, but I don't care"

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 6 of 20
(4,025 Views)

What is your problem? I'm making myself a Gaming Calculator. It calculates the values I want, and it calculates it. Why should I bother doing anything else to it? If I want a calculator that calculates the value of A+B, why do I need to do all this loop or whatever stuff when it calculates my value of A+B? Am I asking for improvement on my LabVIEW skill? No. Am I asking for a simple reinitialize to default button? Yes. Just don't reply if you guys aren't going to help.

0 Kudos
Message 7 of 20
(4,010 Views)

Yea why listen to the guys who get paid a lot of money to do this. They are really stupid. We tried. Good luck with your version of the code. We were trying to help you.

Tim
GHSP
0 Kudos
Message 8 of 20
(4,003 Views)

Don't give me the "we were trying to help you." Help me with what? Telling me to fix a code that I don't need fixed because it DOES EVERYTHING I want it to do, what I made it to do, not what other people want it to do. Seriously, if I posted an A+B calculator that's literally 2 numeric controls, numeric indicator and a add button, and I wanted to ask how to reinitialize the numeric values to default, are you going to tell me to put a loop or all those extra stuff? Yeah, my question had nothing to do with the code, maybe I should just ask a simple question instead of posting my code for no reason. 

0 Kudos
Message 9 of 20
(3,997 Views)

You win we are all idiots except you. Congratulations. Must be nice to be you. Good luck scaling or changing your code.

Tim
GHSP
0 Kudos
Message 10 of 20
(3,988 Views)