The Simulink® Real-Time™ software supports communication from the target computer to other systems or devices using raw Ethernet (Ethernet packets). Raw Ethernet is a direct method to send and receive packets with the real-time application using the Ethernet protocol. To transfer data using Ethernet packets, you must manually create Ethernet frames. This topic assumes that you are knowledgeable about the IEEE® 802.3 standard.
By itself, raw Ethernet does not implement the TCP/IP or UDP standards. For information about modeling protocols built upon raw Ethernet, see Real-Time UDP.
Before you start, provide a dedicated Ethernet card on your target computer. A dedicated Ethernet card is to be used only for model-based Ethernet communications and not for communication between the development and target computers. Therefore, your target computer must have at least two Ethernet cards, one to connect the development and target computers, and one for model-based Ethernet communication. The Simulink Real-Time model-based Ethernet communication blocks support selected members of the following Intel® (Vendor ID 0x8086) chip families:
To use the model-based Ethernet blocks, specify the PCI bus and slot number of the dedicated Ethernet card in the Real-Time Ethernet Configuration block. To identify which Ethernet card is available:
Boot the target computer with which you want to perform model-based Ethernet communications.
Examine the startup screen on the target computer. Note the PCI bus and slot information on the bottom right of the status window. This information represents the Ethernet card that is installed on the target computer for dedicated communication between the development and target computers.
In the MATLAB® Command Window, type
tg = slrt; getPCIInfo(tg, 'ethernet')
This command determines which Ethernet cards are installed in the target computer.
In the list, find the Ethernet card with a bus and slot different from the bus and slot that are displayed on the target computer monitor.
Note the PCI bus and slot of the free Ethernet card. Use the card for model-based Ethernet communications.
Several Ethernet blocks require you to enter MAC addresses.
The MAC address must be vector-based. To obtain the vector-based version
of a MAC address, use the
This command converts a character vector-based MAC address to a vector-based
one. For example:
macaddr('01:23:45:67:89:ab') [1 35 69 103 137 171]
When an Ethernet block requires a MAC address, you can enter either of the following in the address field:
macaddr(', for example:
Vector-based output from the
[1 35 69 103 137 171]
Real-Time Ethernet block library uses pointers to refer
to network buffers. Blocks can pass pointers to these buffers as single
They can also refer to a chain of network buffer packets.
The Filter Type and Filter Address blocks accept a chain of network buffers as input. These blocks specify criteria that the drivers use while parsing each buffer on the chain. Based on these criteria, the drivers either pass the packets through the port or drop the packets. When using these blocks, create your models with filter blocks to pass data only from expected sources.
The raw Ethernet blocks have the following execution priority, from first to last:
The remaining raw Ethernet and network buffer library blocks
To access the Simulink Real-Time Ethernet library blocks, in the Simulink Real-Time block library, double-click Ethernet. The Simulink Real-Time Ethernet library is displayed.
The Simulink Real-Time Ethernet library contains commonly used Ethernet blocks at the top level of the library. Use these blocks to create your models.
The Ethernet library also has a sublibrary, Network Buffers, which contains blocks specific to the management of Ethernet network buffers. The blocks in this sublibrary are core blocks for use in creating other subsystems. However, the top-level Ethernet blocks provide enough functionality for model-based Ethernet communications.