Spending Boolean values throughout code

I am needing to know how to spend a boolean value from the teleop vi to the timed task vi, that way i can control the code. I was wondering if anyone could point me in the right direction.

I havent done alot with them but what you might be looking for is a global variable but im not sure

Do you know how to set up a global variable?

See if this helps any.

i got the global variables working but now when i run my code the sonar that i have in the timed tasks vi only works when the code is not enabled.

what does your code look like in both v.i.s