Tutorial_Data_Analysis_With_CANape_EN
Tutorial_Data_Analysis_With_CANape_EN
CANape 21.0
Version of 2023-05-31
Tutorial_Data_Analysis_With_CANape_EN.docx
Change history
Date Changes
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
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
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.
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.
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.
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.
You can also access the same dialog by clicking the right mouse button in the display.
You can choose between two filter types or deactivate the filter again:
With an algebraic filter "X>120" for VehicleSpeed, the window then looks like this:
In the chapter Base Mathematics you will find, for example, the following functions:
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).
If the displayed measurement file is replaced, the virtual measurement file channel is recalculated and displayed.
Already on the topmost page several settings can be made. But the properties dialog offers even more
information and parameterization options.
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.
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.
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.
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:
At
the positions where the expression SlowSpeed returns a 1 as result both conditions are fulfilled.
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.
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.
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.
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.
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.
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.
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.
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.
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:
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.
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.
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.
// last value of calculated MaxSpeed signal is the max speed of the file
maxSpeed = calculated.MaxSpeed.mbuffer[-1];
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).
Favorites for file filtering are available in the Data Mining Editor.
Please check afterwards if the configuration fits to your own computer (especially the paths for the measurement
file selection).
A more detailed description of the function editor can be found in the CANape Help.
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.
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:
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'.
Once you are satisfied with the function, save it and compile it:
You can also use function with this form of parameterization several times, setting the parameter values
individually each time.
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).
In the Task Manager, the script execution is assigned to an event, such as before a measurement or when loading
the project.
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.
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.
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.