Challenge

Project 1- Traffic Jam Assistant Feature

Ans)

Working Principle:

Traffic Jam Assistant is based on the sensors and the functionality of the Adaptive Cruise Control (ACC) with stop & go and Lane Keeping Support (LKS). When ACC ‘Stop & Go’ is turned ON, the Traffic Jam Assistant continuously analyses the speed of the surrounding vehicles and compares it with the own driving speed. If the system detects dense traffic or a traffic jam at speeds less than 60 kmph, the driver can activate the functionality by press of a button. The vehicle will now automatically follow the vehicle in front, takes over driving off, acceleration, braking and steering within same lane.

Information regarding the Traffic Jam Assistant will be available to be displayed to the driver in the Instrument Panel Cluster (IPC). The Algorithm which the students need to implement here in this project is predominantly based on IPC units.

Problem Statement:

To develop one specific requirement of Traffic Jam Assistant algorithm which would predominantly feature in the IPC algorithm.Please note that the whole Traffic Jam Assistant is a very huge algorithm & only one small part of the logic is implemented here. Idea is to familiarize with concepts of Model Based Development in MATLAB Environment. The Project must be done keeping in mind the following processes & steps.

  • This model must be developed in MATLAB Simulink as per MBD guidelines.
  • Code Generation Profile must be in Embedded Coder.
  • Simulink Data Dictionary must be created for the model & must be linked to the model.
  • Model Advisor Report is mandatory & this will be followed by Code Generation.

Input Signals:

Name of the Signal

Data Type

Range

Input_Voltage

uint8

0 - 255

Input_Switch

boolean

0 – 1

Enable_Display

uint8

0 - 255

Output Signal:

Name of the Signal

Data Type

Range

Output_Display

uint8

0 - 255

Calibration Signals:

Name of the Signal

Data Type

Range

Initial Value

VOLTAGE_MINIMUM_RANGE

uint8

0 – 255

30

VOLTAGE_MAXIMUM_RANGE

uint8

0 – 255

50

OFF_MODE

uint8

0 – 255

2

ON_MODE

uint8

0 – 255

1

STANDBY_MODE

uint8

0 – 255

3

INTERRUPT_1

boolean

0 – 1

1

INTERRUPT_2

boolean

0 - 1

1

NO_DISPLAY

uint8

0 – 255

0

Local Signal:

Name of the Signal

Data Type

Range

Optimum_Voltage

boolean

0 - 1

Simulink Data Dictionary must be created for the model & must be linked to the model.

Requirement No 1:

  • Input Signal “Input_Voltage” is compared against voltage values “VOLTAGE_MINIMUM_RANGE” & “VOLTAGE_MAXIMUM_RANGE”.
  • Incoming input signal “Input_Voltage” must be greater than – equal to “VOLTAGE_MINIMUM_RANGE” and less than – equal to “VOLTAGE_MAXIMUM_RANGE”.
  • Output signal from here is “Optimum_Voltage” which will be one of the inputs to the subsystem “DisplayUnit”.

Requirement No 2 (DisplayUnit Subsystem):

  • Input Signals are “Optimum_Voltage”, “Input_Switch”,“Enable_Display”. Signal “Enable_Display” must be saturated between the range 0 – 7. Output signal from the subsystem is “Output_Display”.
  • Input Signal “Enable_Display” is compared against pre – defined set of values in a multiport switch. Total data ports in the multiport switch is 5.
  • Multiport switch inputs 1 & 2 is connected to calibration signal “ON_MODE”, Multiport switch inputs 3 & 4 is connected to calibration signal “OFF_MODE” while Multiport switch input 5 is connected to calibration signal “STANDBY_MODE”.
  • The output from Multiport switch is connected to the first input port of the Switch block. The third input port of the Switch block is connected to the calibration signal “NO_DISPLAY”.
  • Meanwhile NOT value of input signal “Input_Switch” is compared in an AND gate against input signal “Optimum_Voltage” and the output from comparing if calibration signals “INTERRUPT_1” & “INTERRUPT_2” are equal. The output of the AND gate is the second input of the switch block.
  • The output from the switch block is “Output_Display”.

Code Generation Report

File: ert_main.c
1	/*
2	 * File: ert_main.c
3	 *
4	 * Code generated for Simulink model 'Pro_1R1'.
5	 *
6	 * Model version                  : 1.13
7	 * Simulink Coder version         : 9.5 (R2021a) 14-Nov-2020
8	 * C/C++ source code generated on : Tue Oct 18 18:57:59 2022
9	 *
10	 * Target selection: ert.tlc
11	 * Embedded hardware selection: Intel->x86-64 (Windows64)
12	 * Code generation objectives: Unspecified
13	 * Validation result: Not run
14	 */
15	
16	#include <stddef.h>
17	#include <stdio.h>              /* This ert_main.c example uses printf/fflush */
18	#include "Pro_1R1.h"                   /* Model's header file */
19	#include "rtwtypes.h"
20	
21	/*
22	 * Associating rt_OneStep with a real-time clock or interrupt service routine
23	 * is what makes the generated code "real-time".  The function rt_OneStep is
24	 * always associated with the base rate of the model.  Subrates are managed
25	 * by the base rate from inside the generated code.  Enabling/disabling
26	 * interrupts and floating point context switches are target specific.  This
27	 * example code indicates where these should take place relative to executing
28	 * the generated code step function.  Overrun behavior should be tailored to
29	 * your application needs.  This example simply sets an error status in the
30	 * real-time model and returns from rt_OneStep.
31	 */
32	void rt_OneStep(void);
33	void rt_OneStep(void)
34	{
35	  static boolean_T OverrunFlag = false;
36	
37	  /* Disable interrupts here */
38	
39	  /* Check for overrun */
40	  if (OverrunFlag) {
41	    rtmSetErrorStatus(Pro_1R1_M, "Overrun");
42	    return;
43	  }
44	
45	  OverrunFlag = true;
46	
47	  /* Save FPU context here (if necessary) */
48	  /* Re-enable timer or interrupt here */
49	  /* Set model inputs here */
50	
51	  /* Step the model */
52	  Pro_1R1_step();
53	
54	  /* Get model outputs here */
55	
56	  /* Indicate task complete */
57	  OverrunFlag = false;
58	
59	  /* Disable interrupts here */
60	  /* Restore FPU context here (if necessary) */
61	  /* Enable interrupts here */
62	}
63	
64	/*
65	 * The example "main" function illustrates what is required by your
66	 * application code to initialize, execute, and terminate the generated code.
67	 * Attaching rt_OneStep to a real-time clock is target specific.  This example
68	 * illustrates how you do this relative to initializing the model.
69	 */
70	int_T main(int_T argc, const char *argv[])
71	{
72	  /* Unused arguments */
73	  (void)(argc);
74	  (void)(argv);
75	
76	  /* Initialize model */
77	  Pro_1R1_initialize();
78	
79	  /* Attach rt_OneStep to a timer or interrupt service routine with
80	   * period 0.2 seconds (the model's base sample time) here.  The
81	   * call syntax for rt_OneStep is
82	   *
83	   *  rt_OneStep();
84	   */
85	  printf("Warning: The simulation will run forever. "
86	         "Generated ERT main won't simulate model step behavior. "
87	         "To change this behavior select the 'MAT-file logging' option.\n");
88	  fflush((NULL));
89	  while (rtmGetErrorStatus(Pro_1R1_M) == (NULL)) {
90	    /*  Perform other application tasks here */
91	  }
92	
93	  /* Disable rt_OneStep() here */
94	
95	  /* Terminate model */
96	  Pro_1R1_terminate();
97	  return 0;
98	}
99	
100	/*
101	 * File trailer for generated code.
102	 *
103	 * [EOF]
104	 */
105	

Scroll to top
Hide check details
Model Advisor Report - Pro_1R1.slx
Simulink version: 10.3 Model version: 1.13
System: Pro_1R1 Current run: 18-Oct-2022 18:39:48
Treat as Referenced Model: off

Run Summary
Pass Fail Warning Not Run Total
129 0 15 0 144


Modeling Standards for MAB


1 Naming Conventions 19 0 1 0


1.1 General 4 0 0 0

Check file names

Check the model file name to ensure that the name complies with the recommended guidelines.

Passed
All files have correct names.


Check folder names

Check the folder name to ensure that the name complies with the recommended guidelines.

Passed
All folders have correct names.


Check length of model file name

Check length of model file name

Passed
Model name is valid.


Check length of folder name at every level of model path

The model file name is: Pro_1R1



Passed
Folder names are valid.


1.2 Content 15 0 1 0

Check subsystem names

Identify subsystem names with incorrect characters.

Passed
All the subsystem names use correct characters.


Check port block names

Identify Inport or Outport block names with incorrect characters.

Passed
All the Inport or Outport block names use correct characters.


Check character usage in block names

Identify block names with incorrect characters.

Passed
All the block names use correct characters.


Check length of subsystem names

Check length of subsystem names

Passed
All subsystem names are valid.


Check length of block names

Check length of block names

Passed
All block names are valid.


Check length of Inport and Outport names

Check length of Inport and Outport names

Passed
All Inport and Outport names are valid.


Check character usage in signal names and bus names

Identify signal and bus names with invalid characters.

Passed
No invalid characters are used in signal and bus names.


Check character usage in parameter names

Identify parameter names with invalid characters.

Passed
No invalid characters are used in parameter names.


Check length of signal and bus names

Check length of signal and bus names

Passed
All signal and bus names are valid.


Check length of parameter names

Check length of parameter names

Passed
All parameter names are valid.


Check character usage in Stateflow data names

Identify Stateflow data names with invalid characters.

Passed
No invalid characters are used in Stateflow data names.


Check length of Stateflow data name

Check if the length of Stateflow data names are within limit.

Passed
All Stateflow data names are valid.


Check duplication of Simulink Data names

Simulink Data names should be unique across base workspace, model workspace and data dictionary.

Passed
All Simulink Data names are unique.


Check unused data in Simulink Model

Check for unused data in Data Dictionary

Warning
The following data variables in the data dictionary are unused:

Data Objects Source
Input_Voltage Project_1.sldd
Optimum_Voltage Project_1.sldd
Output_Display Project_1.sldd


Recommended Action
Consider removing the unused data variables.

Check for unused data in Stateflow Charts

Checks if the model parameter 'Unused data, events, messages and functions' is not set to 'none'.

Passed
All constraints on model configuration parameters have been met.

Status Parameter Current Value Recommended Values
Pass Unused data, events, messages and functions (SFUnusedDataAndEventsDiag) warning error, warning


Check usage of restricted variable names

Checks whether variable names used in MATLAB Function blocks are reserved for C/C++/MATLAB keywords

Passed
No variable names conflict with reserved keywords



2 Simulink 49 0 14 0


2.1 Configuration Parameters 4 0 0 0

Check Implement logic signals as Boolean data (vs. double)

Identify whether Implement logic signals as Boolean data (vs. double) is selected.

Passed
Implement logic signals as Boolean data (vs. double) is selected.


Check Signed Integer Division Rounding mode

jc_0642: Integer rounding mode setting

Identifies blocks with block parameter 'Integer Rounding Mode' set to 'Simplest' when the configuration parameter 'Signed integer division rounds to' is set to 'Undefined'.

Passed
Configuration parameter 'Signed integer division rounds to' is not set to 'Undefined'.


Check diagnostic settings for incorrect calculation results

Identify data validity diagnostic settings which detect incorrect calculation results.

Passed
All constraints on model configuration parameters have been met.

Status Parameter Current Value Recommended Values
Pass Division by singular matrix (CheckMatrixSingularityMsg) error error
Pass Inf or NaN block output (SignalInfNanChecking) error error
Pass Wrap on overflow (IntegerOverflowMsg) error error
Pass Saturate on overflow (IntegerSaturationMsg) error error


Check model diagnostic parameters

Identify diagnostic parameters that are set to none.

Passed
All of the diagnostic parameters are set to error or warning.



2.2 Diagram Appearance 13 0 4 0

Check for Simulink diagrams using nonstandard display attributes

Identify nonstandard display attributes in Simulink diagrams.


_________________________________________________________________________________________

Check format settings
Identify incorrect model-level format options.

Passed
The format options are correct.
_________________________________________________________________________________________

Check block colors
Identify blocks using nonstandard colors.

Passed
All blocks use standard colors.
_________________________________________________________________________________________

Check canvas colors
Identify canvases that are not white.

Passed
All diagrams use a white canvas.
_________________________________________________________________________________________

Check diagram zoom
Identify diagrams that do not have zoom factor set to 100 %.
Note: Zoom factors can differ for each instance of a model diagram opened in Simulink Editor

Warning
The following diagrams do not have zoom factor set to 100 percent:

Recommended Action
For each listed diagram, select Modeling > Environment > Zoom > Normal View (100%).

Check Model font settings

Identify blocks and charts with different font settings from input parameters.

Passed
Font settings of the blocks and charts and input parameters are same.


Check whether block names appear below blocks

Identify blocks where the name is not displayed below the block.

Passed
All blocks have names displayed below the block.


Check the display attributes of block names

Identify whether to display block names.

Check for blocks with hidden names and obvious function
Identify block names that are displayed but can be hidden due to obvious behavior.

Passed
All blocks with obvious behavior have hidden names.

Check for non-descriptive displayed block names
Identify block names that are displayed but should be hidden due to a lack of a descriptive name.

Passed
All displayed names provide descriptive information.

Check for missing block names
Identify block names that are hidden but should be displayed to show a descriptive name.

Passed
All displayed names provide descriptive information.


Check for nondefault block attributes

Identify blocks that use and fail to display nondefault values.

Warning
The following blocks use and fail to display nondefault values:

Block Parameter Expected Value Actual Value
Pro_1R1/DisplayUnit_Subsystem/Saturation UpperLimit 0.5 7
Pro_1R1/DisplayUnit_Subsystem/Saturation LowerLimit -0.5 0
Pro_1R1/DisplayUnit_Subsystem/Saturation LinearizeAsGain on off


Recommended Action
For the above blocks, display the nondefault value using the Block Annotation pane of the Block Properties dialog box.

Check Model Description

Identify layers in the model having inconsistent description format.

Warning
Following layers do not have model descriptions:

Recommended Action
Consider adding model description for all the layers.

Check if blocks are shaded in the model

Check if blocks are shaded in the model

Passed
Blocks in the model are not shaded.


Check for unconnected signal lines and blocks

Identify unconnected signal lines, subsystems and basic blocks.

Passed
All signal lines and blocks in the model are connected.


Check signal line connections

Identify intersections and overlaps of signals in a model.

Passed
No signal intersections or overlaps found.


Check signal flow in model

Identify subsystems which do not have a signal flow from left to right.

Warning
The signal flow of diagrams in the following subsystems can be improved:

Recommended Action
Ensure that the signal flow in the mentioned subsystems is from left to right.
  • All sequential blocks, except the blocks on feedback path, must be placed from left to right.
  • All parallel blocks, except the blocks on feedback path, must be placed from top to bottom.
  • All blocks should be oriented to the right.

Check usage of tunable parameters in blocks

Identify tunable parameters used to specify expressions, data type conversions, or indexing operations.

Passed
Tunable parameters are not used in the model.


Check connections between structural subsystems

Identify connections between structural subsystems.

Passed
All connections to structural subsystems adhere to the guideline.


Check for consistency in model element names

Check if model elements connected to a signal are following consistent naming.

Passed
Model elements connected to a signal are following consistent names.


Check trigger signal names

Identify trigger blocks where the origin of the trigger signal and the destination have dissimilar names.

Passed
No violation of the guideline for use of trigger signal names.


Check for mixing basic blocks and subsystems

Identify levels in the model that include basic blocks and subsystems. Each level of a model must be designed with blocks of the same level (for example, only subsystems or only basic blocks).

Passed
The model does not mix basic blocks and subsystems at the same level.


Check for avoiding algebraic loops between subsystems

jc_0653: Delay block layout in feedback loops

Identify delay blocks usage in feedback loops.

Passed
No delay blocks in feedback loops violate the guidelines for avoiding algebraic loops between subsystems.


Check for prohibited sink blocks

Identify sink blocks that must be removed prior to code generation.

Passed
There are no prohibited blocks in the subsystem.



2.3 Signal 2 0 4 0

Check usage of vector and bus signals

Identify mixed usages of vector and bus signals.

Passed
No mixing of vector and bus signals found in the system.


Check definition of signal labels

Identify blocks that require labeled signals. A subset of source and destination blocks require labeled signals.

Check source block labels

Warning
The following signals have no label:

Recommended Action
Add a new or propagated label to the signal line.
_________________________________________________________________________________________

Identify blocks that require labeled signals. A subset of source and destination blocks require labeled signals.

Check destination block labels

Warning
The following signals have no label:

Recommended Action
Add a new or propagated label to the signal line.

Check Signal name propagation

Check Signal name propagation for subsystems

Warning
The following subsystems do not have propagated signal labels:

Recommended Action
Add labels and enable signal propagation by selecting 'Show propagated signal' parameter for signals.

Check position of signal labels

Check location of signal labels

Warning
The following signals do not have labels located at the origin of the signal line:

Recommended Action
Consider placing the labels at the origin of the signal line.

Check signal line labels

Identify blocks that require labeled signals. A subset of source and destination blocks require labeled signals.

Check source block labels

Warning
The following signals have no label:

Recommended Action
Add a new or propagated label to the signal line.
_________________________________________________________________________________________

Identify blocks that require labeled signals. A subset of source and destination blocks require labeled signals.

Check destination block labels

Warning
The following signals have no label:

Recommended Action
Add a new or propagated label to the signal line.

Check for propagated signal labels

Identify propagated labels on signal lines.

Passed
All inputs and outputs to the subsystems and blocks have labels and display propagated signals.



2.4 Block Consistency 4 0 2 0

Check Indexing Mode

Check for Zero-Based Indexing Mode.

Warning
The following blocks or charts have One-Based Indexing mode:

Recommended Action
Consider remodeling by using Zero-Based Indexing.

Check block orientation

Identify blocks which are rotated or reversed.

Passed
No blocks found with rotated or reversed orientation


Check if tunable block parameters are defined as named constants

Check if tunable block parameters are defined as named constants

Warning
The following tunable block parameters are not defined as named constants.

Block Violations
Pro_1R1/DisplayUnit_Subsystem/Saturation UpperLimit : 7


Recommended Action
Consider changing tunable block parameter literal values to named constants.

Check for sample time setting

Check if sample time property of a block is set to -1 (inherited).

Passed
All permitted blocks have sample time set to -1 (inherited).


Check usage of fixed-point data type with non-zero bias

jc_0643: Fixed-point setting

Identify blocks with a fixed-point data type whose bias is not zero.

Passed
No blocks found with the Data Type Assistant mode set to "Fixed point" and a bias value other than zero


Check type setting by data objects

jc_0644: Type setting

Identify blocks that violate signal data type setting if signal objects are used.

Passed
No blocks found that violate signal data type setting if signal objects are used.



2.5 Conditional Subsystem relations 5 0 0 0

Check position of conditional blocks and iterator blocks

Identify conditional and iterative blocks that are positioned inconsistently in the model.

Passed
The conditional and iterative blocks are correctly placed in the model.


Check undefined initial output for conditional subsystems

Identify undefined initial output for Outports/Merge blocks in conditional subsystems

Passed
The initial output setting for all Conditional Subsystems are valid.


Check usage of Merge block

jc_0659: Usage restrictions of signal lines input to Merge blocks
There must not be any block between a Conditional Subsystem block and a Merge block.

Passed
No Merge block found.


Check logical expressions in If blocks

Checks If blocks for complex usage of primary expressions within a logical expression

Passed
Logical expressions inside If blocks are simple


Check default/else case in Switch Case blocks and If blocks

Check if default/else case in Switch Case blocks and If blocks are set to 'on'

Passed
Conditional Control blocks are valid.



2.6 Operation Blocks 12 0 3 0

Check fundamental logical and numerical operations

Check input data types of blocks meant for numerical operations

Warning
The following numerical operation blocks have boolean data type as input:

Recommended Action
Consider having non-boolean inputs for the numerical operation blocks.

Check usage of Sum blocks

Identify Sum block usage that can affect readability.

Passed
No violations of the guideline found with the usage of the Sum block.


Check operator order of Product blocks

Operator order for Product blocks.

Passed
All Product blocks have valid operator order.


Check signs of input signals in product blocks

jc_0611: Input sign for multiplication and division blocks

Identify blocks that perform division whose inputs have different sign bit.

Passed
No product block with division of different sign bits found.


Check for parentheses in Fcn block expressions

Identify order of parentheses in Fcn block expressions.

Passed
All Fcn blocks use parentheses to mark operator precedence.


Check icon shape of Logical Operator blocks

Icon shape of Logical Operator blocks.

Passed
All Logical Operator blocks have consistent icon shape.


Check usage of Relational Operator blocks

Identify Relational Operator blocks that connect to constants with the first (upper) input value.

Passed
All Relational Operator blocks with constant input values are configured correct.


Check comparison of floating point types in Simulink

jc_0800: Comparing floating-point types in Simulink

Equivalence comparison should not be used for floating point numbers.

Passed
No Equivalence comparison done on floating point numbers.


Check usage of Lookup Tables

Check usage of recommended settings for Lookup Table blocks to prevent unexpected results.

Passed
All Lookup Table blocks have recommended settings.


Check usage of Memory and Unit Delay blocks

Identify Memory blocks not using a continuous sample time

Passed
No Memory blocks found with inappropriate sample time
_________________________________________________________________________________________

Identify Unit Delay blocks with non-discrete sample time

Passed
No Unit Delay blocks found with non-discrete sample time


Check for cascaded Unit Delay blocks

Identify cascaded and tapped pattern of Unit Delay blocks.

Passed
No cascaded Unit Delay blocks found that can be changed to Tapped Delay/Delay block.


Check usage of Discrete-Time Integrator block

Check usage of recommended settings for Discrete-Time Integrator blocks to prevent unexpected results.

Passed
All Discrete-Time Integrator blocks have recommended settings.


Check usage of the Saturation blocks

jc_0628: Usage of Saturation blocks

Identify the Saturation and Saturation Dynamic blocks that perform type casting.

Warning
The blocks listed below have one or more of the following issues -
1. For Saturation block, Output data type property is not set to "Inherit: Same as input".
2. For Dynamic Saturation block, Output data type property is not set "Inherit: Same as second input".
3. For Saturation block, upper limit of input signal is not set to less than the maximum value of the output data type.
4. For Saturation block, lower limit of input signal is not set to more than the minimum value of the output data type.

Recommended Action
Perform following actions for Saturation and Dynamic Saturation blocks -
1. For Saturation block, set Output data type property to "Inherit: Same as input"
2. For Dynamic Saturation block, set Output data type property to "Inherit: Same as second input"
3. For Saturation block, set upper limit of input signal to less than the maximum value of the output data type.
4. For Saturation block, set lower limit of input signal to more than the minimum value of the output data type.

Check output data type of operation blocks

jc_0651: Implementing a type conversion

Identify operation blocks that specify output data type.

Warning
Following operation blocks explicitly specify output data type:

Recommended Action
Instead of explicitly specifying output data type on operation blocks, use 'Data Type Conversion' block when changing the data type of the block output signal.

Check for division by zero in Simulink

Identify division operations in Simulink resulting in divide-by-zero error.

Passed
No division operations found resulting in divide-by-zero error.



2.7 Other blocks 9 0 1 0

Check position of Inport and Outport blocks

Check positions of Inport blocks

Warning
The following Inport blocks are not placed to the extreme left side of the diagram:

Recommended Action
Move the Inport blocks identified to the left of all other blocks in the diagram.
It is acceptable to move the Inport block to the right only to prevent signal crossings.

Check display for port blocks

Identify Inport and Outport blocks that do not specify Port number for the Icon display block parameter.

Passed
All port blocks display the port number.


Check scope of From and Goto blocks

Identify incorrect scoping of From and Goto blocks. For signal flows, From and Goto blocks must use local scope. Control flow can use global scope.

Passed
All From and Goto blocks are used correctly.


Check for usage of Data Store Memory blocks

Identify the usage of Data Store Memory blocks.

Passed
Usage of Data Store Memory blocks is correct.


Check usage of Switch blocks

Identify Switch blocks that do not use Boolean inputs for the switch condition (input 2), and do not use u2 ~= 0 for the Criteria for passing first input block parameter.

_________________________________________________________________________________________

Check Switch block parameters
Identify Switch blocks with the parameter Criteria for passing first input not set to u2 ~= 0.

Passed
The block parameter Criteria for passing first input is correctly configured.
_________________________________________________________________________________________

Check for Boolean switch condition
Identify blocks that do not use Boolean signal switch conditions (input 2).

Passed
The switch condition is a Boolean signal.


Check input and output datatype for Switch blocks

Identify Switch blocks with mismatched input and output data types.

Passed
No Switch blocks found with mismatched input and output data types


Check settings for data ports in Multiport Switch blocks

Identify Multiport Switch blocks that violate data port settings.

Passed
No Multiport Switch blocks found with inappropriate data port settings.


Check for missing ports in Variant Subsystems

Check for number of inputs/outputs to a Variant Subsystem.

Passed
No Variant Subsystems found having different number of inputs/outputs in the Variant Subsystem choices.


Check use of default variants

na_0036: Default variant

Identify variant subsystems that do not use default variants.

Passed
All variant subsystems in the model use default variants


Check use of single variable variant conditionals

Identify variant subsystems which use multi-variable compound conditions.

Passed
No variant subsystems with multiple variable compound conditions found



3 Stateflow 52 0 0 0


3.1 Block/Data/Events 7 0 0 0

Check for Strong Data Typing with Simulink I/O

Check whether labeled input and output signals are strongly typed.

Passed
No Stateflow charts have Use Strong Data Typing with Simulink I/O cleared.


Check for names of Stateflow ports and associated signals


Identify mismatches between names of Stateflow ports and the associated signals.

Passed
No Stateflow charts were found.


Check execution timing for default transition path

'Execute (enter) Chart At Initialization' should be set to OFF.

Passed
All Stateflow Charts pass the check.


Check definition of Stateflow data

Identify the Scope value set on Stateflow data defined at machine level.

Passed
All Stateflow data at machine level has been defined as per guideline.


Check usable number for first index

Identify usage of first index of Stateflow data.

Passed
All Stateflow data first index values are uniform.


Check scope of data in parallel states

jc_0722: Local data definition in parallel states
The scope of local variables should be restricted to one parallel state unless it is being used by other parallel states.

Passed
No Stateflow States were found.


Check definition of Stateflow events

Stateflow events should be defined at the smallest possible scope of usage.

Passed
All Stateflow events are defined at their smallest scope.



3.2 Diagram 14 0 0 0

Check for unconnected objects in Stateflow Charts

Identify dangling transitions and unconnected Stateflow States and Junctions in Stateflow Charts.

Passed
No unconnected transitions, states or junctions found in Stateflow Charts.


Check for exclusive states in state machines

Identify states which are the only sub-state within a state with OR(exclusive) type decomposition.

Passed
All states with OR(exclusive) type decomposition have more than one sub-state.


Check usage of parallel states

Substates of parallel states should not be parallel states.

Passed
All Stateflow Charts pass the check.


Check Stateflow transition appearance

Identify Stateflow transitions visually overlapping other Stateflow objects.

Passed
No transition violates the guidelines for Stateflow transition appearance.


Check default transition placement in Stateflow charts

jc_0531: Default transition

Identify all groupings of states that do not have a default transition or do not have the default state as the top-most state.

Passed
No Stateflow transitions and states found that violate the guidelines for default transition placement in Stateflow charts.


Check usage of transitions to external states

Identify transitions ending on external child states.

Passed
No direct transitions found from external state to child state.


Check for unexpected backtracking in state transitions

Identify configuration parameter settings which identify unexpected backtracking in state transitions.

Passed
All constraints on model configuration parameters have been met.

Status Parameter Current Value Recommended Values
Pass Unexpected backtracking (SFUnexpectedBacktrackingDiag) error error


Check usage of internal transition

Internal transition lines should start from the left edge of the state.

Passed
No Stateflow transitions found that violate the guidelines for starting point of internal transition in Stateflow.


Check usage of internal transitions in Stateflow states

Identify Stateflow states using multiple internal transitions.

Passed
No Stateflow states found with multiple internal transitions


Check prohibited combination of state action and flow chart

State actions and flow charts should not be combined in states.

Passed
No Stateflow states were found that combine state action and flow chart.


Check transitions in Stateflow flow charts

Identify transitions in Stateflow flow charts that are drawn incorrectly.

Passed
All Stateflow transitions in flow charts are drawn correctly.


Check usage of unconditional transitions in flow charts

Identify unconditional transitions in flow charts.

Passed
All unconditional transitions adhere to the guideline.


Check terminal junctions in Stateflow

Identify usage of terminal junctions in flow charts.

Passed
Multiple terminal junctions were not found.


Check usage of Stateflow comments

Identify comments that are nested or contain newline(s) in the middle in Stateflow for action language 'C'.

Passed
No comments found that are either nested or contain newline(s) in the middle.



3.3 Condition Transition/Action 17 0 0 0

Check Stateflow chart action language

Check if the action language of Stateflow charts is set to 'C'.

Passed
All Stateflow Charts have action language set to 'C'.


Check usage of numeric literals in Stateflow

Identify use of numeric literals in Stateflow states and transitions.

Passed
No numeric literals found in Stateflow charts.


Check for pointers in Stateflow charts

Identify pointer operations on custom code variables.
Note: This check applies only to Stateflow charts that use C as the action language.

Passed
No pointer operations were found.


Check usage of events in Stateflow charts

Identify undirected event broadcasts in Stateflow.

Passed
No instances of undirected event broadcast were found.


Check order of state action types

Identify out of order state action types in Stateflow states.

Passed
No Stateflow states found with out of order state action types


Check repetition of Action types

jc_0734: Number of state action types
Identifies repeated action types in a Stateflow State.

Passed
No Stateflow States were found.


Check if state action type 'exit' is used in the model

Check if state action type 'exit' is used in the model.

Passed
State action type 'exit' is not used in the model.


Check updates to variables used in state transition conditions

jc_0741: Timing to update data used in state chart transition conditions

Variables used in state transition conditions must not perform an update by "during" state action type.

Passed
No Stateflow states found that violate the guidelines for updating the variables used in state transition conditions.


Check usage of transition conditions in Stateflow transitions

Identify unconditional Stateflow transitions with higher priority than conditional transitions.

Passed
No unconditional Stateflow transitions found with higher priority than conditional transitions


Check condition actions and transition actions in Stateflow

Identify usage of transition actions in Stateflow.

Passed
No Stateflow charts have transition actions.


Check for MATLAB expressions in Stateflow blocks

Identify MATLAB expressions that are not suitable for code generation in Stateflow blocks.

Passed
No Stateflow objects found using MATLAB expressions unsuitable for code generation.


Check usage of floating-point expressions in Stateflow charts

Identify equality or inequality operations (==,~=,!=) in expressions involving floating-point variables or constants.

Passed
No equality or inequality to operations in expressions where at least one side of the expression is a floating-point variable or constant were found.


Check Stateflow operators

Identify the usage of operators in Stateflow.

Passed
No Stateflow blocks found with incorrect operator usage.


Check prohibited comparison operation of logical type signals

Identify boolean variables in Stateflow charts using comparison operations.

Passed
No boolean variables use comparison operations of logical type in the model.


Check usage of unary minus operations in Stateflow charts

Identify unary minus operations applied to unsigned integers in Stateflow objects.

Passed
No unary minus operations applied to unsigned integers in Stateflow objects were found.


Check for implicit type casting in Stateflow

Identify implicit type casting in Stateflow.

Passed
No instances of implicit type casting found.


Check usage of graphical functions in Stateflow

Check for calls between graphical functions.

Passed
No calls between graphical functions were found.



3.4 Label Description 10 0 0 0

Check uniqueness of Stateflow State and Data names

jc_0732: Distinction between state names, data names, and event names
Identify Stateflow State and Stateflow Data that have identical names in a given chart.

Passed
No Stateflow charts were found.


Check uniqueness of State names

jc_0730: Unique state name in Stateflow blocks
Identifies identical State names within a Stateflow Chart.

Passed
No Stateflow charts were found.


Check usage of State names

jc_0731: State name format

Identify state names with '/' at its end.

Passed
No Stateflow states were found.


Check entry formatting in State blocks in Stateflow charts

Identify missing line breaks between entry action (en), during action (du), and exit action (ex) entries in states. Identify missing line breaks after semicolons (;) in statements.

Passed
All state entries found are correctly formatted.


Check indentation of code in Stateflow states

Identify non-uniform indentation in Stateflow blocks.

Passed
All Stateflow blocks have uniform indentation.


Check for usage of text inside states

Identify Stateflow states with text exceeding the boundary of the state.

Passed
No Stateflow states found with text exceeding the boundary of the state.


Check position of label string in Stateflow transition

Identify placement of label string in Stateflow transition.

Passed
All Stateflow transitions are placed uniformly.


Check position of comments in transition labels

Identify comments in transition labels that are not positioned uniformly.

Passed
Comments in transition labels are positioned uniformly.


Check usage of parentheses in Stateflow transitions

jc_0752: Condition action in transition label

Start new line before and after parentheses for condition actions in Stateflow transitions.

Passed
No Stateflow Transitions found that violate the requirement for new line for condition actions.


Check for comments in unconditional transitions

Identify comments in unconditional transitions without action statements.

Passed
All unconditional transitions without action statements have comments.



3.5 Miscellaneous 4 0 0 0

Check return value assignments in Stateflow graphical functions

Identify graphical functions with multiple assignments of return values in Stateflow charts.

Passed
No Stateflow charts were found.


Check uniqueness of Stateflow State and Data names

jc_0732: Distinction between state names, data names, and event names
Identify Stateflow State and Stateflow Data that have identical names in a given chart.

Passed
No Stateflow charts were found.


Check usage of Simulink functions in Stateflow

Usage of Simulink Functions in Stateflow.

Passed
All Simulink Functions in Stateflow are defined according to the guideline.


Check use of Simulink in Stateflow charts

na_0039: Limitation on Simulink functions in Chart blocks

Check use of Stateflow charts nested inside Simulink functions used in Stateflow.

Passed
No Stateflow charts found nested inside Simulink functions used in Stateflow.



4 MATLAB 9 0 0 0


4.1 Data and Operations 3 0 0 0

Check MATLAB code for global variables

Check for global variables in MATLAB code

_________________________________________________________________________________________

Check for global variables in MATLAB code used in MATLAB Function blocks

Passed
No MATLAB Function blocks found
_________________________________________________________________________________________

Check for global variables in MATLAB functions defined in Stateflow charts

Passed
No MATLAB functions defined in Stateflow charts found
_________________________________________________________________________________________

Check for global variables in called MATLAB functions

Passed
No external MATLAB functions found
_________________________________________________________________________________________


Check usage of enumerated values

Identify enumeration classes used in the model with no default value specification.

Passed
No enumeration classes found without default value specifications.


Check input and output settings of MATLAB Functions

Identify MATLAB Functions that have inputs, outputs, or parameters with inherited complexity, data type, or size properties.

Passed
No MATLAB Functions found in the model or subsystem.



4.2 Usage 6 0 0 0

Check lines of code in MATLAB Functions

Identify MATLAB Functions with high number of effective lines of code.

Passed
No MATLAB Function found with high number of effective lines of code.


Check the number of function calls in MATLAB Function blocks

Checks whether number of function calls in MATLAB Function blocks is less than 3.

Passed
Number of function calls in MATLAB Function blocks is less than 3.


Check nested conditions in MATLAB Functions

Identify nested if/else and case statements in MATLAB Functions.

Passed
No MATLAB Function found with deeply nested if/else and case statements.


Check usage of character vector inside MATLAB Function block

Checks whether character vectors are being used inside MATLAB Function blocks

Passed
No character vectors found in MATLAB Function block


Check usage of recommended patterns for Switch/Case statements

Checks whether non-constant variables are used in Switch/Case arguments.

Passed
Non-constant variables are not used as Switch/Case arguments


Check for use of C-style comment symbols

Identify usage of C-style comments in CGT Files and MPT Objects.

Passed
C-style comments are not used in CGT Files and MPT Objects.

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.