|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Hey,
I have a Boolean control set so that when a joystick button is pressed and released, it switches a case statement. Since the joystick button is momentary I have it set up so: True + False = True, then the next True+False sets it back to False. In essence, pressing & releasing the joystick button toggles the case structure. Now, my question is, I have a sequence inside each case structure. I want to be able to toggle the case structure programmatically when the sequence is finished. (Basically, the program can run back and forth between true and false, but the user can hit the joystick button to manually override the back and forth.) Any ideas on how I can do this? Thanks! |
|
#2
|
||||
|
||||
|
Re: Programmatically Toggling a Boolean Control
Quote:
|
|
#3
|
|||||
|
|||||
|
Re: Programmatically Toggling a Boolean Control
Quote:
If you have a simplified specific example, we can help you refine it. And like Michael said, a delaying sequence can be done in Teleop as a state machine, or put in Periodic Tasks as a true sequence. Is this the kind of thing you're hoping to do? Last edited by Mark McLeod : 05-02-2013 at 14:27. |
|
#4
|
||||
|
||||
|
Re: Programmatically Toggling a Boolean Control
Thanks for the replies!
I've got to the next step. I have another problem -- now, when I'm running a while loop in one of the case sequences, there's no way I can stop this loop outside of the loop itself. Here's the vi I'm using: I try to use the cancel boolean, but it doesn't change any values, because the while loop is running. |
|
#5
|
|||||
|
|||||
|
Re: Programmatically Toggling a Boolean Control
Can't directly break into a while loop while it's running. New values won't pass through it's borders
It alone decides when it's done. You could set a Global variable in a parallel task (i.e., not a check that is linked to the loop in any way) that gets read within the loop. Here's your example using that. (Adding Global Variables ) Last edited by Mark McLeod : 05-02-2013 at 16:30. |
|
#6
|
||||
|
||||
|
Re: Programmatically Toggling a Boolean Control
thanks alot!
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|