LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to reinitialize the shift register after stop?

Solved!
Go to solution

Whenever I stop the program I would like to reinitiate the value that the case structure gives me. It is giving me the maximum value.

After I stop, I want it to go back to zero. 

 

Any suggestion?

 

Thanks

 

Download All
0 Kudos
Message 1 of 5
(3,384 Views)
Solution
Accepted by topic author RM1991

You can reinitialize it upon start using the Initializer Terminal on the feedback node.

aputman
0 Kudos
Message 2 of 5
(3,375 Views)

In addition, I think you can remove that entire inner while loop and it would still work the same. Less code = less places for bugs to hide! 😄

 

And yes, simply initialize the feedback node as has been said.

 

There is also "ptbypt min&max" which will do all that for you directly. try it!

0 Kudos
Message 3 of 5
(3,360 Views)

Also what's the point of the formula node?  It's unnecessary, as is the comparison equal to 0. 

aputman
0 Kudos
Message 4 of 5
(3,346 Views)

@aputman wrote:

Also what's the point of the formula node?  It's unnecessary, as is the comparison equal to 0. 


Yes, there are plenty more things wrong with this code. We only scratched the surface. 🙂

0 Kudos
Message 5 of 5
(3,335 Views)