Developer Blog

25/06/2022 by Lars-Göran Fredriksson

Beginners Guide To Kvaser Memorator – Basic setup and logging

In this blog I will try to show how easy it is to set up a Kvaser Memorator to record the traffic between two CAN devices. This is the first time that I have used a Memorator and I will try to show how to set it up without prior knowledge of logging data from a CAN-bus.

I am using the Kvaser Memorator Pro 2xHS v2 but it is possible to use (almost) any of Kvaser’s combined interface/loggers:

  • Kvaser Memorator Pro 2xHS v2 (73-30130-00819-9)
  • Kvaser Memorator Pro 5xHS (73-30130-00778-9)
  • Kvaser Memorator R SemiPro (73-30130-00490-0)
  • Kvaser Memorator 2xHS v2 (73-30130-00821-2)

In this blog, I intend to record the data between two units during their startup sequence for later inspection and analysis.

I will not use any advanced setups and will show how easy it is to simply record data. My aim is to begin recording within 5 minutes!

In my setup I am using two “GARMIN echoMAP™ CHIRP 72sv” connected to a NMEA2000 (CAN-bus) via a “Kvaser T-Cannector v2”. I use standard D-SUB 9 to NMEA2000 cables. The T-Cannector adds 12 VDC to the CAN bus, powers the Memorator and adds a 60Ω terminator. The Garmin units use the standard NMEA2000 protocol and start transmitting data when powered.

Drivers, SDK and configuration tools

Please install the Kvaser Drivers, Kvaser CANLib SDK and Kvaser Memorator Config Tools before using the Kvaser Memorator Pro 2xHS v2; it is much easier to use the unit if we have done that. You can find the latest versions in the Download section on our homepage.

  • Kvaser Drivers for Windows
  • Kvaser CANlib SDK
  • Kvaser Memorator Config Tools

Battery charging

Before the Memorator is used, please charge the battery in the unit (check the USERGUIDE for instructions.) If you are training to use the unit, then the unit will charge while you are performing the setup, but please ensure that it is charged properly before you perform a real survey. The purpose of the battery is to enable the unit to store data on the SD card when the external power is removed and close the unit properly without data loss.

SD Card management

Before ANY logging can be performed with the Memorator, it is important that the SD card is initialized. This MUST be done using Kvaser Memorator Config Tools. An SD card that has been formatted via a Windows system or similar will not work. How to initialize the SD card will be mentioned in a later section.

Memorator setup

Install the SD card into the Memorator (you will initialize it later).

Please connect the Memorator with a USB cable to your computer.

(The Memorator will now charge the battery.)

In the START menu, you will find the “Kvaser Memorator Config Tool”; in my case it is called “Kvaser Memorator Pro 2xHS v2”.

You can also start the tool via “Kvaser Device Guide”.

With this tool, we can set up the Memorator to log the information we want to record.

If needed, press the CONNECT button.

(If it is the first time the unit is used or if the SD card is empty, it might ask you to initialize the card. If you are unsure how to do this, check 7.1 Disk Management – Initialize Disk)

Standard features

General Information

Make sure that the realtime clock is correct. Adjust if needed.

Bus configuration

Starting to set up the BUS parameters. NMEA2000 uses 250 kBit/s and I do not edit any settings, allowing the tool to use the default values.

(Now is a good time to save the settings into a named file so you can open it later. Use the menu FILE/SAVE AS and store it somewhere.)

Advanced features

Under Log Configuration we can find:

  • Define Messages
  • Databases
  • Filters
  • Triggers
  • Scripts

In this section we really can do some advanced stuff, but for the moment we’ll leave everything blank. We do not need to enter any information here in order to record data.

The only thing we do is to check the “Log Everything” box.

Check that “Log everything” is checked.

Flash disk

This section is important.

  • Log files (will be used later, so we will come back to this later)
  • Disk management (Here we setup our SD card)

Disk Management – Initialize Disk

It is essential to INITIALIZE the SD card before logging any data!

I do not yet understand the different numbers so I use the default values and press OK.

Hmmm, it seems like it tries to reset everything, including the settings we already have configured! Maybe we should have done this before we set parameters, triggers, filters and scripts.

But, this is only true if we have something on the SD card we want to keep. In this case, I do not have anything important on the card so I press OK.

Download configuration to Memorator

If we press the DOWNLOAD button, then the configuration is downloaded from our tool to our Memorator. 

  • DOWNLOAD – From ConfigTool to Memorator
  • UPLOAD – From Memorator to ConfigTool

Configuration achieved?

We have now configured the Memorator to be able to log traffic on the NMEA2000 bus. I left many settings unused and only set the necessary bus parameters.

Let’s see what happens when I start this set up in Memorator mode.

Collecting data

I will do it in this order:

  • Select the DISCONNECT button in ConfigTool
  • Disconnect the USB communication between the Memorator and the computer. cable from the MemoratorRemove Memorator from the USB
  • Turn all test units off (my Garmin units)
  • Connect Memorator DB9 channel 1 to the NMEA2000 bus.
  • Wait for Memorator to start (12VDC is already running through the power source (in my case, a Kvaser T-Cannector v2)
  • Turn all test units on
  • Wait approximately 2 to 3 minutes to ensure that all normal startup traffic has occurred
  • Disconnect Memorator DB9-1 (this will end the recording)
  • Connect the Memorator to the USB cable attached to your PC.

Checking results

I connect to the Memorator again in the ConfigTool and select the sections “Flash disk”, then “Log files”.

If I select “List files” then the unit lists all available files for me:

Just as I expected, I have recorded approximately four minutes of recorded data, 12520 events, or approximately 50 events/s. I expected 100 events/s but it took some time before I started the units, so this data makes sense.

Extracting files

I select file 1. And choose the option to “Extract files”.

Select file destination …

Select the format you would like the data to appear in. I select “CAN frames in plain text”.

If you are unsure, select KME50, which allows you to convert the data to other formats later.

This seems OK, so let’s test and see what happens.

After a short period, the application reports that the export is done.

The logfile001.txt

Kvaser Memorator Log
                              ====================

Memorator Binary logfile created at: 2018-04-25 13:17:16

                                                        
Settings:
   Format of data field: DEC
   Format of id field:   DEC
   Timestamp Offset:     0.000000           s
   CAN channel:          1 2

        Time Chan   Identifier Flags        DLC  Data                                     Counter
=============================================================================================
    0.243188  Trigger (type=0x1, active=0x00, pre-trigger=0, post-trigger=-1)
  188.359876  1   418316033x   Rx            8  222 175 184  28   0 190 120 192             1
  188.609826  1   418053889x   Rx            3    0 238   0                                 2
  188.621215  1   167248385x   Rx            8  255 252 254 255 254 255 255 255             3
  188.784812  1   167248129x   Rx            8  254 255 255 127 254 255 255 127             4
  188.846120  1   167248129x   Rx            8  254 255 255 127 254 255 255 127             5
  188.875237  1   167248385x   Rx            8  255 252 254 255 254 255 255 255             6
  188.876593  1   167248129x   Rx            8  254 255 255 127 254 255 255 127             7
  188.973338  1   167248129x   Rx            8  254 255 255 127 254 255 255 127             8
  189.073275  1   167248129x   Rx            8  254 255 255 127 254 255 255 127             9
  189.123231  1   167248385x   Rx            8  255 252 254 255 254 255 255 255            10
  189.173227  1   167248129x   Rx            8  254 255 255 127 254 255 255 127            11
  189.273280  1   167248129x   Rx            8  254 255 255 127 254 255 255 127            12
  189.354273  1   502267649x   Rx            8    0  17 229 152 231   8   0  10            13
  189.354845  1   502267649x   Rx            8    1   3   1   3  13 230 197 176            14
  189.355425  1   502267649x   Rx            8    2 220   1  17   0 255 255 255            15
  189.373409  1   234358017x   Rx            8    0  43 255  89  65 254 255 255            16

Ok, we have some results!

  • I can record data
  • I can download data
  • I can convert data to the required format
  • I can verify data
  • I can analyze data later.

It seems like I am able to do some logging less than 5 minutes after I started to use the unit. (Actually, it took 10 minutes, as I had to drink some coffee!)

ΟΕΔ  (Q.E.D.  Quod erat demonstrandum)

Additional Materials:

Video instructions for Kvaser Memorator products can also be found at https://www.kvaser.com/videos/quick-start-guide-for-memorator-professional/

Do you need more information or do you have questions?

Please feel free to contact us, your comments and questions are welcome!

You can find us here: SUPPORT@KVASER.COM

 

Author Image

Lars-Göran Fredriksson

Lars-Göran Fredriksson is a Field Application Engineer for Kvaser AB. His background is in geographic information system (GIS) and Remote Sensing and his current focus is on connecting the deep knowledge of Kvaser's developers with the practical questions of our end users. If you doubt his passion for CAN, just know that his first week in the office he created an interactive CAN Trivia game that sent the office scouring the halls for the correct answers. He is a passionate fisherman who would like to develop new environmentally friendly fishing methods. Biggest catch and release fish is for the moment a Bluefin Tuna at appr 325kg / 715lbs.