Académique Documents
Professionnel Documents
Culture Documents
About Us
▪ Founded in 1999
▪ Located in Darmstadt, Germany
▪ Development for the mobile and
industrial communication sector
▪ Hardware and software with
focus on CAN, CAN FD, and LIN
▪ More than 100 products
▪ About 40 employees
▪ Manufacturing in Germany
▪ Distributors worldwide
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 2
Topic Overview
▪ CAN & CAN FD Basics 2 hours
▪ Elements of CAN frames
▪ Structure of CAN buses
▪ Bit rates, bus load, and bus length
▪ Demonstration of a simple CAN FD bus
▪ PCAN-Explorer 6 4 hours
▪ Establishing connections to CAN and CAN FD buses
▪ Receiving and sending CAN messages
▪ Recording and playback of CAN traffic
▪ Filtering of CAN traffic and trace files
▪ Readable representation of CAN ID and data
▪ Overview of PCAN-Explorer 6 add-ins
▪ Automation with VBScript and macros
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 3
CAN & CAN FD
Basics
CAN Overview
▪ CAN = Controller Area Network
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 5
CAN FD
▪ FD = Flexible Data rate
▪ Since end of 2015 defined in the standard ISO 11898-1
▪ CAN FD nodes also work on classic CAN buses (without FD features)
▪ Raised bit rate for the data part from 1 Mbit/s up to 12 Mbit/s
▪ Raised maximum number of data bytes per frame from 8 to 64
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 6
CAN Applications
▪ Vehicles Passenger cars, trucks, buses, agricultural vehicles, e-bikes
▪ Aviation Main and sub systems in planes (ARINC 825), sub systems
like lights, seat control, hydraulic
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 7
CAN Properties
▪ Serial field bus
Data transmission is done bit by bit.
▪ Multi-master architecture
Each CAN node is equal and needs no external control.
▪ Collision avoidance
Message collisions are resolved based on CAN ID priority (low ID, high priority).
▪ Transmission is done
Periodically, event-driven or on request via RTR (Remote Transmission Request).
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 8
CAN Properties
CAN ID
▪ CAN messages are distinguished with IDs
▪ 11 bits (CAN 2.0A, Standard), makes 2048 IDs
▪ 29 bits (CAN 2.0B, Extended), makes about 500 million IDs
▪ Use of an CAN ID by one node only
▪ Prioritization based on the CAN ID
Data Bytes
▪ Maximum 8 data bytes
per CAN message
▪ Minimum 0 data bytes
▪ Maximum 64 data bytes CAN ID Data Bytes
with CAN FD 100h 00 FF 1C
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 9
CAN Frame Structure*
ACK
SOF
DLC
RTR
IDE
r0
Idle ID Data CRC EOF IFS Idle
* This illustration shows the structure of a CAN 2.0A “Standard” message frame.
The 18 additional bits of a CAN 2.0B “Extended” ID follow the IDE directly.
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 10
Physical Transmission Types
▪ High-speed CAN (ISO 11898-2)
▪ 2 data lines CAN_High/CAN_Low for differential signal transmission
▪ Bitrates up to 1 Mbit/s
▪ Maximum bus length depends on the bitrate
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 11
High-speed CAN: Structure
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 12
High-speed CAN: Structure
But what components are essential for CAN communication?
▪ Connector
▪ CAN bus connection
T C
▪ Pin assignments are recommended
by CiA® 303-1, for example D-Sub, 9 pin
▪ Transceiver
▪ Responsible for transmitting and receiving
▪ Together with the connector and cables,
the transceiver covers the Physical Layer
▪ Controller
▪ The controller is the CAN protocol in silicon
▪ Covers the Data Link Layer of the ISO / OSI model
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 13
High-speed CAN: Signal Levels
U [V]
1 0 1
5
3.5
CAN_High
2.5
CAN_Low
1.5
▪ Udiff recessive = 0 V
▪ Udiff dominant = 2 V
▪ Recessive state is also idle state on the CAN bus
▪ With several participants: dominant state superimposes the recessive
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 14
High-speed CAN: Differential Signal
U
Udiff
Udiff
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 15
High-speed CAN: Maximum Distances
The maximum distance of CAN nodes Bitrate Max. distance
is limited by the bitrate, because: 1 Mbit/s 40 m
500 kBit/s 110 m
250 kBit/s 240 m
▪ All nodes must receive 125 kBit/s 500 m
the recessive or dominant 50 kBit/s 1.3 km
signal “simultaneously” 20 kBit/s 3.3 km
(propagation speed) 10 kBit/s 6.6 km
▪ On long lines, the voltage 5 kBit/s 13 km
difference Udiff must still be
distinguishable
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 16
Error Detection
▪ A CAN network is fault-tolerant
▪ Error Detection Process
1. CAN node detects an error
2. CAN node transmits an error frame
3. All CAN nodes detect an error
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 17
Node Error Conditions
▪ Error Active ▪ Normal state
▪ REC and TEC both ≤ 96
▪ “Warning” at REC or TEC > 96 (flag, no change in behavior)
▪ Active Error Frame is transmitted (6 dominant bits)
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 18
Error Types
▪ Bit error
▪ Physical check of the transmitted bit
▪ Exceptions: arbitration, acknowledge
▪ CRC error
▪ Received and calculated checksum do not match
▪ Format error
▪ Violation of the CAN frame format (e.g. End of Frame)
▪ Acknowledge error
▪ No other participant has detected and confirmed the CAN message as being correct
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 19
CAN FD
Live and in Color
Accessing a CAN Bus
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 21
Our first CAN Bus
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 22
Our first CAN Bus: Real Signals
Sensor data like temperatures, status of switches, and controlling
actuators is handled with digital and analog signals. But how to
transmit and receive these signals with CAN messages?
▪ PCAN-MicroMod FD:
▪ Basic hardware component with I/O and CAN FD connection
▪ Digital and analog I/O signals are mapped to CAN messages
▪ Configuration is done with a Windows software via CAN
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 23
Our first CAN Bus: Real Signals
PCAN-MicroMod FD
PCAN-T-Adapter
Evaluation Board
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 24
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 25
PCAN-Explorer
The PCAN-Explorer from PEAK-System is a professional Windows®
software for the communication with CAN and CAN FD buses.
Use Cases:
▪ Observation and analysis of several CAN buses
▪ Understandable presentation of CAN traffic
▪ Influencing the CAN traffic for control
purposes or simulations
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 26
Organization: Projects
▪ Working with PCAN-Explorer 6 requires a project
▪ Projects contain:
▪ CAN bus connections
▪ Contents of the Transmit window
▪ References to files
(Symbols, transmit lists, traces, macros, Add-in files)
▪ Filters
▪ Folders (to help organize)
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 27
CAN Connections and Nets
What do you need for displaying CAN messages?
1. Project
2. Connection to a Net
What is a Net?
▪ Net Virtual CAN bus structure in the computer
connecting Clients and CAN interfaces
▪ Client Software application connected to a Net
(like PCAN-Explorer or PCAN-View)
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 28
CAN Connections and Nets
How does it work?
▪ Multiple Clients can be connected with a Net
▪ A Client can be connected with multiple Nets
▪ A Net is connected to no or one CAN interface
Net 2
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 29
PCAN Nets Configuration Tool
Nets are created and managed with the
PCAN Nets Configuration Tool.
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 30
CAN Connections
▪ PCAN-Explorer uses Nets for the CAN Connection
▪ Connections are set in the Connections dialog
▪ Multiple Connections are possible
▪ Connections status display:
▪ OK, Error Passive Warning, BUSOFF, OVERRUN, …
▪ Error Frames:
▪ are displayed in the Receive window
▪ are recorded in Trace files
Note: This can cause huge files
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 31
Receive & Transmit
▪ CAN data traffic representation in
sortable receive and transmit lists
▪ Display of messages showing the
bus number, ID, length, data bytes, …
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 32
Tracer
▪ Recording of the whole CAN traffic
▪ Further application of traces:
▪ Play back (also with loop function)
▪ Manual examination with a text editor
▪ Application of filters
▪ Plotter import
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 33
Filters
▪ Filtering for the Receive window and the Tracer
▪ With Tracer: Subsequent filtering is possible
(result occurs in new window)
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 34
Symbols
Symbols: Introduction
▪ CAN standard: No determination of transmitted data
▪ Symbols convert CAN messages to a readable format
Symbol
ID Signal 1 Signal
Data2 Variable
Coffee100h
Machine Pressure: 5 bar 0ATemperature:
FF CD 12 89 5A C1 70 Water: 1.5 l
120°C
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 36
Symbols
▪ Creating a Symbol file:
▪ Using the PCAN Symbol Editor is recommended
▪ Using the PCAN-Explorer 6 text editor but …
… it requires deep knowledge
… it's easy to make a mistake
▪ Format versions:
▪ Current version: 6.0
▪ PCAN-Explorer 6 can read all
formats, even 3.0
▪ Version conversion can be done
with the PCAN Symbol Editor
▪ Configuration is saved in
Symbol files (*.sym, text file)
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 37
Symbols
▪ A Symbol represents the CAN message by its ID
▪ Name: A name is assigned to the CAN ID
▪ Symbol Type: ▪ Standard CAN with 11 bits ID
▪ Extended CAN with 29 bits ID
▪ J1939 PG Special type for the J1939 Add-in
▪ FD Standard CAN FD with 11 bits ID
▪ FD Extended CAN FD with 29 bits ID
▪ Data Length: Select the amount of data bytes. If the data length
differs from the CAN message, the Symbol won’t apply
▪ Send Period: Set the cycle time for transmitting.
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 38
Signals & Variables
▪ Signals & Variables represent the CAN data
▪ Signals can be used in several Symbols
▪ Variables are used in only one Symbol
▪ A Symbol can contain several Signals or Variables
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 39
Signals & Variables
▪ Factor & Offset
▪ At reception: physical value = (raw value * factor) + offset
▪ At transmission: raw value = (physical value - offset) / factor
▪ Note: How to set the number of decimal places for float values?
▪ Global Symbol option: Custom Decimal Places
▪ Local Signal/Variable option: Custom Decimal Places
▪ Globally within PCAN-Explorer: Tools > Options > General > Float values
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 40
Applying the Symbol File
1. Add the Symbol file to your Project
2. Apply it to a Connection
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 41
Locations of Interpreted CAN Data
▪ Receive window
▪ “Symbol” column is filled
▪ “Data” is interpreted
▪ Tip for view customization: Tools > Options > Receive/Transmit > Receive List
▪ Transmit window:
▪ Window for new message shows Symbols to be selected
▪ Subsequent change of data by double-clicking on “Data” field
▪ Trace:
▪ Symbol name is displayed directly
▪ Popup for variables when pointing with mouse on data
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 42
Signals in PCAN-Explorer 6
Signals and Variables from the Symbols definitions are
both handled as Signals in the PCAN-Explorer.
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 43
CANdb Import Add-in
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 44
CANdb Import Add-in
▪ CANdb is a file format from the company
“Vector Informatik” (*.dbc)
▪ Description of a CAN network
▪ PCAN-Explorer uses relevant information
analog to Symbols
Usage:
▪ Direct work with DBC file,
handling like Symbol files
▪ Conversion to a Symbol file is
possible with PCAN Symbol Editor
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 45
J1939 Add-in
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 46
J1939: General Information
▪ Standard is maintained by the
Society of Automotive Engineers (SAE J1939)
▪ Transfer of information between ECUs
in commercial vehicles
▪ Relies on CAN and covers different OSI layers
▪ 29-bit CAN IDs (CAN 2.0B)
▪ Usually 8 data bytes
▪ Transport protocol for up to 1785 data bytes
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 47
J1939 Add-in
▪ Select your Connection
▪ Properties > CAN section: Change the Protocol to J1939
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 48
J1939 Add-in: Symbol File Specifics
▪ Type: J1939PG
▪ DLC: up to 1785 Bytes
▪ Multipacket: true
Enables the transmission of large CAN messages even with DLC = 8
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 49
Plotter Add-in
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 50
Plotter Add-in
The free Line Writer Add-in is a simple line writer for up to 4 Signals.
The Plotter Add-in is used for recording and enhanced graphical
representation of multiple Signal courses.
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 51
Plotter Add-in
▪ Recording can be start, paused, and stopped
▪ Starting a recording does not erase prior recordings
▪ Erase all recordings with right-click > Clear all Data
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 52
Instruments Panel Add-in
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 53
Instruments Panel Add-in
The Instruments Panel Add-in is used for the representation
of digital and analog Signals via graphical instruments for an
easy simulation of complex CAN applications.
▪ Switching between
▪ Design mode: for layout and configuration
▪ Run mode: for instruments panel application
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 54
Instruments Panel Add-in
▪ Freely composable panel with instruments for
value indication and manipulation:
▪ Gauge meters, bar graphs, LEDs, and Trend diagrams
▪ Potentiometers, sliders, switches, and buttons
▪ Signal-dependent display of Bitmap Lists
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 55
Automation
via Scripting
Automation Possibilities of the PE6
▪ Standard Macro:
▪ Proprietary simple instruction set
▪ Rapid implementation of reception and transmission tasks
▪ Limited functionality
▪ Only Symbols are accessible, not Signals
▪ VBScript:
▪ Comprehensive implementation of VBScript
▪ Accessing COM objects of the PE6
▪ More effort needed at programming
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 57
Standard Macro: Instructions
▪ Transmit:
▪ Send Bus CAN_ID Length Data_bytes
▪ Receive:
▪ WaitMsg, WaitId, WaitData
▪ Outputs:
▪ In the Macro Status window: Print
▪ On the Macro tab of the Output window: PrintToOutputWindow
▪ ExecuteCommand PE6_Command
For Commands see Help topic: Reference > PCAN-Explorer Commands
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 58
VBScript: Creation & Application
▪ VBScript frame:
Sub Macro_name()
|
End Sub
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 59
Further Information
▪ Visit our website for product information and our latest catalog
© 2019 PEAK-System - India 2019 - CAN in Theory and Practice - Last Update: 2019-07-03 60
Thank you
for your attention.
For questions and suggestions for
improvement, I am at your
disposal.