■
Multilingual debugging output
■
Output language depends on operating systems
■
Debugging information can be defined individually
6.2 Principle Description of the API
The sequence of accessing the CAN interface is divided into three phases:
Initialization
A CAN channel must be initialized before using it. This is done by the simple call of
the function
CAN_Initialize
for CAN and
CAN_InitializeFD
for CAN FD. Per
CAN interface type the API allows the simultaneous use of up to 16 CAN channels.
After a successful initialization the CAN channel is ready. No further configuration
steps are required.
Interaction
For receiving and transmitting messages the functions
CAN_Read
and
CAN_Write
as well as
CAN_ReadFD
and
CAN_WriteFD
are available depending on the
initialization mode. Additional settings can be made, such as setting up message
filters to confine to specific CAN IDs or setting the CAN controller to Listen-only
mode.
For the receiving CAN messages, events can be configured for automatic notification
of an application (client). This offers the following advantages:
■
The application no longer needs to check for received messages periodically
(no polling).
■
The response time at reception is reduced.
Completion
To end the communication the function
CAN_Uninitialize
is called in order to
release the reserved resources for the CAN channel, among others. In addition the
CAN channel is marked as "Free" and is available to other applications.
6 API PCAN-Basic
PCAN-PCI Express FD
User Manual 2.0.0
© 2022 PEAK-System Technik GmbH
32