Receive UDP packets from the network
The dsp.UDPReceiver
System object™ receives UDP packets over a UDP network from a remote IP address specified in
the RemoteIPAddress property. The object then saves the data to
its internal buffer. The amount of data (number of elements) received in each UDP packet can
vary. The maximum number of bytes the object can receive without losing data is set by the
ReceiveBufferSize property. The MaximumMessageLength property specifies the maximum number
of samples each data packet can contain. The LocalIPPort on which the object receives the data is tunable in generated code but not tunable during
simulation. For an example, see Tune the UDP Port Number in MATLAB.
To receive UDP packets from the network:
Create the dsp.UDPReceiver
object and set its properties.
Call the object with arguments, as if it were a function.
To learn more about how System objects work, see What Are System Objects?.
To use an object function, specify the
System object as the first input argument. For
example, to release system resources of a System object named obj
, use
this syntax:
release(obj)