Quick Introduction to CANalyzer Version 1.1 2009-09-08 Application Note AN-AND-1-110 Restrictions Abstract Public Document This application note focuses on quickly learning several key CANalyzer skills. The aim is to move first time users up the curve rapidly by focusing on the tool architecture and key operational features of CANalyzer. Table of Contents 1.0 2.0 3.0 4.0 5.0 6.0 6.1 6.1.1 6.1.2 6.1.3 6.1.3.1 6.1.3.2 6.1.3.3 6.1.3.4 6.1.3.5 6.1.3.6 6.1.3.7 6.1.4 6.1.4.1 6.1.4.2 6.1.4.3 7.0 8.0 9.0 Overview ..........................................................................................................................................................1 The Downloadable Demo ................................................................................................................................2 Before We Start ...............................................................................................................................................2 Loading CANalyzer ..........................................................................................................................................2 Starting Measurement......................................................................................................................................2 CANalyzer Tool Architecture ...........................................................................................................................2 The Measurement Setup Window.................................................................................................................2 Data Flow....................................................................................................................................................3 Hardware Setup Block ................................................................................................................................3 Analysis Blocks...........................................................................................................................................4 The Trace Window ...................................................................................................................................4 The Statistics Window..............................................................................................................................5 The Bus Statistics Window ......................................................................................................................5 The Data Window.....................................................................................................................................6 The Graphics Window..............................................................................................................................6 Logging Block...........................................................................................................................................7 The Write Window....................................................................................................................................7 Application Expansion Blocks.....................................................................................................................8 Program Block..........................................................................................................................................8 Interactive Generator Block .....................................................................................................................9 Filters .......................................................................................................................................................9 Network Databases..........................................................................................................................................9 Panels ............................................................................................................................................................10 Contacts .........................................................................................................................................................11 1.0 Overview Since many potential customers initially experience CANalyzer by obtaining the downloadable demo version from the Internet, learning can be difficult without a guide or documentation. This application note seeks to allow firsttime network tool users to gain the skills needed to quickly become productive with Vector CANalyzer. After this simple walk-through, the user may be pleasantly surprised as to what this tool can do for CAN development efforts. Many companies which thought that a company-specific custom tool would be necessary are realizing that the programmable CANalyzer can handle customer requirements beyond original expectations. Copyright © 2009 - Vector CANtech, Inc. Contact Information: www.vector-cantech.com or 1-248-449-9290 1 Quick Introduction to CANalyzer 2.0 The Downloadable Demo The downloadable demo is a usable working copy of the programmable version of CANalyzer. It does not run on a real CAN bus, but the user can do four important things with it: • • • • Learn the basic operation of CANalyzer. Create a user-specific application or test. Create a set of messages and define specific data content. Reuse all work, configurations and program blocks in a licensed CANalyzer. 3.0 Before We Start CANalyzer is user-configurable tool that can be setup to fit a user-specific application. The settings for each application can be saved into a configuration file (*.cfg) for reusability. Once CANalyzer is installed, a list of demo configurations is also installed for users to experience. Seeing how these demo configurations are put together is great way to learn the CANalyzer tool. 4.0 Loading CANalyzer Typically, the user would use Windows’ Start menu and navigate to the CANalyzer shortcut to load the tool. If CANalyzer is loaded for the first time, a blank configuration will be opened; otherwise, the last loaded configuration will open. Via the Windows’ Start menu, a list of demo configurations is also available for loading. Most of the figures in this document are made with the CANMainDemo.cfg. 5.0 Starting Measurement After a CANalyzer configuration is made or an existing configuration is loaded (including the demo configurations), the user may start the measurement by clicking on the “lightning bolt” icon on the toolbar. During a measurement, all settings within the configuration are executed. If the CANalyzer is connected to a real CAN bus, CAN data are now being transmitted, filtered, logged, graphed, statistically analyzed, etc. To stop the measurement, the “stop sign” icon on the toolbar is used. Once the measurement is stopped, the user may reconfigure any settings within CANalyzer to fit their application. If the CANalyzer tool is not connected to a real CAN bus, the measurement may still be run and settings are still configurable. This provides a great opportunity to learn the tool. 6.0 CANalyzer Tool Architecture The beginner should first understand the architecture of the CANalyzer tool as it contains quite a few windows depending on the user application. Regardless of the number of windows displayed or the settings of the configuration, there is one centralized window that summarizes/organizes them all with a data flow plan – the Measurement Setup Window. 6.1 The Measurement Setup Window The Measurement Setup window shows the architectural model of CANalyzer. With the measurement stopped, it is possible for the user to create and modify any settings in the CANalyzer configuration via the Measurement Setup window and then run the measurement to see changes take effect. The changes will not be saved until the user selects Save from the toolbar or menu. Application Note AN-AND-1-110 2 Quick Introduction to CANalyzer Figure 1 – The CANalyzer Measurement Setup Window The Measurement Setup window consists of several blocks with connecting lines. Users may create new blocks or modify existing blocks to fit their application needs by right-clicking on the blocks. 6.1.1 Data Flow The lines connecting the blocks within the Measurement Setup window show the direction of data flow from block to block. At any given time, the data always flow from the left-most block to the blocks on the right as depicted by the arrows. Data never flows from any given block to neighbors to the left except to the Send block. The user doesn’t have to draw and connect the lines to a block. The lines are drawn automatically once the block is created. 6.1.2 Hardware Setup Block The left-most block, containing the circuit board icon, is the first block a user typically configures when a new CANalyzer configuration is created. By right-clicking on this block, the user may configure the settings of each bus channel connection (bus rate, acknowledgment on/off, sampling point, etc). Application Note AN-AND-1-110 3 Quick Introduction to CANalyzer In the Measurement Setup window, this block also represents the hardware interface card for CANalyzer. It receives data from the physical bus and provides data to transmit onto the physical bus (via the Send block). Note: If data needs to be transmitted onto the physical bus, the blocks that transmit the data must be located on the vertical line above the Send block. 6.1.3 Analysis Blocks On the right side of the Measurement Setup window, there are six types of analysis blocks used for evaluating data that has been transmitted or received. The user can define more than one instance of these blocks (with the exception of the Bus Statistics block). For example, two Trace blocks can be defined, one for each channel CANalyzer is connected to. To toggle these analysis blocks on and off, double-click on the small blue square to the left of the analysis block. The analysis blocks will open the corresponding window (except Logging block) when double-clicked. 6.1.3.1 The Trace Window The Trace window shows the messages detected on the bus. Every message is time stamped and the identifier, message type, data length, and any associated data bytes are indicated. Figure 2 – The Trace Window Experiment with all of the associated toolbar buttons and observe the effects. Notice that the hex data are interpreted into symbolic names with physical values. CANalyzer made this possible with a database file created by the CANdb++ tool, which comes with CANalyzer. Application Note AN-AND-1-110 4 Quick Introduction to CANalyzer 6.1.3.2 The Statistics Window The Statistics window shows a graphical view of the frequency of each message transmitted or received. When activated, a statistical report can be displayed in the Write window showing the minimum/maximum transmission time and standard deviation for each message. Figure 3 – The Statistics Window 6.1.3.3 The Bus Statistics Window The Bus Statistics window shows the statistical information for the entire network: the total composite message rate, total number of messages, the average and maximum bus utilization. Figure 4 – The Bus Statistics Window Application Note AN-AND-1-110 5 Quick Introduction to CANalyzer 6.1.3.4 The Data Window The Data window is a signal-oriented window that displays the signal data in detail. The user needs to select which signals to display, either by dragging and dropping from another window, or right-clicking to add a signal from the database. Figure 5 – The Data Window The user may also configure this window to show bus statistics information and log all data within the window to a file. 6.1.3.5 The Graphics Window The Graphics window is another signal-oriented window that shows a graphical representation of user-selected signals. The user also has to select the signals to be graphed either by right-clicking on the window or dragging and dropping the signal from another analysis window. To configure the display settings of this window, an associated toolbar provides a number of analysis features or the user may right-click on the Graphics window to get to a more detailed configuration window. Figure 6 – The Graphics Window User may also configure this window to graph bus statistics information and log all data within the window to a file. Application Note AN-AND-1-110 6 Quick Introduction to CANalyzer 6.1.3.6 Logging Block The Logging block on the Measurement Setup window does not come with a corresponding window showing the message data being logged because the Trace window already does that. By right-clicking on the Logging block, the user may set one or more logging trigger conditions. The trigger condition can be based on parameters from bus statistics, message identifiers and hex data bytes, signal values, bus events such as error frames, etc. 6.1.3.7 The Write Window The Write window is a text output window and it is not represent by a block on the Measurement Setup window. It is used to indicate major CANalyzer operational modes, such as measurement start and end times and detected hardware warning conditions. This window is also shared with potential behavior designed into a Program block if text information is to be output during program execution. Programmers can use the CAPL write("text") function to directly output text to this window. Figure 7 – The Write Window Application Note AN-AND-1-110 7 Quick Introduction to CANalyzer 6.1.4 Application Expansion Blocks In the Measurement Setup window, an expansion block may also be added into the area where there is a small blue square (such as the ones to the left of the analysis blocks). An expansion block provides the ability to refine the configuration to meet the application needs. The expansion block is inserted by right-clicking on the location of a small blue square. To configure the expansion block, double-click on it. If the expansion block no longer applies to the application, the user may remove it or simply disable it (the block would look grey-out with an “X”). Figure 8 – Measurement Setup Window with Expansion Blocks 6.1.4.1 Program Block Probably the most common expansion block is the Program block or simply "P” block. The “P” block is a programmable block that is typically used for simulating the behavior of an ECU or complex analysis algorithms. The programming language used within this block is a C-like language called CAPL (Communication Access Programming Language). Application Note AN-AND-1-110 8 Quick Introduction to CANalyzer The user may develop, edit, compile, and save “P” blocks within the CANalyzer environment. “P” blocks may be reused in other CANalyzer configurations, and are saved as *.CAN files. 6.1.4.2 Interactive Generator Block For users who do not know how to program in CAPL. and would like to transmit a message onto the physical bus, then the Interactive Generator block or simply “IG” block is used. The “IG” block is also the easiest way to setup CANalyzer to transmit a message. It is commonly used for wakeup messages and static periodic messages. This block can be configured on-the-fly while the measurement is running for users that require live interaction with the physical bus. 6.1.4.3 Filters When dealing with a physical bus, there could be hundreds of messages to work with. Also equipped with the Measurement Setup window are filter blocks. Filter blocks since as Pass Filter (“PF”) or Stop Filter (“SP”) and allow the user to filter by message names, message IDs or range of IDs, and network node. If filtering by channel is desired, the user may insert a Channel Filter that filters based on channel number. CANalyzer supports up to 32 channels (any combination of CAN, LIN, MOST, or FlexRay-based channels). 7.0 Network Databases CANalyzer supports all native database formats for all CAN (*.DBC), LIN (*.LDF and *.NCF), MOST (*.XML), and FlexRay (*.XML) networks. These databases are required for interpreting raw hex data into physical data units with signal names. For CAN networks, CANalyzer is bundled with a tool called the CANdb++ Editor. This editor allows any user to create or modify an existing database. To open this editor, click on the icon with the four little red squares on the toolbar or go to the File menu. Figure 9 – The CANdb++ Database Editor Application Note AN-AND-1-110 9 Quick Introduction to CANalyzer The CANdb++ Editor allows the user to do all of the following: 1 2 3 4 5 6 7 8 9 10 Define nodes Define messages Define message names with specific identifiers Define the message size Define message data items (also known as signals) Define data items or signal names Define the position of data items or signals in a CAN message Define the size of a data item or signal Define the physical units of a signal, if appropriate Define symbolic values for a signal, if appropriate It is interesting to note that at many companies which use the CANalyzer platform, the CANdb database files are often developed by a systems design group and made available corporate wide. 8.0 Panels CANalyzer also allows panel creation with the bundled Panel Designer tool. For most users, these panels are created to give an image representation of network signals once they are transmitted or received. These panels can be created without any programming efforts in the Panel Designer by clicking on the “pencil on a gauge” icon on the CANalyzer toolbar or File menu. Figure 10 – Panel Example Application Note AN-AND-1-110 10 Quick Introduction to CANalyzer 9.0 Contacts Germany and all countries not named below: Vector Informatik GmbH Ingersheimer Str. 24 70499 Stuttgart GERMANY Phone: +49 711-80670-0 Fax: +49 711-80670-111 Email: info@vector-informatik.de France, Belgium, Luxemburg: Vector France SAS 168 Boulevard Camélinat 92240 Malakoff FRANCE Phone: +33 1 42 31 40 00 Fax: +33 1 42 31 40 09 Email: information@vector-france.fr Sweden, Denmark, Norway, Finland, Iceland: VecScan AB Theres Svenssons Gata 9 41755 Göteborg SWEDEN Phone: +46 31 764 76 00 Fax: +46 31 764 76 19 Email: info@vecscan.com United Kingdom, Ireland: Vector GB Ltd. Rhodium Central Boulevard Blythe Valley Park Solihull, Birmingham West Midlands B90 8AS UNITED KINGDOM Phone: +44 121 50681-50 Email: info@vector-gb.co.uk USA, Canada, Mexico: Vector CANtech, Inc. 39500 Orchard Hill Pl., Ste 550 Novi, MI 48375 USA Phone: +1 248 449 9290 Fax: +1 248 449 9704 Email: info@vector-cantech.com Application Note AN-AND-1-110 Japan: Vector Japan Co. Ltd. Seafort Square Center Bld. 18F 2-3-12, Higashi-shinagawa, Shinagawa-ku Tokyo 140-0002 JAPAN Phone: +81 3 5769 7800 Fax: +81 3 5769 6975 Email: info@vector-japan.co.jp Korea: Vector Korea IT Inc. #1406, Mario Tower, 222-12 Guro-dong, Guro-gu Seoul, 152-848 REPUBLIC OF KOREA Phone: +82 2 2028 0600 Fax: +82 2 2028 0604 Email: info@vector-korea.com 11