Table of Contents
The Ethernet input mailbox block allows receiving up to 1024 bytes of data via Ethernet using the UDP protocol (in SDK versions prior to 2025.2, the size limit was 32-bit). To send up to 1024 bytes of data via Ethernet using the UDP/IP protocol, the Ethernet output mailbox should be used.
The ETH input block reads n bytes of data received via UDP/IP on the specified port and applies it to the output port of the block. The value of n is defined by the Signal decoding format
parameter (in bytes) multiplied by the Number of signals
parameter. The data can be interpreted as one of the following types: int8, int16, int32, uint8, uint16, uint32, float32, or float64. It features a second output that indicates that new data has been received. The value on the output data port will remain unchanged until new data are received.
Simulink block
Signal specification
- The data output signal returns n bytes of data received via UDP, formatted as a vector. The value of n is defined by the
Signal decoding format
parameter (in bytes) multiplied by theNumber of signals
parameter. The output data type is configured by theSignal decoding format
parameter, and the vector length is defined by theNumber of signals
parameter. (e.g. withSignal coding format
set to uint32 andNumber of signals
set to 100, the data size read will be 4 x 100 = 400 bytes. The output vector will have a length of 100, with each element occupying 4 bytes) - The second signal is the data valid output. It is set to 1 each time new data are available.
Parameters
Ethernet port number
: sets the port number on which data will be received.Signal decoding format
: defines the type of the data output (int8, int16, int32, uint8, uint16, uint32, float32, or float64).Number of signals
: specifies the vector size of the data output signal.Byte order
: defines the byte order in which the data will be read. (little-endian or big-endian)Initial value
: sets the initial value of the data output before any data are received. The value is interpreted as a uint64.
PLECS block
Signal specification
- The data output signal returns 32 bits of data received via UDP. The output data type is configured by
Signal decoding format
parameter. - The second signal is the data valid output. It is set to 1 each time new data are available.
Parameters
Ethernet port number
: sets the port number on which data will be received.Signal decoding format
: defines the type of the data output (int8, int16, int32, uint8, uint16, uint32, float32, or float64).Number of signals
: specifies the vector size of the data output signal.Byte order
: defines the byte order in which the data will be read. (little-endian or big-endian)Initial value
: sets the initial value of the data output before any data are received. The value is interpreted as a uint64.