Testing with PCAN Explorer

Stefan Heinrich

19/04/2021

The PCAN Explorer software from PEAK-System enables the sending, monitoring, and evaluation of messages on a system's internal CAN (Controller Area Network). At a comparatively low price, it offers a clear, customizable user interface and contains helpful tools for testing a system's CAN communication. Depending on the type of data sent on the CAN bus, conclusions can be drawn not only about a system's communication capabilities but also about its behavior. Using macros in the VBScript scripting language, test sequences and test evaluations can be largely automated. This also offers the possibility of simulating CAN communication and testing isolated subsystems autonomously. PCAN Explorer includes several useful features that facilitate the logging and documentation of data flow on a heavily used CAN bus.

Symbol-based interpretation of the data

When testing a system with many senders and receivers, you can quickly become overwhelmed with data. PCAN Explorer enables the interpretation of received data using symbol files. These files can be created with the associated symbol editor and assign any name (symbol) and structure to the respective CAN messages. The data bytes they contain, or even individual bits of the messages, can be assigned different names or data types and displayed according to the specified structure. Enumerations enable the resolution of numerical values into status texts. A message sent by the system with a seven-byte value is automatically assigned a symbol based on the CAN ID and displayed as a four-byte measured value with a unit of measurement and status texts, or as a notification with easily understandable content:

Botschaftsdaten mit und ohne symbolische Auflösung
Fig. 1: Message data with and without symbolic resolution

Message filter

Filters can be used to reduce the number of CAN messages displayed. If a test case only requires messages from a specific subsystem, PCAN Explorer can hide the messages from all other components. This makes it easier to maintain an overview or to monitor the update of a specific status or value. Filtering can be performed, for example, by the contents of a specific symbol file. If a separate symbol file is created for each subsystem, it is easy to display only relevant CAN messages during tests. Important CAN IDs or ID ranges can also be used as filter criteria. The created filters can be saved for later reuse and selected from a dropdown menu above the receive list (see Fig. 1).

Recording and displaying the data flow

With an integrated trace function, the entire CAN communication can be recorded during a test. This makes it easier to subsequently verify the timing of a status, a change in a measured value, or a subsystem's response to sent messages. The trace function is also supported by a plotter that displays measured value trends or status changes over time, if required:

Plot von Testdaten in PCAN Explorer
Fig. 2: Plot of test data in PCAN Explorer

Reading and sending on the CAN bus

In the simplest application, PCAN Explorer is connected to the CAN bus and monitors all system communication. This allows testing to verify whether the system sends CAN messages as required, whether subsystems respond to specific messages, or whether system variables and measured values are within a reasonable range. Using the same setup, it is possible to trigger specific system states or manually trigger specific firmware functions in subsystems. The required signals or measured values are simply sent to the CAN bus with PCAN Explorer, eliminating the need to wait for system states or create specific environmental conditions during testing.

Lesen und Senden am CAN Bus
Fig. 3: Reading and sending on the CAN bus

Automation of test processes

More complex tests are enabled in PCAN Explorer through the use of macros. These allow messages to be sent automatically and the contents of received messages to be automatically checked. Using basic programming skills such as if-else statements and loops, the resulting scripts can process entire test protocols at the push of a button.

Example:
During software tests on a CAN-controlled stepper motor, a macro is used to read mechanical minimum and maximum positions from the CAN bus. The minimum position is then controlled. The macro calculates target positions based on the motor's minimum step size, controls all possible positions between minimum and maximum, and then returns to the minimum position using the same movement pattern. The macro reads the corresponding measurement data via the CAN bus and compares it, while new data for the target position is generated and sent as a CAN message. The data can be plotted during the test run. The macro ensures that the motor is capable of controlling all 4000 positions available in the application with the specified resolution without significantly deviating from the target value.

Automatisierte Soll-Position (blau) und eingelesene Ist-Position (überlagert von Soll) des Schrittmotors
Fig. 4: Automated target position (blue) and read actual position (overlaid by target) of the stepper motor

With a little more effort, symbol files can be integrated into the macro, allowing direct access to symbols and status texts. The macro then automatically searches for CAN IDs and enumeration values from the symbol file and sends the message with the associated data. This makes the code much more understandable. Even though the available functions and operators are somewhat more limited than one might be used to from higher-level programming languages, VBScript allows almost complete access to the object structure of PCAN Explorer and thus access to project files, symbol files, send and receive lists, connections, and other software functions. Even email notifications can be implemented based on test results.

Simulation and autonomous testing

The most interesting application scenario for PCAN Explorer is the simulation of system components and subsystems. For example, if a sensor or control panel is unavailable for testing, its CAN communication can be simulated with PCAN Explorer. If a higher-level system is missing, PCAN Explorer can be used to send necessary messages to subsystems and still be able to perform the test.

PCAN Explorer zur Simulation der Botschaften einer fehlenden Komponente
Fig. 5: PCAN Explorer for simulating the messages of a missing component

This makes it possible to autonomously test components that are normally controlled by system messages. All necessary messages are sent via PCAN Explorer.

In a current project, this use case is being used to test a component that is supposed to translate between two CAN bus systems. The devices that communicate with the component on the second bus system are not available for testing. However, the component sends a timeout and stops communication on both bus systems if the correct communication protocol is not maintained. For testing, therefore, PCAN Explorer must be used to simulate communication on the second bus system while the test protocol for the component is executed on the first bus.

Isoliertes Testen eines Subsystems durch beidseitige Simulation der CAN Kommunikation
Fig. 6: Isolated testing of a subsystem by simulating CAN communication on both sides

Advantages of testing with PCAN Explorer

  1. Manageable acquisition costs of the software
    (Comparable software can cost several thousand euros depending on the provider)
  2. Enables autonomous testing of system components
  3. Enables easy automation of test protocols

Disadvantages of testing with PCAN Explorer

  1. Partially limited possibilities of VBScript
  2. Suboptimal integrated text editor
    (Using Notepad++ or similar is recommended)
  3. Additional costs when using various accessories

Written by Stefan Heinrich

Stefan Heinrich has been part of the MEDtech engineering team since October 2020. He primarily works as a hardware developer.


More articles

  • 26/11/2025
  • General, Hardware, Standards, Quality, Testing

Why EMC testing is vital in medical technology: Imagine a patient is lying in the hospital during critical monitoring. Suddenly, a visitor's smartphone rings – and the monitoring device... ...

Read more
  • 20/11/2025
  • General, Hardware, Quality, Technology, Testing

Have you ever considered sourcing inexpensive components from China? The temptation is strong, we know that. And we've already gained some experience, from which I... ...

Read more
  • 29/01/2025
  • General, Hardware, Testing

IntroductionIn order to reduce the risk during EMC testing for the approval of new medical devices, we are happy to conduct preliminary tests with devices in the prototype phase. We currently support ...

Read more
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

Strictly Necessary Cookies

Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.