WP_Query Object
(
    [query] => Array
        (
            [paged] => 17
            [pagename] => about-us/news
        )

    [query_vars] => Array
        (
            [paged] => 17
            [pagename] => about-us/news
            [error] => 
            [m] => 
            [p] => 0
            [post_parent] => 
            [subpost] => 
            [subpost_id] => 
            [attachment] => 
            [attachment_id] => 0
            [name] => 
            [page_id] => 0
            [second] => 
            [minute] => 
            [hour] => 
            [day] => 0
            [monthnum] => 0
            [year] => 0
            [w] => 0
            [category_name] => 
            [tag] => 
            [cat] => 
            [tag_id] => 
            [author] => 
            [author_name] => 
            [feed] => 
            [tb] => 
            [meta_key] => 
            [meta_value] => 
            [preview] => 
            [s] => 
            [sentence] => 
            [title] => 
            [fields] => 
            [menu_order] => 
            [embed] => 
            [category__in] => Array
                (
                )

            [category__not_in] => Array
                (
                    [0] => 1047
                )

            [category__and] => Array
                (
                )

            [post__in] => Array
                (
                )

            [post__not_in] => Array
                (
                )

            [post_name__in] => Array
                (
                )

            [tag__in] => Array
                (
                )

            [tag__not_in] => Array
                (
                )

            [tag__and] => Array
                (
                )

            [tag_slug__in] => Array
                (
                )

            [tag_slug__and] => Array
                (
                )

            [post_parent__in] => Array
                (
                )

            [post_parent__not_in] => Array
                (
                )

            [author__in] => Array
                (
                )

            [author__not_in] => Array
                (
                )

            [orderby] => date
            [post_type] => Array
                (
                    [0] => post
                    [1] => developer_blog
                )

            [post_status] => publish
            [order] => DESC
            [tax_query] => Array
                (
                    [0] => Array
                        (
                            [taxonomy] => blog-group
                            [field] => slug
                            [terms] => Array
                                (
                                    [0] => public
                                )

                            [operator] => IN
                        )

                    [1] => Array
                        (
                            [taxonomy] => blog-group
                            [field] => slug
                            [terms] => Array
                                (
                                    [0] => general-user
                                    [1] => technical-asociate
                                    [2] => qualified-sales-representative
                                    [3] => kvaser-internal
                                )

                            [operator] => NOT IN
                        )

                )

            [ignore_sticky_posts] => 
            [suppress_filters] => 
            [cache_results] => 1
            [update_post_term_cache] => 1
            [lazy_load_term_meta] => 1
            [update_post_meta_cache] => 1
            [posts_per_page] => 10
            [nopaging] => 
            [comments_per_page] => 50
            [no_found_rows] => 
            [taxonomy] => blog-group
            [term] => public
        )

    [tax_query] => WP_Tax_Query Object
        (
            [queries] => Array
                (
                    [0] => Array
                        (
                            [taxonomy] => blog-group
                            [terms] => Array
                                (
                                    [0] => public
                                )

                            [field] => slug
                            [operator] => IN
                            [include_children] => 1
                        )

                    [1] => Array
                        (
                            [taxonomy] => blog-group
                            [terms] => Array
                                (
                                    [0] => general-user
                                    [1] => technical-asociate
                                    [2] => qualified-sales-representative
                                    [3] => kvaser-internal
                                )

                            [field] => slug
                            [operator] => NOT IN
                            [include_children] => 1
                        )

                    [2] => Array
                        (
                            [taxonomy] => category
                            [terms] => Array
                                (
                                    [0] => 1047
                                )

                            [field] => term_id
                            [operator] => NOT IN
                            [include_children] => 
                        )

                )

            [relation] => AND
            [table_aliases:protected] => Array
                (
                    [0] => wp_term_relationships
                )

            [queried_terms] => Array
                (
                    [blog-group] => Array
                        (
                            [terms] => Array
                                (
                                    [0] => public
                                )

                            [field] => slug
                        )

                )

            [primary_table] => wp_posts
            [primary_id_column] => ID
        )

    [meta_query] => WP_Meta_Query Object
        (
            [queries] => Array
                (
                )

            [relation] => 
            [meta_table] => 
            [meta_id_column] => 
            [primary_table] => 
            [primary_id_column] => 
            [table_aliases:protected] => Array
                (
                )

            [clauses:protected] => Array
                (
                )

            [has_or_relation:protected] => 
        )

    [date_query] => 
    [queried_object] => WP_Post Object
        (
            [ID] => 1277
            [post_author] => 38
            [post_date] => 2014-11-21 12:03:40
            [post_date_gmt] => 2013-12-19 15:28:51
            [post_content] => 
            [post_title] => News
            [post_excerpt] => 
            [post_status] => publish
            [comment_status] => open
            [ping_status] => open
            [post_password] => 
            [post_name] => news
            [to_ping] => 
            [pinged] => 
            [post_modified] => 2021-08-12 09:14:30
            [post_modified_gmt] => 2021-08-12 09:14:30
            [post_content_filtered] => 
            [post_parent] => 23
            [guid] => https://www.kvaser.com/?page_id=1277
            [menu_order] => 5
            [post_type] => page
            [post_mime_type] => 
            [comment_count] => 0
            [filter] => raw
        )

    [queried_object_id] => 1277
    [request] => SELECT SQL_CALC_FOUND_ROWS  wp_posts.ID FROM wp_posts  LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) WHERE 1=1  AND ( 
  wp_term_relationships.term_taxonomy_id IN (1026) 
  AND 
  wp_posts.ID NOT IN (
				SELECT object_id
				FROM wp_term_relationships
				WHERE term_taxonomy_id IN (1025,1027,1028,1029)
			) 
  AND 
  wp_posts.ID NOT IN (
				SELECT object_id
				FROM wp_term_relationships
				WHERE term_taxonomy_id IN (1058)
			)
) AND wp_posts.post_type IN ('post', 'developer_blog') AND ((wp_posts.post_status = 'publish')) GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 160, 10
    [posts] => Array
        (
            [0] => WP_Post Object
                (
                    [ID] => 28158
                    [post_author] => 910
                    [post_date] => 2020-05-28 22:00:49
                    [post_date_gmt] => 2020-05-28 22:00:49
                    [post_content] => [vc_row][vc_column][vc_column_text]A few of the customers I’ve worked with over the last few years have indicated a need to analyze a limited number of CAN signals within an SAE J1939 data stream. Although Kvaser has many partner companies that offer plenty of powerful choices for CAN analysis software, it is sometimes desirable to graph a signal with the tools we have. For a student with a one-time need, or an engineer from a small company who just wants to understand a signal on a CAN bus, this method would have value. [/vc_column_text][vc_column_text]In this paper I will present a method to capture and analyze a CAN signal, buried within a CAN frame, using Microsoft Excel, Notepad, and Kvaser’s free CanKing software. These are tools most of us already have, or in the case of CanKing, can download free from the Kvaser website.[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column width="2/3"][vc_column_text]By using this method to initially analyze a signal, an engineer will gain additional insight into the inner workings of CAN and J1939, as well as an understanding of the .dbc file and how it is used by other applications. Although I use a J1939 signal as an example in this paper, the method I am using is applicable to any signal-based CAN protocol including CANOpen, RVC, NMEA 2000®, and many more. While the method shown uses Excel and Notepad, there are other Spreadsheet and Text Editor programs that will accomplish the same thing.[/vc_column_text][vc_column_text]The intention of this paper is not to detract from the many very powerful CAN analysis tools already available to customers through our partner network. Many of these tools have built in support of high-level protocols like J1939 and CANOpen, with powerful graphical and signal analysis capabilities that include the ability to analyze high data volumes (‘big data’). The method presented here will show that with a few simple tools and a need for limited analysis, an engineer may be able to get what they want with the tools they already have on their desktop.[/vc_column_text][vc_column_text]This method also has limitations well beyond those of the dedicated software sold by Kvaser partners. These limitations prevent, or at least greatly complicate, signal analysis in the case of variable length Diagnostic Messages (DMs), Transport Protocol Frames, and multiplexed data frames. In any of these cases a dedicated CAN analysis package will be required, or at least highly desired, in order to properly analyze signals within the data stream. [/vc_column_text][/vc_column][vc_column width="1/3"][vc_well_raket images="40359" meta="WHITE PAPER" title="CAN Signal Analysis with Spreadsheets and Kvaser’s CanKing" button_title="Download PDF" post_id="https://www.kvaser.com/training-materials/#?trainingSearch=CAN%20signal%20analysis"][/vc_well_raket][/vc_column][/vc_row][vc_row][vc_column][vc_column_text]Prerequisites for this method:[/vc_column_text][vc_column_text]
  • Be capable of capturing raw CAN data in Hexadecimal ('hex') or Decimal format, or have access to the raw CAN data you want to analyze, and be able to transfer that data into a .txt file. This will be shown using Kvaser’s CanKing software, free and available at https://www.kvaser.com/download/.
  • Access to Microsoft Excel or equivalent, with a basic understanding of how to use the Filters function within your spread sheet software.
  • Know what data you want to see, or have a .dbc file or a specification showing where to find the signal you’re looking for within the CAN frame, and know how that signal is formatted within the message
[/vc_column_text][vc_column_text]The steps we will follow are:
  1. Capture the data with CanKing, and save it to a text file with Notepad
  2. Open Excel and import the data from the text file
  3. Format the data to be in separate columns
  4. Filter the data to find the CAN frames of interest
  5. Isolate the data bytes to be analyzed
  6. Convert the data to a graphable format
  7. Create a graph showing the signal of interest
[/vc_column_text][vc_separator_raket][/vc_column][/vc_row][vc_row][vc_column][vc_header_raket header_type="h3" header="1. Capture and save data with CanKing"][vc_column_text]If Kvaser’s CanKing is not already loaded and working on your computer, download it and the Kvaser Drivers for Windows, both found in the Downloads section of www.kvaser.com. You can use any Kvaser interface such as the Kvaser Leaf Light HS v2, a Kvaser USBcan, or a Kvaser Memorator to capture data for analysis. There are many ways you can do this from CanKing. If you are capturing J1939 data you should go to the Select Formatter window and select the J1939 Formatter, by putting this formatter in the Active Formatters section of the window and checking the box next to it.  This will allow your data to be formatted as in Figure 2. Once you have connected to your CAN bus and can see the data, you can use the Log To Text File window to start and stop logging, then save the file to your projects working directory.[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column][vc_single_image image="40442" img_size="full"][vc_column_text]

Figure 1. Log to Text File, a Window within Kvaser CanKing

[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column][vc_column_text]Figure 1 shows Kvaser CanKing’s Log To Text File window that will allow the user to capture the CAN data that is to be analyzed. Confirm that you are connected to the CAN bus and seeing the data in CanKing by selecting the Start Run button in the Kvaser CanKing main window. The data that is going to be captured is what you see in the Output Window of CanKing. The data will look something like this, when viewed with a text editor like NotePad:[/vc_column_text][vc_code_raket language="t" code="V2luTm8lMjBQJTIwJTIwJTIwUEdOJTIwU0ElMjAlMjBEQSUyMEZsZyUyMCUyMCUyMExlbiUyMCUyMEQwLi4uMS4uLjIuLi4zLi4uNC4uLjUuLi42Li5ENyUyMCUyMCUyMCUyMCUyMCUyMFRpbWUlMjAlMjAlMjBEaXIlMEFDQU4lMjAxJTIwNiUyMDBGMDA5JTIwMEItJTNFJTJBJTIwJUMyJUEwJTIwJUMyJUEwJTIwJUMyJUEwJTIwJUMyJUEwJTIwOCUyMCVDMiVBMCUyMDdEJUMyJUEwJTIwN0ElQzIlQTAlMjA2MCVDMiVBMCUyMDgzJUMyJUEwJTIwN0QlQzIlQTAlMjA0RiVDMiVBMCUyMDdEJUMyJUEwJTIwN0QlMjAlQzIlQTAlMjAlQzIlQTAlMjAyMTcuMDg4MzUwJTIwUiUwQSUwQUNBTiUyMDElMjAzJTIwMEYwMDQlMjAwMC0lM0UlMkElMjAlQzIlQTAlMjAlQzIlQTAlMjAlQzIlQT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MiVBMCUyMEYwJUMyJUEwJTIwODQlMjAlQzIlQTAlMjAlQzIlQTAlMjAyMTcuMTI2OTMwJTIwUiUwQSUwQUNBTiUyMDElMjA2JTIwMEYwMDklMjAwQi0lM0UlMkElMjAlQzIlQTAlMjAlQzIlQTAlMjAlQzIlQTAlMjAlQzIlQTAlMjA4JTIwJUMyJUEwJTIwN0QlQzIlQTAlMjA3QSVDMiVBMCUyMDYwJUMyJUEwJTIwODMlQzIlQTAlMjA3RCVDMiVBMCUyMDQ3JUMyJUEwJTIwN0QlQzIlQTAlMjA3RCUyMCVDMiVBMCUyMCVDMiVBMCUyMDIxNy4xMjc3NzAlMjBSJTBBJTBBQ0FOJTIwMSUyMDYlMjAwRkY2MCUyMDRELSUzRSUyQSUyMCVDMiVBMCUyMCVDMiVBMCUyMCVDMiVBMCUyMCVDMiVBMCUyMDglMjAlQzIlQTAlMjAwMCVDMiVBMCUyMDAwJUMyJUEwJTIwMDAlQzIlQTAlMjBGRiVDMiVBMCUyMEZGJUMyJUEwJTIwRkYlQzIlQTAlMjBGRiVDMiVBMCUyMEZGJTIwJUMyJUEwJTIwJUMyJUEwJTIwMjE3LjEzMTcxMCUyMFI="][vc_column_text]Figure 2. Sample J1939 data captured with CanKing[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column][vc_column_text]In this simple case, all the CAN frames have eight data bytes. The signal I’m going to analyze is a periodic signal of 10 msec, and I’ll graph a few seconds worth of data. At this point you should have the data stream you want to analyze in a .txt file in a working directory on your computer.[/vc_column_text][vc_raw_html]JTNDYnIlMjAlMkYlM0U=[/vc_raw_html][/vc_column][/vc_row][vc_row][vc_column][vc_header_raket header_type="h3" header="2. Open Excel and Import the data"][vc_column_text]The goal of this step is to get your data into Excel so we can manipulate it with the Filter functions and isolate the data we want to analyze. Other spread sheet programs will also work if they have filters, functions, and graphing capabilities, similar to Excel. It is up to the reader to determine if using a different application is best for them, and find similar functions that will accomplish the conversions. Open Microsoft Excel with a blank worksheet and select File, Open and Browse. In the lower right hand corner of your navigation box you’ll have to select All Files (*.*) so that your .txt file can be opened. Navigate to your working directory and find and select the .txt file you created in step 1 above. Your display will look something like this:[/vc_column_text][vc_single_image image="40443" img_size="full"][vc_column_text]

Figure 3. Selecting a .txt file to open within Excel

[/vc_column_text][vc_column_text]

Select the .txt file you created in step 1 and open it.

[/vc_column_text][vc_raw_html]JTNDYnIlMjAlMkYlM0U=[/vc_raw_html][/vc_column][/vc_row][vc_row][vc_column][vc_header_raket header_type="h3" header="3. Format the data to be in separate columns:"][vc_column_text]Once you have selected your .txt file and attempted to open it with Excel, you will see the Text Import Wizard as shown in Figure 4.  There are different ways you can import your CAN data into Excel using the Text Import Wizard, and many of them will work to some extent.  One way or the other you will most likely have to edit your data and/or headers to make it graph properly.  [/vc_column_text][vc_single_image image="40444" img_size="full"][vc_column_text]

Figure 4. The Text Import Wizard

[/vc_column_text][vc_column_text]This Wizard gives you a quick and easy way to convert your .txt data into Excel format. Follow these steps to convert your data:
  1. Under Choose the file type that best describes your data: select Delimited.
  2. Next to Start import at row: select the first row that has your CAN data; in my case it’s the second row. Some data monitors put in headers and you just want to filter those headers out. You can add them back in later with Excel.
  3. Press Next >.
  4. In the second window under Delimiters select Space.
  5. Press Next >.
  6. Press Finish.
You should now have an Excel Worksheet open that shows your CAN frames separated in columns for Identifier, Flag, DLC and data bytes. You will also have columns for Time and Direction. If you kept your column headers above your data, make sure the headers are lined up correctly with the data. Sometimes the headers get shifted by one or two columns in the conversion process. If you didn’t keep your column headers above your data, you should add them back in now.  The column names I used are Type, Ch, Pri, PGN, SA/DA, DLC, D1, D2, D3, D4, D5, D6, D7, D8, Time, and Dir. Here is what the first few lines of my spread sheet look like after I added the column headers:[/vc_column_text][vc_single_image][vc_column_text]

Figure 5. My spreadsheet so far.

[/vc_column_text][vc_column_text]My data consist of only eight-byte frames, so everything lines up nicely under the headers I entered on the first row. If your data has some frames with different DLCs things will not line up as nicely for you. Don’t worry about this, because you’re going to be graphing one PGN at a time, and at this level a given PGN has a fixed DLC, almost always eight bytes.[/vc_column_text][vc_raw_html]JTNDYnIlMjAlMkYlM0U=[/vc_raw_html][/vc_column][/vc_row][vc_row][vc_column][vc_header_raket header_type="h3" header="4. Filter the data to find the CAN frames of interest"][vc_column_text]This is where you need to know what data you’re looking for and where this data is located within the CAN frame. In J1939 as well as other CAN based protocols, the Data portion of the CAN frame is usually used to communicate more than one signal. Different protocols use different names for things like massages and signals. I’m going to use J1939 terminology when possible, and try to keep it consistent. In J1939 talk, a signal is an informal way to refer to an SP, or a Suspect Parameter. To identify a signal, you use a Suspect Parameter Number, or SPN.  A group of signals make up a Parameter Group, or PG, and a PG is identified by a Parameter Group Number, or PGN.  For the example we’re going to use, a PG is going to fit into one CAN frame.  This is not always the case, sometimes a PG is spread across multiple CAN frames by using Transport Protocol, but that’s a subject for a later write-up. In my example we’re going to analyze a signal called Engine Speed. Details of this signal can be found in the SAE J1939DA, or Digital Annex. Engine Speed is identified as SPN 190 and some of the details from the Digital Annex are shown below:[/vc_column_text][vc_single_image image="40446"][vc_column_text]

Table 1. Information obtained from the SAE J1939DA specification

[/vc_column_text][vc_column_text]Table 1 gives us everything we need to know to graph Engine Speed from the data we have collected, but first we must be able to filter the data to find only what we are interested in.  The key here is the PGN, 61444.  This is represented as a decimal number so converting to hexadecimal gives us 0x0F004. This is the PGN we want to isolate so we can graph SPN 190, because this is the PGN that contains SPN 190. The format is in hexadecimal just as it is shown in Figure 6 column D. Figure 6 also shows that I have turned on the Filter function. I can now Filter column D for the data I want to graph.[/vc_column_text][vc_single_image image="40445" img_size="full"][vc_column_text]

Figure 6. Excel Spread Sheet with filtering turned on, showing all data

[/vc_column_text][vc_column_text]If you have not previously used the Filters within Excel, click on the Data tap at the top in Excel, and find Filter. Highlight the top row of the data (the headers row) then turn the Filter function on and you will see small boxes in each column of the top row of your spread sheet with down arrows in them.  Select the arrow over the column PGN and you should see a box come down as in Figure 7. Uncheck the (Select All) box, and then select just the message you want to filter on, in this case 0F004.  Select OK and you will have filtered on the data you want to see. Your spread sheet will now be showing only the CAN frames containing the message with the signal we want to graph, SPN 190, Engine Speed.[/vc_column_text][vc_single_image image="40446" img_size="full"][vc_column_text]

Figure 7. Excel Spread Sheet with filtering turned on, showing only Engine Speed PGN

[/vc_column_text][vc_raw_html]JTNDYnIlMjAlMkYlM0U=[/vc_raw_html][/vc_column][/vc_row][vc_row][vc_column][vc_header_raket header_type="h3" header="5. Isolate the data bytes to be analyzed"][vc_column_text]Our spread sheet is showing only the CAN frames containing the data we want to graph, so now it’s time to isolate the signal we want.[/vc_column_text][vc_single_image image="40447" img_size="full"][vc_column_text]Figure 8.[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column][vc_column_text]Going back to Table 1, we can see that Engine Speed is a two-byte signal contained in position 4 and 5, or according to our headers, D4 and D5. Since this is a two-byte signal we must consider byte order before we do any calculations on the data. Figure 8 shows a cut from our filtered data with D4 and D5 highlighted in Yellow. Just by looking at the data it’s easy to answer the question about byte order. We can see that the least significant byte is in D4 and is transmitted first. We know this because it’s the byte that’s changing the most, and we can see it’s driving D5 up by one when it rolls over. If we look at the first line of data in Figure 8, and look at Engine Speed as a single number, we can write the hexadecimal value of Engine Speed as 0x1466. We have now isolated SPN 190 within the data that was captured from the CAN bus. It is isolated to D4 and D5 in PGN 0x0F004, or PGN 61444. Some SPNs are less than one byte, and in some cases, they’re combined with other SPNs in the same byte. If this were the case for the SPN we were interested in, it would require some more Excel functions like masking and shifting. Spreadsheets offer many mathematical functions that can be applied to the data in many creative ways. It’s up to the reader to find a way to use those functions to isolate whatever specific data they’re interested in graphing.[/vc_column_text][vc_raw_html]JTNDYnIlMjAlMkYlM0U=[/vc_raw_html][/vc_column][/vc_row][vc_row][vc_column][vc_header_raket header_type="h3" header="6. Convert the data to a graphable format"][vc_column_text]The only other things we must consider for this signal before graphing it is the resolution and the offset. Resolution is the term used in the SAE J1939DA, to describe the scaling factor to be applied to a signal so that it is displayed in an understandable and readable way. If you are using the Kvaser Database Editor 3 software, also free and downloadable from kvaser.com/download/ to extract this information from a .dbc file, the term that is used is Factor. Table 1 shows the resolution equal to 0.125 rpm per bit, and the offset equal to zero. Follow the steps below to calculate Engine Speed in RPMs, from the raw data that is transmitted:
  1. Convert the two-byte SPN 190 to a decimal number, ex. 0x1466 = 5,222.
  2. Multiply this number by the resolution, or what I call scaling: (5,222 bits) x (0.125 rpm/bit) = 652.75 rpm
  3. Apply the offset, in this case zero, so the final value is 652.75 rpm
With the power of the spreads sheet we can easily make this calculation for all the samples of the signal we want to graph.  The first thing to do is to add a blank column to the right of the column D5. Once this column is in, we can use it to calculate RPMs with the steps above. If this is not clear you should review the Functions capabilities within Excel by going to a blank cell and typing “=”, then clicking on fx up by the menu bar. My data is in columns J and K, so here is the function I am going to enter into the first block of my new column under the header row: =HEX2DEC(CONCAT(K3,J3))*0.125 This single line will concatenate our two bytes of data in the correct order (K3 first then J3), convert from hexadecimal to decimal, then multiple by our scaling value, all in one easy equation. Perform this calculation by using the auto fill function in Excel to populate the new column for all the data we want to graph.  If you haven’t used auto fill before you should go to the Help menu within Excel to see how to use it. After you use auto fill to fill all the cells you want to graph, you will have a graphable number for Engine Speed, alone in a column within your spread sheet, ready to be graphed.[/vc_column_text][vc_raw_html]JTNDYnIlMjAlMkYlM0U=[/vc_raw_html][/vc_column][/vc_row][vc_row][vc_column][vc_header_raket header_type="h3" header="7. Create a graph showing the data of interest"][vc_column_text]From this point on it’s just a matter of using the graphing functions in Excel to graph one column of data. The column you want to graph is the column you created with the concatenate (CONCAT) function and the hexadecimal to decimal (HEX2DEC) conversion function. You can select the entire column that was created in step 6 above, or just select a portion of it. Next select Insert from the menu bar to Insert Line or Area Chart, and this will give you a graph of the signal you’re interested in. A graph generated from a portion of my data is shown in Figure 9.[/vc_column_text][vc_single_image image="40448" img_size="full"][vc_column_text]

Figure 9. Engine Speed as it appears in my data

[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column][vc_column_text]I have labeled this graph SPN 190, and have done nothing else to it after creating it with the Insert Line or Area Cart Function. Spreadsheet programs have many powerful functions and ways of creation graphs, showing different signals in many different ways, and this procedure allows an engineer or technician to use these powerful features on most data captures on a CAN bus, provided they have a specification or .dbc file showing where that data is and how it is formatted.[/vc_column_text][vc_column_text]This paper is meant to show a method of using non-specific software tools to help understand signals in a CAN data stream. Each step requires knowledge beyond what is explained here, but it is not the individual steps that are of interest. It is my hope that the general method, whether applied as in the example here, or using other software, will have value to readers who want to gain a more in-depth knowledge of CAN and how signals are transmitted using CAN.[/vc_column_text][/vc_column][/vc_row] [post_title] => CAN Signal Analysis with Spreadsheets and Kvaser’s CanKing SAE J1939 Example [post_excerpt] => [post_status] => publish [comment_status] => closed [ping_status] => closed [post_password] => [post_name] => can-signal-analysis-with-spreadsheets-and-kvasers-canking-sae-j1939-example [to_ping] => [pinged] => [post_modified] => 2022-12-08 12:02:23 [post_modified_gmt] => 2022-12-08 12:02:23 [post_content_filtered] => [post_parent] => 0 [guid] => https://www.kvaser.com/?post_type=developer_blog&p=28158 [menu_order] => 0 [post_type] => developer_blog [post_mime_type] => [comment_count] => 0 [filter] => raw ) [1] => WP_Post Object ( [ID] => 28214 [post_author] => 910 [post_date] => 2020-05-21 03:13:25 [post_date_gmt] => 2020-05-21 03:13:25 [post_content] => [vc_row][vc_column][vc_column_text]In the previous post I introduced some of the free software downloads from Kvaser, and gave an example of how to use some of these tools for learning about CAN, and for CAN development and test projects while at home. There is no specific hardware required for this, just a computer. The primary software tools are Kvaser CanKing and Kvaser Driver for Windows. What we accomplished in the last blog was to send random data between two virtual CAN channels that the Kvaser Driver for Windows creates when installed. We picked random addresses and let the program pick some random data. Today we will explore ways of using this ability to learn SAE J1939 CAN Frame formatting and create a method for testing an application. For now, we will keep using the two virtual CAN channels installed with the driver. If you would like some study material to prepare for this blog, search Kvaser.com for CAN Basics, or visit https://www.kvaser.com/course/can-basics-training-a-practical-introduction-to-the-can-bus/ for a video introduction to CAN. You can also look at An Introduction to J1939 and DBC Files, also available on Kvaser.com.[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column][vc_header_raket header_type="h3" header="Loading and testing a .dbc file with Kvaser CanKing and the Virtual Channels"][vc_column_text]To follow along with actual data as I go through this blog, you will need to have a .dbc file available to load into CanKing, or you will need to create one. Creating a .dbc file for just a few CAN messages and signals is not that difficult with the Kvaser Database Editor 3, available free at https://www.kvaser.com/download/. Creating a .dbc file will not be covered in this blog. Start by opening Kvaser CanKing using the 2 CAN channels template, as in the first blog of this series, then go to View and add the History List window and Times Transmission window to your desktop as before. Creating the CAN message is where most of the complexity will be, so we’ll start with the message I copied from a recent article on J1939 tools. Here is a raw message that I am going to use:[/vc_column_text][vc_single_image image="28215"][vc_column_text]This is a message as received in CanKing, and is called the Electronic Engine Controller 1 message, identified as PGN 61444. The signal we will manipulate within this message is Engine Speed, identified as SPN 190. To do this we first need to break the message down into the Identifier and the data segments.  To show how to construct the identifier from the J1939 data above, here is a cut from the CAN Protocol Tutorial, Higher Layer Protocols, found here: https://www.kvaser.com/about-can/higher-layer-protocols/j1939-introduction/.[/vc_column_text][vc_single_image image="28216"][vc_column_text]This is a 29-bit extended identifier, so we know the following from the information in the frame, as displayed in CanKing: Priority = 3 Reserved Bit and Data Page = 0 PGN = 0x0F004 Source Address = 0 Combining all this information into a 29-bit identifier and displaying it in hexadecimal format gives us 0CF00400, so plug this into the CAN Identifier box in the message window, putting the small “x” at the end to indicate Extended identifier format. See the next figure below. If you are having difficulty understanding how I came up with this hexadecimal number from the bits as displayed in CanKing, start from Source Address on the right, and work right to left. Remember that the identifier must be 29 bits, or seven nibbles plus one extra bit on the left. The Priority is what makes it difficult, because it straddles nibbles 7 and 8. A frame with a priority of 3, like this one, always starts with an 0C and has the form 0Cxxxxxx, while a frame with priority 6 has the form 18xxxxxx, and priority 7 would be 1Cxxxxxx. Next, we know the Data Length Code (DLC) is 8, so enter this in the DLC box. The eight data bytes are as listed in the CanKing frame above, 60  7D  84  50  14  00  F0  84, so enter these as Byte 0 through Byte 7, reading from left to right. The end-result is the CAN message window as shown below, with the identifier and the data entered, ready to be sent:[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column width="1/2"][vc_single_image image="28218"][/vc_column][vc_column width="1/2"][/vc_column][/vc_row][vc_row][vc_column][vc_column_text]Next, we need to load a .dbc file that describes the data we’re ready to send. I have a partial J1939 dbc file that I use for things like this, so I am going to load it into CanKing. To load a .dbc file into CanKing, go to the Select Formatters window and activate and select the J1939 Formatter. You can now double-click on the J1939 Formatter to open the Select Databases window as shown below.[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column width="1/2"][vc_single_image image="28219"][/vc_column][vc_column width="1/2"][/vc_column][/vc_row][vc_row][vc_column][vc_column_text]In this window you can see that I have loaded a .dbc file into CAN 2. I have also selected the settings I want to use in displaying the data. Since we plan to transmit the message from CAN 1 we will receive it with CAN 2, and this is where we want to decode the message using the .dbc file.  We’re now ready to test our system. Select Start Run in the Kvaser CanKing window, then click on Send in the CAN Message 1 window. If everything was set up correctly your Output Window should now look like this:[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column width="5/6"][vc_single_image image="28220"][/vc_column][vc_column width="1/6"][/vc_column][/vc_row][vc_row][vc_column][vc_column_text]This Output Window shows four lines of data, plus all the signals within the message decoded per the .dbc file loaded into CAN 2. We know data was transmitted on CAN 1 and received and decoded on CAN 2. The reason we’re seeing four lines of data is that we have two formatters selected in the Select Formatter window, the Standard Text Formatter and the J1939 Formatter. Each formatter produces one line for transmitted data and another line for received data. Starting at the top, the first line shows the Standard Text Formatter transmit line. Below that is the J1939 Formatter transmit line, and since we don’t have a .dbc file loaded into CAN 1, it does not decode this data and just shows it as raw hexadecimal numbers. The third line shows the Standard Text Formatter receive line, which looks just like the Standard Text Formatter transmit line, as it should. The fourth line is the important one, showing the J1939 Formatter receive line with all the signals in the message decoded and displayed. Here are the signals and their values as decoded:[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column width="5/6"][vc_single_image image="28221"][/vc_column][vc_column width="1/6"][/vc_column][/vc_row][vc_row][vc_column][vc_column_text]To summarize what we have done to this point, we have manually created a J1939 Electronic Engine Controller 1 message within the CAN Message 1 formatter box, loaded a J1939 .dbc file into CAN 1, sent and received the message over the virtual CAN buses within the Kvaser Driver, and decoded the message with the .dbc file. The next step is to make something more practical out of all this data manipulation. I’m going to identify the Engine Speed signal within this program, and then manipulate it across many messages to create a simulated engine speed ramp. I’ll capture this data in the History List window then used the Timed Transmission window to play it back as a continuously changing engine speed. A practical application for this would be in a test circuit where you wanted to control engine speed in a simulated environment and use this to test the response of a different device. You could create it and test it here, then using the Save feature in the History List window, you could save this test and play it back later to test the response of a different application. You could also play it back later through a Kvaser hardware interface, and test the response of any device on the same CAN bus. Any signal you create and test over the virtual device is available to you through a Kvaser interface, and can be transmitted to any device you like. We know from the J1939DA that bytes D3 and D4 are the Engine Speed signal and D4 is the MSB (Most Significant Byte). Follow these steps to create an engine speed ramp test signal:[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column width="1/2"][vc_column_text]
  1. Clear the History List window by right clicking in the window and selecting Clear.
  2. Start a new run by clicking Stop then Start Run in the Kvaser CanKing window. This will reset the timer field.
  3. Click Send in the CAN Message 1 window one time. This will put one message into the History List.
  4. Change Byte 4 in the CAN Message 1 window from $14 to $15 and click Send again.
  5. Repeat this sequence as many times as you like to create a history list of a ramping engine speed.
  6. When you have the data you’re interested in, click Save in the History List window and select a location and file name.
To the right is a view of my History List window with the engine speed ramp that took RPMs from 650 to 1738.[/vc_column_text][vc_column_text]You can use this manual method to manipulate most CAN data that is described in a .dbc file provided you have access to the .dbc file. If the signal you want to manipulate is part of a larger message that uses Transport Protocol, this task gets much more difficult.[/vc_column_text][/vc_column][vc_column width="1/2"][vc_single_image image="28222"][/vc_column][/vc_row][vc_row][vc_column][vc_column_text]Kvaser has many partner companies producing powerful CAN analysis and simulation software that can do much more than what I have demonstrated here. These companies and their products can be found on www.kvaser.com under CAN Software/Partner Directory. The tools I’m showing here are good for learning about CAN and maybe performing some simple simulation and validation tasks. I hope you find this blog useful for whatever work you are doing with CAN. Stay tuned for more in this series![/vc_column_text][/vc_column][/vc_row] [post_title] => Applying a J1939 DBC file and building a simple test script in CanKing [post_excerpt] => [post_status] => publish [comment_status] => closed [ping_status] => closed [post_password] => [post_name] => applying-a-j1939-dbc-file-and-building-a-simple-test-script-in-canking [to_ping] => [pinged] => [post_modified] => 2021-01-08 07:58:49 [post_modified_gmt] => 2021-01-08 07:58:49 [post_content_filtered] => [post_parent] => 0 [guid] => https://www.kvaser.com/?post_type=developer_blog&p=28214 [menu_order] => 0 [post_type] => developer_blog [post_mime_type] => [comment_count] => 0 [filter] => raw ) [2] => WP_Post Object ( [ID] => 27637 [post_author] => 23 [post_date] => 2020-05-19 14:58:42 [post_date_gmt] => 2020-05-19 14:58:42 [post_content] => [vc_row][vc_column][vc_single_image image="27642"][vc_column_text]GEMAC is supporting Kvaser CAN interfaces in the latest version of its CANvision protocol monitor, version 1.3.4.1. The bus monitoring and decoding software, which handles CAN, CANopen, CANopen FD and SAE J1939 (including NMEA2000 and ISOBUS) messages, supports Kvaser in interface mode only. For more information on CANvision, please visit https://gemac-fieldbus.com/en/ or address questions to [email protected].[/vc_column_text][/vc_column][/vc_row] [post_title] => GEMAC’s CANvision now supports Kvaser interfaces [post_excerpt] => [post_status] => publish [comment_status] => closed [ping_status] => closed [post_password] => [post_name] => __trashed [to_ping] => [pinged] => [post_modified] => 2022-04-04 10:19:11 [post_modified_gmt] => 2022-04-04 10:19:11 [post_content_filtered] => [post_parent] => 0 [guid] => https://www.kvaser.com/?p=27637 [menu_order] => 0 [post_type] => post [post_mime_type] => [comment_count] => 0 [filter] => raw ) [3] => WP_Post Object ( [ID] => 28122 [post_author] => 6080 [post_date] => 2020-05-15 10:53:57 [post_date_gmt] => 2020-05-15 10:53:57 [post_content] => [post_title] => TKE's CANtrace 3.17 includes more J1939 functionality [post_excerpt] => [post_status] => publish [comment_status] => closed [ping_status] => closed [post_password] => [post_name] => tkes-cantrace-3-17-includes-more-j1939-functionality [to_ping] => [pinged] => [post_modified] => 2022-04-04 10:19:11 [post_modified_gmt] => 2022-04-04 10:19:11 [post_content_filtered] => [post_parent] => 0 [guid] => https://www.kvaser.com/?p=28122 [menu_order] => 0 [post_type] => post [post_mime_type] => [comment_count] => 0 [filter] => raw ) [4] => WP_Post Object ( [ID] => 28054 [post_author] => 23 [post_date] => 2020-04-30 23:26:32 [post_date_gmt] => 2020-04-30 23:26:32 [post_content] => [vc_row][vc_column][vc_single_image image="28056"][vc_column_text]Kvaser AB has signed a Technical Associate (TA) agreement with test and measurement specialist, Klaric GmbH & Co. KG. The Stuttgart-based manufacturer serves the automotive market with a product portfolio that encompasses current, voltage and temperature measurement modules and sensors for high and low voltage applications, as well as the high voltage breakout boxes for safe measurement in electric and hybrid systems, many of which use CAN for data output and/or configuration. Killian Klaric commented:[/vc_column_text][/vc_column][/vc_row][vc_row css=".vc_custom_1588288848069{margin-right: 10px !important;margin-left: 10px !important;}"][vc_column][vc_column_text]
“With many customers who work with Kvaser interfaces and dataloggers, we have supported Kvaser hardware for a number of years. A closer relationship with Kvaser means we have more confidence with their products and see potential for presenting a total solution to customers; pairing Klaric’s measurement modules and Kvaser’s data loggers.”
[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column width="3/4"][vc_column_text]Commented Silvia Küller, Managing Director of Kvaser Europe: “The measurement and validation of electrical components is a key phase within the development and test of any vehicle, determining its overall reliability and efficiency. When it comes to High Voltage or EV applications, Klaric’s range of capable and Kvaser-compatible tools are highly complementary to our existing partner network.”[/vc_column_text][/vc_column][vc_column width="1/4"][vc_single_image image="28055"][/vc_column][/vc_row][vc_row][vc_column][vc_column_text]One of Klaric’s latest products is an EV charge-monitor, used to validate the charging process for electric or hybrid vehicles. Capable of measuring current and voltage in both AC and DC, the system can be used for among others, vehicle certification, emissions testing and energy management R&D. With up to three CAN bus outputs (all high-speed), the Kvaser Memorator Pro 5xHS is a particularly good fit.[/vc_column_text][/vc_column][/vc_row] [post_title] => High voltage test and measurement specialist joins Kvaser’s TA network [post_excerpt] => [post_status] => publish [comment_status] => closed [ping_status] => closed [post_password] => [post_name] => high-voltage-test-and-measurement-specialist-joins-kvasers-ta-network [to_ping] => [pinged] => [post_modified] => 2021-03-02 23:33:03 [post_modified_gmt] => 2021-03-02 23:33:03 [post_content_filtered] => [post_parent] => 0 [guid] => https://www.kvaser.com/?p=28054 [menu_order] => 0 [post_type] => post [post_mime_type] => [comment_count] => 0 [filter] => raw ) [5] => WP_Post Object ( [ID] => 27865 [post_author] => 23 [post_date] => 2020-04-13 21:29:56 [post_date_gmt] => 2020-04-13 21:29:56 [post_content] => [vc_row][vc_column][vc_single_image image="27883"][vc_column_text]No doubt like you, our development team is adapting to the current situation by working more from home. Conscious that more of our customers will be tackling CAN development remotely, Kvaser’s support and field application engineers have put together a few suggestions to help keep your CAN projects moving ahead.[/vc_column_text][vc_header_raket header_type="h2" header="A license to develop"][vc_row_inner][vc_column_inner el_class="space-fix" width="1/2"][vc_column_text]Aside from ensuring a secure, stable and fast home connection, a challenge to remote working is the software licence you use. Products with multi-user access or maintenance plans often require a license to use software at home. Whilst some companies provide low-cost or free home-access if you make a direct request, others have 30-day free software trials that could get you over the initial ‘hump’. Here’s a few suggestions sourced from Kvaser's Technical Associate network that offer home licenses and/or free trials:[/vc_column_text][/vc_column_inner][vc_column_inner el_class="space-fix" width="1/2"][vc_single_image image="27870"][/vc_column_inner][/vc_row_inner][vc_header_raket header_type="h3" header="Bus Analysis"][vc_column_text]Accurate Technologies (ATI) CANLab Network Analysis Free trial available at support.accuratetechnologies.com MathWorks Vehicle Network Toolbox Free 30-day trial available. FAAR Industry EASY CAN Free 30-day trial available. Michael Eisele Software XTM, a CAN/LIN/FlexRay display Free 60-day trial available. Kvaser CanKing Unlimited-time free download.[/vc_column_text][vc_header_raket header_type="h3" header="Data Acquisition"][vc_column_text]Accurate Technologies (ATI) VISION Free trial available from support.accuratetechnologies.com. Zuragon ViCANdo for ADAS development Free 30-day trial available.[/vc_column_text][vc_separator_raket][vc_header_raket header_type="h2" header="Beginner’s Guide to Using Kvaser’s Virtual Drivers"][vc_row_inner][vc_column_inner el_class="space-fix" width="3/4"][vc_column_text]If you are interested in developing a Controller Area Network (CAN) project from home using tools available to you today, Kvaser and our partners can help. Kvaser’s CAN interfaces and dataloggers work with one universal driver that includes a Virtual CAN Driver. This Virtual CAN driver is used by tools to monitor and transmit CAN data, and with a little imagination you can start a CAN development project, continue an existing development, and learn more about CAN, all within the confines of your home, with tools that are readily available. For a simple walk-through on how to use virtual channels with CanKing, see this Developer Blog: "Beginner's Guide To Using Kvaser's Virtual Channels".[/vc_column_text][/vc_column_inner][vc_column_inner el_class="space-fix" width="1/4"][vc_single_image image="16831"][/vc_column_inner][/vc_row_inner][/vc_column][/vc_row][vc_row][vc_column][vc_separator_raket][vc_header_raket header_type="h2" header="Physical bus still accessible?"][vc_column_text]For those in development groups that aren’t confined (or perhaps you managed to grab some CAN hardware and a CAN interface to take home!), the following accessories may be helpful:[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column width="1/4"][vc_single_image image="27906" onclick="custom_link" link="https://www.kvaser.com/product/kvaser-t-cannector-v2/"][/vc_column][vc_column width="3/4"][vc_column_text]Create an impromptu CAN network using this device. Allows you to connect multiple CAN interfaces, data loggers and/or multiple CAN channels together quickly and easily, without the risk of creating short circuits or time spent from wiring them together yourself. View Kvaser T-cannector v2 >>[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column width="1/4"][vc_single_image image="27907" onclick="custom_link" link="https://www.kvaser.com/product/kvaser-d-sub-9-pin-120-ohm-termination-adapter-2/"][/vc_column][vc_column width="3/4"][vc_column_text]Terminate your CAN network without fuss. This CAN adapter has a 9-pin male D-Sub connector at one end and a 9-pin female D-Sub connector at the other. View Kvaser termination adapter >>[/vc_column_text][/vc_column][/vc_row] [post_title] => Tools to help you work remotely [post_excerpt] => [post_status] => publish [comment_status] => closed [ping_status] => closed [post_password] => [post_name] => tools-to-help-you-work-remotely [to_ping] => [pinged] => [post_modified] => 2022-11-19 00:32:16 [post_modified_gmt] => 2022-11-19 00:32:16 [post_content_filtered] => [post_parent] => 0 [guid] => https://www.kvaser.com/?p=27865 [menu_order] => 0 [post_type] => post [post_mime_type] => [comment_count] => 0 [filter] => raw ) [6] => WP_Post Object ( [ID] => 27847 [post_author] => 910 [post_date] => 2020-04-13 14:32:57 [post_date_gmt] => 2020-04-13 14:32:57 [post_content] => [vc_row][vc_column][vc_column_text]If you are interested in developing a Controller Area Network (CAN) project from home using tools available to you today, Kvaser and our partners can help. Kvaser’s CAN interfaces and dataloggers work with one universal driver that includes a Virtual CAN Driver.[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column width="1/2"][vc_column_text]This Virtual CAN driver is used by tools to monitor and transmit CAN data, and with a little imagination you can start a CAN development project, continue an existing development, and learn more about CAN, all within the confines of your home, with tools that are readily available.[/vc_column_text][vc_column_text]Here, I will give an example of how this can be accomplished. Using Kvaser CANKing, the free bus monitor software available on the Kvaser web site, along with the Kvaser Drivers for Windows, available from the same place, I can transmit and receive CAN messages through the two virtual ports available in the driver.[/vc_column_text][/vc_column][vc_column width="1/2"][vc_column_text css=".vc_custom_1619031729590{padding-top: 30px !important;padding-right: 30px !important;padding-bottom: 30px !important;padding-left: 30px !important;background-color: #f7f7f7 !important;}"]NOTE: Virtual Drivers are supported in both Windows and Linux environments. For a deeper look at configuring virtual devices, virtual channels, and virtual busses, see the Developer Blog: How to use Kvaser Virtual Device Channel and Bus >> [/vc_column_text][/vc_column][/vc_row][vc_row][vc_column][vc_video link="https://www.youtube.com/watch?v=wY7W1CTqBLU"][/vc_column][/vc_row][vc_row][vc_column][vc_column_text]Full tutorial text with screenshots:[/vc_column_text][vc_header_raket header_type="h3" header="Virtual Driver Tutorial"][vc_column_text]Download and install Kvaser Drivers for Windows, available here: https://www.kvaser.com/download/ Download and install Kvaser CANKing, available at the same link. Start CANKing and select Template from the first window.[/vc_column_text][vc_single_image][vc_column_text]After selecting OK, you will see the Template selection window. Select 2 CAN channels within this window leading to two CAN windows appearing on your desktop.. One Kvaser driver supports a maximum of two virtual channels, so this is the only selection that makes sense for now, since you need a minimum of two channels to pass data.[/vc_column_text][vc_single_image image="40731"][vc_column_text]Five windows should open on your desktop, the Kvaser CANKing window, two CAN Channel windows, a Select Formatter window, and the Output Window. If your configuration is different you can go to the View menu and manually turn these five windows on. You’ll also need the Timed Transmission and History List windows, so turn these on as well. I like to arrange the windows on my Desktop so I can see everything, and the locations are logical. Here’s how my Desktop looks now:[/vc_column_text][vc_single_image image="40732"][vc_column_text]Make sure you select the Virtual CAN Driver in both CAN 1 and CAN 2 windows, found under CAN Channels. One should say 0 – Kvaser Virtual CAN Driver, and the other should say 1 – Kvaser Virtual CAN Driver. Both channels should also have the same Bus Configuration information. All this should be set by default. Now select Start Run in your Kvaser CANKing window. This will turn on both Virtual channels and start communication. Now we create a message. Go up to the Message menu in the top right corner, and select Universal, or just use the shortcut Ctrl+U. The window that will open will look like this:[/vc_column_text][vc_single_image image="40733"][vc_column_text]This CAN Message 1 window is where we’re going to select a CAN message to send on our virtual CAN bus. Plug a simple CAN Identifier into the top box, say $0F0, then type a number between 1 and 8 into the DLC box. I like to use 8 to send a full frame of data. Now click on Randomize Data in the lower right corner of the window. My window now looks like this:[/vc_column_text][vc_single_image image="40642"][vc_column_text]We are now all set to transmit the data. Click Send in your CAN Message 1 window. If you followed the steps above you should see two messages in your Output Window, and one in your History List window. The Output Window shows one message as Transmitted, and the same message as Received on the other channel. What we just did was to send our CAN message from one virtual channel to a second virtual channel. Here is what’s at the top of my Output Window:[/vc_column_text][vc_single_image image="40734"][vc_column_text]You can see that this is the same randomized data selected in the CAN Message 1 window, with the CAN Identifier that I selected, transmitted from channel 0 and received on channel 1. Let’s send one more message with a different Data Length Cade (DLC). Go back to the CAN Message 1 window and change the CAN Identifier, I’ll use $050 for the new identifier. Now change the DLC to 3. Click the Randomize Data button again, then click Send. Another message should be transmitted from Channel 0 and received on Channel 1, this time with only three data bytes. You can see this below in my CAN Message 1 window and my Output Window:[/vc_column_text][vc_single_image image="40735"][vc_column_text]Now we are set up to go to step two of this training and use the History List window to send repeating CAN data frames. Your Timed Transmission window should still be open on your desktop. If not, you can go to the View menu and open it. I filled in my Timed Transmission window for 1000ms and Cyclic Transmission Mode:[/vc_column_text][vc_single_image image="40736"][vc_column_text]Next, I looked at my History List window and could see the two original messages I transmitted and received through the virtual channels:[/vc_column_text][vc_single_image image="40737"][vc_column_text]If you now select Send All in the History List window, you will see that the messages you created are pulled from the History List and transmitted on the virtual CAN bus according the parameters set in your Timed Transmission window. Here is what my Output Window now shows:[/vc_column_text][vc_single_image image="40738"][vc_column_text]This is just an example of what can be done with the Kvaser Virtual CAN drivers and Kvaser CANKing. Other tasks that can be performed with the software you have are:
  • Develop an example .dbc file as it would be used to decode any CAN data (J1939, NMEA 2000®, or CANOpen), and then put it to work by generating some data with CANKing and seeing if the decode goes correctly. Search Kvaser.com for J1939 DBC Files and find this link if you want to learn more about these before working with .dbc files. https://www.kvaser.com/developer-blog/an-introduction-j1939-and-dbc-files/
  • Download and install a trial version of a partner’s CAN analysis tool and get to know it by sending and receiving data with it, through your virtual CAN bus.
  • Download and install Kvaser CANlib SDK and develop a PC based application that accesses a CAN bus, then test your application through the virtual CAN driver.
[/vc_column_text][vc_separator_raket][vc_header_raket header_type="h3" header="Further Reading:"][vc_column_text]Dev Blog Article: How to use Kvaser Virtual Device Channel and Bus
  • A deeper look at using registry edits to configure your system for 16 virtual channels.
[/vc_column_text][/vc_column][/vc_row] [post_title] => Beginner's Guide to Using Kvaser's Virtual Drivers [post_excerpt] => [post_status] => publish [comment_status] => closed [ping_status] => closed [post_password] => [post_name] => beginners-guide-to-using-kvasers-virtual-drivers [to_ping] => [pinged] => [post_modified] => 2023-01-23 07:37:34 [post_modified_gmt] => 2023-01-23 07:37:34 [post_content_filtered] => [post_parent] => 0 [guid] => https://www.kvaser.com/?post_type=developer_blog&p=27847 [menu_order] => 0 [post_type] => developer_blog [post_mime_type] => [comment_count] => 0 [filter] => raw ) [7] => WP_Post Object ( [ID] => 27694 [post_author] => 22955 [post_date] => 2020-04-08 17:51:11 [post_date_gmt] => 2020-04-08 17:51:11 [post_content] => [vc_row][vc_column width="1/6"][vc_column_text][/vc_column_text][/vc_column][vc_column width="2/3"][vc_single_image image="27695"][/vc_column][vc_column width="1/6"][vc_column_text][/vc_column_text][/vc_column][/vc_row][vc_row][vc_column][vc_column_text]Warwick Control Technologies has released a new version of the powerful network analysis tool X-Analyser (version 3.12.0).  This now provides CAN CAN FD and LIN all in one tool, along with the CAN higher layer protocols SAE J1939, NMEA2000 and CANopen. This is available in a kit which includes the Kvaser Hybrid two-channel interface and can be used to test CAN, CAN FD and LIN systems via one interface.  The two channels of the Kvaser interface can be mapped to the X-Analyser software in any combination of these network protocols that you wish, e.g. channel 1 can be LIN and channel 2 can be CAN FD.  This makes the kit a very versatile and cost-effective tool for testing CAN, CAN FD and LIN systems. An optional feature is the CAN Physical Layer Analyser via the PicoScope 2206b USB oscilloscope (if purchased as an optional extra) which:
  • Scans the CAN bus for 10 seconds and records 1 example of each CAN message
  • User can click on the CAN identifier and view the CAN_H, CAN_L and differential of the entire CAN frame in an oscilloscope type view
  • Each CAN frame trace for CAN_H and CAN_L electrical signals
It comes with 1-year email support which includes free updates.  Subsequent maintenance contracts are available. The X-Analyser supports all Kvaser CAN, CAN FD and LIN interfaces. For more information, contact Warwick Control.[/vc_column_text][vc_separator_raket][/vc_column][/vc_row][vc_row][vc_column width="1/2"][vc_raket_product post_id="18894"][/vc_column][vc_column width="1/2"][/vc_column][/vc_row] [post_title] => CAN, CAN FD, and LIN Network Analysis In One Tool From Warwick [post_excerpt] => [post_status] => publish [comment_status] => closed [ping_status] => closed [post_password] => [post_name] => can-can-fd-and-lin-network-analysis-in-one-tool-from-warwick [to_ping] => [pinged] => [post_modified] => 2022-12-21 22:50:05 [post_modified_gmt] => 2022-12-21 22:50:05 [post_content_filtered] => [post_parent] => 0 [guid] => https://www.kvaser.com/?p=27694 [menu_order] => 0 [post_type] => post [post_mime_type] => [comment_count] => 0 [filter] => raw ) [8] => WP_Post Object ( [ID] => 27725 [post_author] => 6080 [post_date] => 2020-04-03 09:16:30 [post_date_gmt] => 2020-04-03 09:16:30 [post_content] => [post_title] => Advanced Motion Controls is still operational [post_excerpt] => [post_status] => publish [comment_status] => closed [ping_status] => closed [post_password] => [post_name] => advanced-motion-controls-is-still-operational [to_ping] => [pinged] => [post_modified] => 2022-04-04 10:19:11 [post_modified_gmt] => 2022-04-04 10:19:11 [post_content_filtered] => [post_parent] => 0 [guid] => https://www.kvaser.com/?p=27725 [menu_order] => 0 [post_type] => post [post_mime_type] => [comment_count] => 0 [filter] => raw ) [9] => WP_Post Object ( [ID] => 27723 [post_author] => 6080 [post_date] => 2020-04-03 09:08:26 [post_date_gmt] => 2020-04-03 09:08:26 [post_content] => [post_title] => Dedicated Computing has 'essential industry' status. [post_excerpt] => [post_status] => publish [comment_status] => closed [ping_status] => closed [post_password] => [post_name] => dedicated-computing-has-essential-industry-status [to_ping] => [pinged] => [post_modified] => 2022-04-04 10:19:11 [post_modified_gmt] => 2022-04-04 10:19:11 [post_content_filtered] => [post_parent] => 0 [guid] => https://www.kvaser.com/?p=27723 [menu_order] => 0 [post_type] => post [post_mime_type] => [comment_count] => 0 [filter] => raw ) ) [post_count] => 10 [current_post] => -1 [in_the_loop] => [post] => WP_Post Object ( [ID] => 28158 [post_author] => 910 [post_date] => 2020-05-28 22:00:49 [post_date_gmt] => 2020-05-28 22:00:49 [post_content] => [vc_row][vc_column][vc_column_text]A few of the customers I’ve worked with over the last few years have indicated a need to analyze a limited number of CAN signals within an SAE J1939 data stream. Although Kvaser has many partner companies that offer plenty of powerful choices for CAN analysis software, it is sometimes desirable to graph a signal with the tools we have. For a student with a one-time need, or an engineer from a small company who just wants to understand a signal on a CAN bus, this method would have value. [/vc_column_text][vc_column_text]In this paper I will present a method to capture and analyze a CAN signal, buried within a CAN frame, using Microsoft Excel, Notepad, and Kvaser’s free CanKing software. These are tools most of us already have, or in the case of CanKing, can download free from the Kvaser website.[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column width="2/3"][vc_column_text]By using this method to initially analyze a signal, an engineer will gain additional insight into the inner workings of CAN and J1939, as well as an understanding of the .dbc file and how it is used by other applications. Although I use a J1939 signal as an example in this paper, the method I am using is applicable to any signal-based CAN protocol including CANOpen, RVC, NMEA 2000®, and many more. While the method shown uses Excel and Notepad, there are other Spreadsheet and Text Editor programs that will accomplish the same thing.[/vc_column_text][vc_column_text]The intention of this paper is not to detract from the many very powerful CAN analysis tools already available to customers through our partner network. Many of these tools have built in support of high-level protocols like J1939 and CANOpen, with powerful graphical and signal analysis capabilities that include the ability to analyze high data volumes (‘big data’). The method presented here will show that with a few simple tools and a need for limited analysis, an engineer may be able to get what they want with the tools they already have on their desktop.[/vc_column_text][vc_column_text]This method also has limitations well beyond those of the dedicated software sold by Kvaser partners. These limitations prevent, or at least greatly complicate, signal analysis in the case of variable length Diagnostic Messages (DMs), Transport Protocol Frames, and multiplexed data frames. In any of these cases a dedicated CAN analysis package will be required, or at least highly desired, in order to properly analyze signals within the data stream. [/vc_column_text][/vc_column][vc_column width="1/3"][vc_well_raket images="40359" meta="WHITE PAPER" title="CAN Signal Analysis with Spreadsheets and Kvaser’s CanKing" button_title="Download PDF" post_id="https://www.kvaser.com/training-materials/#?trainingSearch=CAN%20signal%20analysis"][/vc_well_raket][/vc_column][/vc_row][vc_row][vc_column][vc_column_text]Prerequisites for this method:[/vc_column_text][vc_column_text]
  • Be capable of capturing raw CAN data in Hexadecimal ('hex') or Decimal format, or have access to the raw CAN data you want to analyze, and be able to transfer that data into a .txt file. This will be shown using Kvaser’s CanKing software, free and available at https://www.kvaser.com/download/.
  • Access to Microsoft Excel or equivalent, with a basic understanding of how to use the Filters function within your spread sheet software.
  • Know what data you want to see, or have a .dbc file or a specification showing where to find the signal you’re looking for within the CAN frame, and know how that signal is formatted within the message
[/vc_column_text][vc_column_text]The steps we will follow are:
  1. Capture the data with CanKing, and save it to a text file with Notepad
  2. Open Excel and import the data from the text file
  3. Format the data to be in separate columns
  4. Filter the data to find the CAN frames of interest
  5. Isolate the data bytes to be analyzed
  6. Convert the data to a graphable format
  7. Create a graph showing the signal of interest
[/vc_column_text][vc_separator_raket][/vc_column][/vc_row][vc_row][vc_column][vc_header_raket header_type="h3" header="1. Capture and save data with CanKing"][vc_column_text]If Kvaser’s CanKing is not already loaded and working on your computer, download it and the Kvaser Drivers for Windows, both found in the Downloads section of www.kvaser.com. You can use any Kvaser interface such as the Kvaser Leaf Light HS v2, a Kvaser USBcan, or a Kvaser Memorator to capture data for analysis. There are many ways you can do this from CanKing. If you are capturing J1939 data you should go to the Select Formatter window and select the J1939 Formatter, by putting this formatter in the Active Formatters section of the window and checking the box next to it.  This will allow your data to be formatted as in Figure 2. Once you have connected to your CAN bus and can see the data, you can use the Log To Text File window to start and stop logging, then save the file to your projects working directory.[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column][vc_single_image image="40442" img_size="full"][vc_column_text]

Figure 1. Log to Text File, a Window within Kvaser CanKing

[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column][vc_column_text]Figure 1 shows Kvaser CanKing’s Log To Text File window that will allow the user to capture the CAN data that is to be analyzed. Confirm that you are connected to the CAN bus and seeing the data in CanKing by selecting the Start Run button in the Kvaser CanKing main window. The data that is going to be captured is what you see in the Output Window of CanKing. The data will look something like this, when viewed with a text editor like NotePad:[/vc_column_text][vc_code_raket language="t" code="V2luTm8lMjBQJTIwJTIwJTIwUEdOJTIwU0ElMjAlMjBEQSUyMEZsZyUyMCUyMCUyMExlbiUyMCUyMEQwLi4uMS4uLjIuLi4zLi4uNC4uLjUuLi42Li5ENyUyMCUyMCUyMCUyMCUyMCUyMFRpbWUlMjAlMjAlMjBEaXIlMEFDQU4lMjAxJTIwNiUyMDBGMDA5JTIwMEItJTNFJTJBJTIwJUMyJUEwJTIwJUMyJUEwJTIwJUMyJUEwJTIwJUMyJUE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CVDMiVBMCUyMDdEJTIwJUMyJUEwJTIwJUMyJUEwJTIwMjE3LjExNzU4MCUyMFIlMEElMEFDQU4lMjAxJTIwMyUyMDBGMDA0JTIwMDAtJTNFJTJBJTIwJUMyJUEwJTIwJUMyJUEwJTIwJUMyJUEwJTIwJUMyJUEwJTIwOCUyMCVDMiVBMCUyMDYwJUMyJUEwJTIwN0QlQzIlQTAlMjA4NCVDMiVBMCUyMDU0JUMyJUEwJTIwMTQlQzIlQTAlMjAwMCVDMiVBMCUyMEYwJUMyJUEwJTIwODQlMjAlQzIlQTAlMjAlQzIlQTAlMjAyMTcuMTI2OTMwJTIwUiUwQSUwQUNBTiUyMDElMjA2JTIwMEYwMDklMjAwQi0lM0UlMkElMjAlQzIlQTAlMjAlQzIlQTAlMjAlQzIlQTAlMjAlQzIlQTAlMjA4JTIwJUMyJUEwJTIwN0QlQzIlQTAlMjA3QSVDMiVBMCUyMDYwJUMyJUEwJTIwODMlQzIlQTAlMjA3RCVDMiVBMCUyMDQ3JUMyJUEwJTIwN0QlQzIlQTAlMjA3RCUyMCVDMiVBMCUyMCVDMiVBMCUyMDIxNy4xMjc3NzAlMjBSJTBBJTBBQ0FOJTIwMSUyMDYlMjAwRkY2MCUyMDRELSUzRSUyQSUyMCVDMiVBMCUyMCVDMiVBMCUyMCVDMiVBMCUyMCVDMiVBMCUyMDglMjAlQzIlQTAlMjAwMCVDMiVBMCUyMDAwJUMyJUEwJTIwMDAlQzIlQTAlMjBGRiVDMiVBMCUyMEZGJUMyJUEwJTIwRkYlQzIlQTAlMjBGRiVDMiVBMCUyMEZGJTIwJUMyJUEwJTIwJUMyJUEwJTIwMjE3LjEzMTcxMCUyMFI="][vc_column_text]Figure 2. Sample J1939 data captured with CanKing[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column][vc_column_text]In this simple case, all the CAN frames have eight data bytes. The signal I’m going to analyze is a periodic signal of 10 msec, and I’ll graph a few seconds worth of data. At this point you should have the data stream you want to analyze in a .txt file in a working directory on your computer.[/vc_column_text][vc_raw_html]JTNDYnIlMjAlMkYlM0U=[/vc_raw_html][/vc_column][/vc_row][vc_row][vc_column][vc_header_raket header_type="h3" header="2. Open Excel and Import the data"][vc_column_text]The goal of this step is to get your data into Excel so we can manipulate it with the Filter functions and isolate the data we want to analyze. Other spread sheet programs will also work if they have filters, functions, and graphing capabilities, similar to Excel. It is up to the reader to determine if using a different application is best for them, and find similar functions that will accomplish the conversions. Open Microsoft Excel with a blank worksheet and select File, Open and Browse. In the lower right hand corner of your navigation box you’ll have to select All Files (*.*) so that your .txt file can be opened. Navigate to your working directory and find and select the .txt file you created in step 1 above. Your display will look something like this:[/vc_column_text][vc_single_image image="40443" img_size="full"][vc_column_text]

Figure 3. Selecting a .txt file to open within Excel

[/vc_column_text][vc_column_text]

Select the .txt file you created in step 1 and open it.

[/vc_column_text][vc_raw_html]JTNDYnIlMjAlMkYlM0U=[/vc_raw_html][/vc_column][/vc_row][vc_row][vc_column][vc_header_raket header_type="h3" header="3. Format the data to be in separate columns:"][vc_column_text]Once you have selected your .txt file and attempted to open it with Excel, you will see the Text Import Wizard as shown in Figure 4.  There are different ways you can import your CAN data into Excel using the Text Import Wizard, and many of them will work to some extent.  One way or the other you will most likely have to edit your data and/or headers to make it graph properly.  [/vc_column_text][vc_single_image image="40444" img_size="full"][vc_column_text]

Figure 4. The Text Import Wizard

[/vc_column_text][vc_column_text]This Wizard gives you a quick and easy way to convert your .txt data into Excel format. Follow these steps to convert your data:
  1. Under Choose the file type that best describes your data: select Delimited.
  2. Next to Start import at row: select the first row that has your CAN data; in my case it’s the second row. Some data monitors put in headers and you just want to filter those headers out. You can add them back in later with Excel.
  3. Press Next >.
  4. In the second window under Delimiters select Space.
  5. Press Next >.
  6. Press Finish.
You should now have an Excel Worksheet open that shows your CAN frames separated in columns for Identifier, Flag, DLC and data bytes. You will also have columns for Time and Direction. If you kept your column headers above your data, make sure the headers are lined up correctly with the data. Sometimes the headers get shifted by one or two columns in the conversion process. If you didn’t keep your column headers above your data, you should add them back in now.  The column names I used are Type, Ch, Pri, PGN, SA/DA, DLC, D1, D2, D3, D4, D5, D6, D7, D8, Time, and Dir. Here is what the first few lines of my spread sheet look like after I added the column headers:[/vc_column_text][vc_single_image][vc_column_text]

Figure 5. My spreadsheet so far.

[/vc_column_text][vc_column_text]My data consist of only eight-byte frames, so everything lines up nicely under the headers I entered on the first row. If your data has some frames with different DLCs things will not line up as nicely for you. Don’t worry about this, because you’re going to be graphing one PGN at a time, and at this level a given PGN has a fixed DLC, almost always eight bytes.[/vc_column_text][vc_raw_html]JTNDYnIlMjAlMkYlM0U=[/vc_raw_html][/vc_column][/vc_row][vc_row][vc_column][vc_header_raket header_type="h3" header="4. Filter the data to find the CAN frames of interest"][vc_column_text]This is where you need to know what data you’re looking for and where this data is located within the CAN frame. In J1939 as well as other CAN based protocols, the Data portion of the CAN frame is usually used to communicate more than one signal. Different protocols use different names for things like massages and signals. I’m going to use J1939 terminology when possible, and try to keep it consistent. In J1939 talk, a signal is an informal way to refer to an SP, or a Suspect Parameter. To identify a signal, you use a Suspect Parameter Number, or SPN.  A group of signals make up a Parameter Group, or PG, and a PG is identified by a Parameter Group Number, or PGN.  For the example we’re going to use, a PG is going to fit into one CAN frame.  This is not always the case, sometimes a PG is spread across multiple CAN frames by using Transport Protocol, but that’s a subject for a later write-up. In my example we’re going to analyze a signal called Engine Speed. Details of this signal can be found in the SAE J1939DA, or Digital Annex. Engine Speed is identified as SPN 190 and some of the details from the Digital Annex are shown below:[/vc_column_text][vc_single_image image="40446"][vc_column_text]

Table 1. Information obtained from the SAE J1939DA specification

[/vc_column_text][vc_column_text]Table 1 gives us everything we need to know to graph Engine Speed from the data we have collected, but first we must be able to filter the data to find only what we are interested in.  The key here is the PGN, 61444.  This is represented as a decimal number so converting to hexadecimal gives us 0x0F004. This is the PGN we want to isolate so we can graph SPN 190, because this is the PGN that contains SPN 190. The format is in hexadecimal just as it is shown in Figure 6 column D. Figure 6 also shows that I have turned on the Filter function. I can now Filter column D for the data I want to graph.[/vc_column_text][vc_single_image image="40445" img_size="full"][vc_column_text]

Figure 6. Excel Spread Sheet with filtering turned on, showing all data

[/vc_column_text][vc_column_text]If you have not previously used the Filters within Excel, click on the Data tap at the top in Excel, and find Filter. Highlight the top row of the data (the headers row) then turn the Filter function on and you will see small boxes in each column of the top row of your spread sheet with down arrows in them.  Select the arrow over the column PGN and you should see a box come down as in Figure 7. Uncheck the (Select All) box, and then select just the message you want to filter on, in this case 0F004.  Select OK and you will have filtered on the data you want to see. Your spread sheet will now be showing only the CAN frames containing the message with the signal we want to graph, SPN 190, Engine Speed.[/vc_column_text][vc_single_image image="40446" img_size="full"][vc_column_text]

Figure 7. Excel Spread Sheet with filtering turned on, showing only Engine Speed PGN

[/vc_column_text][vc_raw_html]JTNDYnIlMjAlMkYlM0U=[/vc_raw_html][/vc_column][/vc_row][vc_row][vc_column][vc_header_raket header_type="h3" header="5. Isolate the data bytes to be analyzed"][vc_column_text]Our spread sheet is showing only the CAN frames containing the data we want to graph, so now it’s time to isolate the signal we want.[/vc_column_text][vc_single_image image="40447" img_size="full"][vc_column_text]Figure 8.[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column][vc_column_text]Going back to Table 1, we can see that Engine Speed is a two-byte signal contained in position 4 and 5, or according to our headers, D4 and D5. Since this is a two-byte signal we must consider byte order before we do any calculations on the data. Figure 8 shows a cut from our filtered data with D4 and D5 highlighted in Yellow. Just by looking at the data it’s easy to answer the question about byte order. We can see that the least significant byte is in D4 and is transmitted first. We know this because it’s the byte that’s changing the most, and we can see it’s driving D5 up by one when it rolls over. If we look at the first line of data in Figure 8, and look at Engine Speed as a single number, we can write the hexadecimal value of Engine Speed as 0x1466. We have now isolated SPN 190 within the data that was captured from the CAN bus. It is isolated to D4 and D5 in PGN 0x0F004, or PGN 61444. Some SPNs are less than one byte, and in some cases, they’re combined with other SPNs in the same byte. If this were the case for the SPN we were interested in, it would require some more Excel functions like masking and shifting. Spreadsheets offer many mathematical functions that can be applied to the data in many creative ways. It’s up to the reader to find a way to use those functions to isolate whatever specific data they’re interested in graphing.[/vc_column_text][vc_raw_html]JTNDYnIlMjAlMkYlM0U=[/vc_raw_html][/vc_column][/vc_row][vc_row][vc_column][vc_header_raket header_type="h3" header="6. Convert the data to a graphable format"][vc_column_text]The only other things we must consider for this signal before graphing it is the resolution and the offset. Resolution is the term used in the SAE J1939DA, to describe the scaling factor to be applied to a signal so that it is displayed in an understandable and readable way. If you are using the Kvaser Database Editor 3 software, also free and downloadable from kvaser.com/download/ to extract this information from a .dbc file, the term that is used is Factor. Table 1 shows the resolution equal to 0.125 rpm per bit, and the offset equal to zero. Follow the steps below to calculate Engine Speed in RPMs, from the raw data that is transmitted:
  1. Convert the two-byte SPN 190 to a decimal number, ex. 0x1466 = 5,222.
  2. Multiply this number by the resolution, or what I call scaling: (5,222 bits) x (0.125 rpm/bit) = 652.75 rpm
  3. Apply the offset, in this case zero, so the final value is 652.75 rpm
With the power of the spreads sheet we can easily make this calculation for all the samples of the signal we want to graph.  The first thing to do is to add a blank column to the right of the column D5. Once this column is in, we can use it to calculate RPMs with the steps above. If this is not clear you should review the Functions capabilities within Excel by going to a blank cell and typing “=”, then clicking on fx up by the menu bar. My data is in columns J and K, so here is the function I am going to enter into the first block of my new column under the header row: =HEX2DEC(CONCAT(K3,J3))*0.125 This single line will concatenate our two bytes of data in the correct order (K3 first then J3), convert from hexadecimal to decimal, then multiple by our scaling value, all in one easy equation. Perform this calculation by using the auto fill function in Excel to populate the new column for all the data we want to graph.  If you haven’t used auto fill before you should go to the Help menu within Excel to see how to use it. After you use auto fill to fill all the cells you want to graph, you will have a graphable number for Engine Speed, alone in a column within your spread sheet, ready to be graphed.[/vc_column_text][vc_raw_html]JTNDYnIlMjAlMkYlM0U=[/vc_raw_html][/vc_column][/vc_row][vc_row][vc_column][vc_header_raket header_type="h3" header="7. Create a graph showing the data of interest"][vc_column_text]From this point on it’s just a matter of using the graphing functions in Excel to graph one column of data. The column you want to graph is the column you created with the concatenate (CONCAT) function and the hexadecimal to decimal (HEX2DEC) conversion function. You can select the entire column that was created in step 6 above, or just select a portion of it. Next select Insert from the menu bar to Insert Line or Area Chart, and this will give you a graph of the signal you’re interested in. A graph generated from a portion of my data is shown in Figure 9.[/vc_column_text][vc_single_image image="40448" img_size="full"][vc_column_text]

Figure 9. Engine Speed as it appears in my data

[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column][vc_column_text]I have labeled this graph SPN 190, and have done nothing else to it after creating it with the Insert Line or Area Cart Function. Spreadsheet programs have many powerful functions and ways of creation graphs, showing different signals in many different ways, and this procedure allows an engineer or technician to use these powerful features on most data captures on a CAN bus, provided they have a specification or .dbc file showing where that data is and how it is formatted.[/vc_column_text][vc_column_text]This paper is meant to show a method of using non-specific software tools to help understand signals in a CAN data stream. Each step requires knowledge beyond what is explained here, but it is not the individual steps that are of interest. It is my hope that the general method, whether applied as in the example here, or using other software, will have value to readers who want to gain a more in-depth knowledge of CAN and how signals are transmitted using CAN.[/vc_column_text][/vc_column][/vc_row] [post_title] => CAN Signal Analysis with Spreadsheets and Kvaser’s CanKing SAE J1939 Example [post_excerpt] => [post_status] => publish [comment_status] => closed [ping_status] => closed [post_password] => [post_name] => can-signal-analysis-with-spreadsheets-and-kvasers-canking-sae-j1939-example [to_ping] => [pinged] => [post_modified] => 2022-12-08 12:02:23 [post_modified_gmt] => 2022-12-08 12:02:23 [post_content_filtered] => [post_parent] => 0 [guid] => https://www.kvaser.com/?post_type=developer_blog&p=28158 [menu_order] => 0 [post_type] => developer_blog [post_mime_type] => [comment_count] => 0 [filter] => raw ) [comment_count] => 0 [current_comment] => -1 [found_posts] => 469 [max_num_pages] => 47 [max_num_comment_pages] => 0 [is_single] => [is_preview] => [is_page] => [is_archive] => [is_date] => [is_year] => [is_month] => [is_day] => [is_time] => [is_author] => [is_category] => [is_tag] => [is_tax] => [is_search] => [is_feed] => [is_comment_feed] => [is_trackback] => [is_home] => 1 [is_privacy_policy] => [is_404] => [is_embed] => [is_paged] => 1 [is_admin] => [is_attachment] => [is_singular] => [is_robots] => [is_favicon] => [is_posts_page] => 1 [is_post_type_archive] => [query_vars_hash:WP_Query:private] => 1fd9c0869a4e097c2730490e942a1a27 [query_vars_changed:WP_Query:private] => 1 [thumbnails_cached] => [stopwords:WP_Query:private] => [compat_fields:WP_Query:private] => Array ( [0] => query_vars_hash [1] => query_vars_changed ) [compat_methods:WP_Query:private] => Array ( [0] => init_query_flags [1] => parse_tax_query ) )

News and Events

CAN Signal Analysis with Spreadsheets and Kvaser’s CanKing SAE J1939 Example

CAN Signal Analysis with Spreadsheets and Kvaser’s CanKing SAE J1939 Example

28/05/2020

A few of the customers I’ve worked with over the last few years have indicated a need to analyze a… Read More

Read More
Applying a J1939 DBC file and building a simple test script in CanKing

Applying a J1939 DBC file and building a simple test script in CanKing

21/05/2020

In the previous post I introduced some of the free software downloads from Kvaser, and gave an example of how… Read More

Read More
GEMAC’s CANvision now supports Kvaser interfaces

GEMAC’s CANvision now supports Kvaser interfaces

19/05/2020

GEMAC is supporting Kvaser CAN interfaces in the latest version of its CANvision protocol monitor, version 1.3.4.1. The bus monitoring… Read More

Read More

TKE’s CANtrace 3.17 includes more J1939 functionality

15/05/2020

Read More

Read More
High voltage test and measurement specialist joins Kvaser’s TA network

High voltage test and measurement specialist joins Kvaser’s TA network

30/04/2020

Kvaser AB has signed a Technical Associate (TA) agreement with test and measurement specialist, Klaric GmbH & Co. KG. The… Read More

Read More
Tools to help you work remotely

Tools to help you work remotely

13/04/2020

No doubt like you, our development team is adapting to the current situation by working more from home. Conscious that… Read More

Read More
Beginner’s Guide to Using Kvaser’s Virtual Drivers

Beginner’s Guide to Using Kvaser’s Virtual Drivers

13/04/2020

If you are interested in developing a Controller Area Network (CAN) project from home using tools available to you today,… Read More

Read More

CAN, CAN FD, and LIN Network Analysis In One Tool From Warwick

08/04/2020

Warwick Control Technologies has released a new version of the powerful network analysis tool X-Analyser (version 3.12.0).  This now provides… Read More

Read More

Advanced Motion Controls is still operational

03/04/2020

Read More

Read More

Dedicated Computing has ‘essential industry’ status.

03/04/2020

Read More

Read More