Challenge

Traffic Jam Assistant Feature

Aim :- To develop a model for Traffic Jam assitance feature.

SLDD :- The SLDD file is created using the given variables. And linked to the model after model is done.

Model :- The model is done by satisfying the given requirements. The solver is set to Fixed step discrete and code generation target file is set to Embedded Coder. The signal resolving and propagation is also done.

Requirement 1 :-

Requirement 2 :-

Requirement Tagging :- The requirement tagging is done with Word file and attached with the project file.

Model advisor check :- The Model is checked for MAB guideliness and report is generated.

Code generation :- The code is generated by using Embedded coder tool box in simulink. The generated Embedded C code is shown below.

/*
 * File: TrafficJamAssistance.c
 *
 * Code generated for Simulink model 'TrafficJamAssistance'.
 *
 * Model version                  : 1.26
 * Simulink Coder version         : 9.5 (R2021a) 14-Nov-2020
 * C/C++ source code generated on : Sun Jun 12 11:14:28 2022
 *
 * Target selection: ert.tlc
 * Embedded hardware selection: Intel->x86-64 (Windows64)
 * Code generation objectives: Unspecified
 * Validation result: Not run
 */

#include "TrafficJamAssistance.h"
#include "TrafficJamAssistance_private.h"

/* Exported data definition */

/* Definition for custom storage class: ExportToFile */
uint8_T Output_Display;                /* '/Switch' */

/* ConstVolatile memory section */
/* Definition for custom storage class: ConstVolatile */
const volatile boolean_T INTERRUPT_1 = 1;/* Referenced by: '/Constant3' */
const volatile boolean_T INTERRUPT_2 = 1;/* Referenced by: '/Constant4' */
const volatile uint8_T NO_DISPLAY = 0U;/* Referenced by: '/Constant5' */
const volatile uint8_T OFF_MODE = 2U;  /* Referenced by: '/Constant1' */
const volatile uint8_T ON_MODE = 1U;   /* Referenced by: '/Constant' */
const volatile uint8_T STANDBY_MODE = 3U;/* Referenced by: '/Constant2' */
const volatile uint8_T VOLTAGE_MAXIMUM_RANGE = 50U;/* Referenced by: '/Constant1' */
const volatile uint8_T VOLTAGE_MINIMUM_RANGE = 30U;/* Referenced by: '/Constant' */

/* Real-time model */
static RT_MODEL_TrafficJamAssistance_T TrafficJamAssistance_M_;
RT_MODEL_TrafficJamAssistance_T *const TrafficJamAssistance_M =
  &TrafficJamAssistance_M_;

/* Model step function */
void TrafficJamAssistance_step(void)
{
  /* local block i/o variables */
  boolean_T Optimum_Voltage;

  /* Logic: '/AND' incorporates:
   *  Constant: '/Constant'
   *  Constant: '/Constant1'
   *  Inport: '/Input_Voltage'
   *  RelationalOperator: '/Relational Operator'
   *  RelationalOperator: '/Relational Operator1'
   */
  Optimum_Voltage = ((Input_Voltage >= VOLTAGE_MINIMUM_RANGE) && (Input_Voltage <=
    VOLTAGE_MAXIMUM_RANGE));

  /* Switch: '/Switch' incorporates:
   *  Constant: '/Constant3'
   *  Constant: '/Constant4'
   *  Inport: '/Input_Switch'
   *  Logic: '/AND'
   *  Logic: '/NOT'
   *  RelationalOperator: '/Relational Operator'
   */
  if (Optimum_Voltage && (!Input_Switch) && (INTERRUPT_1 == INTERRUPT_2)) {
    /* MultiPortSwitch: '/Multiport Switch' incorporates:
     *  Inport: '/Enable_Display'
     */
    switch (Enable_Display) {
     case 1:
      /* Switch: '/Switch' incorporates:
       *  Constant: '/Constant'
       */
      Output_Display = ON_MODE;
      break;

     case 2:
      /* Switch: '/Switch' incorporates:
       *  Constant: '/Constant'
       */
      Output_Display
 = ON_MODE;
      break;

     case 3:
      /* Switch: '/Switch' incorporates:
       *  Constant: '/Constant1'
       */
      Output_Display = OFF_MODE;
      break;

     case 4:
      /* Switch: '/Switch' incorporates:
       *  Constant: '/Constant1'
       */
      Output_Display = OFF_MODE;
      break;

     default:
      /* Switch: '/Switch' incorporates:
       *  Constant: '/Constant2'
       */
      Output_Display = STANDBY_MODE;
      break;
    }

    /* End of MultiPortSwitch: '/Multiport Switch' */
  } else {
    /* Switch: '/Switch' incorporates:
     *  Constant: '/Constant5'
     */
    Output_Display = NO_DISPLAY;
  }

  /* End of Switch: '/Switch' */
}

/* Model initialize function */
void TrafficJamAssistance_initialize(void)
{
  /* (no initialization code required) */
}

/* Model terminate function */
void TrafficJamAssistance_terminate(void)
{
  /* (no terminate code required) */
}

/*
 * File trailer for generated code.
 *
 * [EOF]
 */

Result :- Hence Model is developed for Traffic Jam assistance feature by satisfying the given requirements.

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.

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.