10-17-2012 02:58 PM
I am trying to use counter variable "count". The default for "count" is 0 when the program is opened up. I initialize ssd and sumclick to be 0. However once it goes through the formula node, the value for "count" changes to 1 and then the decision loop within the formula node that checks if "count>0" is used.
My problem is, if I stop the program and then rerun the program without closing and reopenign the program, the value for count continues to be 1, and so my intialization for ssd and sumclick dont happen. Whenever I hit the run button I want count to be 0. I dont want count to remember the 1 from the previous run. How can I do this?
The VI is below.
10-17-2012 04:08 PM
Add a shift register to the while loop, then add a "count" input to the math node. wire the count output to the right shift register, then wire the left shift register to the count input. Finally, add a zero constant outside the while loop and wire it to the outside of the left part of the shift register. Or post the vi and I'll mod it for you.
10-17-2012 04:37 PM
Hi Charles,
Thanks for answering my question. The pciture I posted is part of a large program. After I posted the question I reworked on the block diagram to create a base level example to try and figure out what was going wrong. Here is the base level example. I tried to get rid of the formula node in this. i just have a while loop and all LV operations.
I am trying to generate a random number, take the deviation^2 of the random number from 1 and then keep adding that cumulatively to make SSD. I want my SSD to begin with 0, everytime I stop and re-run the program. VI Attached. Please look at it and tell me. Thanks for the help in advance.
10-17-2012 05:45 PM
I'm not 100% sure I understand what you're trying to do - so I'm not sure if what I have attached will help. I hope it does 🙂
10-17-2012 05:48 PM
Aalenox,
Yep! It helped. Thanks a lot!