01-19-2016 11:49 AM
I am attempting to reinitialize a shift register on every pass of a while loop but it
isn't working. Can anyone spot what I am doing wrong?
Thanks
01-19-2016 11:57 AM
Could you please attach the VI instead of an image? Is shown case structure included in a while loop?
Thanks,
Arev
CTO | RAFA Solutions
01-19-2016 12:08 PM
@arevh wrote:
Could you please attach the VI instead of an image? Is shown case structure included in a while loop?
The bottom image is a snippet, please drag and drop.
01-19-2016 12:17 PM
What is leading you to think that the shift register is not reinitializing? I can belive you having issues with that Feedback Node inside of that FOR loop, but I see nothing wrong with that shift register.
01-19-2016 12:40 PM
I agree with Crossrulz. Try running your code with a Probe inside and outside the For loop.
I'll also note that you appear to be using an I32 to do a Boolean's job. If you wired a False to the input tunnel, made it a Boolean, and turned it True in the "Bad Channel" case inside the For loop, you could bring this "Fail" signal directly into the subsequent "Allow up to 3 passes" Case Statement.
I just erased a comment I made about how silly it was to have two controls, Pass and Fail, one being the negative of the other. I then realized you were making a 3-state indicator for your Boolean outcome -- "Pass", "Fail", and "Don't Know, yet". Here's a way to make it really be three-state:
When you initialize your program (so the answer is "Don't Know Yet", hide Fail. When it is time to display, do the following:
When you go back to the next loop and the "Don't Know Yet" state, you can simply turn both Indicators off.
Now, when your program runs, you will see "Pass", but it will be off. If it Passes, Pass will illuminate, otherwise Fail will illuminate. The Colors will be different (bright Green vs bright Red) and they will show the Pass or Fail label.
Bob Schor
01-19-2016 12:53 PM
Bob_Schor wrote:
I just erased a comment I made about how silly it was to have two controls, Pass and Fail, one being the negative of the other. I then realized you were making a 3-state indicator for your Boolean outcome -- "Pass", "Fail", and "Don't Know, yet". Here's a way to make it really be three-state:
I just change the color of the one indicator when the test is done. While running, I have the FALSE state be a grey or dim green. When the test is complete, change the FALSE state to be red. The colors for TRUE never change. This allows the result to be directly written and you just change the color instead of one control of messing around with multiple indicators.
01-19-2016 01:46 PM