/*
 * File: DGM.c
 *
 * Code generated for Simulink model 'DGM'.
 *
 * Model version                  : 1.2
 * Simulink Coder version         : 8.13 (R2017b) 24-Jul-2017
 * C/C++ source code generated on : Tue Jun 16 14:04:28 2020
 *
 * Target selection: ert.tlc
 * Embedded hardware selection: Generic->Unspecified (assume 32-bit Generic)
 * Code generation objectives: Unspecified
 * Validation result: Not run
 */

#include "DGM.h"
#include "DGM_private.h"

/* Exported block signals */
uint32_T VeDGM_flgFltReactnPt;         /* '<S8>/Switch' */
uint32_T VeDGM_flgFltReactnAux;        /* '<S6>/Switch' */
uint8_T VeDGM_enmVehFltLvl;            /* '<S7>/Switch' */

/* Exported data definition */

/* ConstVolatile memory section */
#define ASW1_OEM_START_SEC_DEFAULT_CALIB_32
#include "Asw1_OEM_MemMap.h"

/* Definition for custom storage class: ConstVolatile_32 */
volatile const uint32_T KeDGM_bIOSDFC1Ovrdval = 4294967295U;
volatile const uint32_T KeDGM_bIOSDFCOvrdval = 4294967295U;
volatile const uint32_T KeDGM_flgFltReactnAuxVal = 0U;
volatile const uint32_T KeDGM_flgFltReactnPtVal = 0U;

#define ASW1_OEM_STOP_SEC_DEFAULT_CALIB_32
#include "Asw1_OEM_MemMap.h"

/* ConstVolatile memory section */
#define ASW1_OEM_START_SEC_DEFAULT_CALIB_8
#include "Asw1_OEM_MemMap.h"

/* Definition for custom storage class: ConstVolatile_8 */
volatile const uint8_T KeDGM_FltLvlVal = 0U;
volatile const boolean_T KeDGM_bFltLvlFlg = 0;
volatile const boolean_T KeDGM_bFltReactnAuxFlg = 0;
volatile const boolean_T KeDGM_bFltReactnPtFlg = 0;

#define ASW1_OEM_STOP_SEC_DEFAULT_CALIB_8
#include "Asw1_OEM_MemMap.h"

/* Block signals (auto storage) */
BlockIO_DGM DGM_B;

/* Block states (auto storage) */
D_Work_DGM DGM_DWork;

/* Real-time model */
RT_MODEL_DGM DGM_M_;
RT_MODEL_DGM *const DGM_M = &DGM_M_;

/* Output and update for atomic system: '<S3>/OnAfterDelay' */
boolean_T DGM_OnAfterDelay(boolean_T rtu_OnSignal, rtB_OnAfterDelay_DGM *localB,
  rtDW_OnAfterDelay_DGM *localDW, uint32_T rtp_taskTime, uint32_T rtp_delayTime)
{
  uint32_T qY;
  boolean_T rty_OnAfterDelay_0;

  /* Outputs for Enabled SubSystem: '<S10>/Enabled Subsystem' incorporates:
   *  EnablePort: '<S32>/Enable'
   */
  if (rtu_OnSignal) {
    if (!localDW->bitsForTID0.EnabledSubsystem_MODE) {
      /* InitializeConditions for UnitDelay: '<S32>/Unit Delay' */
      localDW->UnitDelay_DSTATE = 0U;
      localDW->bitsForTID0.EnabledSubsystem_MODE = true;
    }

    /* Sum: '<S32>/Add' incorporates:
     *  Constant: '<S32>/Constant'
     *  UnitDelay: '<S32>/Unit Delay'
     */
    qY = rtp_taskTime + localDW->UnitDelay_DSTATE;
    if (qY < rtp_taskTime) {
      qY = MAX_uint32_T;
    }

    /* RelationalOperator: '<S32>/Relational Operator' incorporates:
     *  Constant: '<S32>/Constant1'
     *  Sum: '<S32>/Add'
     */
    localB->bitsForTID0.RelationalOperator = (rtp_delayTime < qY);

    /* Update for UnitDelay: '<S32>/Unit Delay' incorporates:
     *  Sum: '<S32>/Add'
     */
    localDW->UnitDelay_DSTATE = qY;
  } else {
    if (localDW->bitsForTID0.EnabledSubsystem_MODE) {
      localDW->bitsForTID0.EnabledSubsystem_MODE = false;
    }
  }

  /* End of Outputs for SubSystem: '<S10>/Enabled Subsystem' */

  /* Logic: '<S10>/Logical Operator' */
  rty_OnAfterDelay_0 = (rtu_OnSignal && localB->bitsForTID0.RelationalOperator);
  return rty_OnAfterDelay_0;
}

/* Output and update for atomic system: '<S3>/OnAfterDelay1' */
boolean_T DGM_OnAfterDelay1(boolean_T rtu_OnSignal, rtB_OnAfterDelay_DGM_f
  *localB, rtDW_OnAfterDelay_DGM_m *localDW, uint32_T rtp_taskTime, uint32_T
  rtp_delayTime)
{
  uint32_T qY;
  boolean_T rty_OnAfterDelay_0;

  /* Outputs for Enabled SubSystem: '<S11>/Enabled Subsystem' incorporates:
   *  EnablePort: '<S33>/Enable'
   */
  if (rtu_OnSignal) {
    if (!localDW->bitsForTID0.EnabledSubsystem_MODE) {
      /* InitializeConditions for UnitDelay: '<S33>/Unit Delay' */
      localDW->UnitDelay_DSTATE = 0U;
      localDW->bitsForTID0.EnabledSubsystem_MODE = true;
    }

    /* Sum: '<S33>/Add' incorporates:
     *  Constant: '<S33>/Constant'
     *  UnitDelay: '<S33>/Unit Delay'
     */
    qY = rtp_taskTime + localDW->UnitDelay_DSTATE;
    if (qY < rtp_taskTime) {
      qY = MAX_uint32_T;
    }

    /* RelationalOperator: '<S33>/Relational Operator' incorporates:
     *  Constant: '<S33>/Constant1'
     *  Sum: '<S33>/Add'
     */
    localB->bitsForTID0.RelationalOperator = (rtp_delayTime < qY);

    /* Update for UnitDelay: '<S33>/Unit Delay' incorporates:
     *  Sum: '<S33>/Add'
     */
    localDW->UnitDelay_DSTATE = qY;
  } else {
    if (localDW->bitsForTID0.EnabledSubsystem_MODE) {
      localDW->bitsForTID0.EnabledSubsystem_MODE = false;
    }
  }

  /* End of Outputs for SubSystem: '<S11>/Enabled Subsystem' */

  /* Logic: '<S11>/Logical Operator' */
  rty_OnAfterDelay_0 = (rtu_OnSignal && localB->bitsForTID0.RelationalOperator);
  return rty_OnAfterDelay_0;
}

/* Output and update for atomic system: '<S3>/OnAfterDelay2' */
boolean_T DGM_OnAfterDelay2(boolean_T rtu_OnSignal, rtB_OnAfterDelay_DGM_j
  *localB, rtDW_OnAfterDelay_DGM_i *localDW, uint32_T rtp_taskTime, uint32_T
  rtp_delayTime)
{
  uint32_T qY;
  boolean_T rty_OnAfterDelay_0;

  /* Outputs for Enabled SubSystem: '<S12>/Enabled Subsystem' incorporates:
   *  EnablePort: '<S34>/Enable'
   */
  if (rtu_OnSignal) {
    if (!localDW->bitsForTID0.EnabledSubsystem_MODE) {
      /* InitializeConditions for UnitDelay: '<S34>/Unit Delay' */
      localDW->UnitDelay_DSTATE = 0U;
      localDW->bitsForTID0.EnabledSubsystem_MODE = true;
    }

    /* Sum: '<S34>/Add' incorporates:
     *  Constant: '<S34>/Constant'
     *  UnitDelay: '<S34>/Unit Delay'
     */
    qY = rtp_taskTime + localDW->UnitDelay_DSTATE;
    if (qY < rtp_taskTime) {
      qY = MAX_uint32_T;
    }

    /* RelationalOperator: '<S34>/Relational Operator' incorporates:
     *  Constant: '<S34>/Constant1'
     *  Sum: '<S34>/Add'
     */
    localB->bitsForTID0.RelationalOperator = (rtp_delayTime < qY);

    /* Update for UnitDelay: '<S34>/Unit Delay' incorporates:
     *  Sum: '<S34>/Add'
     */
    localDW->UnitDelay_DSTATE = qY;
  } else {
    if (localDW->bitsForTID0.EnabledSubsystem_MODE) {
      localDW->bitsForTID0.EnabledSubsystem_MODE = false;
    }
  }

  /* End of Outputs for SubSystem: '<S12>/Enabled Subsystem' */

  /* Logic: '<S12>/Logical Operator' */
  rty_OnAfterDelay_0 = (rtu_OnSignal && localB->bitsForTID0.RelationalOperator);
  return rty_OnAfterDelay_0;
}

/* Output and update for atomic system: '<S3>/OnHoldT' */
boolean_T DGM_OnHoldT(boolean_T rtu_OnSignal, rtB_OnHoldT_DGM *localB,
                      rtDW_OnHoldT_DGM *localDW, uint32_T rtp_taskTime, uint32_T
                      rtp_delayTime)
{
  uint32_T qY;
  boolean_T rty_OnAfterDelay_0;

  /* Outputs for Enabled SubSystem: '<S13>/Enabled Subsystem' incorporates:
   *  EnablePort: '<S35>/Enable'
   */
  if (rtu_OnSignal) {
    if (!localDW->bitsForTID0.EnabledSubsystem_MODE) {
      /* InitializeConditions for UnitDelay: '<S35>/Unit Delay' */
      localDW->UnitDelay_DSTATE = 0U;
      localDW->bitsForTID0.EnabledSubsystem_MODE = true;
    }

    /* Sum: '<S35>/Add' incorporates:
     *  Constant: '<S35>/Constant'
     *  UnitDelay: '<S35>/Unit Delay'
     */
    qY = rtp_taskTime + localDW->UnitDelay_DSTATE;
    if (qY < rtp_taskTime) {
      qY = MAX_uint32_T;
    }

    /* RelationalOperator: '<S35>/Relational Operator' incorporates:
     *  Constant: '<S35>/Constant1'
     *  Sum: '<S35>/Add'
     */
    localB->bitsForTID0.RelationalOperator = (rtp_delayTime > qY);

    /* Update for UnitDelay: '<S35>/Unit Delay' incorporates:
     *  Sum: '<S35>/Add'
     */
    localDW->UnitDelay_DSTATE = qY;
  } else {
    if (localDW->bitsForTID0.EnabledSubsystem_MODE) {
      localDW->bitsForTID0.EnabledSubsystem_MODE = false;
    }
  }

  /* End of Outputs for SubSystem: '<S13>/Enabled Subsystem' */

  /* Logic: '<S13>/Logical Operator' */
  rty_OnAfterDelay_0 = (rtu_OnSignal && localB->bitsForTID0.RelationalOperator);
  return rty_OnAfterDelay_0;
}

/*
 * System initialize for atomic system:
 *    '<S68>/rff_cti'
 *    '<S72>/rff_cti'
 *    '<S76>/rff_cti'
 *    '<S80>/rff_cti'
 *    '<S84>/rff_cti'
 *    '<S88>/rff_cti'
 *    '<S92>/rff_cti'
 *    '<S96>/rff_cti'
 *    '<S100>/rff_cti'
 *    '<S104>/rff_cti'
 *    ...
 */
void DGM_rff_cti_Init(boolean_T *rty_fault_flg)
{
  *rty_fault_flg = false;
}

/*
 * Output and update for atomic system:
 *    '<S68>/rff_cti'
 *    '<S72>/rff_cti'
 *    '<S76>/rff_cti'
 *    '<S80>/rff_cti'
 *    '<S84>/rff_cti'
 *    '<S88>/rff_cti'
 *    '<S92>/rff_cti'
 *    '<S96>/rff_cti'
 *    '<S100>/rff_cti'
 *    '<S104>/rff_cti'
 *    ...
 */
void DGM_rff_cti(boolean_T rtu_i_fault, int16_T rtu_sat, int16_T rtu_inc,
                 int16_T rtu_dec, boolean_T rtu_lock, boolean_T *rty_fault_flg,
                 rtDW_rff_cti_DGM *localDW)
{
  /* Chart: '<S68>/rff_cti' */
  /* Gateway: Fault Operation/DGM_flt_debounce/rff_cti */
  /* During: Fault Operation/DGM_flt_debounce/rff_cti */
  /* Entry Internal: Fault Operation/DGM_flt_debounce/rff_cti */
  /* Transition: '<S71>:8' */
  if (rtu_i_fault) {
    /* Transition: '<S71>:11' */
    localDW->count += rtu_inc;
  } else if (!rtu_lock) {
    /* Transition: '<S71>:10' */
    localDW->count -= rtu_dec;
  } else {
    /* Transition: '<S71>:22' */
  }

  /* Transition: '<S71>:13' */
  if (localDW->count >= rtu_sat) {
    /* Transition: '<S71>:16' */
    localDW->count = rtu_sat;
    *rty_fault_flg = true;
  } else if (localDW->count <= 0) {
    /* Transition: '<S71>:17' */
    localDW->count = 0;
    *rty_fault_flg = false;
  } else {
    /* Transition: '<S71>:15' */
  }

  /* End of Chart: '<S68>/rff_cti' */
  /* Transition: '<S71>:19' */
}

/* System initialize for atomic system: '<S1>/IOS' */
void DGM_IOS_Init(void)
{
  /* SystemInitialize for Chart: '<S68>/rff_cti' */
  DGM_rff_cti_Init(&COMR_DFC_Msg130Tmt);

  /* SystemInitialize for Chart: '<S112>/rff_cti' */
  DGM_rff_cti_Init(&COMR_DFC_Msg2E1Tmt);

  /* SystemInitialize for Chart: '<S156>/rff_cti' */
  DGM_rff_cti_Init(&COMR_DFC_ChkSumMsg2E1Err);

  /* SystemInitialize for Chart: '<S172>/rff_cti' */
  DGM_rff_cti_Init(&COMR_DFC_RcMsg2E1Mis);

  /* SystemInitialize for Chart: '<S176>/rff_cti' */
  DGM_rff_cti_Init(&COMR_DFC_Msg2E6Tmt);

  /* SystemInitialize for Chart: '<S180>/rff_cti' */
  DGM_rff_cti_Init(&COMR_DFC_ChkSumMsg2E6Err);

  /* SystemInitialize for Chart: '<S184>/rff_cti' */
  DGM_rff_cti_Init(&COMR_DFC_RcMsg2E6Mis);

  /* SystemInitialize for Chart: '<S188>/rff_cti' */
  DGM_rff_cti_Init(&COMR_DFC_Msg2EBTmt);

  /* SystemInitialize for Chart: '<S192>/rff_cti' */
  DGM_rff_cti_Init(&COMR_DFC_ChkSumMsg2EBErr);

  /* SystemInitialize for Chart: '<S72>/rff_cti' */
  DGM_rff_cti_Init(&COMR_DFC_RcMsg2EBMis);

  /* SystemInitialize for Chart: '<S76>/rff_cti' */
  DGM_rff_cti_Init(&COMR_DFC_MsgCABTmt);

  /* SystemInitialize for Chart: '<S80>/rff_cti' */
  DGM_rff_cti_Init(&COMR_DFC_Msg0B5Tmt);

  /* SystemInitialize for Chart: '<S84>/rff_cti' */
  DGM_rff_cti_Init(&COMR_DFC_Msg2A3Tmt);

  /* SystemInitialize for Chart: '<S88>/rff_cti' */
  DGM_rff_cti_Init(&COMR_DFC_ChkSumMsg2A3Err);

  /* SystemInitialize for Chart: '<S92>/rff_cti' */
  DGM_rff_cti_Init(&COMR_DFC_RcMsg2A3Mis);

  /* SystemInitialize for Chart: '<S96>/rff_cti' */
  DGM_rff_cti_Init(&COMR_DFC_Msg2A5Tmt);

  /* SystemInitialize for Chart: '<S100>/rff_cti' */
  DGM_rff_cti_Init(&COMR_DFC_ChkSumMsg2A5Err);

  /* SystemInitialize for Chart: '<S104>/rff_cti' */
  DGM_rff_cti_Init(&COMR_DFC_RcMsg2A5Mis);

  /* SystemInitialize for Chart: '<S108>/rff_cti' */
  DGM_rff_cti_Init(&COMR_DFC_Msg2A7Tmt);

  /* SystemInitialize for Chart: '<S116>/rff_cti' */
  DGM_rff_cti_Init(&COMR_DFC_ChkSumMsg2A7Err);

  /* SystemInitialize for Chart: '<S120>/rff_cti' */
  DGM_rff_cti_Init(&COMR_DFC_RcMsg2A7Mis);

  /* SystemInitialize for Chart: '<S124>/rff_cti' */
  DGM_rff_cti_Init(&COMR_DFC_Msg2ADTmt);

  /* SystemInitialize for Chart: '<S128>/rff_cti' */
  DGM_rff_cti_Init(&COMR_DFC_Msg2BBTmt);

  /* SystemInitialize for Chart: '<S132>/rff_cti' */
  DGM_rff_cti_Init(&COMR_DFC_Msg2DFTmt);

  /* SystemInitialize for Chart: '<S136>/rff_cti' */
  DGM_rff_cti_Init(&COMR_DFC_Msg3AATmt);

  /* SystemInitialize for Chart: '<S140>/rff_cti' */
  DGM_rff_cti_Init(&COMR_DFC_Msg050Tmt);

  /* SystemInitialize for Chart: '<S144>/rff_cti' */
  DGM_rff_cti_Init(&COMR_DFC_ChkSumMsg050Err);

  /* SystemInitialize for Chart: '<S148>/rff_cti' */
  DGM_rff_cti_Init(&COMR_DFC_RcMsg050Mis);

  /* SystemInitialize for Chart: '<S152>/rff_cti' */
  DGM_rff_cti_Init(&COMR_DFC_Msg2F1Tmt);

  /* SystemInitialize for Chart: '<S160>/rff_cti' */
  DGM_rff_cti_Init(&COMR_DFC_Msg195Tmt);

  /* SystemInitialize for Chart: '<S164>/rff_cti' */
  DGM_rff_cti_Init(&COMR_DFC_Msg37FTmt);

  /* SystemInitialize for Chart: '<S168>/rff_cti' */
  DGM_rff_cti_Init(&COMR_DFC_Msg28CTmt);
}

/* Output and update for atomic system: '<S1>/IOS' */
void DGM_IOS(void)
{
  uint8_T u0;
  uint8_T u1;

  /* Chart: '<S68>/rff_cti' incorporates:
   *  Constant: '<S68>/decrement'
   *  Constant: '<S68>/increment'
   *  Constant: '<S68>/limit'
   *  Constant: '<S68>/lock'
   *  DataTypeConversion: '<S36>/Data Type Conversion'
   *  DataTypeConversion: '<S69>/Extract Desired Bits'
   *  DataTypeConversion: '<S70>/Extract Desired Bits'
   *  Logic: '<S36>/AND'
   */
  DGM_rff_cti((((int32_T)((uint32_T)DGM_B.Product1 >> 5) & 1) != 0) && ((int32_T)
    (DGM_B.Bitwise_AUX_b >> 31) != 0), 10, 1, 2, false, &COMR_DFC_Msg130Tmt,
              &DGM_DWork.sf_rff_cti);

  /* Chart: '<S112>/rff_cti' incorporates:
   *  Constant: '<S112>/decrement'
   *  Constant: '<S112>/increment'
   *  Constant: '<S112>/limit'
   *  Constant: '<S112>/lock'
   *  DataTypeConversion: '<S113>/Extract Desired Bits'
   *  DataTypeConversion: '<S114>/Extract Desired Bits'
   *  DataTypeConversion: '<S47>/Data Type Conversion'
   *  Logic: '<S47>/AND'
   */
  DGM_rff_cti((((int32_T)((uint32_T)DGM_B.Product1 >> 5) & 1) != 0) &&
              (((int32_T)(DGM_B.Bitwise_AUX_b >> 30) & 1) != 0), 100, 1, 2,
              false, &COMR_DFC_Msg2E1Tmt, &DGM_DWork.sf_rff_cti_n);

  /* Chart: '<S156>/rff_cti' incorporates:
   *  Constant: '<S156>/decrement'
   *  Constant: '<S156>/increment'
   *  Constant: '<S156>/limit'
   *  Constant: '<S156>/lock'
   *  DataTypeConversion: '<S157>/Extract Desired Bits'
   *  DataTypeConversion: '<S158>/Extract Desired Bits'
   *  DataTypeConversion: '<S58>/Data Type Conversion'
   *  Logic: '<S58>/AND'
   */
  DGM_rff_cti((((int32_T)((uint32_T)DGM_B.Product1 >> 5) & 1) != 0) &&
              (((int32_T)(DGM_B.Bitwise_AUX_b >> 29) & 1) != 0), 100, 1, 2,
              false, &COMR_DFC_ChkSumMsg2E1Err, &DGM_DWork.sf_rff_cti_g);

  /* Chart: '<S172>/rff_cti' incorporates:
   *  Constant: '<S172>/decrement'
   *  Constant: '<S172>/increment'
   *  Constant: '<S172>/limit'
   *  Constant: '<S172>/lock'
   *  DataTypeConversion: '<S173>/Extract Desired Bits'
   *  DataTypeConversion: '<S174>/Extract Desired Bits'
   *  DataTypeConversion: '<S62>/Data Type Conversion'
   *  Logic: '<S62>/AND'
   */
  DGM_rff_cti((((int32_T)((uint32_T)DGM_B.Product1 >> 5) & 1) != 0) &&
              (((int32_T)(DGM_B.Bitwise_AUX_b >> 28) & 1) != 0), 100, 1, 2,
              false, &COMR_DFC_RcMsg2E1Mis, &DGM_DWork.sf_rff_cti_l);

  /* Chart: '<S176>/rff_cti' incorporates:
   *  Constant: '<S176>/decrement'
   *  Constant: '<S176>/increment'
   *  Constant: '<S176>/limit'
   *  Constant: '<S176>/lock'
   *  DataTypeConversion: '<S177>/Extract Desired Bits'
   *  DataTypeConversion: '<S178>/Extract Desired Bits'
   *  DataTypeConversion: '<S63>/Data Type Conversion'
   *  Logic: '<S63>/AND'
   */
  DGM_rff_cti((((int32_T)((uint32_T)DGM_B.Product1 >> 5) & 1) != 0) &&
              (((int32_T)(DGM_B.Bitwise_AUX_b >> 27) & 1) != 0), 100, 1, 2,
              false, &COMR_DFC_Msg2E6Tmt, &DGM_DWork.sf_rff_cti_j);

  /* Chart: '<S180>/rff_cti' incorporates:
   *  Constant: '<S180>/decrement'
   *  Constant: '<S180>/increment'
   *  Constant: '<S180>/limit'
   *  Constant: '<S180>/lock'
   *  DataTypeConversion: '<S181>/Extract Desired Bits'
   *  DataTypeConversion: '<S182>/Extract Desired Bits'
   *  DataTypeConversion: '<S64>/Data Type Conversion'
   *  Logic: '<S64>/AND'
   */
  DGM_rff_cti((((int32_T)((uint32_T)DGM_B.Product1 >> 5) & 1) != 0) &&
              (((int32_T)(DGM_B.Bitwise_AUX_b >> 26) & 1) != 0), 100, 1, 2,
              false, &COMR_DFC_ChkSumMsg2E6Err, &DGM_DWork.sf_rff_cti_p);

  /* Chart: '<S184>/rff_cti' incorporates:
   *  Constant: '<S184>/decrement'
   *  Constant: '<S184>/increment'
   *  Constant: '<S184>/limit'
   *  Constant: '<S184>/lock'
   *  DataTypeConversion: '<S185>/Extract Desired Bits'
   *  DataTypeConversion: '<S186>/Extract Desired Bits'
   *  DataTypeConversion: '<S65>/Data Type Conversion'
   *  Logic: '<S65>/AND'
   */
  DGM_rff_cti((((int32_T)((uint32_T)DGM_B.Product1 >> 5) & 1) != 0) &&
              (((int32_T)(DGM_B.Bitwise_AUX_b >> 25) & 1) != 0), 100, 1, 2,
              false, &COMR_DFC_RcMsg2E6Mis, &DGM_DWork.sf_rff_cti_m);

  /* Chart: '<S188>/rff_cti' incorporates:
   *  Constant: '<S188>/decrement'
   *  Constant: '<S188>/increment'
   *  Constant: '<S188>/limit'
   *  Constant: '<S188>/lock'
   *  DataTypeConversion: '<S189>/Extract Desired Bits'
   *  DataTypeConversion: '<S190>/Extract Desired Bits'
   *  DataTypeConversion: '<S66>/Data Type Conversion'
   *  Logic: '<S66>/AND'
   */
  DGM_rff_cti((((int32_T)((uint32_T)DGM_B.Product1 >> 5) & 1) != 0) &&
              (((int32_T)(DGM_B.Bitwise_AUX_b >> 24) & 1) != 0), 100, 1, 2,
              false, &COMR_DFC_Msg2EBTmt, &DGM_DWork.sf_rff_cti_d);

  /* Chart: '<S192>/rff_cti' incorporates:
   *  Constant: '<S192>/decrement'
   *  Constant: '<S192>/increment'
   *  Constant: '<S192>/limit'
   *  Constant: '<S192>/lock'
   *  DataTypeConversion: '<S193>/Extract Desired Bits'
   *  DataTypeConversion: '<S194>/Extract Desired Bits'
   *  DataTypeConversion: '<S67>/Data Type Conversion'
   *  Logic: '<S67>/AND'
   */
  DGM_rff_cti((((int32_T)((uint32_T)DGM_B.Product1 >> 5) & 1) != 0) &&
              (((uint8_T)(DGM_B.Bitwise_AUX_b >> 23) & 1) != 0), 100, 1, 2,
              false, &COMR_DFC_ChkSumMsg2EBErr, &DGM_DWork.sf_rff_cti_k);

  /* Chart: '<S72>/rff_cti' incorporates:
   *  Constant: '<S72>/decrement'
   *  Constant: '<S72>/increment'
   *  Constant: '<S72>/limit'
   *  Constant: '<S72>/lock'
   *  DataTypeConversion: '<S37>/Data Type Conversion'
   *  DataTypeConversion: '<S73>/Extract Desired Bits'
   *  DataTypeConversion: '<S74>/Extract Desired Bits'
   *  Logic: '<S37>/AND'
   */
  DGM_rff_cti((((int32_T)((uint32_T)DGM_B.Product1 >> 5) & 1) != 0) &&
              (((uint8_T)(DGM_B.Bitwise_AUX_b >> 22) & 1) != 0), 100, 1, 2,
              false, &COMR_DFC_RcMsg2EBMis, &DGM_DWork.sf_rff_cti_gn);

  /* Chart: '<S76>/rff_cti' incorporates:
   *  Constant: '<S76>/decrement'
   *  Constant: '<S76>/increment'
   *  Constant: '<S76>/limit'
   *  Constant: '<S76>/lock'
   *  DataTypeConversion: '<S38>/Data Type Conversion'
   *  DataTypeConversion: '<S77>/Extract Desired Bits'
   *  DataTypeConversion: '<S78>/Extract Desired Bits'
   *  Logic: '<S38>/AND'
   */
  DGM_rff_cti((((int32_T)((uint32_T)DGM_B.Product1 >> 5) & 1) != 0) &&
              (((uint8_T)(DGM_B.Bitwise_AUX_b >> 21) & 1) != 0), 10, 1, 2, false,
              &COMR_DFC_MsgCABTmt, &DGM_DWork.sf_rff_cti_b);

  /* Chart: '<S80>/rff_cti' incorporates:
   *  Constant: '<S80>/decrement'
   *  Constant: '<S80>/increment'
   *  Constant: '<S80>/limit'
   *  Constant: '<S80>/lock'
   *  DataTypeConversion: '<S39>/Data Type Conversion'
   *  DataTypeConversion: '<S81>/Extract Desired Bits'
   *  DataTypeConversion: '<S82>/Extract Desired Bits'
   *  Logic: '<S39>/AND'
   */
  DGM_rff_cti((((int32_T)((uint32_T)DGM_B.Product1 >> 5) & 1) != 0) &&
              (((uint8_T)(DGM_B.Bitwise_AUX_b >> 20) & 1) != 0), 10, 1, 2, false,
              &COMR_DFC_Msg0B5Tmt, &DGM_DWork.sf_rff_cti_gv);

  /* Chart: '<S84>/rff_cti' incorporates:
   *  Constant: '<S84>/decrement'
   *  Constant: '<S84>/increment'
   *  Constant: '<S84>/limit'
   *  Constant: '<S84>/lock'
   *  DataTypeConversion: '<S40>/Data Type Conversion'
   *  DataTypeConversion: '<S85>/Extract Desired Bits'
   *  DataTypeConversion: '<S86>/Extract Desired Bits'
   *  Logic: '<S40>/AND'
   */
  DGM_rff_cti((((int32_T)((uint32_T)DGM_B.Product1 >> 5) & 1) != 0) &&
              (((uint8_T)(DGM_B.Bitwise_AUX_b >> 19) & 1) != 0), 10, 1, 2, false,
              &COMR_DFC_Msg2A3Tmt, &DGM_DWork.sf_rff_cti_e);

  /* Chart: '<S88>/rff_cti' incorporates:
   *  Constant: '<S88>/decrement'
   *  Constant: '<S88>/increment'
   *  Constant: '<S88>/limit'
   *  Constant: '<S88>/lock'
   *  DataTypeConversion: '<S41>/Data Type Conversion'
   *  DataTypeConversion: '<S89>/Extract Desired Bits'
   *  DataTypeConversion: '<S90>/Extract Desired Bits'
   *  Logic: '<S41>/AND'
   */
  DGM_rff_cti((((int32_T)((uint32_T)DGM_B.Product1 >> 5) & 1) != 0) &&
              (((uint8_T)(DGM_B.Bitwise_AUX_b >> 18) & 1) != 0), 10, 1, 2, false,
              &COMR_DFC_ChkSumMsg2A3Err, &DGM_DWork.sf_rff_cti_o);

  /* Chart: '<S92>/rff_cti' incorporates:
   *  Constant: '<S92>/decrement'
   *  Constant: '<S92>/increment'
   *  Constant: '<S92>/limit'
   *  Constant: '<S92>/lock'
   *  DataTypeConversion: '<S42>/Data Type Conversion'
   *  DataTypeConversion: '<S93>/Extract Desired Bits'
   *  DataTypeConversion: '<S94>/Extract Desired Bits'
   *  Logic: '<S42>/AND'
   */
  DGM_rff_cti((((int32_T)((uint32_T)DGM_B.Product1 >> 5) & 1) != 0) &&
              (((uint8_T)(DGM_B.Bitwise_AUX_b >> 17) & 1) != 0), 10, 1, 2, false,
              &COMR_DFC_RcMsg2A3Mis, &DGM_DWork.sf_rff_cti_f);

  /* Chart: '<S96>/rff_cti' incorporates:
   *  Constant: '<S96>/decrement'
   *  Constant: '<S96>/increment'
   *  Constant: '<S96>/limit'
   *  Constant: '<S96>/lock'
   *  DataTypeConversion: '<S43>/Data Type Conversion'
   *  DataTypeConversion: '<S97>/Extract Desired Bits'
   *  DataTypeConversion: '<S98>/Extract Desired Bits'
   *  Logic: '<S43>/AND'
   */
  DGM_rff_cti((((int32_T)((uint32_T)DGM_B.Product1 >> 5) & 1) != 0) &&
              (((uint8_T)(DGM_B.Bitwise_AUX_b >> 16) & 1) != 0), 100, 1, 2,
              false, &COMR_DFC_Msg2A5Tmt, &DGM_DWork.sf_rff_cti_ph);

  /* Chart: '<S100>/rff_cti' incorporates:
   *  Constant: '<S100>/decrement'
   *  Constant: '<S100>/increment'
   *  Constant: '<S100>/limit'
   *  Constant: '<S100>/lock'
   *  DataTypeConversion: '<S101>/Extract Desired Bits'
   *  DataTypeConversion: '<S102>/Extract Desired Bits'
   *  DataTypeConversion: '<S44>/Data Type Conversion'
   *  Logic: '<S44>/AND'
   */
  DGM_rff_cti((((int32_T)((uint32_T)DGM_B.Product1 >> 5) & 1) != 0) &&
              (((uint8_T)(DGM_B.Bitwise_AUX_b >> 15) & 1) != 0), 100, 1, 2,
              false, &COMR_DFC_ChkSumMsg2A5Err, &DGM_DWork.sf_rff_cti_c);

  /* Chart: '<S104>/rff_cti' incorporates:
   *  Constant: '<S104>/decrement'
   *  Constant: '<S104>/increment'
   *  Constant: '<S104>/limit'
   *  Constant: '<S104>/lock'
   *  DataTypeConversion: '<S105>/Extract Desired Bits'
   *  DataTypeConversion: '<S106>/Extract Desired Bits'
   *  DataTypeConversion: '<S45>/Data Type Conversion'
   *  Logic: '<S45>/AND'
   */
  DGM_rff_cti((((int32_T)((uint32_T)DGM_B.Product1 >> 5) & 1) != 0) &&
              (((uint8_T)(DGM_B.Bitwise_AUX_b >> 14) & 1) != 0), 100, 1, 2,
              false, &COMR_DFC_RcMsg2A5Mis, &DGM_DWork.sf_rff_cti_e3);

  /* Chart: '<S108>/rff_cti' incorporates:
   *  Constant: '<S108>/decrement'
   *  Constant: '<S108>/increment'
   *  Constant: '<S108>/limit'
   *  Constant: '<S108>/lock'
   *  DataTypeConversion: '<S109>/Extract Desired Bits'
   *  DataTypeConversion: '<S110>/Extract Desired Bits'
   *  DataTypeConversion: '<S46>/Data Type Conversion'
   *  Logic: '<S46>/AND'
   */
  DGM_rff_cti((((int32_T)((uint32_T)DGM_B.Product1 >> 5) & 1) != 0) &&
              (((uint8_T)(DGM_B.Bitwise_AUX_b >> 13) & 1) != 0), 100, 1, 2,
              false, &COMR_DFC_Msg2A7Tmt, &DGM_DWork.sf_rff_cti_el);

  /* Chart: '<S116>/rff_cti' incorporates:
   *  Constant: '<S116>/decrement'
   *  Constant: '<S116>/increment'
   *  Constant: '<S116>/limit'
   *  Constant: '<S116>/lock'
   *  DataTypeConversion: '<S117>/Extract Desired Bits'
   *  DataTypeConversion: '<S118>/Extract Desired Bits'
   *  DataTypeConversion: '<S48>/Data Type Conversion'
   *  Logic: '<S48>/AND'
   */
  DGM_rff_cti((((int32_T)((uint32_T)DGM_B.Product1 >> 5) & 1) != 0) &&
              (((uint8_T)(DGM_B.Bitwise_AUX_b >> 12) & 1) != 0), 100, 1, 2,
              false, &COMR_DFC_ChkSumMsg2A7Err, &DGM_DWork.sf_rff_cti_fx);

  /* Chart: '<S120>/rff_cti' incorporates:
   *  Constant: '<S120>/decrement'
   *  Constant: '<S120>/increment'
   *  Constant: '<S120>/limit'
   *  Constant: '<S120>/lock'
   *  DataTypeConversion: '<S121>/Extract Desired Bits'
   *  DataTypeConversion: '<S122>/Extract Desired Bits'
   *  DataTypeConversion: '<S49>/Data Type Conversion'
   *  Logic: '<S49>/AND'
   */
  DGM_rff_cti((((int32_T)((uint32_T)DGM_B.Product1 >> 5) & 1) != 0) &&
              (((uint8_T)(DGM_B.Bitwise_AUX_b >> 11) & 1) != 0), 100, 1, 2,
              false, &COMR_DFC_RcMsg2A7Mis, &DGM_DWork.sf_rff_cti_bp);

  /* Chart: '<S124>/rff_cti' incorporates:
   *  Constant: '<S124>/decrement'
   *  Constant: '<S124>/increment'
   *  Constant: '<S124>/limit'
   *  Constant: '<S124>/lock'
   *  DataTypeConversion: '<S125>/Extract Desired Bits'
   *  DataTypeConversion: '<S126>/Extract Desired Bits'
   *  DataTypeConversion: '<S50>/Data Type Conversion'
   *  Logic: '<S50>/AND'
   */
  DGM_rff_cti((((int32_T)((uint32_T)DGM_B.Product1 >> 5) & 1) != 0) &&
              (((uint8_T)(DGM_B.Bitwise_AUX_b >> 10) & 1) != 0), 100, 1, 2,
              false, &COMR_DFC_Msg2ADTmt, &DGM_DWork.sf_rff_cti_jg);

  /* Chart: '<S128>/rff_cti' incorporates:
   *  Constant: '<S128>/decrement'
   *  Constant: '<S128>/increment'
   *  Constant: '<S128>/limit'
   *  Constant: '<S128>/lock'
   *  DataTypeConversion: '<S129>/Extract Desired Bits'
   *  DataTypeConversion: '<S130>/Extract Desired Bits'
   *  DataTypeConversion: '<S51>/Data Type Conversion'
   *  Logic: '<S51>/AND'
   */
  DGM_rff_cti((((int32_T)((uint32_T)DGM_B.Product1 >> 5) & 1) != 0) &&
              (((uint8_T)(DGM_B.Bitwise_AUX_b >> 9) & 1) != 0), 100, 1, 2, false,
              &COMR_DFC_Msg2BBTmt, &DGM_DWork.sf_rff_cti_eg);

  /* Chart: '<S132>/rff_cti' incorporates:
   *  Constant: '<S132>/decrement'
   *  Constant: '<S132>/increment'
   *  Constant: '<S132>/limit'
   *  Constant: '<S132>/lock'
   *  DataTypeConversion: '<S133>/Extract Desired Bits'
   *  DataTypeConversion: '<S134>/Extract Desired Bits'
   *  DataTypeConversion: '<S52>/Data Type Conversion'
   *  Logic: '<S52>/AND'
   */
  DGM_rff_cti((((int32_T)((uint32_T)DGM_B.Product1 >> 5) & 1) != 0) &&
              (((uint8_T)(DGM_B.Bitwise_AUX_b >> 8) & 1) != 0), 100, 1, 2, false,
              &COMR_DFC_Msg2DFTmt, &DGM_DWork.sf_rff_cti_mi);

  /* Chart: '<S136>/rff_cti' incorporates:
   *  Constant: '<S136>/decrement'
   *  Constant: '<S136>/increment'
   *  Constant: '<S136>/limit'
   *  Constant: '<S136>/lock'
   *  DataTypeConversion: '<S137>/Extract Desired Bits'
   *  DataTypeConversion: '<S138>/Extract Desired Bits'
   *  DataTypeConversion: '<S53>/Data Type Conversion'
   *  Logic: '<S53>/AND'
   */
  DGM_rff_cti((((int32_T)((uint32_T)DGM_B.Product1 >> 5) & 1) != 0) &&
              (((uint8_T)(DGM_B.Bitwise_AUX_b >> 7) & 1) != 0), 1000, 1, 2,
              false, &COMR_DFC_Msg3AATmt, &DGM_DWork.sf_rff_cti_j2);

  /* Chart: '<S140>/rff_cti' incorporates:
   *  Constant: '<S140>/decrement'
   *  Constant: '<S140>/increment'
   *  Constant: '<S140>/limit'
   *  Constant: '<S140>/lock'
   *  DataTypeConversion: '<S141>/Extract Desired Bits'
   *  DataTypeConversion: '<S142>/Extract Desired Bits'
   *  DataTypeConversion: '<S54>/Data Type Conversion'
   *  Logic: '<S54>/AND'
   */
  DGM_rff_cti((((int32_T)((uint32_T)DGM_B.Product1 >> 5) & 1) != 0) &&
              (((uint8_T)(DGM_B.Bitwise_AUX_b >> 6) & 1) != 0), 100, 1, 2, false,
              &COMR_DFC_Msg050Tmt, &DGM_DWork.sf_rff_cti_fp);

  /* Chart: '<S144>/rff_cti' incorporates:
   *  Constant: '<S144>/decrement'
   *  Constant: '<S144>/increment'
   *  Constant: '<S144>/limit'
   *  Constant: '<S144>/lock'
   *  DataTypeConversion: '<S145>/Extract Desired Bits'
   *  DataTypeConversion: '<S146>/Extract Desired Bits'
   *  DataTypeConversion: '<S55>/Data Type Conversion'
   *  Logic: '<S55>/AND'
   */
  DGM_rff_cti((((int32_T)((uint32_T)DGM_B.Product1 >> 5) & 1) != 0) &&
              (((uint8_T)(DGM_B.Bitwise_AUX_b >> 5) & 1) != 0), 100, 1, 2, false,
              &COMR_DFC_ChkSumMsg050Err, &DGM_DWork.sf_rff_cti_dw);

  /* Chart: '<S148>/rff_cti' incorporates:
   *  Constant: '<S148>/decrement'
   *  Constant: '<S148>/increment'
   *  Constant: '<S148>/limit'
   *  Constant: '<S148>/lock'
   *  DataTypeConversion: '<S149>/Extract Desired Bits'
   *  DataTypeConversion: '<S150>/Extract Desired Bits'
   *  DataTypeConversion: '<S56>/Data Type Conversion'
   *  Logic: '<S56>/AND'
   */
  DGM_rff_cti((((int32_T)((uint32_T)DGM_B.Product1 >> 5) & 1) != 0) &&
              (((uint8_T)(DGM_B.Bitwise_AUX_b >> 4) & 1) != 0), 100, 1, 2, false,
              &COMR_DFC_RcMsg050Mis, &DGM_DWork.sf_rff_cti_f2);

  /* Chart: '<S152>/rff_cti' incorporates:
   *  Constant: '<S152>/decrement'
   *  Constant: '<S152>/increment'
   *  Constant: '<S152>/limit'
   *  Constant: '<S152>/lock'
   *  DataTypeConversion: '<S153>/Extract Desired Bits'
   *  DataTypeConversion: '<S154>/Extract Desired Bits'
   *  DataTypeConversion: '<S57>/Data Type Conversion'
   *  Logic: '<S57>/AND'
   */
  DGM_rff_cti((((int32_T)((uint32_T)DGM_B.Product1 >> 5) & 1) != 0) &&
              (((uint8_T)(DGM_B.Bitwise_AUX_b >> 3) & 1) != 0), 100, 1, 2, false,
              &COMR_DFC_Msg2F1Tmt, &DGM_DWork.sf_rff_cti_mb);

  /* Chart: '<S160>/rff_cti' incorporates:
   *  Constant: '<S160>/decrement'
   *  Constant: '<S160>/increment'
   *  Constant: '<S160>/limit'
   *  Constant: '<S160>/lock'
   *  DataTypeConversion: '<S161>/Extract Desired Bits'
   *  DataTypeConversion: '<S162>/Extract Desired Bits'
   *  DataTypeConversion: '<S59>/Data Type Conversion'
   *  Logic: '<S59>/AND'
   */
  DGM_rff_cti((((int32_T)((uint32_T)DGM_B.Product1 >> 5) & 1) != 0) &&
              (((uint8_T)(DGM_B.Bitwise_AUX_b >> 2) & 1) != 0), 500, 1, 2, false,
              &COMR_DFC_Msg195Tmt, &DGM_DWork.sf_rff_cti_mb1);

  /* Chart: '<S164>/rff_cti' incorporates:
   *  Constant: '<S164>/decrement'
   *  Constant: '<S164>/increment'
   *  Constant: '<S164>/limit'
   *  Constant: '<S164>/lock'
   *  DataTypeConversion: '<S165>/Extract Desired Bits'
   *  DataTypeConversion: '<S166>/Extract Desired Bits'
   *  DataTypeConversion: '<S60>/Data Type Conversion'
   *  Logic: '<S60>/AND'
   */
  DGM_rff_cti((((int32_T)((uint32_T)DGM_B.Product1 >> 5) & 1) != 0) &&
              (((uint8_T)(DGM_B.Bitwise_AUX_b >> 1) & 1) != 0), 500, 1, 2, false,
              &COMR_DFC_Msg37FTmt, &DGM_DWork.sf_rff_cti_e4);

  /* Chart: '<S168>/rff_cti' incorporates:
   *  Constant: '<S168>/decrement'
   *  Constant: '<S168>/increment'
   *  Constant: '<S168>/limit'
   *  Constant: '<S168>/lock'
   *  DataTypeConversion: '<S169>/Extract Desired Bits'
   *  DataTypeConversion: '<S170>/Extract Desired Bits'
   *  DataTypeConversion: '<S61>/Data Type Conversion'
   *  Logic: '<S61>/AND'
   */
  DGM_rff_cti((((int32_T)((uint32_T)DGM_B.Product1 >> 5) & 1) != 0) &&
              (((uint8_T)DGM_B.Bitwise_AUX_b & 1) != 0), 500, 1, 2, false,
              &COMR_DFC_Msg28CTmt, &DGM_DWork.sf_rff_cti_f1);

  /* S-Function (sfix_bitop): '<S4>/Bitwise_AUX' incorporates:
   *  Constant: '<S36>/Calibration9'
   *  Constant: '<S37>/Calibration9'
   *  Constant: '<S38>/Calibration9'
   *  Constant: '<S39>/Calibration9'
   *  Constant: '<S40>/Calibration9'
   *  Constant: '<S41>/Calibration9'
   *  Constant: '<S42>/Calibration9'
   *  Constant: '<S43>/Calibration9'
   *  Constant: '<S44>/Calibration9'
   *  Constant: '<S45>/Calibration9'
   *  Constant: '<S46>/Calibration9'
   *  Constant: '<S47>/Calibration9'
   *  Constant: '<S48>/Calibration9'
   *  Constant: '<S49>/Calibration9'
   *  Constant: '<S50>/Calibration9'
   *  Constant: '<S51>/Calibration9'
   *  Constant: '<S52>/Calibration9'
   *  Constant: '<S53>/Calibration9'
   *  Constant: '<S54>/Calibration9'
   *  Constant: '<S55>/Calibration9'
   *  Constant: '<S56>/Calibration9'
   *  Constant: '<S57>/Calibration9'
   *  Constant: '<S58>/Calibration9'
   *  Constant: '<S59>/Calibration9'
   *  Constant: '<S60>/Calibration9'
   *  Constant: '<S61>/Calibration9'
   *  Constant: '<S62>/Calibration9'
   *  Constant: '<S63>/Calibration9'
   *  Constant: '<S64>/Calibration9'
   *  Constant: '<S65>/Calibration9'
   *  Constant: '<S66>/Calibration9'
   *  Constant: '<S67>/Calibration9'
   *  Product: '<S36>/Product2'
   *  Product: '<S37>/Product2'
   *  Product: '<S38>/Product2'
   *  Product: '<S39>/Product2'
   *  Product: '<S40>/Product2'
   *  Product: '<S41>/Product2'
   *  Product: '<S42>/Product2'
   *  Product: '<S43>/Product2'
   *  Product: '<S44>/Product2'
   *  Product: '<S45>/Product2'
   *  Product: '<S46>/Product2'
   *  Product: '<S47>/Product2'
   *  Product: '<S48>/Product2'
   *  Product: '<S49>/Product2'
   *  Product: '<S50>/Product2'
   *  Product: '<S51>/Product2'
   *  Product: '<S52>/Product2'
   *  Product: '<S53>/Product2'
   *  Product: '<S54>/Product2'
   *  Product: '<S55>/Product2'
   *  Product: '<S56>/Product2'
   *  Product: '<S57>/Product2'
   *  Product: '<S58>/Product2'
   *  Product: '<S59>/Product2'
   *  Product: '<S60>/Product2'
   *  Product: '<S61>/Product2'
   *  Product: '<S62>/Product2'
   *  Product: '<S63>/Product2'
   *  Product: '<S64>/Product2'
   *  Product: '<S65>/Product2'
   *  Product: '<S66>/Product2'
   *  Product: '<S67>/Product2'
   */
  DGM_B.Bitwise_AUX = 0U;

  /* S-Function (sfix_bitop): '<S4>/Bitwise_PT' incorporates:
   *  Constant: '<S36>/Calibration6'
   *  Product: '<S36>/Product97'
   *  Product: '<S47>/Product97'
   *  Product: '<S58>/Product97'
   *  Product: '<S62>/Product97'
   *  Product: '<S63>/Product97'
   *  Product: '<S64>/Product97'
   *  Product: '<S65>/Product97'
   *  Product: '<S66>/Product97'
   *  Product: '<S67>/Product97'
   */
  DGM_B.Bitwise_PT_i = (uint32_T)COMR_DFC_Msg2E1Tmt << 28 | (COMR_DFC_Msg130Tmt ?
    3221225472U : 0U) | (uint32_T)COMR_DFC_ChkSumMsg2E1Err << 28 | (uint32_T)
    COMR_DFC_RcMsg2E1Mis << 28 | (uint32_T)COMR_DFC_Msg2E6Tmt << 28 | (uint32_T)
    COMR_DFC_ChkSumMsg2E6Err << 28 | (uint32_T)COMR_DFC_RcMsg2E6Mis << 28 |
    (uint32_T)COMR_DFC_Msg2EBTmt << 28 | (uint32_T)COMR_DFC_ChkSumMsg2EBErr <<
    28;

  /* MinMax: '<S4>/Max' incorporates:
   *  Constant: '<S36>/Calibration7'
   *  Constant: '<S37>/Calibration7'
   *  Constant: '<S38>/Calibration7'
   *  Constant: '<S39>/Calibration7'
   *  Constant: '<S40>/Calibration7'
   *  Constant: '<S41>/Calibration7'
   *  Constant: '<S42>/Calibration7'
   *  Constant: '<S43>/Calibration7'
   *  Constant: '<S44>/Calibration7'
   *  Constant: '<S45>/Calibration7'
   *  Constant: '<S46>/Calibration7'
   *  Constant: '<S47>/Calibration7'
   *  Constant: '<S48>/Calibration7'
   *  Constant: '<S49>/Calibration7'
   *  Constant: '<S50>/Calibration7'
   *  Constant: '<S51>/Calibration7'
   *  Constant: '<S52>/Calibration7'
   *  Constant: '<S53>/Calibration7'
   *  Constant: '<S54>/Calibration7'
   *  Constant: '<S55>/Calibration7'
   *  Constant: '<S56>/Calibration7'
   *  Constant: '<S57>/Calibration7'
   *  Constant: '<S58>/Calibration7'
   *  Constant: '<S59>/Calibration7'
   *  Constant: '<S60>/Calibration7'
   *  Constant: '<S61>/Calibration7'
   *  Constant: '<S62>/Calibration7'
   *  Constant: '<S63>/Calibration7'
   *  Constant: '<S64>/Calibration7'
   *  Constant: '<S65>/Calibration7'
   *  Constant: '<S66>/Calibration7'
   *  Constant: '<S67>/Calibration7'
   *  Product: '<S36>/Product1'
   *  Product: '<S37>/Product1'
   *  Product: '<S38>/Product1'
   *  Product: '<S39>/Product1'
   *  Product: '<S40>/Product1'
   *  Product: '<S41>/Product1'
   *  Product: '<S42>/Product1'
   *  Product: '<S43>/Product1'
   *  Product: '<S44>/Product1'
   *  Product: '<S45>/Product1'
   *  Product: '<S46>/Product1'
   *  Product: '<S47>/Product1'
   *  Product: '<S48>/Product1'
   *  Product: '<S49>/Product1'
   *  Product: '<S50>/Product1'
   *  Product: '<S51>/Product1'
   *  Product: '<S52>/Product1'
   *  Product: '<S53>/Product1'
   *  Product: '<S54>/Product1'
   *  Product: '<S55>/Product1'
   *  Product: '<S56>/Product1'
   *  Product: '<S57>/Product1'
   *  Product: '<S58>/Product1'
   *  Product: '<S59>/Product1'
   *  Product: '<S60>/Product1'
   *  Product: '<S61>/Product1'
   *  Product: '<S62>/Product1'
   *  Product: '<S63>/Product1'
   *  Product: '<S64>/Product1'
   *  Product: '<S65>/Product1'
   *  Product: '<S66>/Product1'
   *  Product: '<S67>/Product1'
   */
  u0 = (uint8_T)(COMR_DFC_Msg130Tmt ? 3 : 0);
  u1 = (uint8_T)(COMR_DFC_Msg2E1Tmt ? 3 : 0);
  if (u0 > u1) {
    u1 = u0;
  }

  u0 = (uint8_T)(COMR_DFC_ChkSumMsg2E1Err ? 3 : 0);
  if (u1 > u0) {
    u0 = u1;
  }

  u1 = (uint8_T)(COMR_DFC_RcMsg2E1Mis ? 3 : 0);
  if (u0 > u1) {
    u1 = u0;
  }

  u0 = (uint8_T)(COMR_DFC_Msg2E6Tmt ? 3 : 0);
  if (u1 > u0) {
    u0 = u1;
  }

  u1 = (uint8_T)(COMR_DFC_ChkSumMsg2E6Err ? 3 : 0);
  if (u0 > u1) {
    u1 = u0;
  }

  u0 = (uint8_T)(COMR_DFC_RcMsg2E6Mis ? 3 : 0);
  if (u1 > u0) {
    u0 = u1;
  }

  u1 = (uint8_T)(COMR_DFC_Msg2EBTmt ? 3 : 0);
  if (u0 > u1) {
    u1 = u0;
  }

  u0 = (uint8_T)(COMR_DFC_ChkSumMsg2EBErr ? 3 : 0);
  if (u1 > u0) {
    u0 = u1;
  }

  u1 = (uint8_T)(COMR_DFC_RcMsg2EBMis ? 3 : 0);
  if (u0 > u1) {
    u1 = u0;
  }

  u0 = (uint8_T)(COMR_DFC_MsgCABTmt ? 3 : 0);
  if (u1 > u0) {
    u0 = u1;
  }

  u1 = (uint8_T)(COMR_DFC_Msg0B5Tmt ? 3 : 0);
  if (u0 > u1) {
    u1 = u0;
  }

  u0 = (uint8_T)(COMR_DFC_Msg2A3Tmt ? 3 : 0);
  if (u1 > u0) {
    u0 = u1;
  }

  u1 = (uint8_T)(COMR_DFC_ChkSumMsg2A3Err ? 3 : 0);
  if (u0 > u1) {
    u1 = u0;
  }

  u0 = (uint8_T)(COMR_DFC_RcMsg2A3Mis ? 3 : 0);
  if (u1 > u0) {
    u0 = u1;
  }

  u1 = (uint8_T)(COMR_DFC_Msg2A5Tmt ? 3 : 0);
  if (u0 > u1) {
    u1 = u0;
  }

  u0 = (uint8_T)(COMR_DFC_ChkSumMsg2A5Err ? 3 : 0);
  if (u1 > u0) {
    u0 = u1;
  }

  u1 = (uint8_T)(COMR_DFC_RcMsg2A5Mis ? 3 : 0);
  if (u0 > u1) {
    u1 = u0;
  }

  u0 = (uint8_T)(COMR_DFC_Msg2A7Tmt ? 3 : 0);
  if (u1 > u0) {
    u0 = u1;
  }

  u1 = (uint8_T)(COMR_DFC_ChkSumMsg2A7Err ? 3 : 0);
  if (u0 > u1) {
    u1 = u0;
  }

  u0 = (uint8_T)(COMR_DFC_RcMsg2A7Mis ? 3 : 0);
  if (u1 > u0) {
    u0 = u1;
  }

  u1 = (uint8_T)(COMR_DFC_Msg2ADTmt ? 3 : 0);
  if (u0 > u1) {
    u1 = u0;
  }

  u0 = (uint8_T)(COMR_DFC_Msg2BBTmt ? 3 : 0);
  if (u1 > u0) {
    u0 = u1;
  }

  u1 = (uint8_T)(COMR_DFC_Msg2DFTmt ? 3 : 0);
  if (u0 > u1) {
    u1 = u0;
  }

  u0 = (uint8_T)(COMR_DFC_Msg3AATmt ? 3 : 0);
  if (u1 > u0) {
    u0 = u1;
  }

  u1 = (uint8_T)(COMR_DFC_Msg050Tmt ? 3 : 0);
  if (u0 > u1) {
    u1 = u0;
  }

  u0 = (uint8_T)(COMR_DFC_ChkSumMsg050Err ? 3 : 0);
  if (u1 > u0) {
    u0 = u1;
  }

  u1 = (uint8_T)(COMR_DFC_RcMsg050Mis ? 3 : 0);
  if (u0 > u1) {
    u1 = u0;
  }

  u0 = (uint8_T)(COMR_DFC_Msg2F1Tmt ? 3 : 0);
  if (u1 > u0) {
    u0 = u1;
  }

  u1 = (uint8_T)(COMR_DFC_Msg195Tmt ? 3 : 0);
  if (u0 > u1) {
    u1 = u0;
  }

  u0 = (uint8_T)(COMR_DFC_Msg37FTmt ? 3 : 0);
  if (u1 > u0) {
    u0 = u1;
  }

  u1 = (uint8_T)(COMR_DFC_Msg28CTmt ? 3 : 0);
  if (u0 > u1) {
    DGM_B.Max = u0;
  } else {
    DGM_B.Max = u1;
  }

  /* End of MinMax: '<S4>/Max' */
}

/* System initialize for atomic system: '<S1>/IOS1' */
void DGM_IOS1_Init(void)
{
  /* SystemInitialize for Chart: '<S197>/rff_cti' */
  DGM_rff_cti_Init(&COMR_DFC_Msg17DTmt);
}

/* Output and update for atomic system: '<S1>/IOS1' */
void DGM_IOS1(void)
{
  /* Chart: '<S197>/rff_cti' incorporates:
   *  Constant: '<S197>/decrement'
   *  Constant: '<S197>/increment'
   *  Constant: '<S197>/limit'
   *  Constant: '<S197>/lock'
   *  DataTypeConversion: '<S196>/Data Type Conversion'
   *  DataTypeConversion: '<S198>/Extract Desired Bits'
   *  DataTypeConversion: '<S199>/Extract Desired Bits'
   *  Logic: '<S196>/AND'
   */
  DGM_rff_cti((((int32_T)((uint32_T)DGM_B.Product1 >> 5) & 1) != 0) && ((int32_T)
    (DGM_B.Bitwise_AUX_b >> 31) != 0), 20, 1, 2, false, &COMR_DFC_Msg17DTmt,
              &DGM_DWork.sf_rff_cti_i);

  /* S-Function (sfix_bitop): '<S5>/Bitwise_AUX' incorporates:
   *  Constant: '<S196>/Calibration9'
   *  Product: '<S196>/Product2'
   */
  DGM_B.Bitwise_AUX_b = 0U;

  /* S-Function (sfix_bitop): '<S5>/Bitwise_PT' incorporates:
   *  Constant: '<S196>/Calibration6'
   *  Product: '<S196>/Product97'
   */
  DGM_B.Bitwise_PT = 0U;

  /* Product: '<S196>/Product1' incorporates:
   *  Constant: '<S196>/Calibration7'
   */
  DGM_B.Product1 = (uint8_T)(COMR_DFC_Msg17DTmt ? 3 : 0);
}

/* Model step function */
void DGM_step(void)
{
  boolean_T rtb_NOT;
  boolean_T rtb_LogicalOperator_a;
  boolean_T rtb_AND_o4;
  boolean_T rtb_LogicalOperator_c;
  uint8_T rtb_Switch_k;
  uint32_T rtb_Switch_ku;

  /* Logic: '<S3>/NOT' incorporates:
   *  Inport: '<Root>/COMR_stEol'
   */
  rtb_NOT = !COMR_stEol;

  /* Switch: '<S15>/Switch' incorporates:
   *  Constant: '<S9>/Constant'
   *  Inport: '<Root>/COMR_bLvComDiagEn'
   *  Logic: '<S3>/AND4'
   *  S-Function (sfix_bitop): '<S22>/FixPt Bitwise Operator3'
   *  S-Function (sfix_bitop): '<S22>/FixPt Bitwise Operator4'
   *  S-Function (sfix_bitop): '<S22>/FixPt Bitwise Operator5'
   *  S-Function (sfix_bitop): '<S23>/FixPt Bitwise Operator1'
   */
  if (rtb_NOT && COMR_bLvComDiagEn) {
    rtb_Switch_k = 192U;
  } else {
    rtb_Switch_k = 128U;
  }

  /* End of Switch: '<S15>/Switch' */

  /* Outputs for Atomic SubSystem: '<S3>/OnAfterDelay2' */

  /* Logic: '<S3>/Logical Operator' incorporates:
   *  Inport: '<Root>/BMCR_bWkUpVCU'
   *  Inport: '<Root>/BSPR_bKl15WkUp'
   *  Inport: '<Root>/VCAN_NMMsgRx'
   */
  rtb_LogicalOperator_a = DGM_OnAfterDelay2(VCAN_NMMsgRx || BMCR_bWkUpVCU ||
    BSPR_bKl15WkUp, &DGM_B.OnAfterDelay2, &DGM_DWork.OnAfterDelay2, 10U, 2000U);

  /* End of Outputs for SubSystem: '<S3>/OnAfterDelay2' */

  /* Logic: '<S3>/AND' incorporates:
   *  Inport: '<Root>/COMR_bLvComDiagEn'
   */
  rtb_AND_o4 = (COMR_bLvComDiagEn && rtb_LogicalOperator_a);

  /* Switch: '<S14>/Switch' incorporates:
   *  Logic: '<S3>/AND5'
   *  S-Function (sfix_bitop): '<S20>/FixPt Bitwise Operator3'
   *  S-Function (sfix_bitop): '<S20>/FixPt Bitwise Operator4'
   *  S-Function (sfix_bitop): '<S20>/FixPt Bitwise Operator5'
   *  S-Function (sfix_bitop): '<S21>/FixPt Bitwise Operator1'
   */
  if (rtb_NOT && rtb_AND_o4) {
    rtb_Switch_k = (uint8_T)(rtb_Switch_k | 32);
  } else {
    rtb_Switch_k = (uint8_T)~(uint8_T)((uint8_T)~rtb_Switch_k | 32U);
  }

  /* End of Switch: '<S14>/Switch' */

  /* Outputs for Atomic SubSystem: '<S3>/OnAfterDelay' */

  /* Constant: '<S3>/Constant1' */
  rtb_LogicalOperator_a = DGM_OnAfterDelay(false, &DGM_B.OnAfterDelay,
    &DGM_DWork.OnAfterDelay, 10U, 2000U);

  /* End of Outputs for SubSystem: '<S3>/OnAfterDelay' */

  /* Switch: '<S17>/Switch' incorporates:
   *  Inport: '<Root>/COMR_bLvComDiagEn'
   *  Logic: '<S3>/AND1'
   *  Logic: '<S3>/AND6'
   *  S-Function (sfix_bitop): '<S26>/FixPt Bitwise Operator3'
   *  S-Function (sfix_bitop): '<S26>/FixPt Bitwise Operator4'
   *  S-Function (sfix_bitop): '<S26>/FixPt Bitwise Operator5'
   *  S-Function (sfix_bitop): '<S27>/FixPt Bitwise Operator1'
   */
  if (rtb_NOT && (COMR_bLvComDiagEn && rtb_LogicalOperator_a)) {
    rtb_Switch_k |= 16U;
  } else {
    rtb_Switch_k = (uint8_T)~(uint8_T)((uint8_T)~rtb_Switch_k | 16U);
  }

  /* End of Switch: '<S17>/Switch' */

  /* Outputs for Atomic SubSystem: '<S3>/OnAfterDelay1' */

  /* Inport: '<Root>/BSPR_bKl15WkUp' */
  rtb_LogicalOperator_c = DGM_OnAfterDelay1(BSPR_bKl15WkUp, &DGM_B.OnAfterDelay1,
    &DGM_DWork.OnAfterDelay1, 10U, 2000U);

  /* End of Outputs for SubSystem: '<S3>/OnAfterDelay1' */

  /* Switch: '<S16>/Switch' incorporates:
   *  Inport: '<Root>/COMR_bLvComDiagEn'
   *  Logic: '<S3>/AND2'
   *  Logic: '<S3>/AND7'
   *  S-Function (sfix_bitop): '<S24>/FixPt Bitwise Operator3'
   *  S-Function (sfix_bitop): '<S24>/FixPt Bitwise Operator4'
   *  S-Function (sfix_bitop): '<S24>/FixPt Bitwise Operator5'
   *  S-Function (sfix_bitop): '<S25>/FixPt Bitwise Operator1'
   */
  if (rtb_NOT && (COMR_bLvComDiagEn && rtb_LogicalOperator_c)) {
    rtb_Switch_k |= 8U;
  } else {
    rtb_Switch_k = (uint8_T)~(uint8_T)((uint8_T)~rtb_Switch_k | 8U);
  }

  /* End of Switch: '<S16>/Switch' */

  /* Switch: '<S19>/Switch' incorporates:
   *  S-Function (sfix_bitop): '<S30>/FixPt Bitwise Operator3'
   *  S-Function (sfix_bitop): '<S30>/FixPt Bitwise Operator4'
   *  S-Function (sfix_bitop): '<S30>/FixPt Bitwise Operator5'
   */
  rtb_Switch_k = (uint8_T)~(uint8_T)((uint8_T)~rtb_Switch_k | 4U);

  /* Outputs for Atomic SubSystem: '<S3>/OnHoldT' */
  rtb_LogicalOperator_a = DGM_OnHoldT(rtb_LogicalOperator_c, &DGM_B.OnHoldT,
    &DGM_DWork.OnHoldT, 10U, 500U);

  /* End of Outputs for SubSystem: '<S3>/OnHoldT' */

  /* Switch: '<S18>/Switch' incorporates:
   *  Inport: '<Root>/COMR_bLvComDiagEn'
   *  Logic: '<S3>/AND10'
   *  Logic: '<S3>/AND9'
   *  S-Function (sfix_bitop): '<S28>/FixPt Bitwise Operator3'
   *  S-Function (sfix_bitop): '<S28>/FixPt Bitwise Operator4'
   *  S-Function (sfix_bitop): '<S28>/FixPt Bitwise Operator5'
   *  S-Function (sfix_bitop): '<S29>/FixPt Bitwise Operator1'
   */
  if (rtb_NOT && (COMR_bLvComDiagEn && rtb_LogicalOperator_a)) {
    DGM_B.Product1 = (uint8_T)(rtb_Switch_k | 2U);
  } else {
    DGM_B.Product1 = (uint8_T)~(uint8_T)((uint8_T)~rtb_Switch_k | 2U);
  }

  /* End of Switch: '<S18>/Switch' */

  /* Switch: '<S214>/Switch' incorporates:
   *  Constant: '<S201>/BitSet0'
   *  Inport: '<Root>/hld_PrivateCAN_0x130_TimeoutErr'
   *  Inport: '<Root>/hld_PrivateCAN_0x2E1_TimeoutErr'
   *  S-Function (sfix_bitop): '<S246>/FixPt Bitwise Operator1'
   *  Switch: '<S203>/Switch'
   */
  if (hld_PrivateCAN_0x2E1_TimeoutErr) {
    /* Switch: '<S203>/Switch' incorporates:
     *  Constant: '<S201>/BitSet0'
     *  Inport: '<Root>/hld_PrivateCAN_0x130_TimeoutErr'
     */
    if (hld_PrivateCAN_0x130_TimeoutErr) {
      rtb_Switch_ku = DGM_ConstB.FixPtBitwiseOperator1;
    } else {
      rtb_Switch_ku = 0U;
    }

    rtb_Switch_ku |= 1073741824U;
  } else if (hld_PrivateCAN_0x130_TimeoutErr) {
    /* Switch: '<S203>/Switch' */
    rtb_Switch_ku = DGM_ConstB.FixPtBitwiseOperator1;
  } else {
    rtb_Switch_ku = 0U;
  }

  /* End of Switch: '<S214>/Switch' */

  /* Switch: '<S225>/Switch' incorporates:
   *  Inport: '<Root>/hld_PrivateCAN_0x2E1_ChksumErr'
   *  S-Function (sfix_bitop): '<S257>/FixPt Bitwise Operator1'
   */
  if (hld_PrivateCAN_0x2E1_ChksumErr) {
    rtb_Switch_ku |= 536870912U;
  }

  /* End of Switch: '<S225>/Switch' */

  /* Switch: '<S229>/Switch' incorporates:
   *  Inport: '<Root>/hld_PrivateCAN_0x2E1_RolcntErr'
   *  S-Function (sfix_bitop): '<S261>/FixPt Bitwise Operator1'
   */
  if (hld_PrivateCAN_0x2E1_RolcntErr) {
    rtb_Switch_ku |= 268435456U;
  }

  /* End of Switch: '<S229>/Switch' */

  /* Switch: '<S230>/Switch' incorporates:
   *  Inport: '<Root>/hld_PrivateCAN_0x2E6_TimeoutErr'
   *  S-Function (sfix_bitop): '<S262>/FixPt Bitwise Operator1'
   */
  if (hld_PrivateCAN_0x2E6_TimeoutErr) {
    rtb_Switch_ku |= 134217728U;
  }

  /* End of Switch: '<S230>/Switch' */

  /* Switch: '<S231>/Switch' incorporates:
   *  Inport: '<Root>/hld_PrivateCAN_0x2E6_ChksumErr'
   *  S-Function (sfix_bitop): '<S263>/FixPt Bitwise Operator1'
   */
  if (hld_PrivateCAN_0x2E6_ChksumErr) {
    rtb_Switch_ku |= 67108864U;
  }

  /* End of Switch: '<S231>/Switch' */

  /* Switch: '<S232>/Switch' incorporates:
   *  Inport: '<Root>/hld_PrivateCAN_0x2E6_RolcntErr'
   *  S-Function (sfix_bitop): '<S264>/FixPt Bitwise Operator1'
   */
  if (hld_PrivateCAN_0x2E6_RolcntErr) {
    rtb_Switch_ku |= 33554432U;
  }

  /* End of Switch: '<S232>/Switch' */

  /* Switch: '<S233>/Switch' incorporates:
   *  Inport: '<Root>/hld_PrivateCAN_0x2EB_TimeoutErr'
   *  S-Function (sfix_bitop): '<S265>/FixPt Bitwise Operator1'
   */
  if (hld_PrivateCAN_0x2EB_TimeoutErr) {
    rtb_Switch_ku |= 16777216U;
  }

  /* End of Switch: '<S233>/Switch' */

  /* Switch: '<S234>/Switch' incorporates:
   *  Inport: '<Root>/hld_PrivateCAN_0x2EB_ChksumErr'
   *  S-Function (sfix_bitop): '<S266>/FixPt Bitwise Operator1'
   */
  if (hld_PrivateCAN_0x2EB_ChksumErr) {
    rtb_Switch_ku |= 8388608U;
  }

  /* End of Switch: '<S234>/Switch' */

  /* Switch: '<S204>/Switch' incorporates:
   *  Inport: '<Root>/hld_PrivateCAN_0x2EB_RolcntErr'
   *  S-Function (sfix_bitop): '<S236>/FixPt Bitwise Operator1'
   */
  if (hld_PrivateCAN_0x2EB_RolcntErr) {
    rtb_Switch_ku |= 4194304U;
  }

  /* End of Switch: '<S204>/Switch' */

  /* Switch: '<S205>/Switch' incorporates:
   *  Inport: '<Root>/hld_PrivateCAN_0x3C2_TimeoutErr'
   *  S-Function (sfix_bitop): '<S237>/FixPt Bitwise Operator1'
   */
  if (hld_PrivateCAN_0x3C2_TimeoutErr) {
    rtb_Switch_ku |= 2097152U;
  }

  /* End of Switch: '<S205>/Switch' */

  /* Switch: '<S206>/Switch' incorporates:
   *  Inport: '<Root>/hld_PrivateCAN_0x0B5_TimeoutErr'
   *  S-Function (sfix_bitop): '<S238>/FixPt Bitwise Operator1'
   */
  if (hld_PrivateCAN_0x0B5_TimeoutErr) {
    rtb_Switch_ku |= 1048576U;
  }

  /* End of Switch: '<S206>/Switch' */

  /* Switch: '<S207>/Switch' incorporates:
   *  Inport: '<Root>/hld_PrivateCAN_0x2A3_TimeoutErr'
   *  S-Function (sfix_bitop): '<S239>/FixPt Bitwise Operator1'
   */
  if (hld_PrivateCAN_0x2A3_TimeoutErr) {
    rtb_Switch_ku |= 524288U;
  }

  /* End of Switch: '<S207>/Switch' */

  /* Switch: '<S208>/Switch' incorporates:
   *  Inport: '<Root>/hld_PrivateCAN_0x2A3_ChksumErr'
   *  S-Function (sfix_bitop): '<S240>/FixPt Bitwise Operator1'
   */
  if (hld_PrivateCAN_0x2A3_ChksumErr) {
    rtb_Switch_ku |= 262144U;
  }

  /* End of Switch: '<S208>/Switch' */

  /* Switch: '<S209>/Switch' incorporates:
   *  Inport: '<Root>/hld_PrivateCAN_0x2A3_RolcntErr'
   *  S-Function (sfix_bitop): '<S241>/FixPt Bitwise Operator1'
   */
  if (hld_PrivateCAN_0x2A3_RolcntErr) {
    rtb_Switch_ku |= 131072U;
  }

  /* End of Switch: '<S209>/Switch' */

  /* Switch: '<S210>/Switch' incorporates:
   *  Inport: '<Root>/hld_PrivateCAN_0x2A5_TimeoutErr'
   *  S-Function (sfix_bitop): '<S242>/FixPt Bitwise Operator1'
   */
  if (hld_PrivateCAN_0x2A5_TimeoutErr) {
    rtb_Switch_ku |= 65536U;
  }

  /* End of Switch: '<S210>/Switch' */

  /* Switch: '<S211>/Switch' incorporates:
   *  Inport: '<Root>/hld_PrivateCAN_0x2A5_ChksumErr'
   *  S-Function (sfix_bitop): '<S243>/FixPt Bitwise Operator1'
   */
  if (hld_PrivateCAN_0x2A5_ChksumErr) {
    rtb_Switch_ku |= 32768U;
  }

  /* End of Switch: '<S211>/Switch' */

  /* Switch: '<S212>/Switch' incorporates:
   *  Inport: '<Root>/hld_PrivateCAN_0x2A5_RolcntErr'
   *  S-Function (sfix_bitop): '<S244>/FixPt Bitwise Operator1'
   */
  if (hld_PrivateCAN_0x2A5_RolcntErr) {
    rtb_Switch_ku |= 16384U;
  }

  /* End of Switch: '<S212>/Switch' */

  /* Switch: '<S213>/Switch' incorporates:
   *  Inport: '<Root>/hld_PrivateCAN_0x2A7_TimeoutErr'
   *  S-Function (sfix_bitop): '<S245>/FixPt Bitwise Operator1'
   */
  if (hld_PrivateCAN_0x2A7_TimeoutErr) {
    rtb_Switch_ku |= 8192U;
  }

  /* End of Switch: '<S213>/Switch' */

  /* Switch: '<S215>/Switch' incorporates:
   *  Inport: '<Root>/hld_PrivateCAN_0x2A7_ChksumErr'
   *  S-Function (sfix_bitop): '<S247>/FixPt Bitwise Operator1'
   */
  if (hld_PrivateCAN_0x2A7_ChksumErr) {
    rtb_Switch_ku |= 4096U;
  }

  /* End of Switch: '<S215>/Switch' */

  /* Switch: '<S216>/Switch' incorporates:
   *  Inport: '<Root>/hld_PrivateCAN_0x2A7_RolcntErr'
   *  S-Function (sfix_bitop): '<S248>/FixPt Bitwise Operator1'
   */
  if (hld_PrivateCAN_0x2A7_RolcntErr) {
    rtb_Switch_ku |= 2048U;
  }

  /* End of Switch: '<S216>/Switch' */

  /* Switch: '<S217>/Switch' incorporates:
   *  Inport: '<Root>/hld_PrivateCAN_0x2AD_TimeoutErr'
   *  S-Function (sfix_bitop): '<S249>/FixPt Bitwise Operator1'
   */
  if (hld_PrivateCAN_0x2AD_TimeoutErr) {
    rtb_Switch_ku |= 1024U;
  }

  /* End of Switch: '<S217>/Switch' */

  /* Switch: '<S218>/Switch' incorporates:
   *  Inport: '<Root>/hld_PrivateCAN_0x2BB_TimeoutErr'
   *  S-Function (sfix_bitop): '<S250>/FixPt Bitwise Operator1'
   */
  if (hld_PrivateCAN_0x2BB_TimeoutErr) {
    rtb_Switch_ku |= 512U;
  }

  /* End of Switch: '<S218>/Switch' */

  /* Switch: '<S219>/Switch' incorporates:
   *  Inport: '<Root>/hld_PrivateCAN_0x2DF_TimeoutErr'
   *  S-Function (sfix_bitop): '<S251>/FixPt Bitwise Operator1'
   */
  if (hld_PrivateCAN_0x2DF_TimeoutErr) {
    rtb_Switch_ku |= 256U;
  }

  /* End of Switch: '<S219>/Switch' */

  /* Switch: '<S220>/Switch' incorporates:
   *  Inport: '<Root>/hld_PrivateCAN_0x3AA_TimeoutErr'
   *  S-Function (sfix_bitop): '<S252>/FixPt Bitwise Operator1'
   */
  if (hld_PrivateCAN_0x3AA_TimeoutErr) {
    rtb_Switch_ku |= 128U;
  }

  /* End of Switch: '<S220>/Switch' */

  /* Switch: '<S221>/Switch' incorporates:
   *  Inport: '<Root>/hld_PrivateCAN_0x050_TimeoutErr'
   *  S-Function (sfix_bitop): '<S253>/FixPt Bitwise Operator1'
   */
  if (hld_PrivateCAN_0x050_TimeoutErr) {
    rtb_Switch_ku |= 64U;
  }

  /* End of Switch: '<S221>/Switch' */

  /* Switch: '<S222>/Switch' incorporates:
   *  Inport: '<Root>/hld_PrivateCAN_0x050_ChksumErr'
   *  S-Function (sfix_bitop): '<S254>/FixPt Bitwise Operator1'
   */
  if (hld_PrivateCAN_0x050_ChksumErr) {
    rtb_Switch_ku |= 32U;
  }

  /* End of Switch: '<S222>/Switch' */

  /* Switch: '<S223>/Switch' incorporates:
   *  Inport: '<Root>/hld_PrivateCAN_0x050_RolcntErr'
   *  S-Function (sfix_bitop): '<S255>/FixPt Bitwise Operator1'
   */
  if (hld_PrivateCAN_0x050_RolcntErr) {
    rtb_Switch_ku |= 16U;
  }

  /* End of Switch: '<S223>/Switch' */

  /* Switch: '<S224>/Switch' incorporates:
   *  Inport: '<Root>/hld_PrivateCAN_0x2F1_TimeoutErr'
   *  S-Function (sfix_bitop): '<S256>/FixPt Bitwise Operator1'
   */
  if (hld_PrivateCAN_0x2F1_TimeoutErr) {
    rtb_Switch_ku |= 8U;
  }

  /* End of Switch: '<S224>/Switch' */

  /* Switch: '<S226>/Switch' incorporates:
   *  Inport: '<Root>/hld_PrivateCAN_0x195_TimeoutErr'
   *  S-Function (sfix_bitop): '<S258>/FixPt Bitwise Operator1'
   */
  if (hld_PrivateCAN_0x195_TimeoutErr) {
    rtb_Switch_ku |= 4U;
  }

  /* End of Switch: '<S226>/Switch' */

  /* Switch: '<S227>/Switch' incorporates:
   *  Inport: '<Root>/hld_PrivateCAN_0x37F_TimeoutErr'
   *  S-Function (sfix_bitop): '<S259>/FixPt Bitwise Operator1'
   */
  if (hld_PrivateCAN_0x37F_TimeoutErr) {
    rtb_Switch_ku |= 2U;
  }

  /* End of Switch: '<S227>/Switch' */

  /* Switch: '<S228>/Switch' incorporates:
   *  Inport: '<Root>/hld_PrivateCAN_0x28C_TimeoutErr'
   *  S-Function (sfix_bitop): '<S260>/FixPt Bitwise Operator1'
   */
  if (hld_PrivateCAN_0x28C_TimeoutErr) {
    rtb_Switch_ku |= 1U;
  }

  /* End of Switch: '<S228>/Switch' */

  /* S-Function (sfix_bitop): '<S201>/Ovrd' incorporates:
   *  Constant: '<S201>/Cal'
   */
  DGM_B.Bitwise_AUX_b = rtb_Switch_ku & KeDGM_bIOSDFCOvrdval;

  /* Outputs for Atomic SubSystem: '<S1>/IOS' */
  DGM_IOS();

  /* End of Outputs for SubSystem: '<S1>/IOS' */

  /* Switch: '<S267>/Switch' incorporates:
   *  Constant: '<S202>/BitSet0'
   *  Inport: '<Root>/hld_PrivateCAN_0x17D_TimeoutErr'
   */
  if (hld_PrivateCAN_0x17D_TimeoutErr) {
    rtb_Switch_ku = DGM_ConstB.FixPtBitwiseOperator1_j;
  } else {
    rtb_Switch_ku = 0U;
  }

  /* End of Switch: '<S267>/Switch' */

  /* S-Function (sfix_bitop): '<S202>/Ovrd' incorporates:
   *  Constant: '<S202>/Cal'
   */
  DGM_B.Bitwise_AUX_b = rtb_Switch_ku & KeDGM_bIOSDFC1Ovrdval;

  /* Outputs for Atomic SubSystem: '<S1>/IOS1' */
  DGM_IOS1();

  /* End of Outputs for SubSystem: '<S1>/IOS1' */

  /* Switch: '<S8>/Switch' incorporates:
   *  Constant: '<S8>/Constant'
   *  Constant: '<S8>/Constant1'
   *  S-Function (sfix_bitop): '<S1>/Bitwise_PT'
   */
  if (KeDGM_bFltReactnPtFlg) {
    VeDGM_flgFltReactnPt = KeDGM_flgFltReactnPtVal;
  } else {
    VeDGM_flgFltReactnPt = DGM_B.Bitwise_PT_i | DGM_B.Bitwise_PT;
  }

  /* End of Switch: '<S8>/Switch' */

  /* Switch: '<S6>/Switch' incorporates:
   *  Constant: '<S6>/Constant'
   *  Constant: '<S6>/Constant1'
   *  S-Function (sfix_bitop): '<S1>/Bitwise_AUX'
   */
  if (KeDGM_bFltReactnAuxFlg) {
    VeDGM_flgFltReactnAux = KeDGM_flgFltReactnAuxVal;
  } else {
    VeDGM_flgFltReactnAux = DGM_B.Bitwise_AUX | DGM_B.Bitwise_AUX_b;
  }

  /* End of Switch: '<S6>/Switch' */

  /* Switch: '<S7>/Switch' incorporates:
   *  Constant: '<S7>/Constant'
   *  Constant: '<S7>/Constant1'
   *  MinMax: '<S1>/Max'
   */
  if (KeDGM_bFltLvlFlg) {
    VeDGM_enmVehFltLvl = KeDGM_FltLvlVal;
  } else if (DGM_B.Max > DGM_B.Product1) {
    /* MinMax: '<S1>/Max' */
    VeDGM_enmVehFltLvl = DGM_B.Max;
  } else {
    VeDGM_enmVehFltLvl = DGM_B.Product1;
  }

  /* End of Switch: '<S7>/Switch' */
}

/* Model initialize function */
void DGM_initialize(void)
{
  /* SystemInitialize for Atomic SubSystem: '<S1>/IOS' */
  DGM_IOS_Init();

  /* End of SystemInitialize for SubSystem: '<S1>/IOS' */

  /* SystemInitialize for Atomic SubSystem: '<S1>/IOS1' */
  DGM_IOS1_Init();

  /* End of SystemInitialize for SubSystem: '<S1>/IOS1' */
}

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

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