View Single Post
  #2   Spotlight this post!  
Unread 16-02-2013, 15:34
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,795
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Trouble understanding timed tasks in Periodic vi

The outer loop runs all the time just checking to see if the button has been pressed.
The button can't be pressed any faster than 20ms, because that's how often a fresh command packet arrives from the Driver Station.

The outside Wait is just to keep the outer loop from running as fast as possible and sucking up all the available CPU when it really isn't doing anything. All loops should be throttled by a Wait of some kind, because the Wait releases the CPU for time sharing with other tasks that are running on the cRIO.
The outside Wait can actually be 20ms.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 16-02-2013 at 15:36.
Reply With Quote