modelTestSerialPackagerBitPack_UDP

Example for the PackUnsignedInteger and UnpackUnsignedInteger blocks from the SerialPackager

Extends from Modelica.Icons.Example (Icon for runnable examples).

Information

In particular this model demonstrates how integer values can be packed and unpacked at bit level using the PackUnsignedInteger and UnpackUnsignedInteger blocks.

This example sends data to address 127.0.0.1, which is a special-purpose IPv4 address and is called the localhost or loopback address. When you have to transfer data to another computer you have to use in uDPSend that computer's IP. You've also to set the port number of the remote computer you want to send to.

When you want to receive data from another computer, you have set in uDPReceive the actual port number of the local computer you a willing to receive data to.

Components

TypeNameDefaultDescription
Modelica_DeviceDrivers.Blocks.Communication.UDPSenduDPSend
Modelica.Blocks.Sources.IntegerExpressionintegerExpression
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.Packagerpackager
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.PackUnsignedIntegerpackInt
Modelica_DeviceDrivers.Blocks.Communication.UDPReceiveuDPReceive
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.UnpackUnsignedIntegerunpackInt
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.PackUnsignedIntegerpackInt1
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.AddIntegeraddInteger1
Modelica.Blocks.Sources.IntegerExpressionintegerExpression1
Modelica.Blocks.Sources.IntegerConstantintegerConstant1
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.UnpackUnsignedIntegerunpackInt1
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.GetIntegergetInteger1
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.AddRealaddReal
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.GetRealgetReal
Modelica.Blocks.Sources.RealExpression[3]realExpression