View Single Post
  #4   Spotlight this post!  
Unread 25-03-2012, 04:40
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: LabView corrupt?

Quote:
Originally Posted by gnunes View Post
While many would have ideas, I would most appreciate hearing from actual NI employees and similarly knowledgeable folks.
Your dashboard sends UDP packets every 20 milliseconds. Your UDP receive loop on the robot will wait 20 milliseconds between checking for new packets. This is a recipe for slowly degrading performance, as slight timing discrepancies will cause packets to be produced slightly faster than the robot will consume them.

This might not be the only thing that is causing issues with your code, but it is an obvious one that jumped out at me quickly. Remove the 20 ms delay in the UDP receive loop, and let the UDP receive function itself control the loop execution rate. By the way, there's no need for such a short timeout on the UDP receive. The default of 25 seconds would be fine.
Reply With Quote