How to edit States and State Groups Version 1.2 2008-09-23
Transcription
How to edit States and State Groups Version 1.2 2008-09-23
How to edit States and State Groups Version 1.2 2008-09-23 Application Note AN-IDG-1-005 Author(s) Restrictions Abstract Huber, Carsten Public Document This application note describes how to edit and use states and state groups of a CANdelaStudio document. Table of Contents 1.0 1.1 1.2 1.3 1.4 1.5 2.0 3.0 4.0 Overview ..........................................................................................................................................................1 Session State Group .....................................................................................................................................1 Security State Group .....................................................................................................................................2 Graphical Representation of States ..............................................................................................................2 Editing State Transitions ...............................................................................................................................3 Defining Default State Transitions.................................................................................................................3 Automatic Setting of State Transitions.............................................................................................................4 Additional Resources .......................................................................................................................................4 Contacts ...........................................................................................................................................................4 1.0 Overview This application note describes how to edit and use states and state groups of a CANdela document. Setting states and state transitions properly is essential if you want to create automatic tests with CANoe Option DiVa. Executing a service generally causes a state change in the ECU. Some services may only be executed if the ECU is in a particular state. For this, CANdelaStudio offers the opportunity to define and edit global states and state transitions on the services of a diagnostic instance. States can further be combined into state groups to describe the state machine defined by services, states and state transitions. CANdelaStudio supports two state groups with special semantics: “Session” and “Security”. States which follow no specific semantic can be set to semantics “None”. 1.1 Session State Group The “session” state group contains all states belonging to session control (service $10 StartDiagnosticSession). States in this state group are used to manage the execution of services in a certain session (e.g. Programming Session, Default Session etc.) If your CANdela document does not contain a “session” state group, proceed as following: 1. Go to chapter “States/State Groups” 2. Click on the magic line of the upper table 3. Rename the new state group to e.g. “Session” 4. Set “Semantics” to “session” 1 Copyright © 2008 - Vector Informatik GmbH Contact Information: www.vector-informatik.com or ++49-711-80 670-0 How to edit States and State Groups Figure 1: Entry mask “State Groups” 1.2 Security State Group The “security” state group contains all states belonging to security access control (service $27 SecurityAccess). States in this state group are used e.g. to set the ECU in a locked mode (no service can be executed) or to handle access to security critical services like IO-Control. If your CANdela document does not contain a “security” state group, proceed as described above but rename the state group to “Security” and set “Semantics” to “security”. 1.3 Graphical Representation of States CANdelaStudio offers a graphical overview of all states and state transitions of the services in a CANdela document. It is located in the “Dependencies” chapter of the CANdela document. The view window takes up the main part of the entry mask. There are three lists under the view window, which you can use to select one of three views, the variant and the state group that are to be displayed in the view window. The entry mask offers three views: • • • Note: “State diagram” plots the graph of the currently selected state group and variant in the graphic window. “Editing” replaces the current view with a tabular view, in which you can edit the state transitions. “Overview” replaces the current view with a tabular view that provides an overview of all states. You must have installed the external program “GraphViz” in order to view the graphics. For information about this program see http://www.graphviz.org. 2 Application Note AN-IDG-1-005 How to edit States and State Groups Figure 2: Graphical view of the state dependencies 1.4 Editing State Transitions You can edit state transitions of existing services in the entry mask of chapter “Dependencies”. To do so, click on . The graphical state diagram will be replaced by a tabular view with columns “Service”, “Protocol Service”, “Prefix”, as well as additional columns for each state defined in the selected State group. The names of the columns to the right of column “Prefix” represent the current ECU state before service execution. In these columns, you can define the state the ECU will reach after execution of the respective service is completed. The contents of these columns have the following meaning: • “(no)”: the service must not be executed. • "(yes)": the service may be executed, but triggers no state transition. • Name: the service may be executed and triggers a state transition to the specified state. If you want to modify multiple state transitions at once, highlight the respective lines with the bar in the desired column, and then press <F2>. Select the state from the appearing list and press <Return>. 1.5 Defining Default State Transitions You can also define default state transitions for new services. You can do this in chapter “Defaults” of the “States” chapter of a CANdelaStudio document. The entry mask of this chapter provides the same tabular view as the “Dependencies” chapter if “Editing” is selected under View. See chapter 1.4 for a description of the tabular view. 3 Application Note AN-IDG-1-005 How to edit States and State Groups 2.0 Automatic Setting of State Transitions CANdelaStudio offers automatic setting of state transitions via its Session and Security Level Wizards. Both Wizards use states defined in state groups “session” and “security”, if present (see description above). Note: To achieve correct results, you should add a state “Locked” to state group “Security”. This state is used by Session Wizard and Security Level Wizard to set the state transition which resets the ECU to a locked state. You can find further information on these Wizards in the online help of CANdelaStudio. 3.0 Additional Resources VECTOR APPLICATION NOTE AN-ION-1-1050 Introduction to Vehicle Network Software Development AN-AND-1-121 Introduction to Detroit’s CAN-based Physical Layers 4.0 Contacts Vector Informatik GmbH Ingersheimer Straße 24 70499 Stuttgart Germany Tel.: +49 711-80670-0 Fax: +49 711-80670-111 Email: [email protected] Vector CANtech, Inc. 39500 Orchard Hill Pl., Ste 550 Novi, MI 48375 USA Tel: +1-248-449-9290 Fax: +1-248-449-9704 Email: [email protected] VecScan AB Theres Svenssons Gata 9 41755 Göteborg Sweden Tel: +46 (0)31 764 76 00 Fax: +46 (0)31 764 76 19 Email: [email protected] Vector France SAS 168 Boulevard Camélinat 92240 Malakoff France Tel: +33 (0)1 42 31 40 00 Fax: +33 (0)1 42 31 40 09 Email: [email protected] Vector Japan Co. Ltd. Seafort Square Center Bld. 18F 2-3-12, Higashi-shinagawa, Shinagawa-ku Tokyo 140-0002 Japan Tel.: +81 3 5769 7800 Fax: +81 3 5769 6975 Email: [email protected] Vector Korea IT Inc. Daerung Post Tower III, 508 182-4 Guro-dong, Guro-gu Seoul, 152-790 Republic of Korea Tel.: +82-2-2028-0600 Fax: +82-2-2028-0604 Email: [email protected] 4 Application Note AN-IDG-1-005