Go to Post We can either sit around and complain about what could have been, or we can focus on the upside of what we have and move on. - Vikesrock [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
  #17   Spotlight this post!  
Unread 09-02-2012, 12:12
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,560
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Image processing on the driver station laptop

Quote:
Originally Posted by Chris Hibner View Post
I thought about this a little more, and the behavior of the UDP seems logical to me now. The protocol is made for transferring contiguous data (like strings or files) where missing a packet is a bad idea (it would make your string nonsense or corrupt your file). Therefore, making sure all of the data is received is more important than the timing of the data.
Both TCP and UDP are typically implemented with multiple levels of fifos (buffer in the library at the send side, buffer in the os in the send side, buffer in the ethernet chip in the send side, buffer in the ethernet chip at the receive side, etc). This does complicate only reading the most recent data. I have not looked at the LabVIEW UDP libraries, but (based on experience with UDP on other embedded systems) I would expect there is a way to peek into the buffer to see how much is waiting, read all of it, then only use the latest data in your code.

If you research UDP vs TCP, you'll actually find the opposite conclusion (UDP loses data, TCP doesn't). However, this comes from use over a lossy connection, such as the internet. UDP just blasts out the data. If one packet gets routed through Russia, it will be received after a later packet that gets routed more directly. It can also get lost. It's used for protocols where missing or out of order information is not critical, but low latency is. TCP on the other hand is a handshaked protocol where if a packet is lost, it will be re-transmitted or if a packet is delayed, it will be re-assembled in the correct order. This is what you use if want to transfer contiguous data. Neither tries to lose data, but only TCP guarantees you don't lose data.

Now, in a low utilization local link like the robot network, in reality packets don't get lost or delayed, so there is little difference between TCP and UDP.

I'm not sure why you see different results with tcp. If anything, the results should be worse, given the same algorithm for reading data.
 


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


All times are GMT -5. The time now is 04:00.

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