Challenge

Project 1- Traffic Jam Assistant Feature

PROJECT_ON_TRAFFIC_JAM_ASSISTANT:

Traffic Jam Assistant Feature

Introduction to the Feature:

Traffic Jam Assistant is one of the most common feature in Advanced Driver Assistance System. Traffic Jam Assistant helps the driver arrive more relaxed at their destination, even in dense traffic or in traffic jams. As a partially automated comfort function, the system takes over the longitudinal & lateral guidance of the vehicle. This means that the car can drive off, accelerate & brake automatically, as well as steer the vehicle within certain constraints. The driver has to permanently supervise the system & be ready to take over the complete control of the vehicle at any time.

Traffic Jam Assistant system helps to avoid rear end collisions in dense traffic conditions & traffic jams. In Traffic jams, the vehicle takes over driving off, acceleration, braking and steering within same lane.

Basic 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

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”.

MAAB_GUIDELINES:

Model Advisor Report - TRAFFIC_JAM_ASSISTANT.slx
Simulink version: 10.7 Model version: 1.39
System: TRAFFIC_JAM_ASSISTANT Current run: 17-Oct-2023 23:04:25


Run Summary

Incomplete Failed Warning Justified Passed Not Run Total  
   0    0    9    0    133    1819 1961  



 Model Advisor



     1 By Product  0  0  0  0  0  742


         1.1 Embedded Coder  0  0  0  0  0  34

 


 

  Identify lookup table blocks that generate expensive out-of-range checking code

Not Run

 


 

  Check configuration parameters for generation of inefficient saturation code

Not Run

 


 

  Check for blocks not recommended for C/C++ production code deployment

Not Run

 


 

  Check output types of logic blocks

Not Run

 


 

  Check the hardware implementation

Not Run

 


 

  Identify questionable software environment specifications

Not Run

 


 

  Identify questionable code instrumentation (data I/O)

Not Run

 


 

  Identify blocks generating inefficient algorithms

Not Run

 


 

  Check configuration parameters for MISRA C:2012

Not Run

 


 

  Check for blocks not recommended for MISRA C:2012

Not Run

 


 

  Check for unsupported block names

Not Run

 


 

  Check usage of Assignment blocks

Not Run

 


 

  Check for switch case expressions without a default case

Not Run

 


 

  Check for missing error ports in AUTOSAR receiver interfaces

Not Run

 


 

  Check configuration parameters for secure coding standards

Not Run

 


 

  Check for blocks not recommended for secure coding standards

Not Run

 


 

  Check signal interfaces

Not Run

 


 

  Check configuration for component deployment using service interface configuration

Not Run

 


 

  Check startup and shutdown event

Not Run

 


 

  Identify questionable subsystem settings

Not Run

 


 

  Check usage of 'long long' data type

Not Run

 


 

  Check for blocks not supported for row-major code generation

Not Run

 


 

  Identify TLC S-Functions with unset array layout

Not Run

 


 

  Identify blocks that generate expensive fixed-point and saturation code

Not Run

 


 

  Check for missing const qualifiers in model functions

Not Run

 


 

  Check bus object names that are used as bus element names

Not Run

 


 

  Check modeling style for component deployment

Not Run

 


 

  Check usage of partial data send

Not Run

 


 

  Identify questionable fixed-point operations

Not Run

 


 

  Identify blocks that generate expensive rounding code

Not Run

 


 

  Check for bitwise operations on signed integers

Not Run

 


 

  Check for recursive function calls

Not Run

 


 

  Check for equality and inequality operations on floating-point values

Not Run

 


 

  Check integer word lengths

Not Run



         1.2 Simulink  0  0  0  0  0  43

 


 

  Check optimization settings

Not Run

 


 

  Identify unconnected lines, input ports, and output ports

Not Run

 


 

  Check root model Inport block specifications

Not Run

 


 

  Check diagnostic settings ignored during accelerated model reference simulation

Not Run

 


 

  Check for parameter tunability information ignored for referenced models

Not Run

 


 

  Check for implicit signal resolution

Not Run

 


 

  Check for optimal bus virtuality

Not Run

 


 

  Check for calls to slDataTypeAndScale()

Not Run

 


 

  Check for Discrete-Time Integrator blocks with initial condition uncertainty

Not Run

 


 

  Identify disabled library links

Not Run

 


 

  Identify parameterized library links

Not Run

 


 

  Identify unresolved library links

Not Run

 


 

  Identify configurable subsystem blocks in the model for converting to variant subsystem blocks.

Not Run

 


 

  Check usage of function-call connections

Not Run

 


 

  Check and update mask image display commands with unnecessary imread() function calls

Not Run

 


 

  Check and update mask to affirm icon drawing commands dependency on mask workspace

Not Run

 


 

  Identify Environment Controller blocks to be replaced with Variant Source blocks

Not Run

 


 

  Identify variant blocks with VariantActivation set to "Inherit From Simulink.VariantControl" but does not use Simulink.VariantControl

Not Run

 


 

  Runtime diagnostics for S-functions

Not Run

 


 

  Check if Read/Write diagnostics are enabled for Data Store blocks

Not Run

 


 

  Check Data Store Memory blocks for multitasking, strong typing, and shadowing issues

Not Run

 


 

  Check Model History properties

Not Run

 


 

  Check S-functions in the model

Not Run

 


 

  Open the Upgrade Advisor

Not Run

 


 

  Check structure parameter usage with bus signals

Not Run

 


 

  Check for large number of function arguments from virtual bus across model reference boundary

Not Run

 


 

  Check Delay, Unit Delay and Zero-Order Hold blocks for rate transition

Not Run

 


 

  Check bus signals treated as vectors

Not Run

 


 

  Check for potentially delayed function-call block return values

Not Run

 


 

  Identify block output signals with continuous sample time and non-floating point data type

Not Run

 


 

  Check usage of Merge blocks

Not Run

 


 

  Check usage of Outport blocks

Not Run

 


 

  Check usage of Discrete-Time Integrator blocks

Not Run

 


 

  Check model settings for migration to simplified initialization mode

Not Run

 


 

  Check for non-continuous signals driving derivative ports

Not Run

 


 

  Check data store block sample times for modeling errors

Not Run

 


 

  Check for potential ordering issues involving data store access

Not Run

 


 

  Identify unit mismatches in the model

Not Run

 


 

  Identify automatic unit conversions in the model

Not Run

 


 

  Identify disallowed unit systems in the model

Not Run

 


 

  Identify undefined units in the model

Not Run

 


 

  Identify ambiguous units in the model

Not Run

 


 

  Identify questionable operations for strict single-precision design

Not Run



         1.3 Simulink Coder  0  0  0  0  0  9

 


 

  Identify blocks using one-based indexing

Not Run

 


 

  Check solver for code generation

Not Run

 


 

  Check for blocks not supported by code generation

Not Run

 


 

  Check for model reference configuration mismatch

Not Run

 


 

  Check code generation identifier formats used for model reference

Not Run

 


 

  Check for relative execution order change for Data Store Read and Data Store Write blocks

Not Run

 


 

  Check reuse of subsystem code

Not Run

 


 

  Check sample times and tasking mode

Not Run

 


 

  Check for blocks that have constraints on tunable parameters

Not Run



         1.4 AUTOSAR Blockset  0  0  0  0  0  2

 


 

  Check compatibility of AUTOSAR Interpolation Routines

Not Run

 


 

  Check model configuration parameters for AUTOSAR compliance

Not Run



         1.5 Simscape  0  0  0  0  0  3

 


 

  Check consistency of block parameter units

Not Run

 


 

  Check for outdated AC source blocks

Not Run

 


 

  Check for dry hydraulic nodes

Not Run



         1.6 Simulink Check  0  0  0  0  0  632


             1.6.1 Modeling Standards  0  0  0  0  0  620


                 1.6.1.1 DO-178C/DO-331 Checks  0  0  0  0  0  96

 


 

  Check usage of standardized MATLAB function headers

Not Run

 


 

  Check for MATLAB Function interfaces with inherited properties

Not Run

 


 

  Check MATLAB Function metrics

Not Run

 


 

  Check MATLAB Code Analyzer messages

Not Run

 


 

  Check if/elseif/else patterns in MATLAB Function blocks

Not Run

 


 

  Check switch statements in MATLAB Function blocks

Not Run

 


 

  Check MATLAB functions not supported for code generation

Not Run

 


 

  Check state machine type of Stateflow charts

Not Run

 


 

  Check Stateflow charts for ordering of states and transitions

Not Run

 


 

  Check Stateflow debugging options

Not Run

 


 

  Check Stateflow charts for transition paths that cross parallel state boundaries

Not Run

 


 

  Check for inappropriate use of transition paths

Not Run

 


 

  Check naming of ports in Stateflow charts

Not Run

 


 

  Check scoping of Stateflow data objects

Not Run

 


 

  Check usage of While Iterator blocks

Not Run

 


 

  Check usage of For and While Iterator subsystems

Not Run

 


 

  Check for blocks not recommended for C/C++ production code deployment

Not Run

 


 

  Check for inconsistent vector indexing methods

Not Run

 


 

  Check usage of variant blocks

Not Run

 


 

  Check model file name

Not Run

 


 

  Check usage of lookup table blocks

Not Run

 


 

  Check safety-related solver settings for simulation time

Not Run

 


 

  Check Stateflow charts for uniquely defined data objects

Not Run

 


 

  Check global variables in graphical functions

Not Run

 


 

  Check usage of Gain blocks

Not Run

 


 

  Check for model elements that do not link to requirements

Not Run

 


 

  Check safety-related settings for hardware implementation

Not Run

 


 

  Check for parameter tunability ignored for referenced models

Not Run

 


 

  Check for disabled and parameterized library links

Not Run

 


 

  Check safety-related diagnostic settings for data store memory

Not Run

 


 

  Check safety-related diagnostic settings for saving

Not Run

SLDD:

CODE_GENERATION:

MAIN.C_FILE:

/*
 
 
* Event Support License -- for demonstration use and event support. Not
 
 
* for government, research, commercial, or other organizational use.
 
 
*
 
 
* File: ert_main.c
 
 
*
 
 
* Code generated for Simulink model 'TRAFFIC_JAM_ASSISTANT'.
 
 
*
 
 
* Model version : 1.41
 
 
* Simulink Coder version : 9.9 (R2023a) 19-Nov-2022
 
 
* C/C++ source code generated on : Tue Oct 17 23:14:21 2023
 
 
*
 
 
* Target selection: ert.tlc
 
 
* Embedded hardware selection: Intel->x86-64 (Windows64)
 
 
* Code generation objectives: Unspecified
 
 
* Validation result: Not run
 
 
*/
 
 
 
 
 
#include
 
 
#include /* This example main program uses printf/fflush */
 
 
#include "TRAFFIC_JAM_ASSISTANT.h" /* Model header file */
 
 
 
 
 
/*
 
 
* Associating rt_OneStep with a real-time clock or interrupt service routine
 
 
* is what makes the generated code "real-time". The function rt_OneStep is
 
 
* always associated with the base rate of the model. Subrates are managed
 
 
* by the base rate from inside the generated code. Enabling/disabling
 
 
* interrupts and floating point context switches are target specific. This
 
 
* example code indicates where these should take place relative to executing
 
 
* the generated code step function. Overrun behavior should be tailored to
 
 
* your application needs. This example simply sets an error status in the
 
 
* real-time model and returns from rt_OneStep.
 
 
*/
 
 
void rt_OneStep(void);
 
 
void rt_OneStep(void)
 
 
{
 
 
static boolean_T OverrunFlag = false;
 
 
 
 
 
/* Disable interrupts here */
 
 
 
 
 
/* Check for overrun */
 
 
if (OverrunFlag) {
 
 
rtmSetErrorStatus(TRAFFIC_JAM_ASSISTANT_M, "Overrun");
 
 
return;
 
 
}
 
 
 
 
 
OverrunFlag = true;
 
 
 
 
 
/* Save FPU context here (if necessary) */
 
 
/* Re-enable timer or interrupt here */
 
 
/* Set model inputs here */
 
 
 
 
 
/* Step the model */
 
 
TRAFFIC_JAM_ASSISTANT_step();
 
 
 
 
 
/* Get model outputs here */
 
 
 
 
 
/* Indicate task complete */
 
 
OverrunFlag = false;
 
 
 
 
 
/* Disable interrupts here */
 
 
/* Restore FPU context here (if necessary) */
 
 
/* Enable interrupts here */
 
 
}
 
 
 
 
 
/*
 
 
* The example main function illustrates what is required by your
 
 
* application code to initialize, execute, and terminate the generated code.
 
 
* Attaching rt_OneStep to a real-time clock is target specific. This example
 
 
* illustrates how you do this relative to initializing the model.
 
 
*/
 
 
int_T main(int_T argc, const char *argv[])
 
 
{
 
 
/* Unused arguments */
 
 
(void)(argc);
 
 
(void)(argv);
 
 
 
 
 
/* Initialize model */
 
 
TRAFFIC_JAM_ASSISTANT_initialize();
 
 
 
 
 
/* Attach rt_OneStep to a timer or interrupt service routine with
 
 
* period 0.01 seconds (base rate of the model) here.
 
 
* The call syntax for rt_OneStep is
 
 
*
 
 
* rt_OneStep();
 
 
*/
 
 
printf("Warning: The simulation will run forever. "
 
 
"Generated ERT main won't simulate model step behavior. "
 
 
"To change this behavior select the 'MAT-file logging' option.\n");
 
 
fflush((NULL));
 
 
while (rtmGetErrorStatus(TRAFFIC_JAM_ASSISTANT_M) == (NULL)) {
 
 
/* Perform application tasks here */
 
 
}
 
 
 
 
 
/* Terminate model */
 
 
TRAFFIC_JAM_ASSISTANT_terminate();
 
 
return 0;
 
 
}
 
 
 
 
 
/*
 
 
* File trailer for generated code.
 
 
*
 
 
* [EOF]
 
 
*/

.C_FILE:


 
/*
 
 
* Event Support License -- for demonstration use and event support. Not
 
 
* for government, research, commercial, or other organizational use.
 
 
*
 
 
* File: TRAFFIC_JAM_ASSISTANT.c
 
 
*
 
 
* Code generated for Simulink model 'TRAFFIC_JAM_ASSISTANT'.
 
 
*
 
 
* Model version : 1.41
 
 
* Simulink Coder version : 9.9 (R2023a) 19-Nov-2022
 
 
* C/C++ source code generated on : Tue Oct 17 23:14:21 2023
 
 
*
 
 
* Target selection: ert.tlc
 
 
* Embedded hardware selection: Intel->x86-64 (Windows64)
 
 
* Code generation objectives: Unspecified
 
 
* Validation result: Not run
 
 
*/
 
 
 
 
 
#include "TRAFFIC_JAM_ASSISTANT.h"
 
 
#include "rtwtypes.h"
 
 
#include "TRAFFIC_JAM_ASSISTANT_private.h"
 
 
 
 
 
/* Exported data definition */
 
 
 
 
 
/* Const memory section */
 
 
/* Definition for custom storage class: Const */
 
 
const boolean_T INTERRUPT_1 = true; /* Referenced by: '/Constant3' */
 
 
const boolean_T INTERRUPT_2 = true; /* Referenced by: '/Constant4' */
 
 
const uint8_T NO_DISPLAY = 0U; /* Referenced by: '/Constant5' */
 
 
const uint8_T OFF_MODE = 1U; /* Referenced by: '/Constant1' */
 
 
const uint8_T ON_MODE = 2U; /* Referenced by: '/Constant' */
 
 
const uint8_T STANDBY_MODE = 3U; /* Referenced by: '/Constant2' */
 
 
const uint8_T VOLTAGE_MAXIMUM_RANGE = 50U;/* Referenced by: '/Constant' */
 
 
const uint8_T VOLTAGE_MINIMUM_RANGE = 30U;/* Referenced by: '/Constant' */
 
 
 
 
 
/* External inputs (root inport signals with default storage) */
 
 
ExtU_TRAFFIC_JAM_ASSISTANT_T TRAFFIC_JAM_ASSISTANT_U;
 
 
 
 
 
/* External outputs (root outports fed by signals with default storage) */
 
 
ExtY_TRAFFIC_JAM_ASSISTANT_T TRAFFIC_JAM_ASSISTANT_Y;
 
 
 
 
 
/* Real-time model */
 
 
static RT_MODEL_TRAFFIC_JAM_ASSISTAN_T TRAFFIC_JAM_ASSISTANT_M_;
 
 
RT_MODEL_TRAFFIC_JAM_ASSISTAN_T *const TRAFFIC_JAM_ASSISTANT_M =
 
 
&TRAFFIC_JAM_ASSISTANT_M_;
 
 
 
 
 
/* Model step function */
 
 
void TRAFFIC_JAM_ASSISTANT_step(void)
 
 
{
 
 
real_T tmp_1;
 
 
uint16_T tmp;
 
 
uint8_T rtb_Multiport_switch_out_a;
 
 
boolean_T tmp_0;
 
 
 
 
 
/* Saturate: '/Saturation' incorporates:
 
 
* Inport: '/Enable_Switch'
 
 
*/
 
 
if (TRAFFIC_JAM_ASSISTANT_U.Enable_Switch <= 57344) {
 
 
tmp = TRAFFIC_JAM_ASSISTANT_U.Enable_Switch;
 
 
} else {
 
 
tmp = 57344U;
 
 
}
 
 
 
 
 
/* MultiPortSwitch: '/Multiport Switch' incorporates:
 
 
* Constant: '/Constant'
 
 
* Constant: '/Constant1'
 
 
* Constant: '/Constant2'
 
 
* Saturate: '/Saturation'
 
 
*/
 
 
switch ((int32_T)((uint32_T)tmp >> 13)) {
 
 
case 0:
 
 
if (ON_MODE > 3) {
 
 
rtb_Multiport_switch_out_a = MAX_uint8_T;
 
 
} else {
 
 
rtb_Multiport_switch_out_a = (uint8_T)(ON_MODE << 6);
 
 
}
 
 
break;
 
 
 
 
 
case 1:
 
 
if (ON_MODE > 3) {
 
 
rtb_Multiport_switch_out_a = MAX_uint8_T;
 
 
} else {
 
 
rtb_Multiport_switch_out_a = (uint8_T)(ON_MODE << 6);
 
 
}
 
 
break;
 
 
 
 
 
case 2:
 
 
if (OFF_MODE > 3) {
 
 
rtb_Multiport_switch_out_a = MAX_uint8_T;
 
 
} else {
 
 
rtb_Multiport_switch_out_a = (uint8_T)(OFF_MODE << 6);
 
 
}
 
 
break;
 
 
 
 
 
case 3:
 
 
if (OFF_MODE > 3) {
 
 
rtb_Multiport_switch_out_a = MAX_uint8_T;
 
 
} else {
 
 
rtb_Multiport_switch_out_a = (uint8_T)(OFF_MODE << 6);
 
 
}
 
 
break;
 
 
 
 
 
default:
 
 
if (STANDBY_MODE > 3) {
 
 
rtb_Multiport_switch_out_a = MAX_uint8_T;
 
 
} else {
 
 
rtb_Multiport_switch_out_a = (uint8_T)(STANDBY_MODE << 6);
 
 
}
 
 
break;
 
 
}
 
 
 
 
 
/* End of MultiPortSwitch: '/Multiport Switch' */
 
 
 
 
 
/* Switch: '/Switch' incorporates:
 
 
* Constant: '/Constant3'
 
 
* Constant: '/Constant4'
 
 
* Constant: '/Constant5'
 
 
* Constant: '/Constant'
 
 
* Constant: '/Constant'
 
 
* DataTypeConversion: '/Data Type Conversion'
 
 
* DataTypeConversion: '/Data Type Conversion1'
 
 
* Inport: '/Input_Switch'
 
 
* Logic: '/OR'
 
 
* Logic: '/AND'
 
 
* Logic: '/NOT'
 
 
* MultiPortSwitch: '/Multiport Switch'
 
 
* RelationalOperator: '/Equal'
 
 
* RelationalOperator: '/Compare'
 
 
* RelationalOperator: '/Compare'
 
 
*/
 
 
if (rtb_Multiport_switch_out_a != 0) {
 
 
/* DataTypeConversion: '/Data Type Conversion' incorporates:
 
 
* Inport: '/Input_Voltage'
 
 
*/
 
 
tmp_1 = (real_T)TRAFFIC_JAM_ASSISTANT_U.Input_Voltage * 0.00390625;
 
 
tmp_0 = (((tmp_1 <= VOLTAGE_MINIMUM_RANGE) || (tmp_1 >=
 
 
VOLTAGE_MAXIMUM_RANGE)) && (!TRAFFIC_JAM_ASSISTANT_U.Input_Switch)
 
 
&& (INTERRUPT_1 == INTERRUPT_2));
 
 
} else {
 
 
tmp_0 = (NO_DISPLAY != 0);
 
 
}
 
 
 
 
 
/* Outport: '/Output_Display' incorporates:
 
 
* DataTypeConversion: '/Data Type Conversion2'
 
 
* Switch: '/Switch'
 
 
*/
 
 
TRAFFIC_JAM_ASSISTANT_Y.Output_Display = (uint16_T)(tmp_0 << 15);
 
 
}
 
 
 
 
 
/* Model initialize function */
 
 
void TRAFFIC_JAM_ASSISTANT_initialize(void)
 
 
{
 
 
/* (no initialization code required) */
 
 
}
 
 
 
 
 
/* Model terminate function */
 
 
void TRAFFIC_JAM_ASSISTANT_terminate(void)
 
 
{
 
 
/* (no terminate code required) */
 
 
}
 
 
 
 
 
/*
 
 
* File trailer for generated code.
 
 
*
 
 
* [EOF]
 
 
*/

.H_FILE:

/*
 
 
* Event Support License -- for demonstration use and event support. Not
 
 
* for government, research, commercial, or other organizational use.
 
 
*
 
 
* File: TRAFFIC_JAM_ASSISTANT.h
 
 
*
 
 
* Code generated for Simulink model 'TRAFFIC_JAM_ASSISTANT'.
 
 
*
 
 
* Model version : 1.41
 
 
* Simulink Coder version : 9.9 (R2023a) 19-Nov-2022
 
 
* C/C++ source code generated on : Tue Oct 17 23:14:21 2023
 
 
*
 
 
* Target selection: ert.tlc
 
 
* Embedded hardware selection: Intel->x86-64 (Windows64)
 
 
* Code generation objectives: Unspecified
 
 
* Validation result: Not run
 
 
*/
 
 
 
 
 
#ifndef RTW_HEADER_TRAFFIC_JAM_ASSISTANT_h_
 
 
#define RTW_HEADER_TRAFFIC_JAM_ASSISTANT_h_
 
 
#ifndef TRAFFIC_JAM_ASSISTANT_COMMON_INCLUDES_
 
 
#define TRAFFIC_JAM_ASSISTANT_COMMON_INCLUDES_
 
 
#include "rtwtypes.h"
 
 
#endif /* TRAFFIC_JAM_ASSISTANT_COMMON_INCLUDES_ */
 
 
 
 
 
#include "TRAFFIC_JAM_ASSISTANT_types.h"
 
 
 
 
 
/* Macros for accessing real-time model data structure */
 
 
#ifndef rtmGetErrorStatus
 
 
#define rtmGetErrorStatus(rtm) ((rtm)->errorStatus)
 
 
#endif
 
 
 
 
 
#ifndef rtmSetErrorStatus
 
 
#define rtmSetErrorStatus(rtm, val) ((rtm)->errorStatus = (val))
 
 
#endif
 
 
 
 
 
/* External inputs (root inport signals with default storage) */
 
 
typedef struct {
 
 
uint16_T Input_Voltage; /* '/Input_Voltage' */
 
 
boolean_T Input_Switch; /* '/Input_Switch' */
 
 
uint16_T Enable_Switch; /* '/Enable_Switch' */
 
 
} ExtU_TRAFFIC_JAM_ASSISTANT_T;
 
 
 
 
 
/* External outputs (root outports fed by signals with default storage) */
 
 
typedef struct {
 
 
uint16_T Output_Display; /* '/Output_Display' */
 
 
} ExtY_TRAFFIC_JAM_ASSISTANT_T;
 
 
 
 
 
/* Real-time Model Data Structure */
 
 
struct tag_RTM_TRAFFIC_JAM_ASSISTANT_T {
 
 
const char_T * volatile errorStatus;
 
 
};
 
 
 
 
 
/* External inputs (root inport signals with default storage) */
 
 
extern ExtU_TRAFFIC_JAM_ASSISTANT_T TRAFFIC_JAM_ASSISTANT_U;
 
 
 
 
 
/* External outputs (root outports fed by signals with default storage) */
 
 
extern ExtY_TRAFFIC_JAM_ASSISTANT_T TRAFFIC_JAM_ASSISTANT_Y;
 
 
 
 
 
/* Model entry point functions */
 
 
extern void TRAFFIC_JAM_ASSISTANT_initialize(void);
 
 
extern void TRAFFIC_JAM_ASSISTANT_step(void);
 
 
extern void TRAFFIC_JAM_ASSISTANT_terminate(void);
 
 
 
 
 
/* Exported data declaration */
 
 
 
 
 
/* Const memory section */
 
 
/* Declaration for custom storage class: Const */
 
 
extern const boolean_T INTERRUPT_1; /* Referenced by: '/Constant3' */
 
 
extern const boolean_T INTERRUPT_2; /* Referenced by: '/Constant4' */
 
 
extern const uint8_T NO_DISPLAY; /* Referenced by: '/Constant5' */
 
 
extern const uint8_T OFF_MODE; /* Referenced by: '/Constant1' */
 
 
extern const uint8_T ON_MODE; /* Referenced by: '/Constant' */
 
 
extern const uint8_T STANDBY_MODE; /* Referenced by: '/Constant2' */
 
 
extern const uint8_T VOLTAGE_MAXIMUM_RANGE;/* Referenced by: '/Constant' */
 
 
extern const uint8_T VOLTAGE_MINIMUM_RANGE;/* Referenced by: '/Constant' */
 
 
 
 
 
/* Real-time Model object */
 
 
extern RT_MODEL_TRAFFIC_JAM_ASSISTAN_T *const TRAFFIC_JAM_ASSISTANT_M;
 
 
 
 
 
/*-
 
 
* These blocks were eliminated from the model due to optimizations:
 
 
*
 
 
* Block '/dataconversion1' : Eliminate redundant data type conversion
 
 
* Block '/Data Type Conversion' : Eliminate redundant data type conversion
 
 
* Block '/Data Type Conversion3' : Eliminate redundant data type conversion
 
 
* Block '/dataconversion2' : Eliminate redundant data type conversion
 
 
*/
 
 
 
 
 
/*-
 
 
* The generated code includes comments that allow you to trace directly
 
 
* back to the appropriate location in the model. The basic format
 
 
* is /block_name, where system is the system number (uniquely
 
 
* assigned by Simulink) and block_name is the name of the block.
 
 
*
 
 
* Use the MATLAB hilite_system command to trace the generated code back
 
 
* to the model. For example,
 
 
*
 
 
* hilite_system('') - opens system 3
 
 
* hilite_system('/Kp') - opens and selects block Kp which resides in S3
 
 
*
 
 
* Here is the system hierarchy for this model
 
 
*
 
 
* '' : 'TRAFFIC_JAM_ASSISTANT'
 
 
* '' : 'TRAFFIC_JAM_ASSISTANT/Subsystem'
 
 
* '' : 'TRAFFIC_JAM_ASSISTANT/Subsystem/Requirement_1'
 
 
* '' : 'TRAFFIC_JAM_ASSISTANT/Subsystem/requirement_2'
 
 
* '' : 'TRAFFIC_JAM_ASSISTANT/Subsystem/Requirement_1/Compare To Constant'
 
 
* '' : 'TRAFFIC_JAM_ASSISTANT/Subsystem/Requirement_1/Compare To Constant1'
 
 
*/
 
 
#endif /* RTW_HEADER_TRAFFIC_JAM_ASSISTANT_h_ */
 
 
 
 
 
/*
 
 
* File trailer for generated code.
 
 
*
 
 
* [EOF]
 
 
*/
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.