View Single Post
  #2   Spotlight this post!  
Unread 10-02-2013, 22:56
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: Error While Making Relay Work For Certain Time

That message means that your code is too slow to handle the command packets received from the Driver Station 50 times a second.
For instance, if you tried to run this code in Teleop.vi, because Teleop handles the Driver packets directly and subsequently cannot take longer than 20ms to execute.

Code that is allowed to run just as fast as it possibly can (like your example) will also suck all the life out of the cRIO CPU and prevent other code from running in a timely manner.

So, two points:
  1. A delay sequence like this belongs in Periodic Tasks.vi where it won't slow down Teleop
  2. Every loop you use must have a Wait built into it to slow it down, and Waits act to release the CPU for use by other tasks, like Teleop.
The code as written will never end.
Relay's do not have to be in wait loops.

Here's an example of a Relay sequence, a double sequence really, but just ignore the second one for your purposes.
http://www.chiefdelphi.com/forums/at...chmentid=13775
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 10-02-2013 at 23:14.
Reply With Quote