08-28-2017 08:13 AM - edited 08-28-2017 08:15 AM
I'm trying to make it so that if I turn a switch to the on(true) position, then an led toggles on just once before turning back off. I can't figure out how to have it toggle rather than just stay on. also, I cannot change the action of the switch to only turn on while the switch is being held closed as I need that switch to work with other parts of my code. Any advice?
Solved! Go to Solution.
08-28-2017 08:36 AM - edited 08-28-2017 08:38 AM
08-28-2017 08:37 AM
Shift register or feedback node. Compare new state of switch versus previous state.
Or use the Boolean Crossing Pt by Pt subVI.
08-28-2017 08:55 AM - edited 08-28-2017 09:07 AM
Thanks, I'll take a look into the boolean crossing.
edit: Am I missing something? Currently, I can see the input toggle inside the boolean crossing function, but nothing is triggered...
08-28-2017 09:13 AM
08-28-2017 09:16 AM
I don't want to constantly reset the function. I figured I needed a way to initialize the boolean crossing, but now you bring up a good point. Do I only need to initialize it once or can I leave this disconnected...
08-28-2017 09:43 AM
08-28-2017 09:51 AM
Thank you! It is now working
08-28-2017 10:43 AM
If you don't need all that extra functionality of the ptbypt subVI, all you need is a simple feedback node as follows.
(That's what I typically do :D)