.Modelica_DeviceDrivers.Blocks.Communication.SocketCAN

Information

Support for Linux Socket CAN interface

Modelica external function interface to use the CAN socket interface of the Linux kernel (https://www.kernel.org/doc/Documentation/networking/can.txt).

So far only tested with the virtual CAN interface "vcan". However, in principle it should work similarly with an underlying "real" CAN-device which is supported by the Socket CAN interface.

Setup of a virtual CAN interface

Even if a Linux computer doesn't have a CAN device, it is possible to setup a virtual CAN device that can be used similarly to a physical device. This section discusses the necessary steps to bring up a virtual CAN device (tested with Ubuntu 12.04) which can be used with the SocketCAN example model. Note that this usually requires root rights. Also executing the Modelica example model might require root rights.

Setup of a physical CAN interface

Please have a look in the respective documentation to Socket CAN. A physical CAN interface will require more configuration settings than the virtual interface (e.g., bitrate setting).

Contents

NameDescription
 SocketCANConfigOpen socket to specified CAN interface
 ReadMessageSet up a message for receiving data
 WriteMessageSet up a message for transmitting data
 Internal

Generated at 2024-11-23T19:25:52Z by OpenModelicaOpenModelica 1.24.2 using GenerateDoc.mos