MATLAB: PacketLoss on UDP communication between xPC target and host computer

udpxpc target

Dear all,
I use UDP blocks from xPC target library to send and receive data between xPC and host pc.
The Receive block has two output ports. The first port is the output of the received data. The second one is a flag indicating whether any new data has been received. The second one reflects the "pacakgeLoss".
During the implementation, the comunication (send and recieve 2 "doubles" data at 100Hz) suffers a great "packageLoss", about 20%. The network is LAN and very fast. I 'd like to ask whether this the nature of UDP with a great packageLoss?
I know I could use 'feedback' method introduced by the UDP demo from matlab help to re-send the lost package. However it does not improve the packageLoss fundamantally.
Does anyone have any idea about this? Thanks.
Lily

Best Answer

If you are using full duplex with a proper cable, and any switches involved are decent, and these are the only devices on the network, and if your transmission rate is not greater than what the target can keep up with, and if your ethernet cards are real ethernet cards and not very cheap ones that use the main CPU to run them -- then you should expect UDP packet losses less than 0.01% .
It isn't difficult to get ethernet cards and cables and switches that will have quite acceptable loss rates, but the lowest priced products can be trouble.
Related Question