xPC Target    

Why UDP?

UDP was chosen as the transport layer for xPC Target precisely because of its lightweight nature. Since the primary objective of an application running in the xPC Target framework is real-time, the lightweight nature of UDP ensures that the real-time application will have a maximum chance of succeeding in real-time execution. Also, the datagram nature of UDP is ideal for sending samples of data from the Real-Time Workshop generated application. Since TCP is stream oriented, separators between sets of data will have to be used for the data to be processed in samples. It is easier to build an application to deal with unreliable data than it is to decode all of this information in real-time. Also, if the application is unable to process the data as quickly as it arrives, the following packets can just be ignored and only the most recent packet can be used.

Communication can involve a packet made up of any Simulink data type (double, int8, int32, uint8, etc.), or a combination of these. xPC Target provides blocks for combining various signals into one packet (packing), and then transmitting it. Also, xPC Target provides blocks for splitting a packet (unpacking) into its component signals which can then be used in a Simulink model. The maximum size of a packet is limited to about 500 bytes.


  What Is UDP? xPC Target UDP Blocks