Showing results for 
Search instead for 
Did you mean: 

Strange boolean shift register behavior

Go to solution

Hello All,


I have a very strange situation where A shift register changes a boolean value with no apparent reason.

I have a very simple code should operate only if a switch has changes its value.

For some reason the value in the shift register is changing and I can not figure out why.

I have attached a simplified code with an on/off switch a loop with a shift register and a boolean indicator.



0 Kudos
Message 1 of 8

Can you save for previous version?

0 Kudos
Message 2 of 8

Open the block diagram, run it in highlight execution (lightbulb) mode and tell me why this is happening.  (It should become very obvious.)

(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 3 of 8
Accepted by topic author GilMaor

You want to compare with the previous switch value, not with the previous comparison result, so wire the switch instead of the result to the shift register on the right. Wire only the LED to the comparison result.


While there are also tools to detect changes (example), I typically just used a feedback node.




(Note that you can replace the "not equal" with "greater than" or "less than" to detect FALSE->TRUE and TRUE->FALSE transitions resp. You can even use "equal" to detect if the value is unchanged. ;))


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
Message 4 of 8

Did that,

Silly me...


0 Kudos
Message 5 of 8

Silly me...


0 Kudos
Message 6 of 8

@GilMaor wrote:

Did that,

Silly me...


Did what? And why is this reply marked as the solution? I'm assuming that you are referring to altenbach's reply. If so then you should mark his response as the solution. It's also nice to give kudos.

0 Kudos
Message 7 of 8

As altebach suggested I was comparing the last compare result rather than the last button status.

I fixed the code so it will compare the last button status.  


0 Kudos
Message 8 of 8