0% found this document useful (0 votes)
15 views

Tutorial_Data_Analysis_With_CANape_EN

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Tutorial_Data_Analysis_With_CANape_EN

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 42

Tutorial: Data Analysis with CANape

CANape 21.0

Version of 2023-05-31

Author Patzer, Andreas


Publisher Vector Informatik GmbH
© 2022 All rights reserved.
Any dissemination or reproduction requires the prior consent of Vector.
Note: Document printouts are not subject to change management.

Tutorial_Data_Analysis_With_CANape_EN.docx
Change history
Date Changes

2022-08-05 Initial creation

2023-05-09 Tentative completion

2023-05-30 First publication

Version of 2023-05-31 Tutorial: Data Analysis with CANape 2 / 42


CANape 21.0
Content

1 Objective of the document and important basics ....................................................................................... 5


1.1 Objective ................................................................................................................................................. 5
1.2 General information ................................................................................................................................ 5
1.3 Handling measurement files ................................................................................................................... 5
1.3.1 Drag and drop from Windows Explorer ....................................................................................... 5
1.3.2 From the Symbol Explorer ........................................................................................................... 5
1.3.3 Exchange of a measurement file .................................................................................................. 6

2 Visualization and simple analysis of a measurement file ............................................................................ 7


2.1 Show signals ............................................................................................................................................ 7
2.1.1 Some notes about the Graphic Window ...................................................................................... 8
2.2 Use functions from function library ...................................................................................................... 12
2.2.1 Use of a function ........................................................................................................................ 13
2.2.2 Function configurations ............................................................................................................. 14
2.2.3 Cascading of functions ............................................................................................................... 17
2.3 Create your own function (without programming knowledge) ............................................................ 18

3 Easy analysis: From the evaluation of one file to the evaluation of many files and reporting ................... 20
3.1 Switch to data mining ........................................................................................................................... 20
3.2 Easy selection of the measurement files to be analyzed ...................................................................... 20
3.3 The analysis set ..................................................................................................................................... 21
3.4 Save analysis configuration ................................................................................................................... 22
3.5 Start analysis ......................................................................................................................................... 22
3.6 Show analysis results ............................................................................................................................ 23
3.6.1 Analysis results as CSV file ......................................................................................................... 24
3.7 Manual report generation ..................................................................................................................... 24
3.7.1 Optimization of pages for printing and PDF............................................................................... 25
3.8 Automated report generation ............................................................................................................... 26

4 What other options are there for measurement file selection? ................................................................ 27
4.1 vMDM Explorer ..................................................................................................................................... 27
4.2 Working with the metadata of the measurement files......................................................................... 27
4.3 Add metadata to measurement file ...................................................................................................... 28
4.4 Define filter for file selection ................................................................................................................ 29
4.5 Use filters for data mining ..................................................................................................................... 30

5 How can evaluations be shared within the team? .................................................................................... 31

6 The function I need is not in the library. How can I write my own function?............................................. 32
6.1 Presentation of the function editor ...................................................................................................... 32
6.2 Functions and scripts ............................................................................................................................ 32
6.3 Writing functions................................................................................................................................... 34

Version of 2023-05-31 Tutorial: Data Analysis with CANape 3 / 42


CANape 21.0
6.3.1 Functions with adjustment parameters ..................................................................................... 36
6.4 Script writing ......................................................................................................................................... 37

7 Saving and further processing of analysis results ...................................................................................... 39

8 Glossary and terminology ......................................................................................................................... 42

Version of 2023-05-31 Tutorial: Data Analysis with CANape 4 / 42


CANape 21.0
1 Objective of the document and important basics
1.1 Objective
Data evaluation with CANape and vSignalyzer ranges from viewing measurement results to automated analysis
with subsequent report generation. This document serves as an overview of the various work steps and takes
you from loading the measurement files to analyzing a single measurement file to analyzing many measurement
files and generating reports.
vSignalyzer is derived directly from CANape and includes all options for evaluating measurement data in CANape.
To make the text more readable, the rest of the text will not refer to "CANape and vSignalyzer". Only CANape
will be mentioned. But the statements apply equally to vSignalyzer.

1.2 General information


Memory requirements
CANape loads only the data from an MDF/MF4 measurement file that is needed for display or processing. All
other contents of the measurement file are ignored. This minimizes loading time and RAM requirements. Other
formats do not support this.
Supported measurement data formats
Measurement data in the formats MDF, MF4, DAT (=INCA MDF format), HDF5 and Excel can be read in and
processed directly. For other formats, import converters are available that convert the data into MF4 format.
A function can be used multiple times
A function performs the calculation of an algorithm. For example, the function represents a low pass with an
adjustable cutoff frequency between 10Hz and 1000Hz. The function can be used an unlimited number of times
in the same project. Each time you apply the low-pass function to an input variable, a separate instance is
initiated with individual parameter values. This allows you to choose the cutoff frequency depending on the
signal.

1.3 Handling measurement files


There are several ways to load a measurement file into CANape.

1.3.1 Drag and drop from Windows Explorer


Open CANape and select one or more (<Shift>, <CTRL>) measurement files in Windows Explorer. Drag the
selection into CANape and drop it either in the main window, an existing window, or in Symbol Explorer (under
Measurements). Depending on where the files are dropped, different actions are possible:
- Loading the measurement file without further actions. Measurement file is displayed in the Symbol
Explorer
- Exchange of an already loaded measurement file
- Replacement of the contents of an existing window
- Creating a new window with signal selection

1.3.2 From the Symbol Explorer


The Symbol Explorer is a window in CANape (<CTRL> + <Enter>). It provides access to all details of the loaded
measurement files and facilitates work. A right mouse click on Measurements allows you to load measurement
files, among other things.

Version of 2023-05-31 Tutorial: Data Analysis with CANape 5 / 42


CANape 21.0
1.3.3 Exchange of a measurement file
You have created a view with one or more windows based on a measurement file. Now you want to display the
contents of another measurement file in the same windows. To do this, simply exchange the measurement file
and the contents of the newly selected measurement file will be displayed.
Manually replace the measurement file either via the ribbon bar Analysis | Measurement Files | Replace

or via a right mouse click on the name of the measurement file in the Symbol Explorer:

A right mouse click on an already loaded measurement file offers further possibilities, such as access to the
measurement file comments, saving under a different name and much more.

Version of 2023-05-31 Tutorial: Data Analysis with CANape 6 / 42


CANape 21.0
2 Visualization and simple analysis of a measurement file
2.1 Show signals
Navigate to the measurements in the Symbol Explorer and expand the contents of a measurement file.

This gives you access to the contents of the measurement file. You can find the desired signal directly via the
search field in the Symbol Explorer.
Select one or more signals with the mouse (left mouse button without/with <Shift> or <CTRL>) and drag them to
the CANape main window or an already existing window.

In the main window you can then choose which type of window you want to use.

Version of 2023-05-31 Tutorial: Data Analysis with CANape 7 / 42


CANape 21.0
If you select an existing window as the destination, the data will be added.

2.1.1 Some notes about the Graphic Window


The Graphic Window offers a wide range of possibilities. Please have a look at the ribbons in detail:

Here are a few notes on possibilities that are not controllable via the ribbons and are also not visible at first
glance.
Timeline
Place the mouse cursor on the timeline. Turn the mouse wheel to zoom in time.
Y-axis
Place the mouse on the Y axis. Turn the mouse wheel to zoom in the value range of the axis.
Targeted zooming out of an area
Click with the left mouse button in the display area of the window. Keep the mouse button pressed and move
the mouse in X or Y direction. Two white lines appear, with which you select an area. When you are satisfied with
the section, release the mouse button and the selected area will fill the entire Graphic Window.
You can also stretch a rectangle in the same way.

The content of the rectangle is enlarged to the total area of the window.

Version of 2023-05-31 Tutorial: Data Analysis with CANape 8 / 42


CANape 21.0
Display of additional columns in the legend
Many other values can be displayed in the legend of the window. With a right click on the heading a selection
dialog appears

In this example, the value and the gradient are displayed at the position of the measurement cursor. Via the item
More... you will find a large amount of further information that you can display. In the picture the legend is
shown on top to have more space for the columns.

Filter display by values


The following example shows the signal "VehicleSpeed". The value is between ~100 and ~140kph.

Version of 2023-05-31 Tutorial: Data Analysis with CANape 9 / 42


CANape 21.0
If you are only interested in a part of the data, you can filter the view. There are two ways to filter the view. If
you move the mouse over the name of a signal, a small filter symbol appears in the upper right corner. Select it.

You can also access the same dialog by clicking the right mouse button in the display.

The filter dialog looks like this:

You can choose between two filter types or deactivate the filter again:

Version of 2023-05-31 Tutorial: Data Analysis with CANape 10 / 42


CANape 21.0
For an algebraic filter you can store a formula:

The value filter provides values of the signal

With an algebraic filter "X>120" for VehicleSpeed, the window then looks like this:

Version of 2023-05-31 Tutorial: Data Analysis with CANape 11 / 42


CANape 21.0
2.2 Use functions from function library
The previous displays are based on measured values. From real measurement file channels. By using functions,
another signal type is created: "Virtual measurement file channel". It is the result of a calculation.
You can write your functions using the integrated function editor and the CASL programming language. CANape
already provides a function library. You can reach it via the Symbol Explorer:

In the chapter Base Mathematics you will find, for example, the following functions:

Version of 2023-05-31 Tutorial: Data Analysis with CANape 12 / 42


CANape 21.0
2.2.1 Use of a function
Use the mouse to select a function (e.g. Derivation) and drag and drop it into a window.

If the function is to be calculated during a measurement, select Measurement function here. In this case,
however, it is about the evaluation of measurement data, and therefore please select Virtual measurement file
channel here.
The properties dialog of the function is displayed. You select the input signal (here FILE3.GPS.GPS_speed) and
define which name the virtual measurement file channel should have (here Derivation).

The result then looks like this:

Version of 2023-05-31 Tutorial: Data Analysis with CANape 13 / 42


CANape 21.0
You can find the Virtual measurement file channel in the Symbol Explorer:

If the displayed measurement file is replaced, the virtual measurement file channel is recalculated and displayed.

2.2.2 Function configurations


Dragging and dropping a function into a window opens the function's properties dialog. If the function already
exists in a window, a right mouse click on the function also leads to the properties dialog.
This is an example of a more complex function. It has 6 input variables and 10 output variables.

Already on the topmost page several settings can be made. But the properties dialog offers even more
information and parameterization options.

Version of 2023-05-31 Tutorial: Data Analysis with CANape 14 / 42


CANape 21.0
General

The input variables can be linked here not only manually, but also automatically. This is especially important if a
function has many input or output variables. The automatic link is based on the name equality between the name
of the input or output and the signal to be linked.

Parameterization of the function


If the function has parameters, you can adjust them on this page. An example of a parameter is the cutoff
frequency of a filter. The function remains the same, but the cutoff frequency can be adjusted within a defined
range.
The following picture shows a whole set of parameters of a function. Each parameter value has a predefined
initial value, but it can be overwritten with another value.

Version of 2023-05-31 Tutorial: Data Analysis with CANape 15 / 42


CANape 21.0
Hits
Not every function is suitable to generate a hit. A hit is only generated if the function checks a condition and
there is a change from "Condition not met" to "Condition met". For example, the function
"DetectRangeViolationForPeriod" checks whether the speed of 30km/h was exceeded.

The following configuration of the function:

The speed 0 km/h is set as the lower limit value and 30 km/h as the upper limit value. The parameter "Period"
with 1 s means that the condition must be fulfilled for at least 1 second. If the measured value is between 0-
30km/h, the function outputs the value 0 as the result. If the value is greater than 30km/h, the function result is
a 1. A hit is generated if the function result is not equal to 0.

The hits are displayed not only in the window, but also in the Symbol Explorer:

By double-clicking on "Hit1", the global measurement cursor jumps to the position where the hit was generated.

Version of 2023-05-31 Tutorial: Data Analysis with CANape 16 / 42


CANape 21.0
Here in the scrrenshot, you can see the global measurement cursor as a vertical blue line.

Further hits are also displayed directly in the Graphic Window. If the hits are outside the visible area of the
window, they are displayed in the horizontal scroll bar.

Extended
In which cycles should the calculation be performed? A fixed time interval, or with each individual input value?
Should the calculation be performed over the entire period of the measurement, or only a predefined interval?
You define that here.

2.2.3 Cascading of functions


Functions can not only process measurement file channels as input variables, but also handle virtual
measurement file channels. This allows you to cascade functions.
In the following example the derivative is calculated from GPS_speed. The derivative in turn runs through a low-
pass filter.

In the Graphic Window it look like this:

Version of 2023-05-31 Tutorial: Data Analysis with CANape 17 / 42


CANape 21.0
The best way to merge the functions is to create them in the Function Window:

From the Symbol Explorer you drag and drop the desired functions into the Function Window. You configure the
individual functions and link the inputs and outputs to "data flows" according to your requirements. When you
"pin" a data flow you can give it a name:

A pinned data flow can be found in the Symbol Explorer under Data Flows.

To save space on the interface, you can define multiple bindings in the same Function Window:

2.3 Create your own function (without programming knowledge)


For further processing of signals without programming knowledge, algebraic expressions are available. You can
create them directly from a measurement data display window.

Version of 2023-05-31 Tutorial: Data Analysis with CANape 18 / 42


CANape 21.0
Give the expression a name. In this example it is "SlowSpeed". Via the signal selection you can select the
signals, provide them with conditions and link them logically. In this example there is the AND operation &&
between the conditions speed FILE3.GPS.GPS_speed less than 30 and the engine speed
FILE3.OBD.'OBD1._PID_0C_Engine_RPM.Engine.Rpm' greater than 2500.
The result can be seen in the next screenshot:

At
the positions where the expression SlowSpeed returns a 1 as result both conditions are fulfilled.

Version of 2023-05-31 Tutorial: Data Analysis with CANape 19 / 42


CANape 21.0
3 Easy analysis: From the evaluation of one file to the evaluation of many
files and reporting

In the last chapter, with the help of the query

searches a measurement file and displays the hits. The Graphic Window is very good for seeing and evaluating
the functions and their results. When developing an evaluation, this is the easiest way to see if an algorithm is
working as it should.
In the next step, however, not only this one measurement file should be searched, but many measurement files.

3.1 Switch to data mining


With the help of data mining, the search for hits in many measurement files is organized. Here it is determined
which measurement files are to be searched and in which form the results of the analysis are to be displayed.
Open the Data Mining editor in the ribbon bar Analysis.

3.2 Easy selection of the measurement files to be analyzed

In the file filter list you can specify one or more files and/or directories as sources.
Queries can also be used for filtering. Queries refer to metadata within a measurement file. E.g. to a certain
signal, event or a department name. Queries use "Collections" as source. Collections is the umbrella term for a
collection of data that can be located locally or on a server.
A 'vMDM Collection' is a collection of measurement data in your vMDM solution. vMDM is the abbreviation for
Vector Measurement Data Management. It is available to you as a local solution with every CANape license. You
can use it to manage your measurement data on your computer. If your company uses vMDM as a cloud solution,
you can access the measurement data in the cloud directly from CANape (+option vMDM).
In the chapter '4.1 vMDM Explorer' the local use of the vMDM is presented in more detail.

Version of 2023-05-31 Tutorial: Data Analysis with CANape 20 / 42


CANape 21.0
3.3 The analysis set
All the functions that have been used so far can also be found here:

They can be activated or deactivated. Active means that the function is calculated when data mining is started.
In this example, only the "Slow_Speed" function is active.
Analysis profiles
Finding a hit means that the analysis has found a place in the measurement data that is of interest to you. But
what data are you interested in at this point? In the example, the Slow_Speed function has found the points in
the measurement files that match the search based on the engine speed and the vehicle speed. But you are
interested in, for example, the GPS coordinates where the vehicle has just been.
In an analysis profile, you define which data you want to record in a result file when a hit occurs. You can find
out more about this in Chapter 7.
Options
You use scripts to automate work steps. For example, a script can check a measurement file for completeness. Is
all the information required for the analysis available in the file? If not, the file is not analyzed at all.
Here you also define the name of the result file. Name macros are available for this purpose.
Saved configurations
Here you will find all the configurations that you have created and saved so far.

Version of 2023-05-31 Tutorial: Data Analysis with CANape 21 / 42


CANape 21.0
3.4 Save analysis configuration
You can save your settings in a 'Data Mining Configuration Template' for reuse. The file has the extension DMT.

You will find the saved configurations under Saved Configurations. The configurations are read-only. You can
start them directly, add them to your current evaluation, load them and delete them again. A loaded
configuration can be modified and saved under a new name.

3.5 Start analysis


In CANape, the yellow flash starts the measurement. In the Data Mining Editor, the yellow flash starts the
analysis.

Note, that depending on the amount of data and the type of analysis, the process can take a very long time.
However, you can continue working in parallel.

Version of 2023-05-31 Tutorial: Data Analysis with CANape 22 / 42


CANape 21.0
3.6 Show analysis results
After the analysis, there is a new entry in the Data Mining Editor below the 'Results' section.

The result of the analysis is stored in "Analysis-2023-05-05_16-39-10.dmr". On the right side of the image you
can see a summary of the analysis. 6 files were searched and 7 hits were found.
The name of the result file contains the date and time of the analysis. The extension DMR stands for Data Mining
Result. You will find the result file in the directory of the CANape project.
The analysis includes the hits, the names of the searched files and the configuration used for the search.

You can also see the results in the Symbol Explorer.

Under 'All hits' every single hit is listed. Below that, the file names in which there were hits are listed. By double-
clicking on a hit,
- the corresponding measurement file is loaded,
- updated the windows with the contents of the file and
- the Global measurement cursor jumps to the time of the hit.

Version of 2023-05-31 Tutorial: Data Analysis with CANape 23 / 42


CANape 21.0
In the Graphic Window, the hits are shown as magenta colored markers at the bottom of the timeline. The blue
measurement cursor is positioned on the first hit.
Each analysis creates a DMR file that is available to you in the Data Mining Editor and the Symbol Explorer.

3.6.1 Analysis results as CSV file


You can also save the analysis results as a CSV file. In the options dialog you only have to activate the CSV export.

3.7 Manual report generation


You need representations of signal values and signal curves in your report. You can copy entire pages or individual
windows into your report. You can drag and drop a window from the CANape interface and drop it into your
Word or PowerPoint document. Alternatively, you can copy and export windows or entire pages.
Example: Right mouse click on a window frame

For displays in documents, it is also recommended to switch the page to Print View in CANape. This optimizes
the colors of the signals and backgrounds for use in documents.

Version of 2023-05-31 Tutorial: Data Analysis with CANape 24 / 42


CANape 21.0
3.7.1 Optimization of pages for printing and PDF
In the Project Settings you can define print and export specific settings for the whole project.

Here you specify, among other things, the default file format when exporting and the paper size.
Settings of individual pages can also be made individually. Right mouse click on the name bar of the page and
select Configure:

Version of 2023-05-31 Tutorial: Data Analysis with CANape 25 / 42


CANape 21.0
3.8 Automated report generation
Reports are highly application-specific. Therefore, there is no automated report generation at the push of a
button.
Example of a report that transfers all hits of an evaluation into a PDF:
Use the CANape demo 'DataMiningReport'. It contains 7 pages:

Page 1 provides a description of the demo. On page 2 you start the evaluation and report generation.
Pages 3-7 will be included in the report.
Page 3 contains the cover sheet of the report.
Pages 4 and 5 present a classification of the data and provide a summary of the analysis.
Page 6 shows an overview of the hits, times of the hits, measurement file name and signal values.
Each of these pages is included once in the report.
Page 7 is used to display the signals for the respective hits. The measurement file containing the first hit is loaded.
The display windows are updated and the content of the page is transferred to the PDF. Then the data of the
next hit is loaded, the windows are updated and the page content is taken over into the PDF. Page 7 is thus
transferred to the PDF as many times as there are hits.
Data evaluation and report generation are triggered by a button on page 2.

In the tooltip you can see the name of the script: sExecute.cns. Please have a look at the script in detail to
understand how you can design the report generation by script.

Version of 2023-05-31 Tutorial: Data Analysis with CANape 26 / 42


CANape 21.0
4 What other options are there for measurement file selection?
If a large amount of measurement data is available, searching by measurement file name and directory is no
longer sufficient. The vMDM Explorer is available for this purpose (vMDM: Vector Measurement Data
Management). With its help, you will always find the measurement files you are looking for - on your workstation
or in the vMDM Cloud.
You can search for different information: Measurement file comments, events, signals, min and max values and
much more. To avoid having to search through all measurement files first for each search query, the vMDM
search engine builds an index. Search queries can then be answered quickly and efficiently from the index
contents. Measurement files with the extensions MDF, MF4 and DAT (ETAS Inca measurement data format,
which corresponds to the MDF format) are taken into account.

4.1 vMDM Explorer


Via the vMDM Explorer you define where the measurement data is to be found. Be it on the local disk or in the
cloud. A background process starts and creates an overview of the contents of the files. Network drives are not
supported.
You start the vMDM Explorer via F5 or via mouse under Display | vMDM Explorer.

Details on how to use the vMDM Explorer can be found in the user manual. Question mark icon in the upper
right corner of the vMDM Explorer.

4.2 Working with the metadata of the measurement files


A measurement file can contain metadata. Metadata is additional information. E.g. static values, like the name
of the driver, project name, distance, license plate number of the vehicle etc. But also dynamic information,
which is read or calculated from the measurement data when saving it as a value. For example: The number of
driven laps on the race track, occurred trigger events or values of a signal.
You define the metadata in the measurement configuration. Individually per recorder:

Version of 2023-05-31 Tutorial: Data Analysis with CANape 27 / 42


CANape 21.0
Or globally for all new recorders:

Here is an example of a measurement file via: Symbol Explorer | Measurements | <Filename> | Measurement
file comment (right mouse button):

You can enter fixed data, or work with macros, which then enter the current information. In this example, you
can see the contents of the Write Window inserted via a macro. You can also add more comment fields.

4.3 Add metadata to measurement file


You can write additional metadata in existing measurement files using script functions.
These can be obtained either from the measurement data itself or from external data sources. To make the script
run over each measurement file, you can use data mining mechanisms. To do this, create a script after each file
in the Data Mining Editor under Configuration | Options.
To add a new metadata property to a measurement file, the MeasCommentFieldCreateEx() function is
available in CASL.
Example: Each measurement file should contain the maximum speed of the vehicle as metadata.

Version of 2023-05-31 Tutorial: Data Analysis with CANape 28 / 42


CANape 21.0
Example of the script:
char fieldName[] = "MaxSpeed";
char fileId[] = "File1";
int readOnly = 0;
int dataType = 3; // Data type 3 means "Float
long res;
double maxSpeed;
char valStr[20];

// last value of calculated MaxSpeed signal is the max speed of the file
maxSpeed = calculated.MaxSpeed.mbuffer[-1];

// Meta Data fields must be specified as strings


SPrint(valStr,"%.2f", maxSpeed);

// add the new field to the current measurement file


res = MeasCommentFieldCreateEx(fieldName, fileId, readOnly, dataType, valStr);

4.4 Define filter for file selection


In the vMDM Explorer it looks like this:

Using the search filter, the number of measurement files can then be specifically limited to the desired files. In
this example, there are 6 measurement files. 2 with "Driver A" as author, 4 with "User" as author. By selecting
the author "User", 4 measurement files are still available. The query can be saved (top right).

As name I have chosen "User_is_Author".

Version of 2023-05-31 Tutorial: Data Analysis with CANape 29 / 42


CANape 21.0
4.5 Use filters for data mining
If you want to use the saved filtering as a selection criterion for data mining, mark the query as a favorite.

Favorites for file filtering are available in the Data Mining Editor.

Version of 2023-05-31 Tutorial: Data Analysis with CANape 30 / 42


CANape 21.0
5 How can evaluations be shared within the team?
One possibility is to pass on the entire CANape (or vSignalyzer) project. However, it is also sufficient to exchange
the data mining configuration in the form of a *.DMT file. The recipient can load the configuration in the Data
Mining Editor.

Please check afterwards if the configuration fits to your own computer (especially the paths for the measurement
file selection).

Version of 2023-05-31 Tutorial: Data Analysis with CANape 31 / 42


CANape 21.0
6 The function I need is not in the library. How can I write my own
function?
The function language in CANape is called CASL. It is similar to C, but does not have pointers. It is optimized in
many respects for processing measurement data.
All CASL functions are described in the function editor help and explained with working examples.

6.1 Presentation of the function editor


Open the function editor:

A more detailed description of the function editor can be found in the CANape Help.

6.2 Functions and scripts


Functions are written and compiled in the function editor. They are saved in CANape.INI. However, functions
can also be exported and imported in a file format. A function can be used either during a measurement or for
data evaluation. The code of a function is always passed through within the CANape code. For example, the
incoming value of a bus message serves as an input variable in a function. As soon as the value arrives in CANape,
it is passed to the function and processed further there.
However, one function can also be used for further processing of existing measurement data.
A function can be instantiated many times. For example, if you use a filter function, you can use this function for
any number of signals.
Example of a function:

Scripts are also developed and compiled in the function editor. However, they have a different purpose. They
are used to execute actions and define processes.

Version of 2023-05-31 Tutorial: Data Analysis with CANape 32 / 42


CANape 21.0
Example of a script:

Scripts play a big role in data analysis:

Here you specify when a script should be executed.

Version of 2023-05-31 Tutorial: Data Analysis with CANape 33 / 42


CANape 21.0
6.3 Writing functions
A function library is supplied with CANape and is available via the Symbol Explorer. The library functions are
grouped thematically.

There are different symbols in front of the function measures. The symbol with the three blue horizontal lines is
to symbolize speed. With this we want to point out that these functions have been realized in the form of DLLs
in order to be calculated as fast as possible. Their source code is not available.
For the other functions, you can view the source code:

Version of 2023-05-31 Tutorial: Data Analysis with CANape 34 / 42


CANape 21.0
In this representation you cannot edit the function. But within the function editor you can import a function from
the function library when creating a new function, save it under a different name and then edit it. This way you
can build on existing functions to complete your tasks faster.
But let's start with an empty function: Open the function editor and create a new function and set the name.

As a result, a function body is created.

The variables signal_1 and signal_2 are inserted here as transfer of values.

When typing within the function supports automatic text recognition. In the example above, the text recognition
offers the size signal_2 while typing the word 'sign'.

Version of 2023-05-31 Tutorial: Data Analysis with CANape 35 / 42


CANape 21.0
The font colors help to distinguish the contents: blue are the keywords known to the system (e.g. function and
return), black is the own code and green the comments. They start with //.
You don't know what a keyword (blue) means? Highlight it with the cursor (in the example the word "return")
and press [F1]. The help opens at exactly the right place:

Once you are satisfied with the function, save it and compile it:

The result is displayed in the lower window.


After exiting the function editor, you will find the new function in the Symbol Explorer | Function definitions |
Project functions. You can now use this function in the same way as the library functions already supplied.

6.3.1 Functions with adjustment parameters


There are functions where you would like to parameterize the behavior. An example are low-pass, high-pass and
band-pass filters. Here you define via the cutoff frequency(ies) how the calculation should take place. In order
to not have to change anything in the code, you can allow the user of the function to set the parameters.
In the code, use the characters //! to indicate that the line after it is a parameter.

Version of 2023-05-31 Tutorial: Data Analysis with CANape 36 / 42


CANape 21.0
When using the function on the CANape interface, it looks like this:
If you select "Parameters" in the tree on the left, you will see the initial values of the parameters and can
overwrite them:

You can also use function with this form of parameterization several times, setting the parameter values
individually each time.

6.4 Script writing


The development of scripts is not fundamentally different from the development of functions. However, there
are a few peculiarities:
- A script is saved in the form of a file. The format is *.CNS. The older format *.SCR is still supported,
but should not be used for new scripts.
- A debugger is available in the function editor for script development.
When creating a new script, you can already specify whether the script should be displayed in the CANape
program menu. This can also be done later in the Properties dialog.

Version of 2023-05-31 Tutorial: Data Analysis with CANape 37 / 42


CANape 21.0
Example of a script:

You can start the script directly from the function editor, set breakpoints, etc.
Execute a script:
1. You can start it from the CANape interface:

2. However, other options are also available: For example, via a panel (from the DataMiningReporting demo).

3. The Task Manager allows automated execution of scripts

In the Task Manager, the script execution is assigned to an event, such as before a measurement or when loading
the project.

Version of 2023-05-31 Tutorial: Data Analysis with CANape 38 / 42


CANape 21.0
7 Saving and further processing of analysis results
In one of the previous chapters it was described that analysis results are stored in the form of DMR or CSV files.
However, these are metadata of the analysis and not signal values.
For example, you receive many measurement files from the test benches and test vehicles every day. Overnight,
all files are automatically analyzed and a daily report is generated. But now you also want to create a monthly
report that summarizes all the results of a month. In order not to have to analyze all files of the month again,
there is a way to save analysis results including signal values in a MAR file (=Measurement Analysis Result, file
extension MARMF) and to process them further.
1. Step: Specify which signals are to be recorded when a hit occurs.
In data mining, you add the signals via Add in Analysis profiles.

You can add your own profiles to structure the signals.

In this screenshot you can see the additional profile 'MyProfileGlobalVariables'. In it, three global variables are
now added. In the tooltip you can see the hint that this analysis profile is not used in any method.

By adding the profile to a suitable method (in this case 'FindError'), the signals of the profile
'MyProfileGlobalVariables' are also written to the MAR file.

Version of 2023-05-31 Tutorial: Data Analysis with CANape 39 / 42


CANape 21.0
2. Step: Activate the export of the analysis profiles to the MAR file

Activate Analysis Profiles | Export analysis profile to MAR file.


Then a file with the extension MARMF is generated for each analysis. The signal values for the individual hits are
stored in this file. A MARMF file is comparable to a measurement file in MF4 format. You can load it directly into
CANape and evaluate it via data mining.

Version of 2023-05-31 Tutorial: Data Analysis with CANape 40 / 42


CANape 21.0
In the screenshot you can see the loaded MARMF file as a measurement file in CANape. The Graphic Window
shows three signals from the file. The X-axis of the window now does not have the function of a time axis (even
if the unit 's' is still behind each value). The numbers 0, 1, 2 etc. now stand for the number of the hit. The global
variable 'gClassRpm' is displayed in the map window.
If you now have all MARMF files of a month, you can easily calculate your daily analysis over all MARMF files and
get directly the total result over the month.

Version of 2023-05-31 Tutorial: Data Analysis with CANape 41 / 42


CANape 21.0
8 Glossary and terminology
DMR (file extension) Abbreviation for Data Mining Result. This is a file that summarizes the
results of an analysis. It describes which files were searched and
summarizes at which point in time there was a hit in the file.

DMT (file extension) Abbreviation for Data Mining Template. All configuration settings of the
analysis are summarized in this template.

MAR file Measurement Analysis Result. In a MAR file all hits and corresponding
signals can be stored. The file extension is MARMF.

Symbol Explorer Window in CANape that gives you access to the measurement files, signals,
functions and much more. You start it with CTRL+Enter.

Hit Data mining is based on search algorithms. If the search algorithm is


fulfilled, we speak of a hit. For example, a situation is searched for in the
measurement data in which an engine speed greater than 4000 revolutions
was reached in first gear. If the condition is met during the analysis, this
point in time is marked with a hit.

vMDM Collection vMDM is the abbreviation for Vector Measurement Data Management. A
collection is a collection of measurement data within the vMDM solution.
A collection of measurement data exists either as a local solution on your
computer or as a cloud solution with the vMDM product.

Version of 2023-05-31 Tutorial: Data Analysis with CANape 42 / 42


CANape 21.0

You might also like