Go to Post When mentors and students battle it's the team that loses. - Koko Ed [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Spotlight this post!  
Unread 03-02-2006, 12:45
KenWittlief KenWittlief is offline
.
no team
Team Role: Engineer
 
Join Date: Mar 2003
Location: Rochester, NY
Posts: 4,213
KenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond repute
Re: problem with using a loop

The SW in the robot runs in a loop (the main loop). About 38 times a second it reads all the inputs, executes your code, then sets all the outputs to there new values.

If you stick a WHILE or FOR loop in you code, then this main loop is stopped until your loop completes. This means no more inputs will be read, no more outputs will be updated.

For this reason, you cannot use WHILE or FOR loops in your code.

There is also a second processor handling the Inputs and Outputs on a higher level. When it sees your code has stopped updating the outputs every 26mS, it assumes your code has crashed, and it shuts down the controller.

EDITED FOR CORRECT TIMING: The communication loop runs about 38 times a second, every 26.2 milliseconds. (thanks Alan :^)

Last edited by KenWittlief : 03-02-2006 at 13:33.
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Loop time for OperatorControl function? Debug blows... Chris_Elston Programming 10 13-02-2006 14:42
While Loop Require in OperatorControl? Chris_Elston Programming 2 15-01-2006 14:29
Need a realistic Statics Problem sanddrag Technical Discussion 10 05-12-2005 15:07
arm-limitting gyro PD loop producing some strange results ZZII 527 Programming 8 16-02-2005 02:30
Rewriting main loop Max Lobovsky Programming 4 04-01-2005 18:35


All times are GMT -5. The time now is 02:10.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi