modelTestSerialPackager_SocketCAN

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

Information

Example for Linux Socket CAN interface support

Will only work on Linux!

Please, read the package information for SocketCAN first!

The example

The example is configured to use the virtual CAN interface "vcan0". The SocketCAN package documentation describes briefly how to bring up such a virtual CAN interface in Linux.

Two sockets are opened in the example: One for sending messages, the other for receiving them. The SerialPackager blocks are used to add/retrieve data to/from the messages.

Components

TypeNameDefaultDescription
Modelica_DeviceDrivers.Blocks.Communication.SocketCAN.SocketCANConfigsocketCANConfig1
Modelica_DeviceDrivers.Blocks.Communication.SocketCAN.WriteMessagetxMessage
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.AddIntegeraddInteger
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.PackUnsignedIntegerpackInt2
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.PackUnsignedIntegerpackInt1
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.Packagerpackager
Modelica.Blocks.Sources.IntegerExpressionintegerExpression1
Modelica.Blocks.Sources.IntegerExpressionintegerExpression2
Modelica.Blocks.Sources.IntegerConstantintegerConstant
Modelica_DeviceDrivers.Blocks.Communication.SocketCAN.ReadMessagerxMessage
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.UnpackUnsignedIntegerunpackInt1
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.GetIntegergetInteger
Modelica_DeviceDrivers.Blocks.Communication.SocketCAN.SocketCANConfigsocketCANConfig2
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.UnpackUnsignedIntegerunpackInt2
Modelica_DeviceDrivers.Blocks.OperatingSystem.RealtimeSynchronizerealtimeSynchronize