Main Content

slrealtime.createUDPPacketBusObj

Created UDP packet bus object

Description

example

slrealtime.createUDPPacketBusObj(dataLength) creates a bus object to use with the UDP Receive block and UDP Send block.

If a bus object with the name already exists, it is assumed to contain the IP_Address, IP_Port, Length, and Data elements and the object is updated such that the size of the Data element is set to the maximum of the existing size and the dataLength argument

Examples

collapse all

To create a Simulink.Bus object named UDP_Packet that has bus elements:

  • IP_Address: DataType: 'uint8' Size: 4 x 1)

  • IP_Port: DataType: 'uint16' Size: 1

  • Length: DataType: 'uint16' Size: 1

  • Data: DataType: 'uint8' Size: dataLength x 1

slrealtime.createUDPPacketBusObj(16);

Input Arguments

collapse all

The dataLength selects the number of bytes in the UDP packet.

Example: 16

Data Types: uint16

Version History

Introduced in R2022a

See Also

Objects

Tools

Blocks