Real-Time Testing provides the following Python modules to implement CAN communication via Real‑Time Testing:
rttlib.dscanapilib
rttlib.canlib
In this lesson, you will use the rttlib.dscanapilib module. If you are interested in using the rttlib.canlib module, refer to Lesson 6: Implementing CAN Communication with the rttlib.canlib Module.
The rttlib.dscanapilib module provides an interface to a CAN controller of the simulation platform where the RTT sequence is executed. The rttlib.dscanapilib module can access the CAN controller to transmit and receive CAN messages in raw data format. In contrast to the rttlib.canlib module, no predefined experimental messages are necessary and the Simulink model does not have to use blocks of the RTI CAN MultiMessage Blockset.
The rttlib.dscanapilib module contains all classes and methods which are necessary for handling CAN messages. The rttlib.dscanapilib module supports CAN and CAN FD messages in the standard or extended format.
You can use the rttlib.dscanapilib module on the following simulation platforms:
SCALEXIO Processing Unit
DS6001 Processor Board
MicroAutoBox III
MicroLabBox II
VEOS
V-ECU on VEOS
A hardware platform must have an I/O board or module with CAN controller.
In this lesson, you will use VEOS as a simulation platform to implement CAN communication with the rttlib.dscanapilib module.
Real-Time Testing provides no ready-to-use simulation application for CAN communication. Instead, you can use a demo file provided with the VEOS installation.
It is also possible to use one of the other supported simulation platforms to implement CAN communication. But in this case, you need to build a simulation application. For further information on building a simulation application, refer to Lesson 6: Implementing CAN Communication with the rttlib.canlib Module.
In this lesson, you will learn how to implement CAN communication via Real‑Time Testing using the rttlib.dscanapilib module:
You will learn how to get an offline simulation application (OSA) for CAN communication on VEOS.
You will learn how to write an RTT sequence to transmit and receive CAN messages on VEOS.
This lesson contains the following steps:
To check the learning results of the steps you executed and for further information, refer to Result of Lesson 5.
Working through this lesson will take you about 20 minutes.