Modelica_DeviceDrivers.Blocks.Communication.SoftingCAN

Support for Softing's CAN interfaces utilizing their CANL2 API library

Information


Prototypical support for Softing CAN interfaces

Please note, that the support for CAN is considered prototypical. Even more than for the other elements in this library there might be severe bugs in it and you use it on your own risk. Additionally, the API of the blocks is more likely to change in the future. So please, refrain from using it for building your next nuclear power plant or fly-by-wire system ... System Requirements

The needed files are freely available from Softing, however the corresponding license sets limits on the distributability of the files. Consequently, the files are not distributed with this library.

There are exist drivers for Windows and Linux. However, the Linux package only supports very old Linux kernels (at least that was the case for June, 2012). Because of this, Softing CAN interfaces are currently only supported for Windows.

Please download and install the Softing drivers including the CAN Layer2 API from Softing (e.g., start at http://industrial.softing.com/ and click your way through).

After installation of the software driver package available from Softing, please copy the files from "$PATH_TO_SOFTING_API\APIDLL\*" into the directory $PATH_TO_MODELICA_DEVICEDRIVERS\Modelica_DeviceDrivers\Resources\thirdParty\softing (on my computer the Softing installation path is "C:\Program Files (x86)\Softing\CAN\CAN Layer2 V5.16\APIDLL"), so that you end up with the following directory tree:

.\win32\canL2.dll
.\win32\canL2.lib
.\win32\CANusbM.dll
.\win64\canL2_64.dll
.\win64\canL2_64.lib
.\win64\CANusbM.dll
.\Can_def.h
.\CANL2.h

Finally, note that in order to translate and execute Modelica models utilizing this API it is necessary that the corresponding .lib and .dll files are found at compile and runtime. Prefered way to ensure this:

Copy the *.dll and *.lib for your architecture into your simulation directory (note that working on a 64bit Windows does not necessary mean that your Modelica tool compiles 64bit binaries, i.e., if in doubt just try both). Additionally, rename canL2_64.* to canL2.* if using the 64bit libraries.

Extends from Modelica.Icons.Package (Icon for standard packages).

Package Content

NameDescription
Modelica_DeviceDrivers.Blocks.Communication.SoftingCAN.SoftingCANConfig SoftingCANConfig Configuration for a softing CAN interface
Modelica_DeviceDrivers.Blocks.Communication.SoftingCAN.SoftingReadMessage SoftingReadMessage Set up a message for receiving data
Modelica_DeviceDrivers.Blocks.Communication.SoftingCAN.SoftingWriteMessage SoftingWriteMessage Set up a message for transmitting data

Modelica_DeviceDrivers.Blocks.Communication.SoftingCAN.SoftingCANConfig Modelica_DeviceDrivers.Blocks.Communication.SoftingCAN.SoftingCANConfig

Configuration for a softing CAN interface

Information


Support for Softing CAN bus

Please, read the package information for SoftingCAN first!

Example

See TestSerialPackager_SoftingCAN.

Extends from Modelica_DeviceDrivers.Utilities.Icons.BaseIcon (Base icon for blocks providing access to external devices), Modelica_DeviceDrivers.Utilities.Icons.BusIcon (Icon for a communication bus).

Parameters

NameDescription
deviceNameName of CAN device
baudRateCAN baud rate

Connectors

NameDescription
softingCANBus[nu] 

Modelica_DeviceDrivers.Blocks.Communication.SoftingCAN.SoftingReadMessage Modelica_DeviceDrivers.Blocks.Communication.SoftingCAN.SoftingReadMessage

Set up a message for receiving data

Information


Support for Softing CAN bus

Please, read the package information for SoftingCAN first!

Example

See TestSerialPackager_SoftingCAN.

Extends from Modelica_DeviceDrivers.Blocks.Interfaces.PartialSoftingCANMessage.

Parameters

NameDescription
identIdentifier of CAN message (CAN Id)
sampleTimePeriod at which messages are written [s]
startTimeFirst sample time instant [s]

Connectors

NameDescription
softingCANBus 
pkgOut 

Modelica_DeviceDrivers.Blocks.Communication.SoftingCAN.SoftingWriteMessage Modelica_DeviceDrivers.Blocks.Communication.SoftingCAN.SoftingWriteMessage

Set up a message for transmitting data

Information


Support for Softing CAN bus

Please, read the package information for SoftingCAN first!

Example

See TestSerialPackager_SoftingCAN.

Extends from Modelica_DeviceDrivers.Blocks.Interfaces.PartialSoftingCANMessage.

Parameters

NameDescription
identIdentifier of CAN message (CAN Id)
dlcData length code (payload of data in bytes, max=8)
sampleTimeSample period of component [s]
startTimeFirst sample time instant [s]

Connectors

NameDescription
softingCANBus 
pkgIn 

Automatically generated Tue Oct 1 14:26:57 2013.