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.
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.
sudo modprobe vcan
sudo ip link add type vcan
sudo ifconfig vcan0 up
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).
Name | Description |
---|---|
SocketCANConfig | Open socket to specified CAN interface |
ReadMessage | Set up a message for receiving data |
WriteMessage | Set up a message for transmitting data |
Internal |