Ethernet Receive
Libraries:
Simulink Real-Time /
IP /
Ethernet
Description
The Ethernet Receive block enables you to receive Ethernet packets on a Simulink® Real-Time™ target computer. The block receives the packet from the Ethernet interface (device) that you select on the target computer.
Examples
Apply 802.1Q VLAN Tag by Using Ethernet Send and Receive Blocks
Use Ethernet blocks to send and receive Ethernet packets.
Ports
Output
Data — Outport for Ethernet packet
Simulink message
Connect the Ethernet packet signal from this port to the model. If you enable the
Enable Simulink messages parameter, the data type is
Ethernet_Packet
. This data type consists of:
Data
: DataType: uint8, Complexity: real, Dimensions: [64 1]Length
: DataType: uint8, Complexity: real, Dimensions: 1
Data Types: uint8
| Ethernet_Packet
Length — Number of bytes received
double
This port is available when you disable the Enable Simulink
messages parameter. The Length is the number of bytes in the new packet
received, otherwise it is 0
.
Data Types: double
Parameters
Interface Name — Target computer Ethernet interface name
wm0
| wm1
| character vector
The Interface Name is the name of the target computer Ethernet interface. Use the Speedgoat Ethernet Configuration Tool to identify the Ethernet index (interface) on the target computer.
Programmatic Use
Block Parameter:
InterfaceName |
Data Width — Data port width in bytes
64 (default) | integer
The Data Width is the width of the Data port in bytes. Ethernet packets that are shorter than this width are padded with zeros.
Programmatic Use
Block Parameter:
DataWidth |
Enable Simulink messages — Data as messages
off
(default) | on
The Enable Simulink messages directs the block to treat data as messages. When enabled, the Length port is removed.
Programmatic Use
Block Parameter:
MessageOut |
Maximum messages in a time step — Limit packets per time step
1 (default) | integer
The Maximum messages in a time step selects the maximum number of packets that the block outputs for each time step.
Programmatic Use
Block Parameter:
MaxMessagesPerStep |
Capture filter — Filter on received packets
character vector
The Capture filter selects which packets to receive. If no filter is provided, all
packets are received. For information about capture filter syntax, see the
Expressions section in the tcpdump
page in the QNX Neutrino documentation. This example
filter captures packets that are addressed to destination port 9001.
dst port 9001
Programmatic Use
Block Parameter:
FilterString |
Sample Time — Sample time of block
-1 (default) | numeric
Enter the base sample time or a multiple of the base sample time.
-1
means that sample time is inherited.
Programmatic Use
Block Parameter:
SampleTime |
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
Version History
Introduced in R2022a
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)