modelTestSerialPackager_LCM

Example for combining LCM and SerialPackager blocks with deactivated autoBufferSize / useBackwardPropagatedBufferSize

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

Information

The lcmSend block sends to the local port 10002. The lcmReceive block starts a background process that listens at port 10002. Consequently, the lcmReceive block receives what the lcmSend block sends.

Note: There is no causality between the lcmSend block and the lcmReceive block. Therefore the execution order of the blocks is not determined. Additionally, the lcmReceive block starts an own receiving thread, so that the time the data was received is not equal to the time the external function within the lcmReceive block was called. This indeterminism may also show up in the plots.

Remark regarding Linux

LCM requires a valid multicast route. If this is a Linux computer and it is simply not connected to a network, the following commands are usually sufficient as a temporary solution:

sudo ifconfig lo multicast
sudo route add -net 224.0.0.0 netmask 240.0.0.0 dev lo

Components

TypeNameDefaultDescription
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.Packagerpackager
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.AddRealaddReal
Modelica.Blocks.Sources.RealExpression[3]realExpression
Modelica_DeviceDrivers.Blocks.Communication.LCMSendlcmSend
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.AddIntegeraddInteger
Modelica.Blocks.Sources.IntegerExpressionintegerExpression
Modelica_DeviceDrivers.Blocks.Communication.LCMReceivelcmReceive
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.GetRealgetReal
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.GetIntegergetInteger
Packaging.SerialPackager.AddFloataddFloat
Packaging.SerialPackager.GetFloatgetFloat
Modelica.Blocks.Sources.RealExpression[2]realExpression1