We have a programming puzzle where we would like to lock out certain functions when a button is pressed. For example, when opening a solenoid by pressing button 5, motor actuation assigned to axis 2 of joystick 2 (for speed control) is disabled until a different button is pressed. Then, once button 7 is pressed, control is restored. Our current solution is to use a case statement assigned to button 5 that when true sets the solenoid and then a while loop is called within the Case structure until interrupted by Button 7. The exit tunnel of the case structure then continues the opposite solenoid action.
Can someone take a look at this and tell me if this is on the right track or is there a better way?