View Single Post
  #4   Spotlight this post!  
Unread 10-02-2013, 23:25
piguy123 piguy123 is offline
Registered User
FRC #4751
Team Role: Programmer
 
Join Date: Nov 2012
Rookie Year: 2012
Location: Canada
Posts: 6
piguy123 is an unknown quantity at this point
Re: Error While Making Relay Work For Certain Time

Quote:
Originally Posted by Mark McLeod View Post
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
Thanks for the awesome reply! I'll try that out!
In your example, after Button 1, there is an arrow with an asterix underneath it. How do I make that?

Thanks again!
Reply With Quote