03-30-2019 11:41 AM
Attached to this note is a code snippet that is representative of a logic flow that we have for our robot. Basically, Input 1 is a momentary input designed to toggle the output as a latch. What I am trying to do is take a second input (Input 2) and make it toggle the output to false (and remain false). The problem that I am having is that the shift registers are apparently remembering the previous input state and keeping the output on based on the prior state of Input 1.
I need assistance in figuring out how to program this structure so that when Input 2 is pressed, the output goes to false and remains that way.
Thank you!
Solved! Go to Solution.
03-30-2019 11:55 AM
I'm away from my computer right now, but the SR flip flop in the memory library does just that (frclabviewtutorials.com/tutorials/memory-library)
Check out this thread for an example of doing this controlling two Solenoids: https://forums.ni.com/t5/FIRST-Robotics-Competition/Double-solenoid/td-p/3889386
03-30-2019 04:53 PM
Thank you for your response...
I downloaded the SR flip flop, and I was successful in making a toggle-type switch using the .vi from the memory library. I have not been successful in integrating the second input to reset the condition. Any assistance you can provide is very much appreciated.
03-30-2019 05:37 PM
03-31-2019 08:51 AM
Here's the example from the page.
Only thing to note is that if you push both buttons it will continuously cycle until you let go of at least one of them.
You can make it only respond when only one is pressed by changing the Enable input from a True constant to a NotEqual of the buttons.
04-01-2019 12:56 PM
Here is the code that ends up working in snippet form. Thank you for everyone's assistance.