Ethernet UDP Communication
This section provides basic information regarding Ethernet UDP Communication protocol components.
Ethernet UDP communication is a simple protocol based on UDP for exchanging data over the Ethernet, using the Lightweight IP (lwIP) library provided by Xilinx.
The protocol runs as a bare-metal application with a guaranteed, deterministic execution rate.
Ethernet UDP components in the Typhoon HIL toolchain
In Typhoon HIL Schematic Editor, Ethernet UDP components are found in the Ethernet Communication/UDP sub-folder under the Communication tab.
The Ethernet UDP library category consists of three components: UDP Send, UDP Receive and UDP Multicast Receive.
Ethernet UDP communication is supported by the following Typhoon HIL devices: HIL402, HIL101, HIL404, HIL602+, HIL604, HIL506, and HIL606.
UDP Send
The UDP Send block lets you alter basic settings for the send socket. In this case, the HIL device will be the client in a client-server application. A model can have more than one UDP Send component, provided there is a different local send port for each one.
UDP Send represents a client. The client tries to connect to the remote server specified by Destination IP address and Destination Port after the simulation starts. If the server is accessible, an active connection is opened, system variables are packed, and transferred over Ethernet. In case of a remote server failure, the client will continue trying to reconnect.
UDP Send component properties
- IP Address
- IP address of the HIL device.
- Netmask
- Netmask of the HIL Device.
- Ethernet port
- Ethernet port that will be used for Ethernet UDP communication.
- Local send port
- Represents the local port of the client from which data will be streamed.
- Destination IP address
- Remote server IP address to which data will be streamed.
- Destination port
- Remote server port to which data will be streamed.
- Execution rate
- Signal processing execution rate. Model values are sampled at the Execution rate and they are sent. The Execution rate must match with the other components in the model.
UDP Send ports
- Data[]
- Memory address where the data being sent is stored, the data can be packed using C function.
- Length
- Number of bytes being sent in every message.
- If length is 0 then no message will be sent.
- Status
- Indicates how many messages have not been sent for any reason.
UDP Receive
The UDP Receive block lets you alter basic settings for the receive socket. In this case, the HIL device will represent a server in a client-server application. A model can have more than one UDP Receive component, provided there is a different receive port for each one.
UDP Receive represents a server with a passive opened connection. It waits for any client to try to connect. The server can be configured to accept an incoming connection from any client IP and port (deactivated Specify source port and Specify source IP address respectively), or to accept only from a specified IP and a specified Port. After the connection has been accepted, the server starts receiving packets.
UDP Receive component properties
- IP Address
- IP address of the HIL device.
- Netmask
- Netmask of the HIL Device.
- Ethernet port
- Ethernet port that will be used for Ethernet UDP communication.
- Local receive port
- Represents the local port of the server on which data will be received.
- Specitfy source port
- Enable this option to accept only incoming connections from a client with the specified send port.
- Source port
- Available only if the Specify source port property is active.
- Source port value.
- Specify source IP address
- Enable this option to accept incoming connections only from the client with the specified IP.
- Source IP address
- Available only if Specify source IP address is active.
- Client IP address.
- Execution rate
- Refresh rate of the outputs.
UDP Receive ports
- Rcv_cnt
- Number of messages received since the simulation has started.
- Status
- Indicates how many messages have been dropped for any reason.
- Data[]
- Memory address where all data will be stored, the data can be then parsed using C function.
- Length
- Number of bytes received in the last message.
UDP Multicast Receive
The UDP Multicast Receive block lets you alter basic settings for the receive socket. In this case, the HIL device will represent a server in a client-server application. A model can have more than one UDP Multicast Receive component, provided there is a different multicast port for each one.
UDP Receive represents a server with a passive opened connection. It waits for any client to try to connect. The server can be configured to accept an incoming connection from any client IP and port (deactivated Specify source port and Specify source IP address respectively), or to accept only from a specified IP and a specified Port. After the connection has been accepted, the server starts receiving packets.
UDP Multicast Receive properties
- IP Address
- IP address of the HIL device.
- Ethernet port
- Ethernet port that will be used for Ethernet UDP communication.
- Multicast IP Address
- Represents the multicast group IP address of the server.
- Multicast port
- Represents the multicast group local port of the server on which data will be received.
- Execution rate
- Refresh rate of the outputs.
UDP Multicast Receive ports
- Rcv_cnt
- Number of messages received since the simulation has started.
- Status
- Indicates how many messages have been dropped for any reason.
- Data[]
- Memory address where all data will be stored, the data can be then parsed using C function
- Length
- Number of bytes received in the last message.
Virtual HIL support
Virtual HIL currently does not support this protocol. When using a non-real-time environment (e.g. when running the model on a local computer), inputs to this component will be discarded and outputs from this component will be zeroed.