LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

HELP!!! I can't initialize my VI after stopping it!

Solved!
Go to solution

Hi all,

 

really need some help here.. The problem is that firstly, when i stop the vi from running, and try to run it again, it doesn't initialize to the original values, instead, I have to make some kind of change to the block diagram( by changing some constant values for example), and den when i run it again, it is able to work fine. Any clues on how to fix this?

0 Kudos
Message 1 of 5
(2,879 Views)
Solution
Accepted by student1981

Of course it doesn't initialize after stopping. You have not written any code to do so. To do it manually, all you had to do was to select Edit>Initialize to Default Values. You also seem to have been running the program with the run continuous button . DO NOT USE THIS. You need a while loop around your case statement and then initializing it is simple.

 

See the attached modification. I also cleaned up some of the unnecessary code.

Message 2 of 5
(2,863 Views)
Your first problem is that it doesn't "run" at all.  You've written it in such a way as you need to "run continuously".  Put your block diagram into a While Loop (and add a Stop button) and you'll fix that and be on your way to fixing your other problem.  I'm not sure I understand what you mean about initializing to "the original values", but take a read into Shift Registers and see if that's what you're looking for.
Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 3 of 5
(2,860 Views)

Student-

 

Simple answer- you have an uninitialized shift register in your for loop.

 

Look into Functional Globals, shift registers, and action engines.  You will learn in time Smiley Happy  

0 Kudos
Message 4 of 5
(2,845 Views)
Hi guys! Thanks alot for all da help! I think i kinda get the idea of how to use the for loop/case structure functions.
0 Kudos
Message 5 of 5
(2,790 Views)