/* * File: HVAC_model.c * * Code generated for Simulink model 'HVAC_model'. * * Model version : 1.1202 * Simulink Coder version : 24.1 (R2024a) 19-Nov-2023 * C/C++ source code generated on : Fri Jun 26 14:54:36 2026 * * Target selection: ert.tlc * Embedded hardware selection: ARM Compatible->ARM Cortex-M * Emulation hardware selection: * Differs from embedded hardware (MATLAB Host) * Code generation objectives: Unspecified * Validation result: Not run */ #include "HVAC_model.h" #include #include #include "HVAC_model_private.h" #include #include #include "HVAC_model_types.h" #include "Rs_Cal_Base.h" /* Named constants for Chart: '/Zone_Climate_Logic_Auto_FL1' */ #define IN_AC_Off ((uint8_t)1U) #define IN_AC_On ((uint8_t)2U) #define IN_AUTO_MODE ((uint8_t)1U) #define IN_Def_Off ((uint8_t)1U) #define IN_Def_On ((uint8_t)2U) #define IN_Face_Off ((uint8_t)1U) #define IN_Face_On ((uint8_t)2U) #define IN_Foot_Off ((uint8_t)1U) #define IN_Foot_On ((uint8_t)2U) #define IN_MANUAL_MODE ((uint8_t)2U) #define IN_NO_ACTIVE_CHILD ((uint8_t)0U) /* Named constants for Chart: '/Zone_Climate_Logic_Auto_FL2' */ #define IN_AC_Off_p ((uint8_t)1U) #define IN_AC_On_k ((uint8_t)2U) #define IN_AUTO_MODE_k ((uint8_t)1U) #define IN_Def_Off_d ((uint8_t)1U) #define IN_Def_On_k ((uint8_t)2U) #define IN_Face_Off_n ((uint8_t)1U) #define IN_Face_On_k ((uint8_t)2U) #define IN_Foot_Off_o ((uint8_t)1U) #define IN_Foot_On_j ((uint8_t)2U) #define IN_MANUAL_MODE_e ((uint8_t)2U) #define IN_NO_ACTIVE_CHILD_g ((uint8_t)0U) /* Named constants for Chart: '/13,1,3,15 Valve control' */ #define IN_Entry_2W ((uint8_t)1U) #define IN_Entry_3W ((uint8_t)1U) #define IN_ExitSeq_2W ((uint8_t)2U) #define IN_ExitSeq_3W ((uint8_t)2U) #define IN_NO_ACTIVE_CHILD_o ((uint8_t)0U) #define IN_Wait_2W ((uint8_t)3U) #define IN_Wait_3W ((uint8_t)3U) /* Named constants for Chart: '/Chart' */ #define IN_COND_1 ((uint8_t)1U) #define IN_COND_2 ((uint8_t)2U) #define IN_COND_3 ((uint8_t)3U) #define IN_HOLDING ((uint8_t)1U) #define IN_PARTIAL_REC_OFF ((uint8_t)1U) #define IN_PARTIAL_REC_ON ((uint8_t)2U) #define IN_TRACKING ((uint8_t)2U) /* Named constants for Chart: '/Spd_OSA_Trigger' */ #define IN_OSA_OFF ((uint8_t)1U) #define IN_OSA_ON ((uint8_t)2U) /* Named constants for Chart: '/A//C Control' */ #define IN_COMP_OFF ((uint8_t)1U) #define IN_COMP_ON ((uint8_t)2U) #define IN_Chiller_OFF ((uint8_t)1U) #define IN_Chiller_ON ((uint8_t)2U) #define IN_FAULT_HIGH_PRESS ((uint8_t)1U) #define IN_FAULT_LOW_PRESS ((uint8_t)2U) #define IN_Front_A_C_OFF ((uint8_t)1U) #define IN_Front_A_C_ON ((uint8_t)2U) #define IN_PRESSURE_OK ((uint8_t)3U) #define IN_PROT_LEVEL_0 ((uint8_t)1U) #define IN_PROT_LEVEL_1 ((uint8_t)2U) #define IN_PROT_LEVEL_2 ((uint8_t)3U) #define IN_Rear_A_C_OFF ((uint8_t)1U) #define IN_Rear_A_C_ON ((uint8_t)2U) /* Named constants for Chart: '/Full_Rec_Active' */ #define IN_REC_OFF ((uint8_t)1U) #define IN_REC_ON ((uint8_t)2U) /* Named constants for Chart: '/Synchronization stateflow chart' */ #define IN_FRONT_ONLY ((uint8_t)1U) #define IN_FULL_SYNC ((uint8_t)2U) #define IN_NO_SYNC ((uint8_t)3U) #define IN_REAR_ONLY ((uint8_t)4U) #define IN_SEPARATE_FRONT_AND_REAR ((uint8_t)5U) const CmdBusStatus HVAC_model_rtZCmdBusStatus = { 0, /* Battery */ 0, /* AMB */ 0, /* Incar_FL */ 0, /* Incar_FR */ 0, /* Incar_RL */ 0, /* Incar_RR */ 0, /* Eva_F */ 0, /* Eva_R */ 0, /* Pressure */ 0, /* Duct_FL_Upper */ 0, /* Duct_FL_Lower */ 0, /* Duct_FR_Upper */ 0, /* Duct_FR_Lower */ 0, /* Duct_RL */ 0, /* Duct_RR */ 0, /* Duct_Side_FL */ 0, /* Duct_Side_FR */ 0, /* Duct_Side_RL */ 0, /* Duct_Side_RR */ 0 /* AQS */ }; /* CmdBusStatus ground */ const CmdBusError HVAC_model_rtZCmdBusError = { 0U, /* CCU_IncarTempErrF_Stat */ 0U, /* CCU_IncarTempErrR_Stat */ 0U, /* CCU_DuctTempSenErrF_Stat */ 0U, /* CCU_DuctTempSenErrR_Stat */ 0U, /* CCU_EvaTempSenErrF_Stat */ 0U, /* CCU_EvaTempSenErrR_Stat */ 0U, /* CCU_DeflectorSwErrF_Stat */ 0U, /* CCU_DeflectorSwErrR_Stat */ 0U, /* CCU_PressSenErr_Stat */ 0U, /* CCU_AmbienTemptSenErr_Stat */ 0U, /* CCU_SealingValveErr_Stat */ 0U, /* CCU_ETXVerr_Stat */ 0U, /* CCU_HVACfanOrTXVerrF_Stat */ 0U, /* CCU_HVACfanOrTXVerrR_Stat */ 0U, /* CCU_ActuatorErrF_Stat */ 0U, /* CCU_ActuatorErrR_Stat */ 0U, /* CCU_UltravioletErr_Stat */ 0U, /* CCU_VinRecordErr_Stat */ 0U, /* CCU_AirQualSenErr_Stat */ 0U, /* CCU_CommErr_Stat */ 0U, /* CCU_TWVerr_Stat */ 0U, /* CCU_IonizationErr_Stat */ 0U /* CCU_AromaErr_Stat */ }; /* CmdBusError ground */ const ActuatorCmdBus HVAC_model_rtZActuatorCmdBus = { { 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U } , /* POS */ { 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U } , /* BUS_ADR */ { 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U } , /* MODE */ { 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U } , /* COM */ { 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U } , /* Stall_SET */ { 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U } , /* Lnoise_SET */ { 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U } , /* Autos_SET */ { 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U } , /* Speed_SET */ { 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U } /* Coils_Stop_SET */ }; /* ActuatorCmdBus ground */ const CmdBusPWMGet HVAC_model_rtZCmdBusPWMGet = { 0U, /* pwmPercentFront */ 0U, /* pwmPercentRear */ 0U, /* pwmPercentFrontReserved */ 0U /* pwmPercentRearReserved */ }; /* CmdBusPWMGet ground */ const ActuatorCmdBusInput HVAC_model_rtZActuatorCmdBusInput = { { 0, 0, 0, 0, 0, 0, 0, 0, 0 } , /* in_CPOS_ALL */ { 0, 0, 0, 0, 0, 0, 0, 0, 0 } , /* in_Act_Emrf_Slave */ { 0, 0, 0, 0, 0, 0, 0, 0, 0 } , /* in_Mode_Slave */ { 0, 0, 0, 0, 0, 0, 0, 0, 0 } , /* in_Act_Err1_Supply */ { 0, 0, 0, 0, 0, 0, 0, 0, 0 } , /* in_Act_Err2_Communication */ { 0, 0, 0, 0, 0, 0, 0, 0, 0 } , /* in_Act_Err3_Temperature */ { 0, 0, 0, 0, 0, 0, 0, 0, 0 } , /* in_Act_Err4_Permanent_Electrical */ { 0, 0, 0, 0, 0, 0, 0, 0, 0 } , /* in_Act_Stall_Slave */ { 0, 0, 0, 0, 0, 0, 0, 0, 0 } , /* in_Act_Reset */ 0U, /* Busy */ 0U /* Error_Connect */ }; /* ActuatorCmdBusInput ground */ /* Exported block states */ ActuatorCmdBus Actuator_Ch0_Command_Model;/* '/Data Store Memory15' */ ActuatorCmdBus Actuator_Ch1_Command_Model;/* '/Data Store Memory15' */ ActuatorCmdBus Actuator_Ch2_Command_Model;/* '/Data Store Memory15' */ ActuatorCmdBusInput Actuator_Ch0_Status_Model;/* '/Data Store Memory61' */ ActuatorCmdBusInput Actuator_Ch1_Status_Model;/* '/Data Store Memory62' */ ActuatorCmdBusInput Actuator_Ch2_Status_Model;/* '/Data Store Memory63' */ CmdBusStatus Status_Sensor_Model; /* '/Data Store Memory197' */ CmdBusError CCU_Errors_Model; /* '/Data Store Memory3' */ CmdBusPWMGet PWM_Get; /* '/Data Store Memory128' */ /* Block signals (default storage) */ B rtB; /* Block states (default storage) */ DW rtDW; /* External outputs (root outports fed by signals with default storage) */ ExtY rtY; /* Real-time model */ static RT_MODEL rtM_; RT_MODEL *const rtM = &rtM_; /* Forward declaration for local functions */ static void E_COMP_MANAGER(bool *Enable_Comp_PID, const int16_t *g_assEVA_TG_AMB_F_n, const int16_t *g_assEVA_TG_AMB_R_h); static double find_index(int16_t delta); int16_t look1_is16lu64n32tu16Ds32Is16_binlcs(int16_t u0, const int16_t bp0[], const uint16_t table[], uint32_t maxIndex) { uint64_t frac; uint32_t iLeft; uint16_t yL_0d0; /* Column-major Lookup 1-D Search method: 'binary' Use previous index: 'off' Interpolation method: 'Linear point-slope' Extrapolation method: 'Clip' Use last breakpoint for index at or above upper limit: 'off' Remove protection against out-of-range input in generated code: 'off' Rounding mode: 'simplest' */ /* Prelookup - Index and Fraction Index Search method: 'binary' Extrapolation method: 'Clip' Use previous index: 'off' Use last breakpoint for index at or above upper limit: 'off' Remove protection against out-of-range input in generated code: 'off' Rounding mode: 'simplest' */ if (u0 <= bp0[0U]) { iLeft = 0U; frac = 0ULL; } else if (u0 < bp0[maxIndex]) { uint32_t bpIdx; uint32_t iRght; /* Binary Search */ bpIdx = maxIndex >> 1U; iLeft = 0U; iRght = maxIndex; while (iRght - iLeft > 1U) { if (u0 < bp0[bpIdx]) { iRght = bpIdx; } else { iLeft = bpIdx; } bpIdx = (iRght + iLeft) >> 1U; } int16_t bpLeftVar; bpLeftVar = bp0[iLeft]; frac = ((uint64_t)(uint32_t)(u0 - bpLeftVar) << 32) / (uint32_t)(bp0[iLeft + 1U] - bpLeftVar); } else { iLeft = maxIndex - 1U; frac = 4294967296ULL; } /* Column-major Interpolation 1-D Interpolation method: 'Linear point-slope' Use last breakpoint for index at or above upper limit: 'off' Rounding mode: 'simplest' Overflow mode: 'wrapping' */ yL_0d0 = table[iLeft]; return (int16_t)((int16_t)(((table[iLeft + 1U] - yL_0d0) * (int64_t)frac) >> 32) + (int16_t)yL_0d0); } uint32_t binsearch_u32s16(int16_t u_2, const int16_t bp[], uint32_t startIndex, uint32_t maxIndex) { uint32_t bpIdx; uint32_t bpIndex; uint32_t iRght; /* Binary Search */ bpIdx = startIndex; bpIndex = 0U; iRght = maxIndex; while (iRght - bpIndex > 1U) { if (u_2 < bp[bpIdx]) { iRght = bpIdx; } else { bpIndex = bpIdx; } bpIdx = (iRght + bpIndex) >> 1U; } return bpIndex; } int16_t look1_is16lu64n32Ds32_binlcs(int16_t u0, const int16_t bp0[], const int16_t table[], uint32_t maxIndex) { uint64_t frac; uint32_t iLeft; int16_t bpLeftVar; /* Column-major Lookup 1-D Search method: 'binary' Use previous index: 'off' Interpolation method: 'Linear point-slope' Extrapolation method: 'Clip' Use last breakpoint for index at or above upper limit: 'off' Remove protection against out-of-range input in generated code: 'off' Rounding mode: 'simplest' */ /* Prelookup - Index and Fraction Index Search method: 'binary' Extrapolation method: 'Clip' Use previous index: 'off' Use last breakpoint for index at or above upper limit: 'off' Remove protection against out-of-range input in generated code: 'off' Rounding mode: 'simplest' */ if (u0 <= bp0[0U]) { iLeft = 0U; frac = 0ULL; } else if (u0 < bp0[maxIndex]) { uint32_t bpIdx; uint32_t iRght; /* Binary Search */ bpIdx = maxIndex >> 1U; iLeft = 0U; iRght = maxIndex; while (iRght - iLeft > 1U) { if (u0 < bp0[bpIdx]) { iRght = bpIdx; } else { iLeft = bpIdx; } bpIdx = (iRght + iLeft) >> 1U; } bpLeftVar = bp0[iLeft]; frac = ((uint64_t)(uint32_t)(u0 - bpLeftVar) << 32) / (uint32_t)(bp0[iLeft + 1U] - bpLeftVar); } else { iLeft = maxIndex - 1U; frac = 4294967296ULL; } /* Column-major Interpolation 1-D Interpolation method: 'Linear point-slope' Use last breakpoint for index at or above upper limit: 'off' Rounding mode: 'simplest' Overflow mode: 'wrapping' */ bpLeftVar = table[iLeft]; return (int16_t)((int16_t)(((table[iLeft + 1U] - bpLeftVar) * (int64_t)frac) >> 32) + bpLeftVar); } int16_t look1_is16lu64n32tu8Ds16Is16_binlcs(int16_t u0, const int16_t bp0[], const uint8_t table[], uint32_t maxIndex) { uint64_t frac; uint32_t iLeft; uint8_t yL_0d0; /* Column-major Lookup 1-D Search method: 'binary' Use previous index: 'off' Interpolation method: 'Linear point-slope' Extrapolation method: 'Clip' Use last breakpoint for index at or above upper limit: 'off' Remove protection against out-of-range input in generated code: 'off' Rounding mode: 'simplest' */ /* Prelookup - Index and Fraction Index Search method: 'binary' Extrapolation method: 'Clip' Use previous index: 'off' Use last breakpoint for index at or above upper limit: 'off' Remove protection against out-of-range input in generated code: 'off' Rounding mode: 'simplest' */ if (u0 <= bp0[0U]) { iLeft = 0U; frac = 0ULL; } else if (u0 < bp0[maxIndex]) { uint32_t bpIdx; uint32_t iRght; /* Binary Search */ bpIdx = maxIndex >> 1U; iLeft = 0U; iRght = maxIndex; while (iRght - iLeft > 1U) { if (u0 < bp0[bpIdx]) { iRght = bpIdx; } else { iLeft = bpIdx; } bpIdx = (iRght + iLeft) >> 1U; } int16_t bpLeftVar; bpLeftVar = bp0[iLeft]; frac = ((uint64_t)(uint32_t)(u0 - bpLeftVar) << 32) / (uint32_t)(bp0[iLeft + 1U] - bpLeftVar); } else { iLeft = maxIndex - 1U; frac = 4294967296ULL; } /* Column-major Interpolation 1-D Interpolation method: 'Linear point-slope' Use last breakpoint for index at or above upper limit: 'off' Rounding mode: 'simplest' Overflow mode: 'wrapping' */ yL_0d0 = table[iLeft]; return (int16_t)((int16_t)(((int16_t)(table[iLeft + 1U] - yL_0d0) * (int64_t) frac) >> 32) + yL_0d0); } int16_t look1_is16lu64n32Ds32_binlcn(int16_t u0, const int16_t bp0[], const int16_t table[], uint32_t maxIndex) { uint64_t frac; uint32_t iLeft; int16_t bpLeftVar; /* Column-major Lookup 1-D Search method: 'binary' Use previous index: 'off' Interpolation method: 'Linear point-slope' Extrapolation method: 'Clip' Use last breakpoint for index at or above upper limit: 'off' Remove protection against out-of-range input in generated code: 'off' Rounding mode: 'nearest' */ /* Prelookup - Index and Fraction Index Search method: 'binary' Extrapolation method: 'Clip' Use previous index: 'off' Use last breakpoint for index at or above upper limit: 'off' Remove protection against out-of-range input in generated code: 'off' Rounding mode: 'nearest' */ if (u0 <= bp0[0U]) { iLeft = 0U; frac = 0ULL; } else if (u0 < bp0[maxIndex]) { uint32_t bpIdx; uint32_t iRght; /* Binary Search */ bpIdx = maxIndex >> 1U; iLeft = 0U; iRght = maxIndex; while (iRght - iLeft > 1U) { if (u0 < bp0[bpIdx]) { iRght = bpIdx; } else { iLeft = bpIdx; } bpIdx = (iRght + iLeft) >> 1U; } bpLeftVar = bp0[iLeft]; bpIdx = (uint32_t)(bp0[iLeft + 1U] - bpLeftVar); frac = (((uint64_t)(uint32_t)(u0 - bpLeftVar) << 32) + ((uint64_t)bpIdx >> 1)) / bpIdx; } else { iLeft = maxIndex - 1U; frac = 4294967296ULL; } /* Column-major Interpolation 1-D Interpolation method: 'Linear point-slope' Use last breakpoint for index at or above upper limit: 'off' Rounding mode: 'nearest' Overflow mode: 'wrapping' */ bpLeftVar = table[iLeft]; return (int16_t)((int16_t)(((table[iLeft + 1U] - bpLeftVar) * (int64_t)frac + 2147483648LL) >> 32) + bpLeftVar); } int16_t look1_bs16ts16Dd_binlc(double u0, const int16_t bp0[], const int16_t table[], uint32_t maxIndex) { double frac; double v; uint32_t iLeft; int16_t uCast; /* Column-major Lookup 1-D Search method: 'binary' Use previous index: 'off' Interpolation method: 'Linear point-slope' Extrapolation method: 'Clip' Use last breakpoint for index at or above upper limit: 'off' Remove protection against out-of-range input in generated code: 'off' */ /* Prelookup - Index and Fraction Index Search method: 'binary' Extrapolation method: 'Clip' Use previous index: 'off' Use last breakpoint for index at or above upper limit: 'off' Remove protection against out-of-range input in generated code: 'off' */ frac = floor(u0); if (frac < 32768.0) { if (frac >= -32768.0) { uCast = (int16_t)frac; } else { uCast = INT16_MIN; } } else { uCast = INT16_MAX; } if (u0 < bp0[0U]) { iLeft = 0U; frac = 0.0; } else if (u0 < bp0[maxIndex]) { uint32_t bpIdx; uint32_t iRght; /* Binary Search */ bpIdx = maxIndex >> 1U; iLeft = 0U; iRght = maxIndex; while (iRght - iLeft > 1U) { if (uCast < bp0[bpIdx]) { iRght = bpIdx; } else { iLeft = bpIdx; } bpIdx = (iRght + iLeft) >> 1U; } frac = (u0 - (double)bp0[iLeft]) / (double)(uint32_t)(bp0[iLeft + 1U] - bp0[iLeft]); } else { iLeft = maxIndex - 1U; frac = 1.0; } /* Column-major Interpolation 1-D Interpolation method: 'Linear point-slope' Use last breakpoint for index at or above upper limit: 'off' Overflow mode: 'wrapping' */ uCast = table[iLeft]; frac *= (double)table[iLeft + 1U] - (double)uCast; v = fabs(frac); if (v < 4.503599627370496E+15) { if (v >= 0.5) { frac = floor(frac + 0.5); } else { frac = 0.0; } } return (int16_t)(uCast + (int16_t)frac); } uint8_t look2_iu8bu8s16lu64n32_binlcse(uint8_t u0, uint8_t u1, const uint8_t bp0[], const int16_t bp1[], const uint8_t table[], const uint32_t maxIndex[], uint32_t stride) { uint64_t fractions[2]; uint64_t frac; uint32_t bpIndices[2]; uint32_t bpIdx; uint32_t iLeft; uint32_t iRght; uint8_t bpLeftVar; uint8_t y; uint8_t yL_0d0; uint8_t yL_1d; /* Column-major Lookup 2-D Search method: 'binary' Use previous index: 'off' Interpolation method: 'Linear point-slope' Extrapolation method: 'Clip' Use last breakpoint for index at or above upper limit: 'off' Remove protection against out-of-range input in generated code: 'off' Rounding mode: 'simplest' */ /* Prelookup - Index and Fraction Index Search method: 'binary' Extrapolation method: 'Clip' Use previous index: 'off' Use last breakpoint for index at or above upper limit: 'off' Remove protection against out-of-range input in generated code: 'off' Rounding mode: 'simplest' */ if (u0 <= bp0[0U]) { iLeft = 0U; frac = 0ULL; } else if (u0 < bp0[maxIndex[0U]]) { /* Binary Search */ bpIdx = maxIndex[0U] >> 1U; iLeft = 0U; iRght = maxIndex[0U]; while (iRght - iLeft > 1U) { if (u0 < bp0[bpIdx]) { iRght = bpIdx; } else { iLeft = bpIdx; } bpIdx = (iRght + iLeft) >> 1U; } bpLeftVar = bp0[iLeft]; frac = ((uint64_t)((uint32_t)u0 - bpLeftVar) << 32) / ((uint32_t)bp0[iLeft + 1U] - bpLeftVar); } else { iLeft = maxIndex[0U] - 1U; frac = 4294967296ULL; } fractions[0U] = frac; bpIndices[0U] = iLeft; /* Prelookup - Index and Fraction Index Search method: 'binary' Extrapolation method: 'Clip' Use previous index: 'off' Use last breakpoint for index at or above upper limit: 'off' Remove protection against out-of-range input in generated code: 'off' Rounding mode: 'simplest' */ if (u1 < bp1[0U]) { iLeft = 0U; frac = 0ULL; } else if (u1 < bp1[maxIndex[1U]]) { /* Binary Search */ bpIdx = maxIndex[1U] >> 1U; iLeft = 0U; iRght = maxIndex[1U]; while (iRght - iLeft > 1U) { if (u1 < bp1[bpIdx]) { iRght = bpIdx; } else { iLeft = bpIdx; } bpIdx = (iRght + iLeft) >> 1U; } frac = ((uint64_t)(u1 - (uint32_t)bp1[iLeft]) << 32) / (uint32_t)(bp1[iLeft + 1U] - bp1[iLeft]); } else { iLeft = maxIndex[1U] - 1U; frac = 4294967296ULL; } /* Column-major Interpolation 2-D Interpolation method: 'Linear point-slope' Use last breakpoint for index at or above upper limit: 'off' Rounding mode: 'simplest' Overflow mode: 'wrapping' */ bpIdx = iLeft * stride + bpIndices[0U]; bpLeftVar = table[bpIdx + 1U]; yL_0d0 = table[bpIdx]; if (bpLeftVar >= yL_0d0) { yL_1d = (uint8_t)((uint32_t)(uint8_t)(((uint8_t)((uint32_t)bpLeftVar - yL_0d0) * fractions[0U]) >> 32) + yL_0d0); } else { yL_1d = (uint8_t)((uint32_t)yL_0d0 - (uint8_t)(((uint8_t)((uint32_t)yL_0d0 - bpLeftVar) * fractions[0U]) >> 32)); } bpIdx += stride; bpLeftVar = table[bpIdx + 1U]; yL_0d0 = table[bpIdx]; if (bpLeftVar >= yL_0d0) { bpLeftVar = (uint8_t)((uint32_t)(uint8_t)(((uint8_t)((uint32_t)bpLeftVar - yL_0d0) * fractions[0U]) >> 32) + yL_0d0); } else { bpLeftVar = (uint8_t)((uint32_t)yL_0d0 - (uint8_t)(((uint8_t)((uint32_t) yL_0d0 - bpLeftVar) * fractions[0U]) >> 32)); } if (bpLeftVar >= yL_1d) { y = (uint8_t)((uint32_t)(uint8_t)(((uint8_t)((uint32_t)bpLeftVar - yL_1d) * frac) >> 32) + yL_1d); } else { y = (uint8_t)((uint32_t)yL_1d - (uint8_t)(((uint8_t)((uint32_t)yL_1d - bpLeftVar) * frac) >> 32)); } return y; } uint8_t look1_iu16lu64n48tu8_binlcse(uint16_t u0, const uint16_t bp0[], const uint8_t table[], uint32_t maxIndex) { uint64_t frac; uint32_t iLeft; uint8_t y; uint8_t yL_0d0; uint8_t yR_0d0; /* Column-major Lookup 1-D Search method: 'binary' Use previous index: 'off' Interpolation method: 'Linear point-slope' Extrapolation method: 'Clip' Use last breakpoint for index at or above upper limit: 'off' Remove protection against out-of-range input in generated code: 'off' Rounding mode: 'simplest' */ /* Prelookup - Index and Fraction Index Search method: 'binary' Extrapolation method: 'Clip' Use previous index: 'off' Use last breakpoint for index at or above upper limit: 'off' Remove protection against out-of-range input in generated code: 'off' Rounding mode: 'simplest' */ if (u0 <= bp0[0U]) { iLeft = 0U; frac = 0ULL; } else if (u0 < bp0[maxIndex]) { uint32_t bpIdx; uint32_t iRght; /* Binary Search */ bpIdx = maxIndex >> 1U; iLeft = 0U; iRght = maxIndex; while (iRght - iLeft > 1U) { if (u0 < bp0[bpIdx]) { iRght = bpIdx; } else { iLeft = bpIdx; } bpIdx = (iRght + iLeft) >> 1U; } uint16_t bpLeftVar; bpLeftVar = bp0[iLeft]; frac = ((uint64_t)((uint32_t)u0 - bpLeftVar) << 48) / ((uint32_t)bp0[iLeft + 1U] - bpLeftVar); } else { iLeft = maxIndex - 1U; frac = 281474976710656ULL; } /* Column-major Interpolation 1-D Interpolation method: 'Linear point-slope' Use last breakpoint for index at or above upper limit: 'off' Rounding mode: 'simplest' Overflow mode: 'wrapping' */ yR_0d0 = table[iLeft + 1U]; yL_0d0 = table[iLeft]; if (yR_0d0 >= yL_0d0) { y = (uint8_t)((uint32_t)(uint8_t)(((uint8_t)((uint32_t)yR_0d0 - yL_0d0) * frac) >> 48) + yL_0d0); } else { y = (uint8_t)((uint32_t)yL_0d0 - (uint8_t)(((uint8_t)((uint32_t)yL_0d0 - yR_0d0) * frac) >> 48)); } return y; } int16_t look1_iu16lu64n48ts16Ds32_binlcs(uint16_t u0, const uint16_t bp0[], const int16_t table[], uint32_t maxIndex) { uint64_t frac; uint32_t iLeft; int16_t yL_0d0; /* Column-major Lookup 1-D Search method: 'binary' Use previous index: 'off' Interpolation method: 'Linear point-slope' Extrapolation method: 'Clip' Use last breakpoint for index at or above upper limit: 'off' Remove protection against out-of-range input in generated code: 'off' Rounding mode: 'simplest' */ /* Prelookup - Index and Fraction Index Search method: 'binary' Extrapolation method: 'Clip' Use previous index: 'off' Use last breakpoint for index at or above upper limit: 'off' Remove protection against out-of-range input in generated code: 'off' Rounding mode: 'simplest' */ if (u0 <= bp0[0U]) { iLeft = 0U; frac = 0ULL; } else if (u0 < bp0[maxIndex]) { uint32_t bpIdx; uint32_t iRght; /* Binary Search */ bpIdx = maxIndex >> 1U; iLeft = 0U; iRght = maxIndex; while (iRght - iLeft > 1U) { if (u0 < bp0[bpIdx]) { iRght = bpIdx; } else { iLeft = bpIdx; } bpIdx = (iRght + iLeft) >> 1U; } uint16_t bpLeftVar; bpLeftVar = bp0[iLeft]; frac = ((uint64_t)((uint32_t)u0 - bpLeftVar) << 48) / ((uint32_t)bp0[iLeft + 1U] - bpLeftVar); } else { iLeft = maxIndex - 1U; frac = 281474976710656ULL; } /* Column-major Interpolation 1-D Interpolation method: 'Linear point-slope' Use last breakpoint for index at or above upper limit: 'off' Rounding mode: 'simplest' Overflow mode: 'wrapping' */ yL_0d0 = table[iLeft]; return (int16_t)((int16_t)(((table[iLeft + 1U] - yL_0d0) * (int64_t)frac) >> 48) + yL_0d0); } int16_t look1_iu16bs16lu64n32ts16Ds32_binlcs(uint16_t u0, const int16_t bp0[], const int16_t table[], uint32_t maxIndex) { uint64_t frac; uint32_t iLeft; int16_t yL_0d0; uint16_t tmp; /* Column-major Lookup 1-D Search method: 'binary' Use previous index: 'off' Interpolation method: 'Linear point-slope' Extrapolation method: 'Clip' Use last breakpoint for index at or above upper limit: 'off' Remove protection against out-of-range input in generated code: 'off' Rounding mode: 'simplest' */ /* Prelookup - Index and Fraction Index Search method: 'binary' Extrapolation method: 'Clip' Use previous index: 'off' Use last breakpoint for index at or above upper limit: 'off' Remove protection against out-of-range input in generated code: 'off' Rounding mode: 'simplest' */ tmp = u0; if (u0 > 32767) { tmp = 32767U; } if (u0 < bp0[0U]) { iLeft = 0U; frac = 0ULL; } else if ((int16_t)tmp < bp0[maxIndex]) { uint32_t bpIdx; uint32_t iRght; /* Binary Search */ bpIdx = maxIndex >> 1U; iLeft = 0U; iRght = maxIndex; while (iRght - iLeft > 1U) { if ((int16_t)tmp < bp0[bpIdx]) { iRght = bpIdx; } else { iLeft = bpIdx; } bpIdx = (iRght + iLeft) >> 1U; } frac = ((uint64_t)(u0 - (uint32_t)bp0[iLeft]) << 32) / (uint32_t)(bp0[iLeft + 1U] - bp0[iLeft]); } else { iLeft = maxIndex - 1U; frac = 4294967296ULL; } /* Column-major Interpolation 1-D Interpolation method: 'Linear point-slope' Use last breakpoint for index at or above upper limit: 'off' Rounding mode: 'simplest' Overflow mode: 'wrapping' */ yL_0d0 = table[iLeft]; return (int16_t)((int16_t)(((table[iLeft + 1U] - yL_0d0) * (int64_t)frac) >> 32) + yL_0d0); } double look1_bs16ts16DdId_binlc(double u0, const int16_t bp0[], const int16_t table[], uint32_t maxIndex) { double frac; uint32_t iLeft; int16_t uCast; /* Column-major Lookup 1-D Search method: 'binary' Use previous index: 'off' Interpolation method: 'Linear point-slope' Extrapolation method: 'Clip' Use last breakpoint for index at or above upper limit: 'off' Remove protection against out-of-range input in generated code: 'off' */ /* Prelookup - Index and Fraction Index Search method: 'binary' Extrapolation method: 'Clip' Use previous index: 'off' Use last breakpoint for index at or above upper limit: 'off' Remove protection against out-of-range input in generated code: 'off' */ frac = floor(u0); if (frac < 32768.0) { if (frac >= -32768.0) { uCast = (int16_t)frac; } else { uCast = INT16_MIN; } } else { uCast = INT16_MAX; } if (u0 < bp0[0U]) { iLeft = 0U; frac = 0.0; } else if (u0 < bp0[maxIndex]) { uint32_t bpIdx; uint32_t iRght; /* Binary Search */ bpIdx = maxIndex >> 1U; iLeft = 0U; iRght = maxIndex; while (iRght - iLeft > 1U) { if (uCast < bp0[bpIdx]) { iRght = bpIdx; } else { iLeft = bpIdx; } bpIdx = (iRght + iLeft) >> 1U; } frac = (u0 - (double)bp0[iLeft]) / (double)(uint32_t)(bp0[iLeft + 1U] - bp0[iLeft]); } else { iLeft = maxIndex - 1U; frac = 1.0; } /* Column-major Interpolation 1-D Interpolation method: 'Linear point-slope' Use last breakpoint for index at or above upper limit: 'off' Overflow mode: 'wrapping' */ uCast = table[iLeft]; return ((double)table[iLeft + 1U] - (double)uCast) * frac + (double)uCast; } int16_t look1_iu16tdIs16_binlcs(uint16_t u0, const uint16_t bp0[], const double table[], uint32_t maxIndex) { double frac; double yL_0d0; int32_t tmp_1; uint32_t iLeft; int16_t tmp; int16_t tmp_0; /* Column-major Lookup 1-D Search method: 'binary' Use previous index: 'off' Interpolation method: 'Linear point-slope' Extrapolation method: 'Clip' Use last breakpoint for index at or above upper limit: 'off' Remove protection against out-of-range input in generated code: 'off' */ /* Prelookup - Index and Fraction Index Search method: 'binary' Extrapolation method: 'Clip' Use previous index: 'off' Use last breakpoint for index at or above upper limit: 'off' Remove protection against out-of-range input in generated code: 'off' */ if (u0 <= bp0[0U]) { iLeft = 0U; frac = 0.0; } else if (u0 < bp0[maxIndex]) { uint32_t bpIdx; uint32_t iRght; /* Binary Search */ bpIdx = maxIndex >> 1U; iLeft = 0U; iRght = maxIndex; while (iRght - iLeft > 1U) { if (u0 < bp0[bpIdx]) { iRght = bpIdx; } else { iLeft = bpIdx; } bpIdx = (iRght + iLeft) >> 1U; } uint16_t bpLeftVar; bpLeftVar = bp0[iLeft]; frac = (double)((uint32_t)u0 - bpLeftVar) / (double)((uint32_t)bp0[iLeft + 1U] - bpLeftVar); } else { iLeft = maxIndex - 1U; frac = 1.0; } /* Column-major Interpolation 1-D Interpolation method: 'Linear point-slope' Use last breakpoint for index at or above upper limit: 'off' Overflow mode: 'saturate' */ yL_0d0 = table[iLeft]; if (yL_0d0 < 32768.0) { if (yL_0d0 >= -32768.0) { tmp = (int16_t)yL_0d0; } else { tmp = INT16_MIN; } } else { tmp = INT16_MAX; } frac *= table[iLeft + 1U] - yL_0d0; if (frac < 32768.0) { if (frac >= -32768.0) { tmp_0 = (int16_t)frac; } else { tmp_0 = INT16_MIN; } } else { tmp_0 = INT16_MAX; } tmp_1 = tmp + tmp_0; if (tmp_1 > 32767) { tmp_1 = 32767; } else if (tmp_1 < -32768) { tmp_1 = -32768; } return (int16_t)tmp_1; } double look1_iu16td_binlc(uint16_t u0, const uint16_t bp0[], const double table[], uint32_t maxIndex) { double frac; double yL_0d0; uint32_t iLeft; /* Column-major Lookup 1-D Search method: 'binary' Use previous index: 'off' Interpolation method: 'Linear point-slope' Extrapolation method: 'Clip' Use last breakpoint for index at or above upper limit: 'off' Remove protection against out-of-range input in generated code: 'off' */ /* Prelookup - Index and Fraction Index Search method: 'binary' Extrapolation method: 'Clip' Use previous index: 'off' Use last breakpoint for index at or above upper limit: 'off' Remove protection against out-of-range input in generated code: 'off' */ if (u0 <= bp0[0U]) { iLeft = 0U; frac = 0.0; } else if (u0 < bp0[maxIndex]) { uint32_t bpIdx; uint32_t iRght; /* Binary Search */ bpIdx = maxIndex >> 1U; iLeft = 0U; iRght = maxIndex; while (iRght - iLeft > 1U) { if (u0 < bp0[bpIdx]) { iRght = bpIdx; } else { iLeft = bpIdx; } bpIdx = (iRght + iLeft) >> 1U; } uint16_t bpLeftVar; bpLeftVar = bp0[iLeft]; frac = (double)((uint32_t)u0 - bpLeftVar) / (double)((uint32_t)bp0[iLeft + 1U] - bpLeftVar); } else { iLeft = maxIndex - 1U; frac = 1.0; } /* Column-major Interpolation 1-D Interpolation method: 'Linear point-slope' Use last breakpoint for index at or above upper limit: 'off' Overflow mode: 'wrapping' */ yL_0d0 = table[iLeft]; return (table[iLeft + 1U] - yL_0d0) * frac + yL_0d0; } uint32_t plook_u32s16_bincka(int16_t u_3, const int16_t bp[], uint32_t maxIndex) { uint32_t bpIndex; /* Prelookup - Index only Index Search method: 'binary' Extrapolation method: 'Clip' Use previous index: 'off' Use last breakpoint for index at or above upper limit: 'on' Remove protection against out-of-range input in generated code: 'off' */ if (u_3 <= bp[0U]) { bpIndex = 0U; } else if (u_3 < bp[maxIndex]) { bpIndex = binsearch_u32s16(u_3, bp, maxIndex >> 1U, maxIndex); } else { bpIndex = maxIndex; } return bpIndex; } /* * Output and update for atomic system: * '/get_tg_FLL_for_LVL' * '/get_tg_FLL_for_LVL' * '/get_tg_for_LVL' * '/get_tg_FLL_for_LVL' * '/get_tg_FLL_for_LVL' * '/get_tg_for_LVL' */ void get_tg_FLL_for_LVL(uint8_t rtu_ambient_Lvl, uint8_t rtu_set_tmp, int16_t *rty_vals) { int32_t i; uint32_t qY; int16_t tmp[78]; /* : table = [ */ /* : g_assTG_FLL_LV0; */ /* : g_assTG_FLL_LV1; */ /* : g_assTG_FLL_LV2; */ /* : g_assTG_FLL_LV3; */ /* : g_assTG_FLL_LV4; */ /* : g_assTG_FLL_LV5 */ /* : ]; */ /* : vals = table(ambient_Lvl + 1, set_tmp - 16); */ for (i = 0; i < 13; i++) { tmp[6 * i] = g_assTG_FLL_LV0[i]; tmp[6 * i + 1] = g_assTG_FLL_LV1[i]; tmp[6 * i + 2] = g_assTG_FLL_LV2[i]; tmp[6 * i + 3] = g_assTG_FLL_LV3[i]; tmp[6 * i + 4] = g_assTG_FLL_LV4[i]; tmp[6 * i + 5] = g_assTG_FLL_LV5[i]; } i = (int32_t)(rtu_ambient_Lvl + 1U); if (rtu_ambient_Lvl + 1U > 255U) { i = 255; } /* MW:begin MISRA2012:D4.1 CERT-C:INT30-C 'Justifying MISRA CPP rule violation' */ qY = rtu_set_tmp - 16U; /* MW:end MISRA2012:D4.1 CERT-C:INT30-C */ if (rtu_set_tmp - 16U > rtu_set_tmp) { qY = 0U; } *rty_vals = tmp[(((int32_t)qY - 1) * 6 + i) - 1]; } /* * Output and update for atomic system: * '/get_tg_FLL_for_LVL' * '/get_tg_FLL_for_LVL' * '/get_tg_FLL_for_LVL' * '/get_tg_FLL_for_LVL' * '/get_tg_FLL_for_LVL' * '/get_tg_FLL_for_LVL' */ void get_tg_FLL_for_LVL_j(uint8_t rtu_ambient_Lvl, uint8_t rtu_set_tmp, int16_t * rty_vals) { int32_t i; uint32_t qY; int16_t tmp[78]; /* : table = [ */ /* : g_assTG_FRL_LV0; */ /* : g_assTG_FRL_LV1; */ /* : g_assTG_FRL_LV2; */ /* : g_assTG_FRL_LV3; */ /* : g_assTG_FRL_LV4; */ /* : g_assTG_FRL_LV5 */ /* : ]; */ /* : vals = table(ambient_Lvl + 1, set_tmp - 16); */ for (i = 0; i < 13; i++) { tmp[6 * i] = g_assTG_FRL_LV0[i]; tmp[6 * i + 1] = g_assTG_FRL_LV1[i]; tmp[6 * i + 2] = g_assTG_FRL_LV2[i]; tmp[6 * i + 3] = g_assTG_FRL_LV3[i]; tmp[6 * i + 4] = g_assTG_FRL_LV4[i]; tmp[6 * i + 5] = g_assTG_FRL_LV5[i]; } i = (int32_t)(rtu_ambient_Lvl + 1U); if (rtu_ambient_Lvl + 1U > 255U) { i = 255; } /* MW:begin MISRA2012:D4.1 CERT-C:INT30-C 'Justifying MISRA CPP rule violation' */ qY = rtu_set_tmp - 16U; /* MW:end MISRA2012:D4.1 CERT-C:INT30-C */ if (rtu_set_tmp - 16U > rtu_set_tmp) { qY = 0U; } *rty_vals = tmp[(((int32_t)qY - 1) * 6 + i) - 1]; } /* * Output and update for atomic system: * '/g_assFLOW_BI_AMB_TGT' * '/g_assFLOW_BI_AMB_TGT' * '/g_assFLOW_BI_AMB_TGT' * '/g_assFLOW_BI_AMB_TGT' */ void g_assFLOW_BI_AMB_TGT_n(uint8_t rtu_LVL, int16_t *rty_c_g_assFLOW_BI_AMB_TGT) { int32_t tmp; /* : c_g_assFLOW_BI_AMB_TGT = g_assFLOW_BI_AMB_TGT(LVL + 1); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } *rty_c_g_assFLOW_BI_AMB_TGT = g_assFLOW_BI_AMB_TGT[tmp - 1]; } /* * Output and update for action system: * '/Bilevel' * '/Bilevel' */ void Bilevel(int16_t rtu_Amb_Fb, uint8_t rtu_LVL, uint16_t rty_Out1[9], uint8_t rtu_setTempFL, uint8_t rtu_setTempFR) { int32_t tmp; int32_t tmp_0; int16_t rtb_u_eg; uint16_t rtb_FLF_NEW; uint16_t rtb_FRF_NEW; uint16_t rtb_Switch2_a5_idx_0; uint16_t rtb_Switch2_a5_idx_1; uint16_t rtb_Switch2_cd_0; int8_t rtb_X; uint8_t rtb_c_g_aucFLOW_BI2_FOOT_VALVE_MIN; uint8_t rtb_c_g_aucFLOW_BI_FOOT_VALVE_MAX; uint8_t rtb_c_g_aucFLOW_BI_FOOT_VALVE_MAX_n; uint8_t rtb_c_g_aucFLOW_BI_FOOT_VALVE_MIN; uint8_t rtb_c_g_aucFLOW_BI_VENT_VALVE_MAX; uint8_t rtb_c_g_aucFLOW_BI_VENT_VALVE_MAX_h; uint8_t rtb_c_g_aucFLOW_BI_VENT_VALVE_MIN; uint8_t rtb_c_g_aucFLOW_BI_VENT_VALVE_MIN_a; /* MATLAB Function: '/get_tg_FLL_for_LVL' */ /* : c_g_assFLOW_BI_TEMP_TGT = g_assFLOW_BI_TEMP_TGT(LVL + 1); */ get_tg_FLL_for_LVL(rtu_LVL, rtu_setTempFL, &rtb_u_eg); /* MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } /* Sum: '/ 1' incorporates: * MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ rtb_u_eg = (int16_t)(g_assFLOW_BI_TEMP_TGT[tmp_0 - 1] - rtb_u_eg); /* Gain: '/Gain6' */ tmp_0 = 13107 * rtb_u_eg; rtb_X = (int8_t)(((((uint32_t)tmp_0 & 65536U) != 0U) && ((((uint32_t)tmp_0 & 65535U) != 0U) || (tmp_0 > 0))) + (tmp_0 >> 17)); /* Switch: '/Switch1' incorporates: * Gain: '/Gain6' * Sum: '/Add' */ /* : c_g_aucFLOW_BI_FOOT_PLUS = g_aucFLOW_BI_FOOT_PLUS(LVL + 1); */ if (rtb_X >= 0) { rtb_FLF_NEW = rty_Out1[4]; } else { /* MATLAB Function: '/g_aucFLOW_BI_FOOT_PLUS_LEFT' incorporates: * MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } /* Gain: '/Gain6' incorporates: * MATLAB Function: '/g_aucFLOW_BI_FOOT_PLUS_LEFT' * Product: '/Product3' */ tmp_0 = g_aucFLOW_BI_FOOT_PLUS[tmp_0 - 1] * rtb_X * 13107; rtb_FLF_NEW = (uint16_t)((int16_t)rty_Out1[4] - (int8_t)(((((uint32_t)tmp_0 & 65536U) != 0U) && (((uint32_t)tmp_0 & 65535U) != 0U)) + (tmp_0 >> 17))); } /* End of Switch: '/Switch1' */ /* MATLAB Function: '/g_aucFLOW_BI_FOOT_VALVE_MAX1' incorporates: * MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ /* : c_g_aucFLOW_BI_FOOT_VALVE_MAX = g_aucFLOW_BI_FOOT_VALVE_MAX(LVL + 1); */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } rtb_c_g_aucFLOW_BI_FOOT_VALVE_MAX_n = g_aucFLOW_BI_FOOT_VALVE_MAX[tmp_0 - 1]; /* End of MATLAB Function: '/g_aucFLOW_BI_FOOT_VALVE_MAX1' */ /* MATLAB Function: '/g_aucFLOW_BI_FOOT_VALVE_MIN1' incorporates: * MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ /* : c_g_aucFLOW_BI2_FOOT_VALVE_MIN = g_aucFLOW_BI_FOOT_VALVE_MIN(LVL +1); */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } rtb_c_g_aucFLOW_BI2_FOOT_VALVE_MIN = g_aucFLOW_BI_FOOT_VALVE_MIN[tmp_0 - 1]; /* End of MATLAB Function: '/g_aucFLOW_BI_FOOT_VALVE_MIN1' */ /* MATLAB Function: '/get_tg_FLL_for_LVL' */ /* : c_g_assFLOW_BI_TEMP_TGT = g_assFLOW_BI_TEMP_TGT(LVL + 1 + 6); */ get_tg_FLL_for_LVL_j(rtu_LVL, rtu_setTempFR, &rtb_u_eg); /* MATLAB Function: '/g_assFLOW_BI_TEMP_TGT_RIGHT' incorporates: * MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } tmp = (int32_t)((uint32_t)tmp_0 + 6U); if ((uint32_t)tmp_0 + 6U > 255U) { tmp = 255; } /* Sum: '/ 1' incorporates: * MATLAB Function: '/g_assFLOW_BI_TEMP_TGT_RIGHT' */ rtb_u_eg = (int16_t)(g_assFLOW_BI_TEMP_TGT[tmp - 1] - rtb_u_eg); /* Gain: '/Gain6' */ tmp_0 = 13107 * rtb_u_eg; rtb_X = (int8_t)(((((uint32_t)tmp_0 & 65536U) != 0U) && ((((uint32_t)tmp_0 & 65535U) != 0U) || (tmp_0 > 0))) + (tmp_0 >> 17)); /* Switch: '/Switch3' incorporates: * Gain: '/Gain7' * Sum: '/Add1' */ /* : c_g_aucFLOW_BI_FOOT_PLUS = g_aucFLOW_BI_FOOT_PLUS(LVL + 1 + 6); */ if (rtb_X >= 0) { rtb_FRF_NEW = rty_Out1[6]; } else { /* MATLAB Function: '/g_aucFLOW_BI_FOOT_PLUS_RIGHT' incorporates: * MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } tmp = (int32_t)((uint32_t)tmp_0 + 6U); if ((uint32_t)tmp_0 + 6U > 255U) { tmp = 255; } /* Gain: '/Gain7' incorporates: * MATLAB Function: '/g_aucFLOW_BI_FOOT_PLUS_RIGHT' * Product: '/Product4' */ tmp_0 = g_aucFLOW_BI_FOOT_PLUS[tmp - 1] * rtb_X * 13107; rtb_FRF_NEW = (uint16_t)((int16_t)rty_Out1[6] - (int8_t)(((((uint32_t)tmp_0 & 65536U) != 0U) && (((uint32_t)tmp_0 & 65535U) != 0U)) + (tmp_0 >> 17))); } /* End of Switch: '/Switch3' */ /* MATLAB Function: '/g_aucFLOW_BI_FOOT_VALVE_MAX2' incorporates: * MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ /* : c_g_aucFLOW_BI_FOOT_VALVE_MAX = g_aucFLOW_BI_FOOT_VALVE_MAX(LVL + 1 + 6); */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } tmp = (int32_t)((uint32_t)tmp_0 + 6U); if ((uint32_t)tmp_0 + 6U > 255U) { tmp = 255; } rtb_c_g_aucFLOW_BI_FOOT_VALVE_MAX = g_aucFLOW_BI_FOOT_VALVE_MAX[tmp - 1]; /* End of MATLAB Function: '/g_aucFLOW_BI_FOOT_VALVE_MAX2' */ /* MATLAB Function: '/g_aucFLOW_BI_FOOT_VALVE_MIN2' incorporates: * MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ /* : c_g_aucFLOW_BI_FOOT_VALVE_MIN = g_aucFLOW_BI_FOOT_VALVE_MIN(LVL + 1 + 6); */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } tmp = (int32_t)((uint32_t)tmp_0 + 6U); if ((uint32_t)tmp_0 + 6U > 255U) { tmp = 255; } rtb_c_g_aucFLOW_BI_FOOT_VALVE_MIN = g_aucFLOW_BI_FOOT_VALVE_MIN[tmp - 1]; /* End of MATLAB Function: '/g_aucFLOW_BI_FOOT_VALVE_MIN2' */ /* MATLAB Function: '/g_assFLOW_BI_AMB_TGT' */ /* : c_g_aucFLOW_BI_VENT_PLUS = g_aucFLOW_BI_VENT_PLUS(LVL + 1); */ g_assFLOW_BI_AMB_TGT_n(rtu_LVL, &rtb_u_eg); /* MATLAB Function: '/g_aucFLOW_BI_VENT_PLUS' incorporates: * MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } /* Gain: '/Gain2' incorporates: * Sum: '/deg' */ tmp = (int16_t)(rtb_u_eg - rtu_Amb_Fb) * 13107; /* Product: '/Умножили' incorporates: * Gain: '/Gain' * Gain: '/Gain2' * MATLAB Function: '/g_aucFLOW_BI_VENT_PLUS' */ rtb_u_eg = (int16_t)((int8_t)(((((uint32_t)tmp & 65536U) != 0U) && ((((uint32_t)tmp & 65535U) != 0U) || (tmp > 0))) + (tmp >> 17)) * (int32_t) ((g_aucFLOW_BI_VENT_PLUS[tmp_0 - 1] * 205U + 1024U) >> 11)); /* DataTypeConversion: '/Data Type Conversion' incorporates: * Sum: '/ ' * Switch: '/Switch2' */ rtb_Switch2_a5_idx_0 = (uint16_t)((uint16_t)((rty_Out1[0] - rtb_u_eg) >> 1) << 1); rtb_Switch2_a5_idx_1 = (uint16_t)((uint16_t)((rty_Out1[1] - rtb_u_eg) >> 1) << 1); /* MATLAB Function: '/g_aucFLOW_BI_VENT_VALVE_MAX' incorporates: * MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ /* : c_g_aucFLOW_BI_VENT_VALVE_MAX = g_aucFLOW_BI_VENT_VALVE_MAX(LVL + 1); */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } rtb_c_g_aucFLOW_BI_VENT_VALVE_MAX_h = g_aucFLOW_BI_VENT_VALVE_MAX[tmp_0 - 1]; /* End of MATLAB Function: '/g_aucFLOW_BI_VENT_VALVE_MAX' */ /* MATLAB Function: '/g_aucFLOW_BI_VENT_VALVE_MIN' incorporates: * MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ /* : c_g_aucFLOW_BI_VENT_VALVE_MIN = g_aucFLOW_BI_VENT_VALVE_MIN(LVL + 1); */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } rtb_c_g_aucFLOW_BI_VENT_VALVE_MIN_a = g_aucFLOW_BI_VENT_VALVE_MIN[tmp_0 - 1]; /* End of MATLAB Function: '/g_aucFLOW_BI_VENT_VALVE_MIN' */ /* MATLAB Function: '/g_assFLOW_BI_AMB_TGT' */ /* : c_g_aucFLOW_BI_VENT_PLUS = g_aucFLOW_BI_VENT_PLUS(LVL + 1 + 6); */ g_assFLOW_BI_AMB_TGT_n(rtu_LVL, &rtb_u_eg); /* MATLAB Function: '/g_aucFLOW_BI_VENT_PLUS' incorporates: * MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } tmp = (int32_t)((uint32_t)tmp_0 + 6U); if ((uint32_t)tmp_0 + 6U > 255U) { tmp = 255; } /* Gain: '/Gain2' incorporates: * Sum: '/deg' */ tmp_0 = (int16_t)(rtb_u_eg - rtu_Amb_Fb) * 13107; /* Product: '/Умножили' incorporates: * Gain: '/Gain' * Gain: '/Gain2' * MATLAB Function: '/g_aucFLOW_BI_VENT_PLUS' */ rtb_u_eg = (int16_t)((int8_t)(((((uint32_t)tmp_0 & 65536U) != 0U) && ((((uint32_t)tmp_0 & 65535U) != 0U) || (tmp_0 > 0))) + (tmp_0 >> 17)) * (int32_t)((g_aucFLOW_BI_VENT_PLUS[tmp - 1] * 205U + 1024U) >> 11)); /* MATLAB Function: '/g_aucFLOW_BI_VENT_VALVE_MAX' incorporates: * MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ /* : c_g_aucFLOW_BI_VENT_VALVE_MAX = g_aucFLOW_BI_VENT_VALVE_MAX(LVL + 1 + 6); */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } tmp = (int32_t)((uint32_t)tmp_0 + 6U); if ((uint32_t)tmp_0 + 6U > 255U) { tmp = 255; } rtb_c_g_aucFLOW_BI_VENT_VALVE_MAX = g_aucFLOW_BI_VENT_VALVE_MAX[tmp - 1]; /* End of MATLAB Function: '/g_aucFLOW_BI_VENT_VALVE_MAX' */ /* MATLAB Function: '/g_aucFLOW_BI_VENT_VALVE_MIN' incorporates: * MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ /* : c_g_aucFLOW_BI_VENT_VALVE_MIN = g_aucFLOW_BI_VENT_VALVE_MIN(LVL + 1 + 6); */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } tmp = (int32_t)((uint32_t)tmp_0 + 6U); if ((uint32_t)tmp_0 + 6U > 255U) { tmp = 255; } rtb_c_g_aucFLOW_BI_VENT_VALVE_MIN = g_aucFLOW_BI_VENT_VALVE_MIN[tmp - 1]; /* End of MATLAB Function: '/g_aucFLOW_BI_VENT_VALVE_MIN' */ /* DataTypeConversion: '/Data Type Conversion' incorporates: * Sum: '/ ' * Switch: '/Switch2' */ rtb_Switch2_cd_0 = (uint16_t)((uint16_t)((rty_Out1[0] - rtb_u_eg) >> 1) << 1); /* Switch: '/Switch2' incorporates: * RelationalOperator: '/LowerRelop1' * RelationalOperator: '/UpperRelop' * Switch: '/Switch' */ if (rtb_Switch2_a5_idx_0 > rtb_c_g_aucFLOW_BI_VENT_VALVE_MAX_h) { /* Assignment: '/Присваивание в [1-2]' incorporates: * SignalConversion generated from: '/Out1' */ rty_Out1[0] = rtb_c_g_aucFLOW_BI_VENT_VALVE_MAX_h; } else if (rtb_Switch2_a5_idx_0 < rtb_c_g_aucFLOW_BI_VENT_VALVE_MIN_a) { /* Switch: '/Switch' incorporates: * Assignment: '/Присваивание в [1-2]' * SignalConversion generated from: '/Out1' */ rty_Out1[0] = rtb_c_g_aucFLOW_BI_VENT_VALVE_MIN_a; } else { /* Assignment: '/Присваивание в [1-2]' incorporates: * SignalConversion generated from: '/Out1' * Switch: '/Switch' */ rty_Out1[0] = rtb_Switch2_a5_idx_0; } /* Switch: '/Switch2' incorporates: * RelationalOperator: '/LowerRelop1' * RelationalOperator: '/UpperRelop' * Switch: '/Switch' */ if (rtb_Switch2_cd_0 > rtb_c_g_aucFLOW_BI_VENT_VALVE_MAX) { /* Assignment: '/Присваивание в [3-4]' incorporates: * SignalConversion generated from: '/Out1' */ rty_Out1[2] = rtb_c_g_aucFLOW_BI_VENT_VALVE_MAX; } else if (rtb_Switch2_cd_0 < rtb_c_g_aucFLOW_BI_VENT_VALVE_MIN) { /* Switch: '/Switch' incorporates: * Assignment: '/Присваивание в [3-4]' * SignalConversion generated from: '/Out1' */ rty_Out1[2] = rtb_c_g_aucFLOW_BI_VENT_VALVE_MIN; } else { /* Assignment: '/Присваивание в [3-4]' incorporates: * SignalConversion generated from: '/Out1' * Switch: '/Switch' */ rty_Out1[2] = rtb_Switch2_cd_0; } /* DataTypeConversion: '/Data Type Conversion' incorporates: * Sum: '/ ' * Switch: '/Switch2' */ rtb_Switch2_cd_0 = (uint16_t)((uint16_t)((rty_Out1[1] - rtb_u_eg) >> 1) << 1); /* Switch: '/Switch2' incorporates: * RelationalOperator: '/LowerRelop1' * RelationalOperator: '/UpperRelop' * Switch: '/Switch' */ if (rtb_Switch2_a5_idx_1 > rtb_c_g_aucFLOW_BI_VENT_VALVE_MAX_h) { /* Assignment: '/Присваивание в [1-2]' incorporates: * SignalConversion generated from: '/Out1' */ rty_Out1[1] = rtb_c_g_aucFLOW_BI_VENT_VALVE_MAX_h; } else if (rtb_Switch2_a5_idx_1 < rtb_c_g_aucFLOW_BI_VENT_VALVE_MIN_a) { /* Switch: '/Switch' incorporates: * Assignment: '/Присваивание в [1-2]' * SignalConversion generated from: '/Out1' */ rty_Out1[1] = rtb_c_g_aucFLOW_BI_VENT_VALVE_MIN_a; } else { /* Assignment: '/Присваивание в [1-2]' incorporates: * SignalConversion generated from: '/Out1' * Switch: '/Switch' */ rty_Out1[1] = rtb_Switch2_a5_idx_1; } /* Switch: '/Switch2' incorporates: * RelationalOperator: '/LowerRelop1' * RelationalOperator: '/UpperRelop' * Switch: '/Switch' */ if (rtb_Switch2_cd_0 > rtb_c_g_aucFLOW_BI_VENT_VALVE_MAX) { /* Assignment: '/Присваивание в [3-4]' incorporates: * SignalConversion generated from: '/Out1' */ rty_Out1[3] = rtb_c_g_aucFLOW_BI_VENT_VALVE_MAX; } else if (rtb_Switch2_cd_0 < rtb_c_g_aucFLOW_BI_VENT_VALVE_MIN) { /* Switch: '/Switch' incorporates: * Assignment: '/Присваивание в [3-4]' * SignalConversion generated from: '/Out1' */ rty_Out1[3] = rtb_c_g_aucFLOW_BI_VENT_VALVE_MIN; } else { /* Assignment: '/Присваивание в [3-4]' incorporates: * SignalConversion generated from: '/Out1' * Switch: '/Switch' */ rty_Out1[3] = rtb_Switch2_cd_0; } /* Switch: '/Switch2' incorporates: * RelationalOperator: '/LowerRelop1' * RelationalOperator: '/UpperRelop' * Switch: '/Switch' */ if (rtb_FLF_NEW > rtb_c_g_aucFLOW_BI_FOOT_VALVE_MAX_n) { /* Assignment: '/Присваивание в [5]' incorporates: * SignalConversion generated from: '/Out1' */ rty_Out1[4] = rtb_c_g_aucFLOW_BI_FOOT_VALVE_MAX_n; } else if (rtb_FLF_NEW < rtb_c_g_aucFLOW_BI2_FOOT_VALVE_MIN) { /* Switch: '/Switch' incorporates: * Assignment: '/Присваивание в [5]' * SignalConversion generated from: '/Out1' */ rty_Out1[4] = rtb_c_g_aucFLOW_BI2_FOOT_VALVE_MIN; } else { /* Assignment: '/Присваивание в [5]' incorporates: * SignalConversion generated from: '/Out1' * Switch: '/Switch' */ rty_Out1[4] = rtb_FLF_NEW; } /* End of Switch: '/Switch2' */ /* Switch: '/Switch2' incorporates: * RelationalOperator: '/LowerRelop1' * RelationalOperator: '/UpperRelop' * Switch: '/Switch' */ if (rtb_FRF_NEW > rtb_c_g_aucFLOW_BI_FOOT_VALVE_MAX) { /* Assignment: '/Присваивание в [7]' incorporates: * SignalConversion generated from: '/Out1' */ rty_Out1[6] = rtb_c_g_aucFLOW_BI_FOOT_VALVE_MAX; } else if (rtb_FRF_NEW < rtb_c_g_aucFLOW_BI_FOOT_VALVE_MIN) { /* Switch: '/Switch' incorporates: * Assignment: '/Присваивание в [7]' * SignalConversion generated from: '/Out1' */ rty_Out1[6] = rtb_c_g_aucFLOW_BI_FOOT_VALVE_MIN; } else { /* Assignment: '/Присваивание в [7]' incorporates: * SignalConversion generated from: '/Out1' * Switch: '/Switch' */ rty_Out1[6] = rtb_FRF_NEW; } /* End of Switch: '/Switch2' */ } /* * Output and update for atomic system: * '/g_assFLOW_BI_AMB_TGT' * '/g_assFLOW_BI_AMB_TGT' * '/g_assFLOW_BI_AMB_TGT' * '/g_assFLOW_BI_AMB_TGT' */ void g_assFLOW_BI_AMB_TGT_e(uint8_t rtu_LVL, int16_t *rty_c_g_assFLOW_BI2_AMB_TGT) { int32_t tmp; /* : c_g_assFLOW_BI2_AMB_TGT = g_assFLOW_B2I_AMB_TGT(LVL + 1); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } *rty_c_g_assFLOW_BI2_AMB_TGT = g_assFLOW_B2I_AMB_TGT[tmp - 1]; } /* * Output and update for action system: * '/Bilevel2' * '/Bilevel2' */ void Bilevel2(int16_t rtu_Amb_Fb, uint8_t rtu_LVL, uint16_t rty_Out1[9], uint8_t rtu_setTempFL, uint8_t rtu_setTempFR) { int32_t tmp; int32_t tmp_0; int16_t rtb_u_abl; uint16_t rtb_FLF_NEW; uint16_t rtb_FRF_NEW; uint16_t rtb_Switch2_i_idx_0; uint16_t rtb_Switch2_i_idx_1; uint16_t rtb_Switch2_p4_0; int8_t rtb_X; uint8_t rtb_c_g_aucFLOW_BI2_FOOT_VALVE_MAX; uint8_t rtb_c_g_aucFLOW_BI2_FOOT_VALVE_MAX_l; uint8_t rtb_c_g_aucFLOW_BI2_FOOT_VALVE_MIN; uint8_t rtb_c_g_aucFLOW_BI2_FOOT_VALVE_MIN_l; uint8_t rtb_c_g_aucFLOW_BI2_VENT_VALVE_MAX; uint8_t rtb_c_g_aucFLOW_BI2_VENT_VALVE_MAX_k; uint8_t rtb_c_g_aucFLOW_BI2_VENT_VALVE_MIN; uint8_t rtb_c_g_aucFLOW_BI2_VENT_VALVE_MIN_f; /* MATLAB Function: '/get_tg_FLL_for_LVL' */ /* : c_g_assFLOW_BI2_TEMP_TGT = g_assFLOW_BI2_TEMP_TGT(LVL + 1); */ get_tg_FLL_for_LVL(rtu_LVL, rtu_setTempFL, &rtb_u_abl); /* MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } /* Sum: '/ 1' incorporates: * MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ rtb_u_abl = (int16_t)(g_assFLOW_BI2_TEMP_TGT[tmp_0 - 1] - rtb_u_abl); /* Gain: '/Gain6' */ tmp_0 = 13107 * rtb_u_abl; rtb_X = (int8_t)(((((uint32_t)tmp_0 & 65536U) != 0U) && ((((uint32_t)tmp_0 & 65535U) != 0U) || (tmp_0 > 0))) + (tmp_0 >> 17)); /* Switch: '/Switch1' incorporates: * Gain: '/Gain6' * Sum: '/Add' */ /* : c_g_aucFLOW_BI2_FOOT_PLUS = g_aucFLOW_BI2_FOOT_PLUS(LVL + 1); */ if (rtb_X >= 0) { rtb_FLF_NEW = rty_Out1[4]; } else { /* MATLAB Function: '/g_aucFLOW_BI_FOOT_PLUS_LEFT' incorporates: * MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } /* Gain: '/Gain6' incorporates: * MATLAB Function: '/g_aucFLOW_BI_FOOT_PLUS_LEFT' * Product: '/Product3' */ tmp_0 = g_aucFLOW_BI2_FOOT_PLUS[tmp_0 - 1] * rtb_X * 13107; rtb_FLF_NEW = (uint16_t)((int16_t)rty_Out1[4] - (int8_t)(((((uint32_t)tmp_0 & 65536U) != 0U) && (((uint32_t)tmp_0 & 65535U) != 0U)) + (tmp_0 >> 17))); } /* End of Switch: '/Switch1' */ /* MATLAB Function: '/g_aucFLOW_BI_FOOT_VALVE_MAX1' incorporates: * MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ /* : c_g_aucFLOW_BI2_FOOT_VALVE_MAX = g_aucFLOW_BI2_FOOT_VALVE_MAX(LVL + 1); */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } rtb_c_g_aucFLOW_BI2_FOOT_VALVE_MAX_l = g_aucFLOW_BI2_FOOT_VALVE_MAX[tmp_0 - 1]; /* End of MATLAB Function: '/g_aucFLOW_BI_FOOT_VALVE_MAX1' */ /* MATLAB Function: '/g_aucFLOW_BI_FOOT_VALVE_MIN1' incorporates: * MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ /* : c_g_aucFLOW_BI2_FOOT_VALVE_MIN = g_aucFLOW_BI2_FOOT_VALVE_MIN(LVL + 1); */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } rtb_c_g_aucFLOW_BI2_FOOT_VALVE_MIN = g_aucFLOW_BI2_FOOT_VALVE_MIN[tmp_0 - 1]; /* End of MATLAB Function: '/g_aucFLOW_BI_FOOT_VALVE_MIN1' */ /* MATLAB Function: '/get_tg_FLL_for_LVL' */ /* : c_g_assFLOW_BI2_TEMP_TGT = g_assFLOW_BI2_TEMP_TGT(LVL + 1 + 6); */ get_tg_FLL_for_LVL_j(rtu_LVL, rtu_setTempFR, &rtb_u_abl); /* MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_RIGHT' incorporates: * MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } tmp = (int32_t)((uint32_t)tmp_0 + 6U); if ((uint32_t)tmp_0 + 6U > 255U) { tmp = 255; } /* Sum: '/ 1' incorporates: * MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_RIGHT' */ rtb_u_abl = (int16_t)(g_assFLOW_BI2_TEMP_TGT[tmp - 1] - rtb_u_abl); /* Gain: '/Gain6' */ tmp_0 = 13107 * rtb_u_abl; rtb_X = (int8_t)(((((uint32_t)tmp_0 & 65536U) != 0U) && ((((uint32_t)tmp_0 & 65535U) != 0U) || (tmp_0 > 0))) + (tmp_0 >> 17)); /* Switch: '/Switch3' incorporates: * Gain: '/Gain7' * Sum: '/Add1' */ /* : c_g_aucFLOW_BI2_FOOT_PLUS = g_aucFLOW_BI2_FOOT_PLUS(LVL + 1 + 6); */ if (rtb_X >= 0) { rtb_FRF_NEW = rty_Out1[6]; } else { /* MATLAB Function: '/g_aucFLOW_BI_FOOT_PLUS_RIGHT' incorporates: * MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } tmp = (int32_t)((uint32_t)tmp_0 + 6U); if ((uint32_t)tmp_0 + 6U > 255U) { tmp = 255; } /* Gain: '/Gain7' incorporates: * MATLAB Function: '/g_aucFLOW_BI_FOOT_PLUS_RIGHT' * Product: '/Product4' */ tmp_0 = g_aucFLOW_BI2_FOOT_PLUS[tmp - 1] * rtb_X * 13107; rtb_FRF_NEW = (uint16_t)((int16_t)rty_Out1[6] - (int8_t)(((((uint32_t)tmp_0 & 65536U) != 0U) && (((uint32_t)tmp_0 & 65535U) != 0U)) + (tmp_0 >> 17))); } /* End of Switch: '/Switch3' */ /* MATLAB Function: '/g_aucFLOW_BI_FOOT_VALVE_MAX2' incorporates: * MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ /* : c_g_aucFLOW_BI2_FOOT_VALVE_MAX = g_aucFLOW_BI2_FOOT_VALVE_MAX(LVL + 1 + 6); */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } tmp = (int32_t)((uint32_t)tmp_0 + 6U); if ((uint32_t)tmp_0 + 6U > 255U) { tmp = 255; } rtb_c_g_aucFLOW_BI2_FOOT_VALVE_MAX = g_aucFLOW_BI2_FOOT_VALVE_MAX[tmp - 1]; /* End of MATLAB Function: '/g_aucFLOW_BI_FOOT_VALVE_MAX2' */ /* MATLAB Function: '/g_aucFLOW_BI_FOOT_VALVE_MIN2' incorporates: * MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ /* : c_g_aucFLOW_BI2_FOOT_VALVE_MIN = g_aucFLOW_BI2_FOOT_VALVE_MIN(LVL + 1 + 6); */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } tmp = (int32_t)((uint32_t)tmp_0 + 6U); if ((uint32_t)tmp_0 + 6U > 255U) { tmp = 255; } rtb_c_g_aucFLOW_BI2_FOOT_VALVE_MIN_l = g_aucFLOW_BI2_FOOT_VALVE_MIN[tmp - 1]; /* End of MATLAB Function: '/g_aucFLOW_BI_FOOT_VALVE_MIN2' */ /* MATLAB Function: '/g_assFLOW_BI_AMB_TGT' */ /* : c_g_aucFLOW_BI2_VENT_PLUS = g_aucFLOW_BI2_VENT_PLUS(LVL + 1); */ g_assFLOW_BI_AMB_TGT_e(rtu_LVL, &rtb_u_abl); /* MATLAB Function: '/g_aucFLOW_BI_VENT_PLUS' incorporates: * MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } /* Gain: '/Gain2' incorporates: * Sum: '/deg' */ tmp = (int16_t)(rtb_u_abl - rtu_Amb_Fb) * 13107; /* Product: '/Умножили' incorporates: * Gain: '/Gain' * Gain: '/Gain2' * MATLAB Function: '/g_aucFLOW_BI_VENT_PLUS' */ rtb_u_abl = (int16_t)((int8_t)(((((uint32_t)tmp & 65536U) != 0U) && ((((uint32_t)tmp & 65535U) != 0U) || (tmp > 0))) + (tmp >> 17)) * (int32_t) ((g_aucFLOW_BI2_VENT_PLUS[tmp_0 - 1] * 205U + 1024U) >> 11)); /* DataTypeConversion: '/Data Type Conversion' incorporates: * Sum: '/ ' * Switch: '/Switch2' */ rtb_Switch2_i_idx_0 = (uint16_t)((uint16_t)((rty_Out1[0] - rtb_u_abl) >> 1) << 1); rtb_Switch2_i_idx_1 = (uint16_t)((uint16_t)((rty_Out1[1] - rtb_u_abl) >> 1) << 1); /* MATLAB Function: '/g_aucFLOW_BI_VENT_VALVE_MAX' incorporates: * MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ /* : c_g_aucFLOW_BI2_VENT_VALVE_MAX = g_aucFLOW_BI2_VENT_VALVE_MAX(LVL + 1); */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } rtb_c_g_aucFLOW_BI2_VENT_VALVE_MAX_k = g_aucFLOW_BI2_VENT_VALVE_MAX[tmp_0 - 1]; /* End of MATLAB Function: '/g_aucFLOW_BI_VENT_VALVE_MAX' */ /* MATLAB Function: '/g_aucFLOW_BI_VENT_VALVE_MIN' incorporates: * MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ /* : c_g_aucFLOW_BI2_VENT_VALVE_MIN = g_aucFLOW_BI2_VENT_VALVE_MIN(LVL + 1); */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } rtb_c_g_aucFLOW_BI2_VENT_VALVE_MIN_f = g_aucFLOW_BI2_VENT_VALVE_MIN[tmp_0 - 1]; /* End of MATLAB Function: '/g_aucFLOW_BI_VENT_VALVE_MIN' */ /* MATLAB Function: '/g_assFLOW_BI_AMB_TGT' */ /* : c_g_aucFLOW_BI2_VENT_PLUS = g_aucFLOW_BI2_VENT_PLUS(LVL + 1 + 6); */ g_assFLOW_BI_AMB_TGT_e(rtu_LVL, &rtb_u_abl); /* MATLAB Function: '/g_aucFLOW_BI_VENT_PLUS' incorporates: * MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } tmp = (int32_t)((uint32_t)tmp_0 + 6U); if ((uint32_t)tmp_0 + 6U > 255U) { tmp = 255; } /* Gain: '/Gain2' incorporates: * Sum: '/deg' */ tmp_0 = (int16_t)(rtb_u_abl - rtu_Amb_Fb) * 13107; /* Product: '/Умножили' incorporates: * Gain: '/Gain' * Gain: '/Gain2' * MATLAB Function: '/g_aucFLOW_BI_VENT_PLUS' */ rtb_u_abl = (int16_t)((int8_t)(((((uint32_t)tmp_0 & 65536U) != 0U) && ((((uint32_t)tmp_0 & 65535U) != 0U) || (tmp_0 > 0))) + (tmp_0 >> 17)) * (int32_t)((g_aucFLOW_BI2_VENT_PLUS[tmp - 1] * 205U + 1024U) >> 11)); /* MATLAB Function: '/g_aucFLOW_BI_VENT_VALVE_MAX' incorporates: * MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ /* : c_g_aucFLOW_BI2_VENT_VALVE_MAX = g_aucFLOW_BI2_VENT_VALVE_MAX(LVL + 1 + 6); */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } tmp = (int32_t)((uint32_t)tmp_0 + 6U); if ((uint32_t)tmp_0 + 6U > 255U) { tmp = 255; } rtb_c_g_aucFLOW_BI2_VENT_VALVE_MAX = g_aucFLOW_BI2_VENT_VALVE_MAX[tmp - 1]; /* End of MATLAB Function: '/g_aucFLOW_BI_VENT_VALVE_MAX' */ /* MATLAB Function: '/g_aucFLOW_BI_VENT_VALVE_MIN' incorporates: * MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ /* : c_g_aucFLOW_BI2_VENT_VALVE_MIN = g_aucFLOW_BI2_VENT_VALVE_MIN(LVL + 1 + 6); */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } tmp = (int32_t)((uint32_t)tmp_0 + 6U); if ((uint32_t)tmp_0 + 6U > 255U) { tmp = 255; } rtb_c_g_aucFLOW_BI2_VENT_VALVE_MIN = g_aucFLOW_BI2_VENT_VALVE_MIN[tmp - 1]; /* End of MATLAB Function: '/g_aucFLOW_BI_VENT_VALVE_MIN' */ /* DataTypeConversion: '/Data Type Conversion' incorporates: * Sum: '/ ' * Switch: '/Switch2' */ rtb_Switch2_p4_0 = (uint16_t)((uint16_t)((rty_Out1[0] - rtb_u_abl) >> 1) << 1); /* Switch: '/Switch2' incorporates: * RelationalOperator: '/LowerRelop1' * RelationalOperator: '/UpperRelop' * Switch: '/Switch' */ if (rtb_Switch2_i_idx_0 > rtb_c_g_aucFLOW_BI2_VENT_VALVE_MAX_k) { /* Assignment: '/Присваивание в [1-2]' incorporates: * SignalConversion generated from: '/Out1' */ rty_Out1[0] = rtb_c_g_aucFLOW_BI2_VENT_VALVE_MAX_k; } else if (rtb_Switch2_i_idx_0 < rtb_c_g_aucFLOW_BI2_VENT_VALVE_MIN_f) { /* Switch: '/Switch' incorporates: * Assignment: '/Присваивание в [1-2]' * SignalConversion generated from: '/Out1' */ rty_Out1[0] = rtb_c_g_aucFLOW_BI2_VENT_VALVE_MIN_f; } else { /* Assignment: '/Присваивание в [1-2]' incorporates: * SignalConversion generated from: '/Out1' * Switch: '/Switch' */ rty_Out1[0] = rtb_Switch2_i_idx_0; } /* Switch: '/Switch2' incorporates: * RelationalOperator: '/LowerRelop1' * RelationalOperator: '/UpperRelop' * Switch: '/Switch' */ if (rtb_Switch2_p4_0 > rtb_c_g_aucFLOW_BI2_VENT_VALVE_MAX) { /* Assignment: '/Присваивание в [3-4]' incorporates: * SignalConversion generated from: '/Out1' */ rty_Out1[2] = rtb_c_g_aucFLOW_BI2_VENT_VALVE_MAX; } else if (rtb_Switch2_p4_0 < rtb_c_g_aucFLOW_BI2_VENT_VALVE_MIN) { /* Switch: '/Switch' incorporates: * Assignment: '/Присваивание в [3-4]' * SignalConversion generated from: '/Out1' */ rty_Out1[2] = rtb_c_g_aucFLOW_BI2_VENT_VALVE_MIN; } else { /* Assignment: '/Присваивание в [3-4]' incorporates: * SignalConversion generated from: '/Out1' * Switch: '/Switch' */ rty_Out1[2] = rtb_Switch2_p4_0; } /* DataTypeConversion: '/Data Type Conversion' incorporates: * Sum: '/ ' * Switch: '/Switch2' */ rtb_Switch2_p4_0 = (uint16_t)((uint16_t)((rty_Out1[1] - rtb_u_abl) >> 1) << 1); /* Switch: '/Switch2' incorporates: * RelationalOperator: '/LowerRelop1' * RelationalOperator: '/UpperRelop' * Switch: '/Switch' */ if (rtb_Switch2_i_idx_1 > rtb_c_g_aucFLOW_BI2_VENT_VALVE_MAX_k) { /* Assignment: '/Присваивание в [1-2]' incorporates: * SignalConversion generated from: '/Out1' */ rty_Out1[1] = rtb_c_g_aucFLOW_BI2_VENT_VALVE_MAX_k; } else if (rtb_Switch2_i_idx_1 < rtb_c_g_aucFLOW_BI2_VENT_VALVE_MIN_f) { /* Switch: '/Switch' incorporates: * Assignment: '/Присваивание в [1-2]' * SignalConversion generated from: '/Out1' */ rty_Out1[1] = rtb_c_g_aucFLOW_BI2_VENT_VALVE_MIN_f; } else { /* Assignment: '/Присваивание в [1-2]' incorporates: * SignalConversion generated from: '/Out1' * Switch: '/Switch' */ rty_Out1[1] = rtb_Switch2_i_idx_1; } /* Switch: '/Switch2' incorporates: * RelationalOperator: '/LowerRelop1' * RelationalOperator: '/UpperRelop' * Switch: '/Switch' */ if (rtb_Switch2_p4_0 > rtb_c_g_aucFLOW_BI2_VENT_VALVE_MAX) { /* Assignment: '/Присваивание в [3-4]' incorporates: * SignalConversion generated from: '/Out1' */ rty_Out1[3] = rtb_c_g_aucFLOW_BI2_VENT_VALVE_MAX; } else if (rtb_Switch2_p4_0 < rtb_c_g_aucFLOW_BI2_VENT_VALVE_MIN) { /* Switch: '/Switch' incorporates: * Assignment: '/Присваивание в [3-4]' * SignalConversion generated from: '/Out1' */ rty_Out1[3] = rtb_c_g_aucFLOW_BI2_VENT_VALVE_MIN; } else { /* Assignment: '/Присваивание в [3-4]' incorporates: * SignalConversion generated from: '/Out1' * Switch: '/Switch' */ rty_Out1[3] = rtb_Switch2_p4_0; } /* Switch: '/Switch2' incorporates: * RelationalOperator: '/LowerRelop1' * RelationalOperator: '/UpperRelop' * Switch: '/Switch' */ if (rtb_FLF_NEW > rtb_c_g_aucFLOW_BI2_FOOT_VALVE_MAX_l) { /* Assignment: '/Присваивание в [5]' incorporates: * SignalConversion generated from: '/Out1' */ rty_Out1[4] = rtb_c_g_aucFLOW_BI2_FOOT_VALVE_MAX_l; } else if (rtb_FLF_NEW < rtb_c_g_aucFLOW_BI2_FOOT_VALVE_MIN) { /* Switch: '/Switch' incorporates: * Assignment: '/Присваивание в [5]' * SignalConversion generated from: '/Out1' */ rty_Out1[4] = rtb_c_g_aucFLOW_BI2_FOOT_VALVE_MIN; } else { /* Assignment: '/Присваивание в [5]' incorporates: * SignalConversion generated from: '/Out1' * Switch: '/Switch' */ rty_Out1[4] = rtb_FLF_NEW; } /* End of Switch: '/Switch2' */ /* Switch: '/Switch2' incorporates: * RelationalOperator: '/LowerRelop1' * RelationalOperator: '/UpperRelop' * Switch: '/Switch' */ if (rtb_FRF_NEW > rtb_c_g_aucFLOW_BI2_FOOT_VALVE_MAX) { /* Assignment: '/Присваивание в [7]' incorporates: * SignalConversion generated from: '/Out1' */ rty_Out1[6] = rtb_c_g_aucFLOW_BI2_FOOT_VALVE_MAX; } else if (rtb_FRF_NEW < rtb_c_g_aucFLOW_BI2_FOOT_VALVE_MIN_l) { /* Switch: '/Switch' incorporates: * Assignment: '/Присваивание в [7]' * SignalConversion generated from: '/Out1' */ rty_Out1[6] = rtb_c_g_aucFLOW_BI2_FOOT_VALVE_MIN_l; } else { /* Assignment: '/Присваивание в [7]' incorporates: * SignalConversion generated from: '/Out1' * Switch: '/Switch' */ rty_Out1[6] = rtb_FRF_NEW; } /* End of Switch: '/Switch2' */ } /* * Output and update for atomic system: * '/g_aucFLOW_AF_FOOT_VALVE_MAX' * '/g_aucFLOW_AF_FOOT_VALVE_MAX' * '/g_aucFLOW_AF_FOOT_VALVE_MAX' * '/g_aucFLOW_AF_FOOT_VALVE_MAX' */ void g_aucFLOW_AF_FOOT_VALVE_MAX_e(uint8_t rtu_LVL, uint8_t *rty_c_g_aucFLOW_AF_FOOT_VALVE_MAX) { int32_t tmp; /* : c_g_aucFLOW_AF_FOOT_VALVE_MAX = g_aucFLOW_AF_FOOT_VALVE_MAX(LVL + 1); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } *rty_c_g_aucFLOW_AF_FOOT_VALVE_MAX = g_aucFLOW_AF_FOOT_VALVE_MAX[tmp - 1]; } /* * Output and update for atomic system: * '/g_assFLOW_AF_AMB_TGT' * '/g_assFLOW_AF_AMB_TGT' * '/g_assFLOW_AF_AMB_TGT' * '/g_assFLOW_AF_AMB_TGT' * '/g_assFLOW_AF_AMB_TGT' * '/g_assFLOW_AF_AMB_TGT' */ void g_assFLOW_AF_AMB_TGT_g(uint8_t rtu_LVL, int16_t *rty_c_g_assFLOW_AF_AMB_TGT) { int32_t tmp; /* : c_g_assFLOW_AF_AMB_TGT = g_assFLOW_AF_AMB_TGT(LVL + 1); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } *rty_c_g_assFLOW_AF_AMB_TGT = g_assFLOW_AF_AMB_TGT[tmp - 1]; } /* * Output and update for action system: * '/Afoot' * '/Afoot' */ void Afoot(int16_t rtu_Amb_Fb, uint8_t rtu_LVL, uint16_t rty_Out1[9], uint8_t rtu_setTempFL, uint8_t rtu_setTempFR) { int32_t i; int32_t tmp_0; uint32_t qY; int16_t tmp[78]; int16_t rtb_deg_en; uint16_t rtb_FLF_NEW; uint16_t rtb_FRF_NEW; uint16_t rtb_Switch2_ar_idx_0; uint16_t rtb_Switch2_ar_idx_1; uint16_t rtb_Switch2_j3_idx_0; uint16_t rtb_Switch2_j3_idx_1; int8_t rtb_X; uint8_t rtb_c_g_aucFLOW_AF_FOOT_VALVE_MAX; uint8_t rtb_c_g_aucFLOW_AF_VENT_VALVE_MAX_k; /* MATLAB Function: '/get_tg_for_LVL' */ /* : c_g_aucFLOW_AF_BLR_AF_TGT = g_aucFLOW_AF_BLR_AF_TGT(LVL + 1); */ /* : table = [ */ /* : g_assVTG_FL_LV0; */ /* : g_assVTG_FL_LV1; */ /* : g_assVTG_FL_LV2; */ /* : g_assVTG_FL_LV3; */ /* : g_assVTG_FL_LV4; */ /* : g_assVTG_FL_LV5 */ /* : ]; */ /* : vals = table(ambient_Lvl + 1, set_tmp - 16); */ for (i = 0; i < 13; i++) { tmp[6 * i] = g_assVTG_FL_LV0[i]; tmp[6 * i + 1] = g_assVTG_FL_LV1[i]; tmp[6 * i + 2] = g_assVTG_FL_LV2[i]; tmp[6 * i + 3] = g_assVTG_FL_LV3[i]; tmp[6 * i + 4] = g_assVTG_FL_LV4[i]; tmp[6 * i + 5] = g_assVTG_FL_LV5[i]; } /* MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ i = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { i = 255; } /* MATLAB Function: '/get_tg_for_LVL' incorporates: * MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } /* MW:begin MISRA2012:D4.1 CERT-C:INT30-C 'Justifying MISRA CPP rule violation' */ qY = rtu_setTempFL - 16U; /* MW:end MISRA2012:D4.1 CERT-C:INT30-C */ if (rtu_setTempFL - 16U > rtu_setTempFL) { qY = 0U; } /* Gain: '/Gain6' incorporates: * MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' * MATLAB Function: '/get_tg_for_LVL' * Sum: '/ 1' */ i = (int16_t)(g_aucFLOW_AF_BLR_AF_TGT[i - 1] - tmp[(((int32_t)qY - 1) * 6 + tmp_0) - 1]) * 13107; rtb_X = (int8_t)(((((uint32_t)i & 65536U) != 0U) && ((((uint32_t)i & 65535U) != 0U) || (i > 0))) + (i >> 17)); /* Switch: '/Switch1' incorporates: * Gain: '/Gain6' * Sum: '/Add' */ /* : c_g_aucFLOW_AF_FOOT_PLUS = g_aucFLOW_AF_FOOT_PLUS(LVL + 1); */ if (rtb_X >= 0) { rtb_FLF_NEW = rty_Out1[4]; } else { /* MATLAB Function: '/g_aucFLOW_AF_FOOT_PLUS' incorporates: * MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ i = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { i = 255; } /* Gain: '/Gain6' incorporates: * MATLAB Function: '/g_aucFLOW_AF_FOOT_PLUS' * Product: '/Product3' */ i = g_aucFLOW_AF_FOOT_PLUS[i - 1] * rtb_X * 13107; rtb_FLF_NEW = (uint16_t)((int16_t)rty_Out1[4] - (int8_t)(((((uint32_t)i & 65536U) != 0U) && (((uint32_t)i & 65535U) != 0U)) + (i >> 17))); } /* End of Switch: '/Switch1' */ /* MATLAB Function: '/g_aucFLOW_AF_FOOT_VALVE_MAX' */ g_aucFLOW_AF_FOOT_VALVE_MAX_e(rtu_LVL, &rtb_c_g_aucFLOW_AF_FOOT_VALVE_MAX); /* Switch: '/Switch2' incorporates: * RelationalOperator: '/LowerRelop1' */ if (rtb_FLF_NEW > rtb_c_g_aucFLOW_AF_FOOT_VALVE_MAX) { rtb_FLF_NEW = rtb_c_g_aucFLOW_AF_FOOT_VALVE_MAX; } /* End of Switch: '/Switch2' */ /* MATLAB Function: '/get_vtg_for_LVL' */ /* : c_g_aucFLOW_AF_BLR_AF_TGT = g_aucFLOW_AF_BLR_AF_TGT(LVL + 1); */ /* : table = [ */ /* : g_assVTG_FR_LV0; */ /* : g_assVTG_FR_LV1; */ /* : g_assVTG_FR_LV2; */ /* : g_assVTG_FR_LV3; */ /* : g_assVTG_FR_LV4; */ /* : g_assVTG_FR_LV5 */ /* : ]; */ /* : vals = table(ambient_Lvl + 1, set_tmp - 16); */ for (i = 0; i < 13; i++) { tmp[6 * i] = g_assVTG_FR_LV0[i]; tmp[6 * i + 1] = g_assVTG_FR_LV1[i]; tmp[6 * i + 2] = g_assVTG_FR_LV2[i]; tmp[6 * i + 3] = g_assVTG_FR_LV3[i]; tmp[6 * i + 4] = g_assVTG_FR_LV4[i]; tmp[6 * i + 5] = g_assVTG_FR_LV5[i]; } /* MATLAB Function: '/g_aucFLOW_AF_BLR_AF_TGT' incorporates: * MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ i = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { i = 255; } /* MATLAB Function: '/get_vtg_for_LVL' incorporates: * MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } qY = rtu_setTempFR - 16U; if (rtu_setTempFR - 16U > rtu_setTempFR) { qY = 0U; } /* Sum: '/ 1' incorporates: * MATLAB Function: '/g_aucFLOW_AF_BLR_AF_TGT' * MATLAB Function: '/get_vtg_for_LVL' */ rtb_deg_en = (int16_t)(g_aucFLOW_AF_BLR_AF_TGT[i - 1] - tmp[(((int32_t)qY - 1) * 6 + tmp_0) - 1]); /* Gain: '/Gain6' */ i = 13107 * rtb_deg_en; rtb_X = (int8_t)(((((uint32_t)i & 65536U) != 0U) && ((((uint32_t)i & 65535U) != 0U) || (i > 0))) + (i >> 17)); /* Switch: '/Switch3' incorporates: * Gain: '/Gain7' * Sum: '/Add1' */ /* : c_g_aucFLOW_AF_FOOT_PLUS = g_aucFLOW_AF_FOOT_PLUS(LVL + 1 + 6); */ if (rtb_X >= 0) { rtb_FRF_NEW = rty_Out1[6]; } else { /* MATLAB Function: '/g_aucFLOW_AF_FOOT_PLUS' incorporates: * MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ i = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { i = 255; } tmp_0 = (int32_t)((uint32_t)i + 6U); if ((uint32_t)i + 6U > 255U) { tmp_0 = 255; } /* Gain: '/Gain7' incorporates: * MATLAB Function: '/g_aucFLOW_AF_FOOT_PLUS' * Product: '/Product4' */ i = g_aucFLOW_AF_FOOT_PLUS[tmp_0 - 1] * rtb_X * 13107; rtb_FRF_NEW = (uint16_t)((int16_t)rty_Out1[6] - (int8_t)(((((uint32_t)i & 65536U) != 0U) && (((uint32_t)i & 65535U) != 0U)) + (i >> 17))); } /* End of Switch: '/Switch3' */ /* MATLAB Function: '/g_aucFLOW_AF_FOOT_VALVE_MAX' */ g_aucFLOW_AF_FOOT_VALVE_MAX_e(rtu_LVL, &rtb_c_g_aucFLOW_AF_FOOT_VALVE_MAX); /* MATLAB Function: '/g_assFLOW_AF_AMB_TGT' */ /* : c_g_aucFLOW_AF_VENT_PLUS = g_aucFLOW_AF_VENT_PLUS(LVL + 1); */ g_assFLOW_AF_AMB_TGT_g(rtu_LVL, &rtb_deg_en); /* Sum: '/deg' */ rtb_deg_en -= rtu_Amb_Fb; /* Gain: '/Gain2' */ i = 13107 * rtb_deg_en; rtb_X = (int8_t)(((((uint32_t)i & 65536U) != 0U) && ((((uint32_t)i & 65535U) != 0U) || (i > 0))) + (i >> 17)); /* Switch: '/if (deg < 0)' incorporates: * Sum: '/ ' * Switch: '/Switch2' */ if (rtb_X >= 0) { rtb_Switch2_ar_idx_0 = rty_Out1[0]; rtb_Switch2_ar_idx_1 = rty_Out1[1]; } else { /* MATLAB Function: '/g_aucFLOW_AF_VENT_PLUS' incorporates: * MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ i = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { i = 255; } /* Product: '/Умножили' incorporates: * Gain: '/Gain' * MATLAB Function: '/g_aucFLOW_AF_VENT_PLUS' */ rtb_deg_en = (int16_t)((int32_t)((g_aucFLOW_AF_VENT_PLUS[i - 1] * 205U + 1024U) >> 11) * rtb_X); rtb_Switch2_ar_idx_0 = (uint16_t)(rty_Out1[0] - rtb_deg_en); rtb_Switch2_ar_idx_1 = (uint16_t)(rty_Out1[1] - rtb_deg_en); } /* End of Switch: '/if (deg < 0)' */ /* MATLAB Function: '/g_aucFLOW_AF_VENT_VALVE_MAX' incorporates: * MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ /* : c_g_aucFLOW_AF_VENT_VALVE_MAX = g_aucFLOW_AF_VENT_VALVE_MAX(LVL + 1); */ i = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { i = 255; } rtb_c_g_aucFLOW_AF_VENT_VALVE_MAX_k = g_aucFLOW_AF_VENT_VALVE_MAX[i - 1]; /* End of MATLAB Function: '/g_aucFLOW_AF_VENT_VALVE_MAX' */ /* Switch: '/Switch2' incorporates: * RelationalOperator: '/LowerRelop1' */ if (rtb_Switch2_ar_idx_0 > rtb_c_g_aucFLOW_AF_VENT_VALVE_MAX_k) { rtb_Switch2_ar_idx_0 = rtb_c_g_aucFLOW_AF_VENT_VALVE_MAX_k; } if (rtb_Switch2_ar_idx_1 > rtb_c_g_aucFLOW_AF_VENT_VALVE_MAX_k) { rtb_Switch2_ar_idx_1 = rtb_c_g_aucFLOW_AF_VENT_VALVE_MAX_k; } /* End of Switch: '/Switch2' */ /* MATLAB Function: '/g_assFLOW_AF_AMB_TGT' */ /* : c_g_aucFLOW_AF_VENT_PLUS = g_aucFLOW_AF_VENT_PLUS(LVL + 1 + 6); */ g_assFLOW_AF_AMB_TGT_g(rtu_LVL, &rtb_deg_en); /* Gain: '/Gain2' incorporates: * Sum: '/deg' */ i = (int16_t)(rtb_deg_en - rtu_Amb_Fb) * 13107; rtb_X = (int8_t)(((((uint32_t)i & 65536U) != 0U) && ((((uint32_t)i & 65535U) != 0U) || (i > 0))) + (i >> 17)); /* Switch: '/if (deg < 0)' incorporates: * DataTypeConversion: '/Data Type Conversion' * Sum: '/ ' * Switch: '/Switch2' */ if (rtb_X >= 0) { rtb_Switch2_j3_idx_0 = rty_Out1[0]; rtb_Switch2_j3_idx_1 = rty_Out1[1]; } else { /* MATLAB Function: '/g_aucFLOW_AF_VENT_PLUS' incorporates: * MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ i = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { i = 255; } tmp_0 = (int32_t)((uint32_t)i + 6U); if ((uint32_t)i + 6U > 255U) { tmp_0 = 255; } /* Product: '/Умножили' incorporates: * Gain: '/Gain' * MATLAB Function: '/g_aucFLOW_AF_VENT_PLUS' */ rtb_deg_en = (int16_t)((int32_t)((g_aucFLOW_AF_VENT_PLUS[tmp_0 - 1] * 205U + 1024U) >> 11) * rtb_X); rtb_Switch2_j3_idx_0 = (uint16_t)((int16_t)rty_Out1[0] - rtb_deg_en); rtb_Switch2_j3_idx_1 = (uint16_t)((int16_t)rty_Out1[1] - rtb_deg_en); } /* End of Switch: '/if (deg < 0)' */ /* MATLAB Function: '/g_aucFLOW_AF_VENT_VALVE_MAX' incorporates: * MATLAB Function: '/g_assFLOW_BI2_TEMP_TGT_LEFT' */ /* : c_g_aucFLOW_AF_VENT_VALVE_MAX = g_aucFLOW_AF_VENT_VALVE_MAX(LVL + 1 + 6); */ i = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { i = 255; } tmp_0 = (int32_t)((uint32_t)i + 6U); if ((uint32_t)i + 6U > 255U) { tmp_0 = 255; } rtb_c_g_aucFLOW_AF_VENT_VALVE_MAX_k = g_aucFLOW_AF_VENT_VALVE_MAX[tmp_0 - 1]; /* End of MATLAB Function: '/g_aucFLOW_AF_VENT_VALVE_MAX' */ /* Assignment: '/Присваивание в [1-2]' incorporates: * SignalConversion generated from: '/Out1' * Switch: '/Switch2' */ rty_Out1[0] = rtb_Switch2_ar_idx_0; /* Switch: '/Switch2' incorporates: * RelationalOperator: '/LowerRelop1' */ if (rtb_Switch2_j3_idx_0 > rtb_c_g_aucFLOW_AF_VENT_VALVE_MAX_k) { /* Assignment: '/Присваивание в [3-4]' incorporates: * SignalConversion generated from: '/Out1' */ rty_Out1[2] = rtb_c_g_aucFLOW_AF_VENT_VALVE_MAX_k; } else { /* Assignment: '/Присваивание в [3-4]' incorporates: * SignalConversion generated from: '/Out1' */ rty_Out1[2] = rtb_Switch2_j3_idx_0; } /* Assignment: '/Присваивание в [1-2]' incorporates: * SignalConversion generated from: '/Out1' * Switch: '/Switch2' */ rty_Out1[1] = rtb_Switch2_ar_idx_1; /* Switch: '/Switch2' incorporates: * RelationalOperator: '/LowerRelop1' */ if (rtb_Switch2_j3_idx_1 > rtb_c_g_aucFLOW_AF_VENT_VALVE_MAX_k) { /* Assignment: '/Присваивание в [3-4]' incorporates: * SignalConversion generated from: '/Out1' */ rty_Out1[3] = rtb_c_g_aucFLOW_AF_VENT_VALVE_MAX_k; } else { /* Assignment: '/Присваивание в [3-4]' incorporates: * SignalConversion generated from: '/Out1' */ rty_Out1[3] = rtb_Switch2_j3_idx_1; } /* Assignment: '/Присваивание в [5]' incorporates: * SignalConversion generated from: '/Out1' */ rty_Out1[4] = rtb_FLF_NEW; /* Switch: '/Switch2' incorporates: * RelationalOperator: '/LowerRelop1' */ if (rtb_FRF_NEW > rtb_c_g_aucFLOW_AF_FOOT_VALVE_MAX) { /* Assignment: '/Присваивание в [7]' incorporates: * SignalConversion generated from: '/Out1' */ rty_Out1[6] = rtb_c_g_aucFLOW_AF_FOOT_VALVE_MAX; } else { /* Assignment: '/Присваивание в [7]' incorporates: * SignalConversion generated from: '/Out1' * Switch: '/Switch' */ rty_Out1[6] = rtb_FRF_NEW; } /* End of Switch: '/Switch2' */ } /* * Output and update for atomic system: * '/g_aucFLOW_AFSM_FOOT_VALVE_MAX' * '/g_aucFLOW_AF_FOOT_VALVE_MAX' * '/g_aucFLOW_AFSM_FOOT_VALVE_MAX' * '/g_aucFLOW_AF_FOOT_VALVE_MAX' */ void g_aucFLOW_AFSM_FOOT_VALVE_MAX_f(uint8_t rtu_LVL, uint8_t *rty_c_g_aucFLOW_AFSM_FOOT_VALVE_MAX) { int32_t tmp; /* : c_g_aucFLOW_AFSM_FOOT_VALVE_MAX = g_aucFLOW_AFSM_FOOT_VALVE_MAX(LVL + 1); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } *rty_c_g_aucFLOW_AFSM_FOOT_VALVE_MAX = g_aucFLOW_AFSM_FOOT_VALVE_MAX[tmp - 1]; } /* * Output and update for action system: * '/Afoot_Summer' * '/Afoot_Summer' */ void Afoot_Summer(int16_t rtu_Amb_Fb, uint8_t rtu_LVL, uint16_t rty_Out1[9], uint8_t rtu_setTempFL, uint8_t rtu_setTempFR) { int32_t tmp; int32_t tmp_0; int16_t rtb_deg_c; uint16_t rtb_FLF_NEW; uint16_t rtb_FRF_NEW; uint16_t rtb_Switch2_j1_idx_0; uint16_t rtb_Switch2_j1_idx_1; uint16_t rtb_Switch2_l_idx_0; uint16_t rtb_Switch2_l_idx_1; int8_t rtb_X; uint8_t rtb_c_g_aucFLOW_AFSM_FOOT_VALVE_MAX; uint8_t rtb_c_g_aucFLOW_AFSM_VENT_VALVE_MAX_g; /* MATLAB Function: '/get_tg_for_LVL' */ /* : c_g_assFLOW_AFSM_TEMP_TGT = g_assFLOW_AFSM_TEMP_TGT(LVL + 1); */ get_tg_FLL_for_LVL(rtu_LVL, rtu_setTempFL, &rtb_deg_c); /* MATLAB Function: '/g_assFLOW_AFSM_TEMP_TGT_LEFT' */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } /* Sum: '/ 1' incorporates: * MATLAB Function: '/g_assFLOW_AFSM_TEMP_TGT_LEFT' */ rtb_deg_c = (int16_t)(g_assFLOW_AFSM_TEMP_TGT[tmp_0 - 1] - rtb_deg_c); /* Gain: '/Gain6' */ tmp_0 = 13107 * rtb_deg_c; rtb_X = (int8_t)(((((uint32_t)tmp_0 & 65536U) != 0U) && ((((uint32_t)tmp_0 & 65535U) != 0U) || (tmp_0 > 0))) + (tmp_0 >> 17)); /* Switch: '/Switch1' incorporates: * Gain: '/Gain6' * Sum: '/Add' */ /* : c_g_aucFLOW_AFSM_FOOT_PLUS = g_aucFLOW_AFSM_FOOT_PLUS(LVL + 1); */ if (rtb_X >= 0) { rtb_FLF_NEW = rty_Out1[4]; } else { /* MATLAB Function: '/g_aucFLOW_AFSM_FOOT_PLUS' incorporates: * MATLAB Function: '/g_assFLOW_AFSM_TEMP_TGT_LEFT' */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } /* Gain: '/Gain6' incorporates: * MATLAB Function: '/g_aucFLOW_AFSM_FOOT_PLUS' * Product: '/Product3' */ tmp_0 = g_aucFLOW_AFSM_FOOT_PLUS[tmp_0 - 1] * rtb_X * 13107; rtb_FLF_NEW = (uint16_t)((int16_t)rty_Out1[4] - (int8_t)(((((uint32_t)tmp_0 & 65536U) != 0U) && (((uint32_t)tmp_0 & 65535U) != 0U)) + (tmp_0 >> 17))); } /* End of Switch: '/Switch1' */ /* MATLAB Function: '/g_aucFLOW_AFSM_FOOT_VALVE_MAX' */ g_aucFLOW_AFSM_FOOT_VALVE_MAX_f(rtu_LVL, &rtb_c_g_aucFLOW_AFSM_FOOT_VALVE_MAX); /* Switch: '/Switch2' incorporates: * RelationalOperator: '/LowerRelop1' */ if (rtb_FLF_NEW > rtb_c_g_aucFLOW_AFSM_FOOT_VALVE_MAX) { rtb_FLF_NEW = rtb_c_g_aucFLOW_AFSM_FOOT_VALVE_MAX; } /* End of Switch: '/Switch2' */ /* MATLAB Function: '/get_tg_FLL_for_LVL' */ /* : c_g_assFLOW_AFSM_TEMP_TGT = g_assFLOW_AFSM_TEMP_TGT(LVL + 1 + 6); */ get_tg_FLL_for_LVL_j(rtu_LVL, rtu_setTempFR, &rtb_deg_c); /* MATLAB Function: '/g_assFLOW_AFSM_TEMP_TGT' incorporates: * MATLAB Function: '/g_assFLOW_AFSM_TEMP_TGT_LEFT' */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } tmp = (int32_t)((uint32_t)tmp_0 + 6U); if ((uint32_t)tmp_0 + 6U > 255U) { tmp = 255; } /* Gain: '/Gain6' incorporates: * MATLAB Function: '/g_assFLOW_AFSM_TEMP_TGT' * Sum: '/ 1' */ tmp_0 = (int16_t)(g_assFLOW_AFSM_TEMP_TGT[tmp - 1] - rtb_deg_c) * 13107; rtb_X = (int8_t)(((((uint32_t)tmp_0 & 65536U) != 0U) && ((((uint32_t)tmp_0 & 65535U) != 0U) || (tmp_0 > 0))) + (tmp_0 >> 17)); /* Switch: '/Switch3' incorporates: * Gain: '/Gain7' * Sum: '/Add1' */ /* : c_g_aucFLOW_AFSM_FOOT_PLUS = g_aucFLOW_AFSM_FOOT_PLUS(LVL + 1 + 6); */ if (rtb_X >= 0) { rtb_FRF_NEW = rty_Out1[6]; } else { /* MATLAB Function: '/g_aucFLOW_AFSM_FOOT_PLUS' incorporates: * MATLAB Function: '/g_assFLOW_AFSM_TEMP_TGT_LEFT' */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } tmp = (int32_t)((uint32_t)tmp_0 + 6U); if ((uint32_t)tmp_0 + 6U > 255U) { tmp = 255; } /* Gain: '/Gain7' incorporates: * MATLAB Function: '/g_aucFLOW_AFSM_FOOT_PLUS' * Product: '/Product4' */ tmp_0 = g_aucFLOW_AFSM_FOOT_PLUS[tmp - 1] * rtb_X * 13107; rtb_FRF_NEW = (uint16_t)((int16_t)rty_Out1[6] - (int8_t)(((((uint32_t)tmp_0 & 65536U) != 0U) && (((uint32_t)tmp_0 & 65535U) != 0U)) + (tmp_0 >> 17))); } /* End of Switch: '/Switch3' */ /* MATLAB Function: '/g_aucFLOW_AF_FOOT_VALVE_MAX' */ g_aucFLOW_AFSM_FOOT_VALVE_MAX_f(rtu_LVL, &rtb_c_g_aucFLOW_AFSM_FOOT_VALVE_MAX); /* MATLAB Function: '/g_assFLOW_AFSM_AMB_TGT' incorporates: * MATLAB Function: '/g_assFLOW_AFSM_TEMP_TGT_LEFT' */ /* : c_g_aucFLOW_AFSM_VENT_PLUS = g_aucFLOW_AFSM_VENT_PLUS(LVL + 1); */ /* : c_g_assFLOW_AFSM_AMB_TGT = g_assFLOW_AFSM_AMB_TGT(LVL + 1); */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } /* Sum: '/deg' incorporates: * MATLAB Function: '/g_assFLOW_AFSM_AMB_TGT' */ rtb_deg_c = (int16_t)(g_assFLOW_AFSM_AMB_TGT[tmp_0 - 1] - rtu_Amb_Fb); /* Gain: '/Gain2' */ tmp_0 = 13107 * rtb_deg_c; rtb_X = (int8_t)(((((uint32_t)tmp_0 & 65536U) != 0U) && ((((uint32_t)tmp_0 & 65535U) != 0U) || (tmp_0 > 0))) + (tmp_0 >> 17)); /* Switch: '/if (deg < 0)' incorporates: * Sum: '/ ' * Switch: '/Switch2' */ if (rtb_X >= 0) { rtb_Switch2_l_idx_0 = rty_Out1[0]; rtb_Switch2_l_idx_1 = rty_Out1[1]; } else { /* MATLAB Function: '/g_aucFLOW_AFSM_VENT_PLUS' incorporates: * MATLAB Function: '/g_assFLOW_AFSM_TEMP_TGT_LEFT' */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } /* Product: '/Умножили' incorporates: * Gain: '/Gain' * MATLAB Function: '/g_aucFLOW_AFSM_VENT_PLUS' */ rtb_deg_c = (int16_t)((int32_t)((g_aucFLOW_AFSM_VENT_PLUS[tmp_0 - 1] * 205U + 1024U) >> 11) * rtb_X); rtb_Switch2_l_idx_0 = (uint16_t)(rty_Out1[0] - rtb_deg_c); rtb_Switch2_l_idx_1 = (uint16_t)(rty_Out1[1] - rtb_deg_c); } /* End of Switch: '/if (deg < 0)' */ /* MATLAB Function: '/g_aucFLOW_AF_VENT_VALVE_MAX' incorporates: * MATLAB Function: '/g_assFLOW_AFSM_TEMP_TGT_LEFT' */ /* : c_g_aucFLOW_AFSM_VENT_VALVE_MAX = g_aucFLOW_AFSM_VENT_VALVE_MAX(LVL + 1); */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } rtb_c_g_aucFLOW_AFSM_VENT_VALVE_MAX_g = g_aucFLOW_AFSM_VENT_VALVE_MAX[tmp_0 - 1]; /* End of MATLAB Function: '/g_aucFLOW_AF_VENT_VALVE_MAX' */ /* Switch: '/Switch2' incorporates: * RelationalOperator: '/LowerRelop1' */ if (rtb_Switch2_l_idx_0 > rtb_c_g_aucFLOW_AFSM_VENT_VALVE_MAX_g) { rtb_Switch2_l_idx_0 = rtb_c_g_aucFLOW_AFSM_VENT_VALVE_MAX_g; } if (rtb_Switch2_l_idx_1 > rtb_c_g_aucFLOW_AFSM_VENT_VALVE_MAX_g) { rtb_Switch2_l_idx_1 = rtb_c_g_aucFLOW_AFSM_VENT_VALVE_MAX_g; } /* End of Switch: '/Switch2' */ /* MATLAB Function: '/g_assFLOW_AF_AMB_TGT' */ /* : c_g_aucFLOW_AFSM_VENT_PLUS = g_aucFLOW_AFSM_VENT_PLUS(LVL + 1 + 6); */ g_assFLOW_AF_AMB_TGT_g(rtu_LVL, &rtb_deg_c); /* Gain: '/Gain2' incorporates: * Sum: '/deg' */ tmp_0 = (int16_t)(rtb_deg_c - rtu_Amb_Fb) * 13107; rtb_X = (int8_t)(((((uint32_t)tmp_0 & 65536U) != 0U) && ((((uint32_t)tmp_0 & 65535U) != 0U) || (tmp_0 > 0))) + (tmp_0 >> 17)); /* Switch: '/if (deg < 0)' incorporates: * DataTypeConversion: '/Data Type Conversion' * Sum: '/ ' * Switch: '/Switch2' */ if (rtb_X >= 0) { rtb_Switch2_j1_idx_0 = rty_Out1[0]; rtb_Switch2_j1_idx_1 = rty_Out1[1]; } else { /* MATLAB Function: '/g_aucFLOW_AF_VENT_PLUS' incorporates: * MATLAB Function: '/g_assFLOW_AFSM_TEMP_TGT_LEFT' */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } tmp = (int32_t)((uint32_t)tmp_0 + 6U); if ((uint32_t)tmp_0 + 6U > 255U) { tmp = 255; } /* Product: '/Умножили' incorporates: * Gain: '/Gain' * MATLAB Function: '/g_aucFLOW_AF_VENT_PLUS' */ rtb_deg_c = (int16_t)((int32_t)((g_aucFLOW_AFSM_VENT_PLUS[tmp - 1] * 205U + 1024U) >> 11) * rtb_X); rtb_Switch2_j1_idx_0 = (uint16_t)((int16_t)rty_Out1[0] - rtb_deg_c); rtb_Switch2_j1_idx_1 = (uint16_t)((int16_t)rty_Out1[1] - rtb_deg_c); } /* End of Switch: '/if (deg < 0)' */ /* MATLAB Function: '/g_aucFLOW_AF_VENT_VALVE_MAX' incorporates: * MATLAB Function: '/g_assFLOW_AFSM_TEMP_TGT_LEFT' */ /* : c_g_aucFLOW_AFSM_VENT_VALVE_MAX = g_aucFLOW_AFSM_VENT_VALVE_MAX(LVL + 1 + 6); */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } tmp = (int32_t)((uint32_t)tmp_0 + 6U); if ((uint32_t)tmp_0 + 6U > 255U) { tmp = 255; } rtb_c_g_aucFLOW_AFSM_VENT_VALVE_MAX_g = g_aucFLOW_AFSM_VENT_VALVE_MAX[tmp - 1]; /* End of MATLAB Function: '/g_aucFLOW_AF_VENT_VALVE_MAX' */ /* Assignment: '/Присваивание в [1-2]' incorporates: * SignalConversion generated from: '/Out1' * Switch: '/Switch2' */ rty_Out1[0] = rtb_Switch2_l_idx_0; /* Switch: '/Switch2' incorporates: * RelationalOperator: '/LowerRelop1' */ if (rtb_Switch2_j1_idx_0 > rtb_c_g_aucFLOW_AFSM_VENT_VALVE_MAX_g) { /* Assignment: '/Присваивание в [3-4]' incorporates: * SignalConversion generated from: '/Out1' */ rty_Out1[2] = rtb_c_g_aucFLOW_AFSM_VENT_VALVE_MAX_g; } else { /* Assignment: '/Присваивание в [3-4]' incorporates: * SignalConversion generated from: '/Out1' */ rty_Out1[2] = rtb_Switch2_j1_idx_0; } /* Assignment: '/Присваивание в [1-2]' incorporates: * SignalConversion generated from: '/Out1' * Switch: '/Switch2' */ rty_Out1[1] = rtb_Switch2_l_idx_1; /* Switch: '/Switch2' incorporates: * RelationalOperator: '/LowerRelop1' */ if (rtb_Switch2_j1_idx_1 > rtb_c_g_aucFLOW_AFSM_VENT_VALVE_MAX_g) { /* Assignment: '/Присваивание в [3-4]' incorporates: * SignalConversion generated from: '/Out1' */ rty_Out1[3] = rtb_c_g_aucFLOW_AFSM_VENT_VALVE_MAX_g; } else { /* Assignment: '/Присваивание в [3-4]' incorporates: * SignalConversion generated from: '/Out1' */ rty_Out1[3] = rtb_Switch2_j1_idx_1; } /* Assignment: '/Присваивание в [5]' incorporates: * SignalConversion generated from: '/Out1' */ rty_Out1[4] = rtb_FLF_NEW; /* Switch: '/Switch2' incorporates: * RelationalOperator: '/LowerRelop1' */ if (rtb_FRF_NEW > rtb_c_g_aucFLOW_AFSM_FOOT_VALVE_MAX) { /* Assignment: '/Присваивание в [7]' incorporates: * SignalConversion generated from: '/Out1' */ rty_Out1[6] = rtb_c_g_aucFLOW_AFSM_FOOT_VALVE_MAX; } else { /* Assignment: '/Присваивание в [7]' incorporates: * SignalConversion generated from: '/Out1' * Switch: '/Switch' */ rty_Out1[6] = rtb_FRF_NEW; } /* End of Switch: '/Switch2' */ } double rt_roundd(double u_0) { double y; if (fabs(u_0) < 4.503599627370496E+15) { if (u_0 >= 0.5) { y = floor(u_0 + 0.5); } else if (u_0 > -0.5) { y = 0.0; } else { y = ceil(u_0 - 0.5); } } else { y = u_0; } return y; } /* * Output and update for atomic system: * '/Начальные положения заслонок left' * '/Начальные положения заслонок right' */ void left(uint8_t rtu_idx, uint16_t rty_vals[9]) { int32_t i; int32_t rtu_idx_0; uint16_t tmp[45]; /* : table = [ */ /* : g_ausFLOW_FR_VE2VALVE; */ /* : g_ausFLOW_FR_BIVALVE; */ /* : g_ausFLOW_FR_BI2VALVE; */ /* : g_ausFLOW_FR_AF2VALVE; */ /* : g_ausFLOW_FR_AF2VALVE_SUMMER */ /* : ]; */ /* : idx = idx / 10; */ /* : vals = table(idx, :); */ rtu_idx_0 = (int32_t)rt_roundd((double)rtu_idx / 10.0); for (i = 0; i < 9; i++) { tmp[5 * i] = g_ausFLOW_FR_VE2VALVE[i]; tmp[5 * i + 1] = g_ausFLOW_FR_BIVALVE[i]; tmp[5 * i + 2] = g_ausFLOW_FR_BI2VALVE[i]; tmp[5 * i + 3] = g_ausFLOW_FR_AF2VALVE[i]; tmp[5 * i + 4] = g_ausFLOW_FR_AF2VALVE_SUMMER[i]; rty_vals[i] = tmp[(5 * i + rtu_idx_0) - 1]; } } /* * Output and update for atomic system: * '/g_assSTART_ENTER_INCAR' * '/g_assSTART_ENTER_INCAR' */ void g_assSTART_ENTER_INCAR_f(uint8_t rtu_LVL, int16_t *rty_out) { int32_t tmp; /* : out = int16(g_assSTART_ENTER_INCAR(LVL+1)); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } *rty_out = g_assSTART_ENTER_INCAR[tmp - 1]; } /* * Output and update for action system: * '/Level 2' * '/Level 2' */ void Level2(int8_t *rty_step) { /* SignalConversion generated from: '/step' incorporates: * Constant: '/Constant' */ *rty_step = 3; } /* * Output and update for atomic system: * '/g_assSTART_ENTER_COOLANT ' * '/g_assSTART_ENTER_COOLANT ' * '/g_assSTART_ENTER_COOLANT ' */ void g_assSTART_ENTER_COOLANT_j(uint8_t rtu_LVL, int16_t *rty_out) { int32_t q0; uint32_t qY; /* : out = int16(g_assSTART_ENTER_COOLANT(LVL + 1 - 3)); */ q0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { q0 = 255; } /* MW:begin MISRA2012:D4.1 CERT-C:INT30-C 'Justifying MISRA CPP rule violation' */ qY = (uint32_t)q0 - 3U; /* MW:end MISRA2012:D4.1 CERT-C:INT30-C */ if ((uint32_t)q0 - 3U > (uint32_t)q0) { qY = 0U; } *rty_out = g_assSTART_ENTER_COOLANT[(int32_t)qY - 1]; } /* * Output and update for action system: * '/Level 4' * '/Level 5' */ void Level4(int8_t *rty_step1, const uint8_t *rtd_CCU_MODE_FL, const int16_t *rtd_ECT, const uint8_t *rtd_LEVEL, const uint8_t *rtd_LO_HI_MODE_FL) { int16_t rtb_out_jr; /* MATLAB Function: '/g_assSTART_ENTER_COOLANT ' incorporates: * DataStoreRead: '/Data Store Read3' */ g_assSTART_ENTER_COOLANT_j(*rtd_LEVEL, &rtb_out_jr); /* Switch: '/Switch' incorporates: * Constant: '/Constant' * Constant: '/Constant1' * Constant: '/LOW' * DataStoreRead: '/Data Store Read' * DataStoreRead: '/Data Store Read5' * DataStoreRead: '/mode driver' * Logic: '/AND' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator2' * RelationalOperator: '/Relational Operator3' */ if ((*rtd_ECT < rtb_out_jr) && (*rtd_CCU_MODE_FL == 1) && (*rtd_LO_HI_MODE_FL != 1)) { *rty_step1 = 0; } else { *rty_step1 = -1; } /* End of Switch: '/Switch' */ } /* * Output and update for action system: * '/Level 0' * '/Level 1' * '/Level 2' * '/Level 0' * '/Level 1' */ void Level0(int8_t *rty_step) { /* SignalConversion generated from: '/step' incorporates: * Constant: '/Constant' */ *rty_step = 1; } /* * Output and update for atomic system: * '/incar filter down' * '/incar filter down' * '/incar filter down' * '/incar filter down' * '/incar filter down' * '/incar filter down' * '/incar filter down' * '/incar filter down' * '/incar filter down' * '/incar filter down' * ... */ void incarfilterdown(uint8_t rtu_LVL, uint8_t *rty_out) { int32_t tmp; /* : out = g_aucSTART_INCAR_FLT_DN(LVL + 1); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } *rty_out = g_aucSTART_INCAR_FLT_DN[tmp - 1]; } /* * Output and update for atomic system: * '/incar filter up' * '/incar filter up' * '/incar filter up' * '/incar filter up' * '/incar filter up' * '/incar filter up' * '/incar filter up' * '/incar filter up' * '/incar filter up' * '/incar filter up' * ... */ void incarfilterup(uint8_t rtu_LVL, uint8_t *rty_out) { int32_t tmp; /* : out = g_aucSTART_INCAR_FLT_UP(LVL + 1); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } *rty_out = g_aucSTART_INCAR_FLT_UP[tmp - 1]; } /* * Output and update for atomic system: * '/g_assSTART_COOLANT_STEP0_TO_1 ' * '/g_assSTART_COOLANT_STEP0_TO_1 ' */ void g_assSTART_COOLANT_STEP0_TO_1_a(uint8_t rtu_LVL, int16_t *rty_out) { int32_t q0; uint32_t qY; /* : out = int16(g_assSTART_COOLANT_STEP0_TO_1(LVL + 1 - 2)); */ q0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { q0 = 255; } /* MW:begin MISRA2012:D4.1 CERT-C:INT30-C 'Justifying MISRA CPP rule violation' */ qY = (uint32_t)q0 - 2U; /* MW:end MISRA2012:D4.1 CERT-C:INT30-C */ if ((uint32_t)q0 - 2U > (uint32_t)q0) { qY = 0U; } *rty_out = g_assSTART_COOLANT_STEP0_TO_1[(int32_t)qY - 1]; } /* * Output and update for atomic system: * '/3 way valve status' * '/3 way valve status' * '/3 way valve status' * '/3 way valve status' * '/3 way valve status' */ void uwayvalvestatus(uint8_t rtu_LVL, uint8_t *rty_out) { int32_t tmp; /* : out = g_aucSTART_3WAY_OPEN(LVL + 1); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } *rty_out = g_aucSTART_3WAY_OPEN[tmp - 1]; } /* * Output and update for atomic system: * '/Dtg_FrontLower_X' * '/Dtg_FrontLower_X' * '/Dtg_FrontLower_X' */ void Dtg_FrontLower_X(uint8_t rtu_LVL, uint8_t *rty_out) { int32_t tmp; /* : out = g_aucSTART_DUCT_TGT_STEP2_FX_L(LVL + 1); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } *rty_out = g_aucSTART_DUCT_TGT_STEP2_FX_L[tmp - 1]; } /* * Output and update for atomic system: * '/Dtg_FrontUpper_X' * '/Dtg_FrontUpper_X' * '/Dtg_FrontUpper_X' */ void Dtg_FrontUpper_X(uint8_t rtu_LVL, uint8_t *rty_out) { int32_t tmp; /* : out = g_aucSTART_DUCT_TGT_STEP2_FX_U(LVL + 1); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } *rty_out = g_aucSTART_DUCT_TGT_STEP2_FX_U[tmp - 1]; } /* * Output and update for atomic system: * '/Incar temp goto from step 1 to step 2 ' * '/Incar temp goto from step 1 to step 2 ' * '/Incar temp goto from step 1 to step 2 ' * '/Incar temp goto from step 1 to step 2 ' * '/Incar temp goto from step 1 to step 2 ' */ void Incartempgotofromstep1tostep2(uint8_t rtu_LVL, int16_t *rty_out) { int32_t tmp; /* : out = int16(g_assSTART_INCAR_STEP1_TO_2(LVL + 1)); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } *rty_out = g_assSTART_INCAR_STEP1_TO_2[tmp - 1]; } /* * Output and update for atomic system: * '/blower FR' * '/blower FR' */ void blowerFR(uint8_t rtu_LVL, uint16_t *rty_out) { int32_t tmp; /* : out = g_ausSTART_BLR_AF_STEP12_F(LVL + 1); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } *rty_out = g_ausSTART_BLR_AF_STEP12_F[tmp - 1]; } /* * Output and update for atomic system: * '/mode FR step 1' * '/mode FR step 1' * '/mode FR step 1' * '/mode FR step 1' * '/mode FR step 1' */ void modeFRstep1(uint8_t rtu_LVL, uint8_t *rty_out) { int32_t tmp; /* : out = g_aucSTART_VALVE_IDX_STEP1(LVL + 1); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } *rty_out = g_aucSTART_VALVE_IDX_STEP1[tmp - 1]; } /* * Output and update for atomic system: * '/window heating' * '/window heating' * '/window heating' * '/window heating' * '/window heating' */ void windowheating(uint8_t rtu_LVL, uint8_t *rty_out) { int32_t tmp; /* : out = g_aucSTART_ELEC_WINDOW(LVL + 1); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } *rty_out = g_aucSTART_ELEC_WINDOW[tmp - 1]; } /* * Output and update for atomic system: * '/Time goto from step 1 to step 2 ' * '/Time goto from step 1 to step 2 ' * '/Time goto from step 1 to step 2 ' * '/Time goto from step 1 to step 2 ' */ void Timegotofromstep1tostep2(uint8_t rtu_LVL, int16_t *rty_out) { int32_t tmp; uint16_t tmp_0; /* : out = int16(g_ausSTART_TIME_STEP1_TO_2(LVL + 1)); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } tmp_0 = g_ausSTART_TIME_STEP1_TO_2[tmp - 1]; if (tmp_0 > 32767) { tmp_0 = 32767U; } *rty_out = (int16_t)tmp_0; } /* * Output and update for atomic system: * '/ECT min max' * '/ECT min max' * '/ECT min max' */ void ECTminmax(uint8_t rtu_LVL, int16_t rty_out[2]) { int32_t q0; uint32_t qY; /* : min = int16(g_assSTART_COOLANT_STEP0_TO_1(LVL + 1 - 2)); */ /* : max = int16(g_assSTART_COOLANT_TO_STEP2(1)); */ /* : out = [min, max]; */ q0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { q0 = 255; } /* MW:begin MISRA2012:D4.1 CERT-C:INT30-C 'Justifying MISRA CPP rule violation' */ qY = (uint32_t)q0 - 2U; /* MW:end MISRA2012:D4.1 CERT-C:INT30-C */ if ((uint32_t)q0 - 2U > (uint32_t)q0) { qY = 0U; } rty_out[0] = g_assSTART_COOLANT_STEP0_TO_1[(int32_t)qY - 1]; rty_out[1] = g_assSTART_COOLANT_TO_STEP2[0]; } /* * Output and update for atomic system: * '/blower min max' * '/blower min max' * '/blower min max' */ void blowerminmax(uint8_t rtu_LVL, uint16_t rty_out[2]) { int32_t tmp; /* : min = 20; */ /* : max = g_ausSTART_BLR_AF_STEP12_F(LVL + 1); */ /* : out = [min, max]; */ rty_out[0] = 20U; tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } rty_out[1] = g_ausSTART_BLR_AF_STEP12_F[tmp - 1]; } /* * Output and update for action system: * '/Level 4' * '/Level 5' */ void Level4_h(int8_t *rty_step, uint16_t *rtd_Blower_FL, uint16_t *rtd_Blower_FR, uint8_t *rtd_Dtg_FLL, uint8_t *rtd_Dtg_FLR, uint8_t *rtd_Dtg_FUL, uint8_t *rtd_Dtg_FUR, const int16_t *rtd_ECT, uint8_t *rtd_El_window_heating, const int16_t *rtd_Incar_FL, uint8_t *rtd_Incar_filter_down_value, uint8_t *rtd_Incar_filter_up_value, const uint8_t *rtd_LEVEL, uint8_t *rtd_Mode_FL, uint8_t *rtd_Mode_FR, double *rtd_Recirculation, uint8_t *rtd_Valve_3_way, const int8_t *rtd_step_start_controle_front, const uint32_t *rtd_t_now, DW_Level4_o *localDW) { int32_t tmp; int16_t rtb_out_o4[2]; int16_t rtb_out_dh; int16_t rtb_out_oj; uint16_t rtb_out_nk[2]; uint8_t rtb_out_pa; bool rtb_Equal_eo; bool rtb_RelationalOperator1_a; /* DataStoreWrite: '/Data Store Write8' incorporates: * DataStoreRead: '/Data Store Read10' * MATLAB Function: '/3 way valve status' */ uwayvalvestatus(*rtd_LEVEL, rtd_Valve_3_way); /* DataStoreWrite: '/Data Store Write' incorporates: * DataStoreRead: '/Data Store Read1' * MATLAB Function: '/incar filter up' */ incarfilterup(*rtd_LEVEL, rtd_Incar_filter_up_value); /* DataStoreWrite: '/Data Store Write1' incorporates: * DataStoreRead: '/Data Store Read2' * MATLAB Function: '/incar filter down' */ incarfilterdown(*rtd_LEVEL, rtd_Incar_filter_down_value); /* MATLAB Function: '/mode FR step 1' incorporates: * DataStoreRead: '/Data Store Read5' */ modeFRstep1(*rtd_LEVEL, &rtb_out_pa); /* DataStoreWrite: '/Data Store Write2' */ *rtd_Mode_FR = rtb_out_pa; /* DataStoreWrite: '/Data Store Write3' */ *rtd_Mode_FL = rtb_out_pa; /* MATLAB Function: '/window heating' incorporates: * DataStoreRead: '/Data Store Read6' */ windowheating(*rtd_LEVEL, &rtb_out_pa); /* DataStoreWrite: '/Data Store Write4' */ *rtd_El_window_heating = rtb_out_pa; /* MATLAB Function: '/blower min max' incorporates: * DataStoreRead: '/Data Store Read7' */ blowerminmax(*rtd_LEVEL, rtb_out_nk); /* MATLAB Function: '/ECT min max' incorporates: * DataStoreRead: '/Data Store Read7' */ ECTminmax(*rtd_LEVEL, rtb_out_o4); /* Lookup_n-D: '/blower для текущего ECT' incorporates: * DataStoreRead: '/engine coolant temp' */ rtb_out_oj = look1_is16lu64n32tu16Ds32Is16_binlcs(*rtd_ECT, rtb_out_o4, rtb_out_nk, 1U); /* DataTypeConversion: '/Data Type Conversion1' incorporates: * DataStoreWrite: '/Data Store Write5' */ *rtd_Blower_FR = (uint16_t)rtb_out_oj; /* DataStoreWrite: '/Data Store Write6' incorporates: * DataStoreWrite: '/Data Store Write5' */ *rtd_Blower_FL = *rtd_Blower_FR; /* MATLAB Function: '/Dtg_FrontUpper_X' incorporates: * DataStoreRead: '/Data Store Read8' */ /* : out = g_aucSTART_DUCT_TGT_STEP2_FX_U(LVL + 1); */ tmp = (int32_t)(*rtd_LEVEL + 1U); if (*rtd_LEVEL + 1U > 255U) { tmp = 255; } rtb_out_pa = g_aucSTART_DUCT_TGT_STEP2_FX_U[tmp - 1]; /* DataStoreWrite: '/Data Store Write10' */ *rtd_Dtg_FUR = rtb_out_pa; /* DataStoreWrite: '/Data Store Write11' */ *rtd_Dtg_FUL = rtb_out_pa; /* MATLAB Function: '/Dtg_FrontLower_X' incorporates: * DataStoreRead: '/Data Store Read8' * DataStoreRead: '/Data Store Read9' * MATLAB Function: '/Dtg_FrontUpper_X' */ /* : out = g_aucSTART_DUCT_TGT_STEP2_FX_L(LVL + 1); */ tmp = (int32_t)(*rtd_LEVEL + 1U); if (*rtd_LEVEL + 1U > 255U) { tmp = 255; } rtb_out_pa = g_aucSTART_DUCT_TGT_STEP2_FX_L[tmp - 1]; /* End of MATLAB Function: '/Dtg_FrontLower_X' */ /* DataStoreWrite: '/Data Store Write12' */ *rtd_Dtg_FLR = rtb_out_pa; /* DataStoreWrite: '/Data Store Write13' */ *rtd_Dtg_FLL = rtb_out_pa; /* DataStoreWrite: '/Data Store Write7' incorporates: * Constant: '/Recirc logic Partial REC' */ *rtd_Recirculation = 1.0; /* RelationalOperator: '/Equal' incorporates: * DataStoreRead: '/current step' */ rtb_Equal_eo = (*rtd_step_start_controle_front == 1); /* MATLAB Function: '/Incar temp goto from step 1 to step 2 ' incorporates: * DataStoreRead: '/Data Store Read3' */ Incartempgotofromstep1tostep2(*rtd_LEVEL, &rtb_out_dh); /* MATLAB Function: '/Time goto from step 1 to step 2 ' incorporates: * DataStoreRead: '/Data Store Read4' */ Timegotofromstep1tostep2(*rtd_LEVEL, &rtb_out_oj); /* RelationalOperator: '/Relational Operator1' incorporates: * DataStoreRead: '/Data Store Read4' * Gain: '/из сек в мс' * Sum: '/Subtract' * UnitDelay: '/t_start_delay_private ' */ rtb_RelationalOperator1_a = (*rtd_t_now - localDW->t_start_delay_private_DSTATE > (uint32_t)(1000 * rtb_out_oj)); /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read4' * Logic: '/Logical Operator3' * Logic: '/Logical Operator4' * UnitDelay: '/Cond_prev_private ' * UnitDelay: '/t_start_delay_private ' */ if (rtb_Equal_eo && (!localDW->Cond_prev_private_DSTATE)) { localDW->t_start_delay_private_DSTATE = *rtd_t_now; } /* End of Switch: '/Switch' */ /* Switch: '/Switch' incorporates: * Constant: '/go to next step' * Constant: '/stay at step 1' * DataStoreRead: '/incar temp' * Logic: '/Logical Operator' * RelationalOperator: '/Relational Operator' */ if ((*rtd_Incar_FL > rtb_out_dh) || rtb_RelationalOperator1_a) { *rty_step = 2; } else { *rty_step = 1; } /* End of Switch: '/Switch' */ /* Update for UnitDelay: '/Cond_prev_private ' */ localDW->Cond_prev_private_DSTATE = rtb_Equal_eo; } /* * Output and update for atomic system: * '/3 way valve status' * '/3 way valve status' * '/3 way valve status' * '/3 way valve status' * '/3 way valve status' */ void uwayvalvestatus_j(uint8_t rtu_LVL, uint8_t *rty_out) { int32_t tmp; int32_t tmp_0; /* : out = g_aucSTART_3WAY_OPEN(LVL + 1 + 6); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } tmp_0 = (int32_t)((uint32_t)tmp + 6U); if ((uint32_t)tmp + 6U > 255U) { tmp_0 = 255; } *rty_out = g_aucSTART_3WAY_OPEN[tmp_0 - 1]; } /* * Output and update for atomic system: * '/time for step' * '/time for step' * '/time for step' * '/time for step' * '/time for step' */ void timeforstep(uint8_t rtu_LVL, uint8_t *rty_out) { int32_t tmp; int32_t tmp_0; /* : out = g_aucSTART_DUCT_TGT_STEP2_FX_L(LVL + 1 + 6); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } tmp_0 = (int32_t)((uint32_t)tmp + 6U); if ((uint32_t)tmp + 6U > 255U) { tmp_0 = 255; } *rty_out = g_aucSTART_DUCT_TGT_STEP2_FX_L[tmp_0 - 1]; } /* * Output and update for atomic system: * '/time for step' * '/time for step' * '/time for step' * '/time for step' * '/time for step' */ void timeforstep_c(uint8_t rtu_LVL, uint8_t *rty_out) { int32_t tmp; int32_t tmp_0; /* : out = g_aucSTART_DUCT_TGT_STEP2_FX_U(LVL + 1 + 6); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } tmp_0 = (int32_t)((uint32_t)tmp + 6U); if ((uint32_t)tmp + 6U > 255U) { tmp_0 = 255; } *rty_out = g_aucSTART_DUCT_TGT_STEP2_FX_U[tmp_0 - 1]; } /* * Output and update for atomic system: * '/Time goto from step 2 to step 3 ' * '/Time goto from step 2 to step 3 ' * '/Time goto from step 2 to step 3 ' * '/Time goto from step 2 to step 3 ' * '/Time goto from step 2 to step 3 ' */ void Timegotofromstep2tostep3(uint8_t rtu_LVL, int16_t *rty_out) { int32_t tmp; uint16_t tmp_0; /* : out = int16(g_ausSTART_TIME_STEP2_TO_3(LVL + 1)); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } tmp_0 = g_ausSTART_TIME_STEP2_TO_3[tmp - 1]; if (tmp_0 > 32767) { tmp_0 = 32767U; } *rty_out = (int16_t)tmp_0; } /* * Output and update for atomic system: * '/blower step' * '/blower step' * '/blower step' * '/blower step' * '/blower step' */ void blowerstep(uint8_t rtu_LVL, uint16_t *rty_out) { int32_t tmp; /* : out = g_ausSTART_BLR_SPD_STEP2_F(LVL + 1); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } *rty_out = g_ausSTART_BLR_SPD_STEP2_F[tmp - 1]; } /* * Output and update for atomic system: * '/blower time for step' * '/blower time for step' * '/blower time for step' * '/blower time for step' * '/blower time for step' */ void blowertimeforstep(uint8_t rtu_LVL, uint16_t *rty_out) { int32_t tmp; int32_t tmp_0; /* : out = g_ausSTART_BLR_SPD_STEP2_F(LVL + 1 + 6); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } tmp_0 = (int32_t)((uint32_t)tmp + 6U); if ((uint32_t)tmp + 6U > 255U) { tmp_0 = 255; } *rty_out = g_ausSTART_BLR_SPD_STEP2_F[tmp_0 - 1]; } /* * Output and update for atomic system: * '/step' * '/step' * '/step' * '/step' * '/step' */ void step_h(uint8_t rtu_LVL, uint8_t *rty_out) { int32_t tmp; /* : out = g_aucSTART_VALVE_CHANGE_SPD_F(LVL + 1); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } *rty_out = g_aucSTART_VALVE_CHANGE_SPD_F[tmp - 1]; } /* * Output and update for atomic system: * '/time for step' * '/time for step' * '/time for step' * '/time for step' * '/time for step' */ void timeforstep_p(uint8_t rtu_LVL, uint8_t *rty_out) { int32_t tmp; int32_t tmp_0; /* : out = g_aucSTART_VALVE_CHANGE_SPD_F(LVL + 1 + 6); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } tmp_0 = (int32_t)((uint32_t)tmp + 6U); if ((uint32_t)tmp + 6U > 255U) { tmp_0 = 255; } *rty_out = g_aucSTART_VALVE_CHANGE_SPD_F[tmp_0 - 1]; } /* * Output and update for atomic system: * '/window heating' * '/window heating' * '/window heating' * '/window heating' */ void windowheating_e(uint8_t rtu_LVL, uint8_t *rty_out) { int32_t tmp; int32_t tmp_0; /* : out = g_aucSTART_ELEC_WINDOW(LVL + 1 + 6); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } tmp_0 = (int32_t)((uint32_t)tmp + 6U); if ((uint32_t)tmp + 6U > 255U) { tmp_0 = 255; } *rty_out = g_aucSTART_ELEC_WINDOW[tmp_0 - 1]; } /* * Output and update for atomic system: * '/autodemist (autodefog)' * '/autodemist (autodefog)' * '/autodemist (autodefog)' */ void autodemistautodefog(uint8_t rtu_LVL, uint8_t *rty_out) { int32_t tmp; /* : out = g_aucSTART_AUTODEMIST2_STEP2(LVL + 1); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } *rty_out = g_aucSTART_AUTODEMIST2_STEP2[tmp - 1]; } /* * Output and update for action system: * '/Level 3' * '/Level 4' */ void Level3(int8_t *rty_step, uint8_t *rtd_Autodefog, uint16_t *rtd_Blower_FL, uint16_t *rtd_Blower_FR, const uint16_t *rtd_Blower_logic_FL, uint8_t *rtd_Dtg_FLL, uint8_t *rtd_Dtg_FLR, uint8_t *rtd_Dtg_FUL, uint8_t *rtd_Dtg_FUR, const uint8_t *rtd_Dtg_logic_FLL, const uint8_t *rtd_Dtg_logic_FUL, uint8_t *rtd_El_window_heating, const bool *rtd_HI_logic_on, uint8_t *rtd_Incar_filter_down_value, uint8_t *rtd_Incar_filter_up_value, const uint8_t *rtd_LEVEL, uint8_t *rtd_Mode_FL, uint8_t *rtd_Mode_FR, const uint8_t *rtd_Mode_logic_FL, double *rtd_Recirculation, uint8_t *rtd_Valve_3_way, const int8_t *rtd_step_start_controle_front, const uint32_t *rtd_t_now, DW_Level3 *localDW) { int32_t tmp; int16_t rtb_out_axx; uint16_t rtb_out_pb; uint16_t rtb_out_pv; uint8_t rtb_out_co; uint8_t rtb_out_hp; uint8_t rtb_out_po; bool rtb_Cond_prev_private_dr; bool rtb_RelationalOperator1_a; /* DataStoreWrite: '/Data Store Write8' incorporates: * DataStoreRead: '/Data Store Read10' * MATLAB Function: '/3 way valve status' */ uwayvalvestatus_j(*rtd_LEVEL, rtd_Valve_3_way); /* MATLAB Function: '/step' incorporates: * DataStoreRead: '/Data Store Read9' */ Dtg_FrontLower_X(*rtd_LEVEL, &rtb_out_po); /* MATLAB Function: '/time for step' incorporates: * DataStoreRead: '/Data Store Read9' */ timeforstep(*rtd_LEVEL, &rtb_out_hp); /* Switch: '/Switch' incorporates: * Constant: '/Constant' * Constant: '/epsilon' * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' * DataStoreRead: '/текущее время в мс' * DataStoreWrite: '/Data Store Write12' * Product: '/Product1' * Product: '/change rate (dtg//sec)' * Product: '/скорость в мс' * Product: '/шаг изменения' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator' * Sum: '/Add' * Sum: '/Add' * Sum: '/Subtract' * Switch: '/Switch' * UnitDelay: '/Unit Delay' */ if ((uint8_t)(*rtd_Dtg_FLL - *rtd_Dtg_logic_FLL) <= 0.01) { *rtd_Dtg_FLR = *rtd_Dtg_logic_FLL; } else { if (*rtd_Dtg_FLL <= *rtd_Dtg_logic_FLL) { /* Switch: '/Switch' incorporates: * Constant: '/Constant' */ tmp = 1; } else { /* Switch: '/Switch' incorporates: * Constant: '/Constant1' */ tmp = -1; } *rtd_Dtg_FLR = (uint8_t)((double)rtb_out_po / (double)rtb_out_hp / 1000.0 * (double)(*rtd_t_now - localDW->UnitDelay_DSTATE) * (double)tmp + (double)* rtd_Dtg_FLL); } /* End of Switch: '/Switch' */ /* DataStoreWrite: '/Data Store Write13' incorporates: * DataStoreWrite: '/Data Store Write12' */ *rtd_Dtg_FLL = *rtd_Dtg_FLR; /* MATLAB Function: '/step' incorporates: * DataStoreRead: '/Data Store Read8' */ Dtg_FrontUpper_X(*rtd_LEVEL, &rtb_out_po); /* MATLAB Function: '/time for step' incorporates: * DataStoreRead: '/Data Store Read8' */ timeforstep_c(*rtd_LEVEL, &rtb_out_hp); /* Switch: '/Switch' incorporates: * Constant: '/Constant' * Constant: '/epsilon' * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' * DataStoreRead: '/текущее время в мс' * DataStoreWrite: '/Data Store Write10' * Product: '/Product1' * Product: '/change rate (dtg//sec)' * Product: '/скорость в мс' * Product: '/шаг изменения' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator' * Sum: '/Add' * Sum: '/Add' * Sum: '/Subtract' * Switch: '/Switch' * UnitDelay: '/Unit Delay' */ if ((uint8_t)(*rtd_Dtg_FUL - *rtd_Dtg_logic_FUL) <= 0.01) { *rtd_Dtg_FUR = *rtd_Dtg_logic_FUL; } else { if (*rtd_Dtg_FUL <= *rtd_Dtg_logic_FUL) { /* Switch: '/Switch' incorporates: * Constant: '/Constant' */ tmp = 1; } else { /* Switch: '/Switch' incorporates: * Constant: '/Constant1' */ tmp = -1; } *rtd_Dtg_FUR = (uint8_t)((double)rtb_out_po / (double)rtb_out_hp / 1000.0 * (double)(*rtd_t_now - localDW->UnitDelay_DSTATE_e) * (double)tmp + (double)* rtd_Dtg_FUL); } /* End of Switch: '/Switch' */ /* DataStoreWrite: '/Data Store Write11' incorporates: * DataStoreWrite: '/Data Store Write10' */ *rtd_Dtg_FUL = *rtd_Dtg_FUR; /* DataStoreWrite: '/Data Store Write' incorporates: * DataStoreRead: '/Data Store Read1' * MATLAB Function: '/incar filter up' */ incarfilterup(*rtd_LEVEL, rtd_Incar_filter_up_value); /* DataStoreWrite: '/Data Store Write1' incorporates: * DataStoreRead: '/Data Store Read2' * MATLAB Function: '/incar filter down' */ incarfilterdown(*rtd_LEVEL, rtd_Incar_filter_down_value); /* DataStoreWrite: '/Data Store Write14' incorporates: * DataStoreRead: '/Data Store Read3' * MATLAB Function: '/autodemist (autodefog)' */ autodemistautodefog(*rtd_LEVEL, rtd_Autodefog); /* Sum: '/Add' incorporates: * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' */ rtb_out_po = (uint8_t)(*rtd_Mode_FL - *rtd_Mode_logic_FL); /* MATLAB Function: '/step' incorporates: * DataStoreRead: '/Data Store Read5' */ step_h(*rtd_LEVEL, &rtb_out_hp); /* MATLAB Function: '/time for step' incorporates: * DataStoreRead: '/Data Store Read5' */ timeforstep_p(*rtd_LEVEL, &rtb_out_co); /* Switch: '/Switch' incorporates: * Constant: '/Constant' * Constant: '/epsilon' * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' * DataStoreRead: '/текущее время в мс' * DataStoreWrite: '/Data Store Write2' * Product: '/Product1' * Product: '/change rate (step//sec)' * Product: '/скорость в мс' * Product: '/шаг изменения' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator' * Sum: '/Add' * Sum: '/Subtract' * Switch: '/Switch' * UnitDelay: '/Unit Delay' */ if (rtb_out_po <= 0.01) { *rtd_Mode_FR = *rtd_Mode_logic_FL; } else { if (*rtd_Mode_FL <= *rtd_Mode_logic_FL) { /* Switch: '/Switch' incorporates: * Constant: '/Constant' */ tmp = 1; } else { /* Switch: '/Switch' incorporates: * Constant: '/Constant1' */ tmp = -1; } *rtd_Mode_FR = (uint8_t)((double)rtb_out_hp / (double)rtb_out_co / 1000.0 * (double)(*rtd_t_now - localDW->UnitDelay_DSTATE_g) * (double)tmp + (double)* rtd_Mode_FL); } /* End of Switch: '/Switch' */ /* DataStoreWrite: '/Data Store Write3' incorporates: * DataStoreWrite: '/Data Store Write2' */ *rtd_Mode_FL = *rtd_Mode_FR; /* MATLAB Function: '/window heating' incorporates: * DataStoreRead: '/Data Store Read6' */ windowheating_e(*rtd_LEVEL, &rtb_out_po); /* DataStoreWrite: '/Data Store Write4' */ *rtd_El_window_heating = rtb_out_po; /* Sum: '/Add' incorporates: * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' */ rtb_out_pv = (uint16_t)(*rtd_Blower_FL - *rtd_Blower_logic_FL); /* RelationalOperator: '/Relational Operator' incorporates: * Constant: '/epsilon' */ rtb_Cond_prev_private_dr = (rtb_out_pv <= 0.01); /* MATLAB Function: '/blower step' incorporates: * DataStoreRead: '/Data Store Read7' */ blowerstep(*rtd_LEVEL, &rtb_out_pb); /* MATLAB Function: '/blower time for step' incorporates: * DataStoreRead: '/Data Store Read7' */ blowertimeforstep(*rtd_LEVEL, &rtb_out_pv); /* Switch: '/Switch' incorporates: * Constant: '/Constant' * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' * DataStoreRead: '/текущее время в мс' * DataStoreWrite: '/Data Store Write5' * Product: '/Product1' * Product: '/change rate (step//sec)' * Product: '/скорость в мс' * Product: '/шаг изменения' * RelationalOperator: '/Relational Operator' * Sum: '/Add' * Sum: '/Subtract' * Switch: '/Switch' * UnitDelay: '/Unit Delay' */ if (rtb_Cond_prev_private_dr) { *rtd_Blower_FR = *rtd_Blower_logic_FL; } else { if (*rtd_Blower_FL <= *rtd_Blower_logic_FL) { /* Switch: '/Switch' incorporates: * Constant: '/Constant' */ tmp = 1; } else { /* Switch: '/Switch' incorporates: * Constant: '/Constant1' */ tmp = -1; } *rtd_Blower_FR = (uint16_t)((double)rtb_out_pb / (double)rtb_out_pv / 1000.0 * (double)(*rtd_t_now - localDW->UnitDelay_DSTATE_gq) * (double)tmp + (double)*rtd_Blower_FL); } /* End of Switch: '/Switch' */ /* DataStoreWrite: '/Data Store Write6' incorporates: * DataStoreWrite: '/Data Store Write5' */ *rtd_Blower_FL = *rtd_Blower_FR; /* DataStoreWrite: '/Data Store Write7' incorporates: * Constant: '/Recirc logic Partial REC' */ *rtd_Recirculation = 1.0; /* RelationalOperator: '/Equal' incorporates: * DataStoreRead: '/current step' */ rtb_Cond_prev_private_dr = (*rtd_step_start_controle_front == 2); /* MATLAB Function: '/Time goto from step 2 to step 3 ' incorporates: * DataStoreRead: '/Data Store Read4' */ Timegotofromstep2tostep3(*rtd_LEVEL, &rtb_out_axx); /* RelationalOperator: '/Relational Operator1' incorporates: * DataStoreRead: '/Data Store Read4' * Gain: '/из сек в мс' * Sum: '/Subtract' * UnitDelay: '/t_start_delay_private ' */ rtb_RelationalOperator1_a = (*rtd_t_now - localDW->t_start_delay_private_DSTATE > (uint32_t)(1000 * rtb_out_axx)); /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read4' * Logic: '/Logical Operator3' * Logic: '/Logical Operator4' * UnitDelay: '/Cond_prev_private ' * UnitDelay: '/t_start_delay_private ' */ if (rtb_Cond_prev_private_dr && (!localDW->Cond_prev_private_DSTATE)) { localDW->t_start_delay_private_DSTATE = *rtd_t_now; } /* End of Switch: '/Switch' */ /* Switch: '/Switch' incorporates: * Constant: '/go to next step' * Constant: '/stay at step' * DataStoreRead: '/Data Store Read' * Logic: '/Logical Operator' */ if (rtb_RelationalOperator1_a || (*rtd_HI_logic_on)) { *rty_step = 3; } else { *rty_step = 2; } /* End of Switch: '/Switch' */ /* Update for UnitDelay: '/Unit Delay' incorporates: * DataStoreRead: '/текущее время в мс' */ localDW->UnitDelay_DSTATE = *rtd_t_now; /* Update for UnitDelay: '/Unit Delay' incorporates: * DataStoreRead: '/текущее время в мс' */ localDW->UnitDelay_DSTATE_e = *rtd_t_now; /* Update for UnitDelay: '/Unit Delay' incorporates: * DataStoreRead: '/текущее время в мс' */ localDW->UnitDelay_DSTATE_g = *rtd_t_now; /* Update for UnitDelay: '/Unit Delay' incorporates: * DataStoreRead: '/текущее время в мс' */ localDW->UnitDelay_DSTATE_gq = *rtd_t_now; /* Update for UnitDelay: '/Cond_prev_private ' */ localDW->Cond_prev_private_DSTATE = rtb_Cond_prev_private_dr; } /* * Output and update for atomic system: * '/g_ausSTART_ENTER_SETTEMP' * '/g_ausSTART_ENTER_SETTEMP' * '/g_ausSTART_ENTER_SETTEMP' */ void g_ausSTART_ENTER_SETTEMP_m(uint8_t rtu_LVL, int16_t *rty_out) { int32_t tmp; int32_t tmp_0; uint16_t tmp_1; /* : out = int16(g_ausSTART_ENTER_SETTEMP(LVL+1+6)); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } tmp_0 = (int32_t)((uint32_t)tmp + 6U); if ((uint32_t)tmp + 6U > 255U) { tmp_0 = 255; } tmp_1 = g_ausSTART_ENTER_SETTEMP[tmp_0 - 1]; if (tmp_1 > 32767) { tmp_1 = 32767U; } *rty_out = (int16_t)tmp_1; } /* * Output and update for atomic system: * '/g_assSTART_ENTER_INCAR' * '/g_assSTART_ENTER_INCAR' * '/g_assSTART_ENTER_INCAR' * '/g_assSTART_ENTER_INCAR' * '/g_assSTART_ENTER_INCAR' */ void g_assSTART_ENTER_INCAR_c(uint8_t rtu_LVL, int16_t *rty_out) { int32_t tmp; int32_t tmp_0; /* : out = int16(g_assSTART_ENTER_INCAR(LVL+1+6)); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } tmp_0 = (int32_t)((uint32_t)tmp + 6U); if ((uint32_t)tmp + 6U > 255U) { tmp_0 = 255; } *rty_out = g_assSTART_ENTER_INCAR[tmp_0 - 1]; } /* * Output and update for atomic system: * '/g_assSTART_ENTER_COOLANT ' * '/g_assSTART_ENTER_COOLANT ' * '/g_assSTART_ENTER_COOLANT ' */ void g_assSTART_ENTER_COOLANT_c(uint8_t rtu_LVL, int16_t *rty_out) { int32_t tmp; /* : out = int16(g_assSTART_ENTER_COOLANT(LVL + 1)); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } *rty_out = g_assSTART_ENTER_COOLANT[tmp - 1]; } /* * Output and update for action system: * '/Level 4' * '/Level 5' */ void Level4_l(int8_t *rty_step1, const uint8_t *rtd_CCU_MODE_RR, const int16_t *rtd_ECT, const int16_t *rtd_Incar_RR, const uint8_t *rtd_LEVEL, const uint8_t *rtd_LO_HI_MODE_FL) { int16_t rtb_out_es; int16_t rtb_out_gs; /* MATLAB Function: '/g_assSTART_ENTER_INCAR' incorporates: * DataStoreRead: '/Data Store Read4' */ g_assSTART_ENTER_INCAR_c(*rtd_LEVEL, &rtb_out_es); /* MATLAB Function: '/g_assSTART_ENTER_COOLANT ' incorporates: * DataStoreRead: '/Data Store Read3' */ g_assSTART_ENTER_COOLANT_c(*rtd_LEVEL, &rtb_out_gs); /* Switch: '/Switch' incorporates: * Constant: '/Constant' * Constant: '/Constant1' * Constant: '/LOW' * DataStoreRead: '/Data Store Read' * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read2' * DataStoreRead: '/Data Store Read5' * Logic: '/AND' * Logic: '/AND1' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator1' * RelationalOperator: '/Relational Operator2' * RelationalOperator: '/Relational Operator3' */ if (((*rtd_Incar_RR < rtb_out_es) || (*rtd_ECT < rtb_out_gs)) && (*rtd_CCU_MODE_RR == 1) && (*rtd_LO_HI_MODE_FL != 1)) { *rty_step1 = 0; } else { *rty_step1 = -1; } /* End of Switch: '/Switch' */ } /* * Output and update for atomic system: * '/incar filter down' * '/incar filter down' * '/incar filter down' * '/incar filter down' */ void incarfilterdown_c(uint8_t rtu_LVL, uint8_t *rty_out) { int32_t tmp; int32_t tmp_0; /* : out = g_aucSTART_INCAR_FLT_DN(LVL + 1 + 6); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } tmp_0 = (int32_t)((uint32_t)tmp + 6U); if ((uint32_t)tmp + 6U > 255U) { tmp_0 = 255; } *rty_out = g_aucSTART_INCAR_FLT_DN[tmp_0 - 1]; } /* * Output and update for atomic system: * '/incar filter up' * '/incar filter up' * '/incar filter up' * '/incar filter up' */ void incarfilterup_b(uint8_t rtu_LVL, uint8_t *rty_out) { int32_t tmp; int32_t tmp_0; /* : out = g_aucSTART_INCAR_FLT_UP(LVL + 1 + 6); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } tmp_0 = (int32_t)((uint32_t)tmp + 6U); if ((uint32_t)tmp + 6U > 255U) { tmp_0 = 255; } *rty_out = g_aucSTART_INCAR_FLT_UP[tmp_0 - 1]; } /* * Output and update for atomic system: * '/g_assSTART_COOLANT_STEP0_TO_1 ' * '/g_assSTART_COOLANT_STEP0_TO_1 ' * '/g_assSTART_COOLANT_STEP0_TO_1 ' */ void g_assSTART_COOLANT_STEP0_TO_1_k(uint8_t rtu_LVL, int16_t *rty_out) { int32_t tmp; /* : out = int16(g_assSTART_COOLANT_STEP0_TO_1(LVL + 3)); */ tmp = (int32_t)(rtu_LVL + 3U); if (rtu_LVL + 3U > 255U) { tmp = 255; } *rty_out = g_assSTART_COOLANT_STEP0_TO_1[tmp - 1]; } /* * Output and update for action system: * '/Level 4' * '/Level 5' */ void Level4_c(int8_t *rty_step1, uint16_t *rtd_Blower_RL, uint16_t *rtd_Blower_RR, uint8_t *rtd_Dtg_RL, uint8_t *rtd_Dtg_RR, const int16_t *rtd_ECT, uint8_t *rtd_Incar_filter_down_value, uint8_t *rtd_Incar_filter_up_value, const uint8_t *rtd_LEVEL, uint8_t *rtd_Mode_RL, uint8_t *rtd_Mode_RR, uint8_t *rtd_Valve_2_way, uint8_t *rtd_Valve_3_way) { int16_t rtb_out_nk; /* DataStoreWrite: '/Data Store Write5' incorporates: * Constant: '/Constant2' */ *rtd_Blower_RR = 10U; /* DataStoreWrite: '/Data Store Write6' incorporates: * Constant: '/Constant3' */ *rtd_Blower_RL = 10U; /* DataStoreWrite: '/Data Store Write10' incorporates: * Constant: '/Constant4' */ *rtd_Dtg_RR = 80U; /* DataStoreWrite: '/Data Store Write11' incorporates: * Constant: '/Constant5' */ *rtd_Dtg_RL = 80U; /* DataStoreWrite: '/Data Store Write' incorporates: * DataStoreRead: '/Data Store Read1' * MATLAB Function: '/incar filter up' */ incarfilterup_b(*rtd_LEVEL, rtd_Incar_filter_up_value); /* DataStoreWrite: '/Data Store Write1' incorporates: * DataStoreRead: '/Data Store Read2' * MATLAB Function: '/incar filter down' */ incarfilterdown_c(*rtd_LEVEL, rtd_Incar_filter_down_value); /* DataStoreWrite: '/Data Store Write2' incorporates: * Constant: '/Mode - foot' */ *rtd_Mode_RR = 60U; /* DataStoreWrite: '/Data Store Write3' incorporates: * Constant: '/Mode - foot' */ *rtd_Mode_RL = 60U; /* DataStoreWrite: '/Data Store Write8' incorporates: * Constant: '/Valve open' */ *rtd_Valve_3_way = 1U; /* DataStoreWrite: '/Data Store Write9' incorporates: * Constant: '/Valve open' */ *rtd_Valve_2_way = 1U; /* MATLAB Function: '/g_assSTART_COOLANT_STEP0_TO_1 ' incorporates: * DataStoreRead: '/Data Store Read3' */ g_assSTART_COOLANT_STEP0_TO_1_k(*rtd_LEVEL, &rtb_out_nk); /* Switch: '/Switch' incorporates: * DataStoreRead: '/Engine coolant temp' * RelationalOperator: '/Relational Operator' */ *rty_step1 = (int8_t)(*rtd_ECT > rtb_out_nk); } /* * Output and update for atomic system: * '/2 way valve' * '/2 way valve' * '/2 way valve' * '/2 way valve' * '/2 way valve' * '/2 way valve' * '/2 way valve' * '/2 way valve' * '/2 way valve' * '/2 way valve' * ... */ void uwayvalve(uint8_t rtu_LVL, uint8_t *rty_out) { int32_t tmp; /* : out = g_aucSTART_2WAY_OPEN(LVL + 1); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } *rty_out = g_aucSTART_2WAY_OPEN[tmp - 1]; } /* * Output and update for atomic system: * '/Dtg_rear' * '/Dtg_rear' * '/Dtg_rear' * '/Dtg_rear' * '/Dtg_rear' * '/Dtg_rear' */ void Dtg_rear(uint8_t rtu_LVL, uint8_t *rty_out) { int32_t tmp; /* : out = g_aucSTART_DUCT_TGT_STEP2_RX(LVL + 1); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } *rty_out = g_aucSTART_DUCT_TGT_STEP2_RX[tmp - 1]; } /* * Output and update for atomic system: * '/Incar temp goto from step 1 to step 2 ' * '/Incar temp goto from step 1 to step 2 ' * '/Incar temp goto from step 1 to step 2 ' * '/Incar temp goto from step 1 to step 2 ' * '/Incar temp goto from step 1 to step 2 ' * '/Incar temp goto from step 1 to step 2 ' */ void Incartempgotofromstep1tostep2_n(uint8_t rtu_LVL, int16_t *rty_out) { int32_t tmp; int32_t tmp_0; /* : out = int16(g_assSTART_INCAR_STEP1_TO_2(LVL + 1 + 6)); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } tmp_0 = (int32_t)((uint32_t)tmp + 6U); if ((uint32_t)tmp + 6U > 255U) { tmp_0 = 255; } *rty_out = g_assSTART_INCAR_STEP1_TO_2[tmp_0 - 1]; } /* * Output and update for atomic system: * '/Time goto from step 1 to step 2 ' * '/Time goto from step 1 to step 2 ' * '/Time goto from step 1 to step 2 ' * '/Time goto from step 1 to step 2 ' * '/Time goto from step 1 to step 2 ' * '/Time goto from step 1 to step 2 ' * '/Time goto from step 1 to step 2 ' * '/Time goto from step 1 to step 2 ' * '/Time goto from step 1 to step 2 ' * '/Time goto from step 1 to step 2 ' * ... */ void Timegotofromstep1tostep2_p(uint8_t rtu_LVL, int16_t *rty_out) { int32_t tmp; int32_t tmp_0; uint16_t tmp_1; /* : out = int16(g_ausSTART_TIME_STEP1_TO_2(LVL + 1 + 6)); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } tmp_0 = (int32_t)((uint32_t)tmp + 6U); if ((uint32_t)tmp + 6U > 255U) { tmp_0 = 255; } tmp_1 = g_ausSTART_TIME_STEP1_TO_2[tmp_0 - 1]; if (tmp_1 > 32767) { tmp_1 = 32767U; } *rty_out = (int16_t)tmp_1; } /* * Output and update for atomic system: * '/mode rear step 1' * '/mode rear step 1' * '/mode rear step 1' * '/mode rear step 1' * '/mode rear step 1' * '/mode rear step 1' */ void moderearstep1(uint8_t rtu_LVL, uint8_t *rty_out) { int32_t tmp; int32_t tmp_0; /* : out = g_aucSTART_VALVE_IDX_STEP1(LVL + 1 + 6); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } tmp_0 = (int32_t)((uint32_t)tmp + 6U); if ((uint32_t)tmp + 6U > 255U) { tmp_0 = 255; } *rty_out = g_aucSTART_VALVE_IDX_STEP1[tmp_0 - 1]; } /* * Output and update for action system: * '/Level 0' * '/Level 1' */ void Level0_o(int8_t *rty_step, uint16_t *rtd_Blower_RL, uint16_t *rtd_Blower_RR, uint8_t *rtd_Dtg_RL, uint8_t *rtd_Dtg_RR, const int16_t *rtd_Incar_RR, uint8_t *rtd_Incar_filter_down_value, uint8_t *rtd_Incar_filter_up_value, const uint8_t *rtd_LEVEL, uint8_t *rtd_Mode_RL, uint8_t *rtd_Mode_RR, double *rtd_Recirculation, uint8_t *rtd_Valve_2_way, const int8_t *rtd_step_start_controle_rear, const uint32_t *rtd_t_now, DW_Level0_f *localDW) { int32_t tmp; uint32_t rtb_dt_ay; int16_t rtb_out_dr; int16_t rtb_out_iq; uint16_t rtb_out_jhh; uint8_t rtb_out_gq; bool rtb_Equal_n; /* DataStoreWrite: '/Data Store Write9' incorporates: * DataStoreRead: '/Data Store Read6' * MATLAB Function: '/2 way valve' */ uwayvalve(*rtd_LEVEL, rtd_Valve_2_way); /* DataStoreWrite: '/Data Store Write' incorporates: * DataStoreRead: '/Data Store Read1' * MATLAB Function: '/incar filter up' */ incarfilterup_b(*rtd_LEVEL, rtd_Incar_filter_up_value); /* DataStoreWrite: '/Data Store Write1' incorporates: * DataStoreRead: '/Data Store Read2' * MATLAB Function: '/incar filter down' */ incarfilterdown_c(*rtd_LEVEL, rtd_Incar_filter_down_value); /* MATLAB Function: '/mode rear step 1' incorporates: * DataStoreRead: '/Data Store Read5' */ moderearstep1(*rtd_LEVEL, &rtb_out_gq); /* DataStoreWrite: '/Data Store Write2' */ *rtd_Mode_RR = rtb_out_gq; /* DataStoreWrite: '/Data Store Write3' */ *rtd_Mode_RL = rtb_out_gq; /* MATLAB Function: '/blower rear' incorporates: * DataStoreRead: '/Data Store Read7' */ /* : out = g_ausSTART_BLR_AF_STEP12_R(LVL + 1); */ tmp = (int32_t)(*rtd_LEVEL + 1U); if (*rtd_LEVEL + 1U > 255U) { tmp = 255; } rtb_out_jhh = g_ausSTART_BLR_AF_STEP12_R[tmp - 1]; /* End of MATLAB Function: '/blower rear' */ /* DataStoreWrite: '/Data Store Write5' */ *rtd_Blower_RR = rtb_out_jhh; /* DataStoreWrite: '/Data Store Write6' */ *rtd_Blower_RL = rtb_out_jhh; /* MATLAB Function: '/Dtg_rear' incorporates: * DataStoreRead: '/Data Store Read8' */ Dtg_rear(*rtd_LEVEL, &rtb_out_gq); /* DataStoreWrite: '/Data Store Write10' */ *rtd_Dtg_RR = rtb_out_gq; /* DataStoreWrite: '/Data Store Write11' */ *rtd_Dtg_RL = rtb_out_gq; /* DataStoreWrite: '/Data Store Write7' incorporates: * Constant: '/Recirc logic Partial REC' */ *rtd_Recirculation = 1.0; /* RelationalOperator: '/Equal' incorporates: * DataStoreRead: '/current step' */ rtb_Equal_n = (*rtd_step_start_controle_rear == 1); /* MATLAB Function: '/Incar temp goto from step 1 to step 2 ' incorporates: * DataStoreRead: '/Data Store Read3' */ Incartempgotofromstep1tostep2_n(*rtd_LEVEL, &rtb_out_dr); /* Sum: '/Subtract' incorporates: * DataStoreRead: '/Data Store Read4' * UnitDelay: '/t_start_delay_private ' */ rtb_dt_ay = *rtd_t_now - localDW->t_start_delay_private_DSTATE; /* MATLAB Function: '/Time goto from step 1 to step 2 ' incorporates: * DataStoreRead: '/Data Store Read4' */ Timegotofromstep1tostep2_p(*rtd_LEVEL, &rtb_out_iq); /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read4' * Logic: '/Logical Operator3' * Logic: '/Logical Operator4' * UnitDelay: '/Cond_prev_private ' * UnitDelay: '/t_start_delay_private ' */ if (rtb_Equal_n && (!localDW->Cond_prev_private_DSTATE)) { localDW->t_start_delay_private_DSTATE = *rtd_t_now; } /* End of Switch: '/Switch' */ /* Switch: '/Switch' incorporates: * Constant: '/go to next step' * Constant: '/stay at step 1' * DataStoreRead: '/incar temp' * Gain: '/из сек в мс' * Logic: '/Logical Operator' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator1' */ if ((*rtd_Incar_RR < rtb_out_dr) || (rtb_dt_ay > (uint16_t)(1000 * rtb_out_iq))) { *rty_step = 2; } else { *rty_step = 1; } /* End of Switch: '/Switch' */ /* Update for UnitDelay: '/Cond_prev_private ' */ localDW->Cond_prev_private_DSTATE = rtb_Equal_n; } /* * Output and update for atomic system: * '/blower start finish' * '/blower start finish' * '/blower start finish' * '/blower start finish' */ void blowerstartfinish(uint8_t rtu_LVL, uint16_t rty_out[2]) { int32_t tmp; int32_t tmp_0; /* : start = g_ausSTART_BLR_AF_STEP12_R(LVL + 1); */ /* : finish = g_ausSTART_BLR_AF_STEP12_R(LVL + 1 + 6); */ /* : out = [start, finish]; */ tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } rty_out[0] = g_ausSTART_BLR_AF_STEP12_R[tmp_0 - 1]; tmp_0 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_0 = 255; } tmp = (int32_t)((uint32_t)tmp_0 + 6U); if ((uint32_t)tmp_0 + 6U > 255U) { tmp = 255; } rty_out[1] = g_ausSTART_BLR_AF_STEP12_R[tmp - 1]; } /* * Output and update for atomic system: * '/ECT min max' * '/ECT min max' * '/ECT min max' */ void ECTminmax_b(uint8_t rtu_LVL, int16_t rty_out[2]) { int32_t tmp; /* : min = int16(g_assSTART_COOLANT_STEP0_TO_1(LVL + 3)); */ /* : max = int16(g_assSTART_COOLANT_TO_STEP2(3)); */ /* : out = [min, max]; */ tmp = (int32_t)(rtu_LVL + 3U); if (rtu_LVL + 3U > 255U) { tmp = 255; } rty_out[0] = g_assSTART_COOLANT_STEP0_TO_1[tmp - 1]; rty_out[1] = g_assSTART_COOLANT_TO_STEP2[2]; } /* * Output and update for action system: * '/Level 4' * '/Level 5' */ void Level4_n(int8_t *rty_step, uint16_t *rtd_Blower_RL, uint16_t *rtd_Blower_RR, uint8_t *rtd_Dtg_RL, uint8_t *rtd_Dtg_RR, const int16_t *rtd_ECT, const int16_t *rtd_Incar_RR, uint8_t *rtd_Incar_filter_down_value, uint8_t *rtd_Incar_filter_up_value, const uint8_t *rtd_LEVEL, uint8_t *rtd_Mode_RL, uint8_t *rtd_Mode_RR, double *rtd_Recirculation, uint8_t *rtd_Valve_2_way, const int8_t *rtd_step_start_controle_rear, const uint32_t *rtd_t_now, DW_Level4_oa *localDW) { uint32_t rtb_dt_ls; int16_t rtb_out_fm[2]; int16_t rtb_out_cq; int16_t rtb_out_em; uint16_t rtb_out_hq[2]; uint8_t rtb_out_mu0; bool rtb_Equal_n; /* DataStoreWrite: '/Data Store Write9' incorporates: * DataStoreRead: '/Data Store Read6' * MATLAB Function: '/2 way valve' */ uwayvalve(*rtd_LEVEL, rtd_Valve_2_way); /* DataStoreWrite: '/Data Store Write' incorporates: * DataStoreRead: '/Data Store Read1' * MATLAB Function: '/incar filter up' */ incarfilterup_b(*rtd_LEVEL, rtd_Incar_filter_up_value); /* DataStoreWrite: '/Data Store Write1' incorporates: * DataStoreRead: '/Data Store Read2' * MATLAB Function: '/incar filter down' */ incarfilterdown_c(*rtd_LEVEL, rtd_Incar_filter_down_value); /* MATLAB Function: '/mode rear step 1' incorporates: * DataStoreRead: '/Data Store Read5' */ moderearstep1(*rtd_LEVEL, &rtb_out_mu0); /* DataStoreWrite: '/Data Store Write2' */ *rtd_Mode_RR = rtb_out_mu0; /* DataStoreWrite: '/Data Store Write3' */ *rtd_Mode_RL = rtb_out_mu0; /* MATLAB Function: '/blower start finish' incorporates: * DataStoreRead: '/Data Store Read7' */ blowerstartfinish(*rtd_LEVEL, rtb_out_hq); /* MATLAB Function: '/ECT min max' incorporates: * DataStoreRead: '/Data Store Read7' */ ECTminmax_b(*rtd_LEVEL, rtb_out_fm); /* Lookup_n-D: '/blower для текущего ECT' incorporates: * DataStoreRead: '/engine coolant temp' */ rtb_out_em = look1_is16lu64n32tu16Ds32Is16_binlcs(*rtd_ECT, rtb_out_fm, rtb_out_hq, 1U); /* DataTypeConversion: '/Data Type Conversion1' incorporates: * DataStoreWrite: '/Data Store Write5' */ *rtd_Blower_RR = (uint16_t)rtb_out_em; /* DataStoreWrite: '/Data Store Write6' incorporates: * DataStoreWrite: '/Data Store Write5' */ *rtd_Blower_RL = *rtd_Blower_RR; /* MATLAB Function: '/Dtg_rear' incorporates: * DataStoreRead: '/Data Store Read8' */ Dtg_rear(*rtd_LEVEL, &rtb_out_mu0); /* DataStoreWrite: '/Data Store Write10' */ *rtd_Dtg_RR = rtb_out_mu0; /* DataStoreWrite: '/Data Store Write11' */ *rtd_Dtg_RL = rtb_out_mu0; /* DataStoreWrite: '/Data Store Write7' incorporates: * Constant: '/Recirc logic Partial REC' */ *rtd_Recirculation = 1.0; /* RelationalOperator: '/Equal' incorporates: * DataStoreRead: '/current step' */ rtb_Equal_n = (*rtd_step_start_controle_rear == 1); /* MATLAB Function: '/Incar temp goto from step 1 to step 2 ' incorporates: * DataStoreRead: '/Data Store Read3' */ Incartempgotofromstep1tostep2_n(*rtd_LEVEL, &rtb_out_cq); /* Sum: '/Subtract' incorporates: * DataStoreRead: '/Data Store Read4' * UnitDelay: '/t_start_delay_private ' */ rtb_dt_ls = *rtd_t_now - localDW->t_start_delay_private_DSTATE; /* MATLAB Function: '/Time goto from step 1 to step 2 ' incorporates: * DataStoreRead: '/Data Store Read4' */ Timegotofromstep1tostep2_p(*rtd_LEVEL, &rtb_out_em); /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read4' * Logic: '/Logical Operator3' * Logic: '/Logical Operator4' * UnitDelay: '/Cond_prev_private ' * UnitDelay: '/t_start_delay_private ' */ if (rtb_Equal_n && (!localDW->Cond_prev_private_DSTATE)) { localDW->t_start_delay_private_DSTATE = *rtd_t_now; } /* End of Switch: '/Switch' */ /* Switch: '/Switch' incorporates: * Constant: '/go to next step' * Constant: '/stay at step 1' * DataStoreRead: '/incar temp' * Gain: '/из сек в мс' * Logic: '/Logical Operator' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator1' */ if ((*rtd_Incar_RR > rtb_out_cq) || (rtb_dt_ls > (uint16_t)(1000 * rtb_out_em))) { *rty_step = 2; } else { *rty_step = 1; } /* End of Switch: '/Switch' */ /* Update for UnitDelay: '/Cond_prev_private ' */ localDW->Cond_prev_private_DSTATE = rtb_Equal_n; } /* * Output and update for atomic system: * '/time for step' * '/time for step' * '/time for step' * '/time for step' * '/time for step' * '/time for step' */ void timeforstep_h(uint8_t rtu_LVL, uint8_t *rty_out) { int32_t tmp; int32_t tmp_0; /* : out = g_aucSTART_DUCT_TGT_STEP2_RX(LVL + 1 + 6); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } tmp_0 = (int32_t)((uint32_t)tmp + 6U); if ((uint32_t)tmp + 6U > 255U) { tmp_0 = 255; } *rty_out = g_aucSTART_DUCT_TGT_STEP2_RX[tmp_0 - 1]; } /* * Output and update for atomic system: * '/blower step' * '/blower step' * '/blower step' * '/blower step' * '/blower step' * '/blower step' */ void blowerstep_e(uint8_t rtu_LVL, uint16_t *rty_out) { int32_t tmp; /* : out = g_ausSTART_BLR_SPD_STEP2_R(LVL + 1); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } *rty_out = g_ausSTART_BLR_SPD_STEP2_R[tmp - 1]; } /* * Output and update for atomic system: * '/blower time for step' * '/blower time for step' * '/blower time for step' * '/blower time for step' * '/blower time for step' * '/blower time for step' */ void blowertimeforstep_o(uint8_t rtu_LVL, uint16_t *rty_out) { int32_t tmp; int32_t tmp_0; /* : out = g_ausSTART_BLR_SPD_STEP2_R(LVL + 1 + 6); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } tmp_0 = (int32_t)((uint32_t)tmp + 6U); if ((uint32_t)tmp + 6U > 255U) { tmp_0 = 255; } *rty_out = g_ausSTART_BLR_SPD_STEP2_R[tmp_0 - 1]; } /* * Output and update for atomic system: * '/step' * '/step' * '/step' * '/step' * '/step' * '/step' */ void step_i3(uint8_t rtu_LVL, uint8_t *rty_out) { int32_t tmp; /* : out = g_aucSTART_VALVE_CHANGE_SPD_R(LVL + 1); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } *rty_out = g_aucSTART_VALVE_CHANGE_SPD_R[tmp - 1]; } /* * Output and update for atomic system: * '/time for step' * '/time for step' * '/time for step' * '/time for step' * '/time for step' * '/time for step' */ void timeforstep_m(uint8_t rtu_LVL, uint8_t *rty_out) { int32_t tmp; int32_t tmp_0; /* : out = g_aucSTART_VALVE_CHANGE_SPD_R(LVL + 1 + 6); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } tmp_0 = (int32_t)((uint32_t)tmp + 6U); if ((uint32_t)tmp + 6U > 255U) { tmp_0 = 255; } *rty_out = g_aucSTART_VALVE_CHANGE_SPD_R[tmp_0 - 1]; } /* * Output and update for action system: * '/Level 3' * '/Level 4' * '/Level 5' */ void Level3_j(int8_t *rty_step, uint16_t *rtd_Blower_RL, uint16_t *rtd_Blower_RR, const uint16_t *rtd_Blower_logic_RR, uint8_t *rtd_Dtg_RL, uint8_t * rtd_Dtg_RR, const uint8_t *rtd_Dtg_logic_RR, const bool *rtd_HI_logic_on, uint8_t *rtd_Incar_filter_down_value, uint8_t *rtd_Incar_filter_up_value, const uint8_t *rtd_LEVEL, uint8_t *rtd_Mode_RL, uint8_t *rtd_Mode_RR, const uint8_t *rtd_Mode_logic_RR, double *rtd_Recirculation, uint8_t *rtd_Valve_2_way, const int8_t *rtd_step_start_controle_rear, const uint32_t *rtd_t_now, DW_Level3_j *localDW) { int32_t tmp; uint32_t rtb_dt_de; int16_t rtb_out_lu; uint16_t rtb_out_cq; uint16_t rtb_out_dw0; uint8_t rtb_out_ek; uint8_t rtb_out_k0n; bool rtb_Cond_prev_private_j; /* DataStoreWrite: '/Data Store Write9' incorporates: * DataStoreRead: '/Data Store Read6' * MATLAB Function: '/2 way valve' */ uwayvalve(*rtd_LEVEL, rtd_Valve_2_way); /* MATLAB Function: '/step' incorporates: * DataStoreRead: '/Data Store Read8' */ Dtg_rear(*rtd_LEVEL, &rtb_out_k0n); /* MATLAB Function: '/time for step' incorporates: * DataStoreRead: '/Data Store Read8' */ timeforstep_h(*rtd_LEVEL, &rtb_out_ek); /* Switch: '/Switch' incorporates: * Constant: '/Constant' * Constant: '/epsilon' * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' * DataStoreRead: '/текущее время в мс' * DataStoreWrite: '/Data Store Write10' * Product: '/Product1' * Product: '/change rate (dtg//sec)' * Product: '/скорость в мс' * Product: '/шаг изменения' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator' * Sum: '/Add' * Sum: '/Add' * Sum: '/Subtract' * Switch: '/Switch' * UnitDelay: '/Unit Delay' */ if ((uint8_t)(*rtd_Dtg_RR - *rtd_Dtg_logic_RR) <= 0.01) { *rtd_Dtg_RR = *rtd_Dtg_logic_RR; } else { if (*rtd_Dtg_RR <= *rtd_Dtg_logic_RR) { /* Switch: '/Switch' incorporates: * Constant: '/Constant' */ tmp = 1; } else { /* Switch: '/Switch' incorporates: * Constant: '/Constant1' */ tmp = -1; } *rtd_Dtg_RR = (uint8_t)((double)rtb_out_k0n / (double)rtb_out_ek / 1000.0 * (double)(*rtd_t_now - localDW->UnitDelay_DSTATE) * (double)tmp + (double)* rtd_Dtg_RR); } /* End of Switch: '/Switch' */ /* DataStoreWrite: '/Data Store Write11' incorporates: * DataStoreWrite: '/Data Store Write10' */ *rtd_Dtg_RL = *rtd_Dtg_RR; /* DataStoreWrite: '/Data Store Write' incorporates: * DataStoreRead: '/Data Store Read1' * MATLAB Function: '/incar filter up' */ incarfilterup_b(*rtd_LEVEL, rtd_Incar_filter_up_value); /* DataStoreWrite: '/Data Store Write1' incorporates: * DataStoreRead: '/Data Store Read2' * MATLAB Function: '/incar filter down' */ incarfilterdown_c(*rtd_LEVEL, rtd_Incar_filter_down_value); /* Sum: '/Add' incorporates: * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' */ rtb_out_k0n = (uint8_t)(*rtd_Mode_RR - *rtd_Mode_logic_RR); /* RelationalOperator: '/Relational Operator' incorporates: * Constant: '/epsilon' */ rtb_Cond_prev_private_j = (rtb_out_k0n <= 0.01); /* MATLAB Function: '/step' incorporates: * DataStoreRead: '/Data Store Read5' */ step_i3(*rtd_LEVEL, &rtb_out_ek); /* MATLAB Function: '/time for step' incorporates: * DataStoreRead: '/Data Store Read5' */ timeforstep_m(*rtd_LEVEL, &rtb_out_k0n); /* Switch: '/Switch' incorporates: * Constant: '/Constant' * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' * DataStoreRead: '/текущее время в мс' * DataStoreWrite: '/Data Store Write2' * Product: '/Product1' * Product: '/change rate (step//sec)' * Product: '/скорость в мс' * Product: '/шаг изменения' * RelationalOperator: '/Relational Operator' * Sum: '/Add' * Sum: '/Subtract' * Switch: '/Switch' * UnitDelay: '/Unit Delay' */ if (rtb_Cond_prev_private_j) { *rtd_Mode_RR = *rtd_Mode_logic_RR; } else { if (*rtd_Mode_RR <= *rtd_Mode_logic_RR) { /* Switch: '/Switch' incorporates: * Constant: '/Constant' */ tmp = 1; } else { /* Switch: '/Switch' incorporates: * Constant: '/Constant1' */ tmp = -1; } *rtd_Mode_RR = (uint8_t)((double)rtb_out_ek / (double)rtb_out_k0n / 1000.0 * (double)(*rtd_t_now - localDW->UnitDelay_DSTATE_a) * (double)tmp + (double)* rtd_Mode_RR); } /* End of Switch: '/Switch' */ /* DataStoreWrite: '/Data Store Write3' incorporates: * DataStoreWrite: '/Data Store Write2' */ *rtd_Mode_RL = *rtd_Mode_RR; /* MATLAB Function: '/blower step' incorporates: * DataStoreRead: '/Data Store Read7' */ blowerstep_e(*rtd_LEVEL, &rtb_out_cq); /* MATLAB Function: '/blower time for step' incorporates: * DataStoreRead: '/Data Store Read7' */ blowertimeforstep_o(*rtd_LEVEL, &rtb_out_dw0); /* Switch: '/Switch' incorporates: * Constant: '/Constant' * Constant: '/epsilon' * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' * DataStoreRead: '/текущее время в мс' * DataStoreWrite: '/Data Store Write5' * Product: '/Product1' * Product: '/change rate (step//sec)' * Product: '/скорость в мс' * Product: '/шаг изменения' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator' * Sum: '/Add' * Sum: '/Add' * Sum: '/Subtract' * Switch: '/Switch' * UnitDelay: '/Unit Delay' */ if ((uint16_t)(*rtd_Blower_RR - *rtd_Blower_logic_RR) <= 0.01) { *rtd_Blower_RR = *rtd_Blower_logic_RR; } else { if (*rtd_Blower_RR <= *rtd_Blower_logic_RR) { /* Switch: '/Switch' incorporates: * Constant: '/Constant' */ tmp = 1; } else { /* Switch: '/Switch' incorporates: * Constant: '/Constant1' */ tmp = -1; } *rtd_Blower_RR = (uint16_t)((double)rtb_out_cq / (double)rtb_out_dw0 / 1000.0 * (double)(*rtd_t_now - localDW->UnitDelay_DSTATE_ar) * (double)tmp + (double)*rtd_Blower_RR); } /* End of Switch: '/Switch' */ /* DataStoreWrite: '/Data Store Write6' incorporates: * DataStoreWrite: '/Data Store Write5' */ *rtd_Blower_RL = *rtd_Blower_RR; /* DataStoreWrite: '/Data Store Write7' incorporates: * Constant: '/Recirc logic Partial REC' */ *rtd_Recirculation = 1.0; /* RelationalOperator: '/Equal' incorporates: * DataStoreRead: '/current step' */ rtb_Cond_prev_private_j = (*rtd_step_start_controle_rear == 2); /* Sum: '/Subtract' incorporates: * DataStoreRead: '/Data Store Read4' * UnitDelay: '/t_start_delay_private ' */ rtb_dt_de = *rtd_t_now - localDW->t_start_delay_private_DSTATE; /* MATLAB Function: '/Time goto from step 1 to step 2 ' incorporates: * DataStoreRead: '/Data Store Read4' */ Timegotofromstep1tostep2_p(*rtd_LEVEL, &rtb_out_lu); /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read4' * Logic: '/Logical Operator3' * Logic: '/Logical Operator4' * UnitDelay: '/Cond_prev_private ' * UnitDelay: '/t_start_delay_private ' */ if (rtb_Cond_prev_private_j && (!localDW->Cond_prev_private_DSTATE)) { localDW->t_start_delay_private_DSTATE = *rtd_t_now; } /* End of Switch: '/Switch' */ /* Switch: '/Switch' incorporates: * Constant: '/go to next step' * Constant: '/stay at step' * DataStoreRead: '/Data Store Read' * Gain: '/из сек в мс' * Logic: '/Logical Operator' * RelationalOperator: '/Relational Operator1' */ if ((rtb_dt_de > (uint16_t)(1000 * rtb_out_lu)) || (*rtd_HI_logic_on)) { *rty_step = 3; } else { *rty_step = 2; } /* End of Switch: '/Switch' */ /* Update for UnitDelay: '/Unit Delay' incorporates: * DataStoreRead: '/текущее время в мс' */ localDW->UnitDelay_DSTATE = *rtd_t_now; /* Update for UnitDelay: '/Unit Delay' incorporates: * DataStoreRead: '/текущее время в мс' */ localDW->UnitDelay_DSTATE_a = *rtd_t_now; /* Update for UnitDelay: '/Unit Delay' incorporates: * DataStoreRead: '/текущее время в мс' */ localDW->UnitDelay_DSTATE_ar = *rtd_t_now; /* Update for UnitDelay: '/Cond_prev_private ' */ localDW->Cond_prev_private_DSTATE = rtb_Cond_prev_private_j; } /* * Output and update for atomic system: * '/correction rate' * '/correction rate' */ void correctionrate(int16_t rtu_SET, uint8_t rtu_LVL, int16_t *rty_y) { int32_t i; int32_t tmp_0; int16_t tmp[42]; /* : correct_rate = [g_assCORRECT_DUCT_RATE_LV0; g_assCORRECT_DUCT_RATE_LV1; g_assCORRECT_DUCT_RATE_LV2; g_assCORRECT_DUCT_RATE_LV3; g_assCORRECT_DUCT_RATE_LV4; g_assCORRECT_DUCT_RATE_LV5]; */ /* : y = correct_rate(LVL + 1, idivide(SET - 16 + 1, 2)); */ for (i = 0; i < 7; i++) { tmp[6 * i] = g_assCORRECT_DUCT_RATE_LV0[i]; tmp[6 * i + 1] = g_assCORRECT_DUCT_RATE_LV1[i]; tmp[6 * i + 2] = g_assCORRECT_DUCT_RATE_LV2[i]; tmp[6 * i + 3] = g_assCORRECT_DUCT_RATE_LV3[i]; tmp[6 * i + 4] = g_assCORRECT_DUCT_RATE_LV4[i]; tmp[6 * i + 5] = g_assCORRECT_DUCT_RATE_LV5[i]; } i = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { i = 255; } tmp_0 = rtu_SET - 16; if (rtu_SET - 16 < -32768) { tmp_0 = -32768; } *rty_y = tmp[(((int32_t)trunc(((double)tmp_0 + 1.0) / 2.0) - 1) * 6 + i) - 1]; } /* * Output and update for atomic system: * '/is_ending_with_5' * '/is_ending_with_5' * '/is_ending_with_5' * '/is_ending_with_5' * '/is_ending_with_5' * '/is_ending_with_5' */ void is_ending_with_5(uint16_t rtu_SET, bool *rty_is_ending_with_5) { /* : is_ending_with_5 = (mod(SET, 10) == 5); */ *rty_is_ending_with_5 = ((uint16_t)(rtu_SET - (uint32_t)((int32_t)(rtu_SET / 10U) * 10)) == 5); } /* * Output and update for atomic system: * '/AMBRATE_RISING_DIFF[8]' * '/AMBRATE_RISING_DIFF[8]' */ void AMBRATE_RISING_DIFF8(uint16_t *rty_f_g_ausINCARRATE_FALLING_DIFF_F) { /* : f_g_ausINCARRATE_FALLING_DIFF_F = g_ausINCARRATE_FALLING_DIFF_F(8); */ *rty_f_g_ausINCARRATE_FALLING_DIFF_F = g_ausINCARRATE_FALLING_DIFF_F[7]; } /* * Output and update for atomic system: * '/обычное понижение темп.' * '/обычное повышение темп.' * '/обычное понижение темп.' * '/обычное повышение темп.' */ void u(uint8_t rtu_lvl, uint16_t *rty_f_g_ausINCARRATE_FALLING_F) { int32_t tmp; /* : f_g_ausINCARRATE_FALLING_F = g_ausINCARRATE_FALLING_F(lvl + 1); */ tmp = (int32_t)(rtu_lvl + 1U); if (rtu_lvl + 1U > 255U) { tmp = 255; } *rty_f_g_ausINCARRATE_FALLING_F = g_ausINCARRATE_FALLING_F[tmp - 1]; } /* * Output and update for atomic system: * '/ускоренное повышение темп.' * '/ускоренное повышение темп.' * '/ускоренное повышение темп.' * '/ускоренное повышение темп.' */ void u_m(uint8_t rtu_lvl, uint16_t *rty_f_g_ausINCARRATE_FALLING_DIFF_F) { int32_t tmp; /* : f_g_ausINCARRATE_FALLING_DIFF_F = g_ausINCARRATE_FALLING_DIFF_F(lvl + 1); */ tmp = (int32_t)(rtu_lvl + 1U); if (rtu_lvl + 1U > 255U) { tmp = 255; } *rty_f_g_ausINCARRATE_FALLING_DIFF_F = g_ausINCARRATE_FALLING_DIFF_F[tmp - 1]; } /* * Output and update for action system: * '/Продолжаем в ускоренном' * '/Продолжаем в ускоренном' */ void u_h(uint8_t rtu_lvl, uint16_t *rty_out) { /* SignalConversion generated from: '/out' incorporates: * MATLAB Function: '/ускоренное повышение темп.' */ u_m(rtu_lvl, rty_out); } /* * Output and update for atomic system: * '/AMBRATE_FALLING_DIFF[7]' * '/AMBRATE_FALLING_DIFF[7]' */ void AMBRATE_FALLING_DIFF7(uint16_t *rty_f_g_ausINCARRATE_FALLING_DIFF_F) { /* : f_g_ausINCARRATE_FALLING_DIFF_F = g_ausINCARRATE_FALLING_DIFF_F(7); */ *rty_f_g_ausINCARRATE_FALLING_DIFF_F = g_ausINCARRATE_FALLING_DIFF_F[6]; } /* * Output and update for action system: * '/обычный режим повышения' * '/обычный режим повышения' */ void u_i(uint8_t rtu_lvl, uint16_t *rty_out) { /* SignalConversion generated from: '/out' incorporates: * MATLAB Function: '/обычное повышение темп.' */ u(rtu_lvl, rty_out); } /* * Output and update for atomic system: * '/обычное повышение темп.' * '/обычное повышение темп.' * '/обычное повышение темп.' * '/обычное повышение темп.' */ void u_e(uint8_t rtu_lvl, uint16_t *rty_f_g_ausINCARRATE_RISING_F) { int32_t tmp; /* : f_g_ausINCARRATE_RISING_F = g_ausINCARRATE_RISING_F(lvl + 1); */ tmp = (int32_t)(rtu_lvl + 1U); if (rtu_lvl + 1U > 255U) { tmp = 255; } *rty_f_g_ausINCARRATE_RISING_F = g_ausINCARRATE_RISING_F[tmp - 1]; } /* * Output and update for atomic system: * '/ускоренное повышение темп.' * '/ускоренное повышение темп.' * '/ускоренное повышение темп.' * '/ускоренное повышение темп.' */ void u_c(uint8_t rtu_lvl, uint16_t *rty_f_g_ausINCARRATE_RISING_DIFF_F) { int32_t tmp; /* : f_g_ausINCARRATE_RISING_DIFF_F = g_ausINCARRATE_RISING_DIFF_F(lvl + 1); */ tmp = (int32_t)(rtu_lvl + 1U); if (rtu_lvl + 1U > 255U) { tmp = 255; } *rty_f_g_ausINCARRATE_RISING_DIFF_F = g_ausINCARRATE_RISING_DIFF_F[tmp - 1]; } /* * Output and update for action system: * '/Продолжаем в ускоренном' * '/Продолжаем в ускоренном' */ void u_cc(uint8_t rtu_lvl, uint16_t *rty_out) { /* SignalConversion generated from: '/out' incorporates: * MATLAB Function: '/ускоренное повышение темп.' */ u_c(rtu_lvl, rty_out); } /* * Output and update for atomic system: * '/g_ausINCARRATE_RISING_DIFF_F[8]' * '/g_ausINCARRATE_RISING_DIFF_F[8]' */ void g_ausINCARRATE_RISING_DIFF_F8(uint16_t *rty_f_g_ausINCARRATE_RISING_DIFF_F) { /* : f_g_ausINCARRATE_RISING_DIFF_F = g_ausINCARRATE_RISING_DIFF_F(8); */ *rty_f_g_ausINCARRATE_RISING_DIFF_F = g_ausINCARRATE_RISING_DIFF_F[7]; } /* * Output and update for atomic system: * '/INCARRATE_RISING_DIFF_F[7]' * '/INCARRATE_RISING_DIFF_F[7]' */ void INCARRATE_RISING_DIFF_F7(uint16_t *rty_f_g_ausINCARRATE_RISING_DIFF_F) { /* : f_g_ausINCARRATE_RISING_DIFF_F = g_ausINCARRATE_RISING_DIFF_F(7); */ *rty_f_g_ausINCARRATE_RISING_DIFF_F = g_ausINCARRATE_RISING_DIFF_F[6]; } /* * Output and update for action system: * '/обычный режим повышения' * '/обычный режим повышения' */ void u_mu(uint8_t rtu_lvl, uint16_t *rty_out) { /* SignalConversion generated from: '/out' incorporates: * MATLAB Function: '/обычное повышение темп.' */ u_e(rtu_lvl, rty_out); } /* * Output and update for atomic system: * '/AMBRATE_RISING_DIFF[8]' * '/AMBRATE_RISING_DIFF[8]' */ void AMBRATE_RISING_DIFF8_m(uint16_t *rty_f_g_ausINCARRATE_FALLING_DIFF_R) { /* : f_g_ausINCARRATE_FALLING_DIFF_R = g_ausINCARRATE_FALLING_DIFF_R(8); */ *rty_f_g_ausINCARRATE_FALLING_DIFF_R = g_ausINCARRATE_FALLING_DIFF_R[7]; } /* * Output and update for atomic system: * '/обычное понижение темп.' * '/обычное повышение темп.' * '/обычное понижение темп.' * '/обычное повышение темп.' */ void u_a(uint8_t rtu_lvl, uint16_t *rty_f_g_ausINCARRATE_FALLING_R) { int32_t tmp; /* : f_g_ausINCARRATE_FALLING_R = g_ausINCARRATE_FALLING_R(lvl + 1); */ tmp = (int32_t)(rtu_lvl + 1U); if (rtu_lvl + 1U > 255U) { tmp = 255; } *rty_f_g_ausINCARRATE_FALLING_R = g_ausINCARRATE_FALLING_R[tmp - 1]; } /* * Output and update for atomic system: * '/ускоренное повышение темп.' * '/ускоренное повышение темп.' * '/ускоренное повышение темп.' * '/ускоренное повышение темп.' */ void u_l(uint8_t rtu_lvl, uint16_t *rty_f_g_ausINCARRATE_FALLING_DIFF_R) { int32_t tmp; /* : f_g_ausINCARRATE_FALLING_DIFF_R = g_ausINCARRATE_FALLING_DIFF_R(lvl + 1); */ tmp = (int32_t)(rtu_lvl + 1U); if (rtu_lvl + 1U > 255U) { tmp = 255; } *rty_f_g_ausINCARRATE_FALLING_DIFF_R = g_ausINCARRATE_FALLING_DIFF_R[tmp - 1]; } /* * Output and update for action system: * '/Продолжаем в ускоренном' * '/Продолжаем в ускоренном' */ void u_g(uint8_t rtu_lvl, uint16_t *rty_out) { /* SignalConversion generated from: '/out' incorporates: * MATLAB Function: '/ускоренное повышение темп.' */ u_l(rtu_lvl, rty_out); } /* * Output and update for atomic system: * '/AMBRATE_FALLING_DIFF[7]' * '/AMBRATE_FALLING_DIFF[7]' */ void AMBRATE_FALLING_DIFF7_a(uint16_t *rty_f_g_ausINCARRATE_FALLING_DIFF_R) { /* : f_g_ausINCARRATE_FALLING_DIFF_R = g_ausINCARRATE_FALLING_DIFF_R(7); */ *rty_f_g_ausINCARRATE_FALLING_DIFF_R = g_ausINCARRATE_FALLING_DIFF_R[6]; } /* * Output and update for action system: * '/обычный режим повышения' * '/обычный режим повышения' */ void u_b(uint8_t rtu_lvl, uint16_t *rty_out) { /* SignalConversion generated from: '/out' incorporates: * MATLAB Function: '/обычное повышение темп.' */ u_a(rtu_lvl, rty_out); } /* * Output and update for atomic system: * '/обычное повышение темп.' * '/обычное повышение темп.' * '/обычное повышение темп.' * '/обычное повышение темп.' */ void u_j(uint8_t rtu_lvl, uint16_t *rty_f_g_ausINCARRATE_RISING_R) { int32_t tmp; /* : f_g_ausINCARRATE_RISING_R = g_ausINCARRATE_RISING_R(lvl + 1); */ tmp = (int32_t)(rtu_lvl + 1U); if (rtu_lvl + 1U > 255U) { tmp = 255; } *rty_f_g_ausINCARRATE_RISING_R = g_ausINCARRATE_RISING_R[tmp - 1]; } /* * Output and update for atomic system: * '/ускоренное повышение темп.' * '/ускоренное повышение темп.' * '/ускоренное повышение темп.' * '/ускоренное повышение темп.' */ void u_d(uint8_t rtu_lvl, uint16_t *rty_f_g_ausINCARRATE_RISING_DIFF_R) { int32_t tmp; /* : f_g_ausINCARRATE_RISING_DIFF_R = g_ausINCARRATE_RISING_DIFF_R(lvl + 1); */ tmp = (int32_t)(rtu_lvl + 1U); if (rtu_lvl + 1U > 255U) { tmp = 255; } *rty_f_g_ausINCARRATE_RISING_DIFF_R = g_ausINCARRATE_RISING_DIFF_R[tmp - 1]; } /* * Output and update for action system: * '/Продолжаем в ускоренном' * '/Продолжаем в ускоренном' */ void u_jk(uint8_t rtu_lvl, uint16_t *rty_out) { /* SignalConversion generated from: '/out' incorporates: * MATLAB Function: '/ускоренное повышение темп.' */ u_d(rtu_lvl, rty_out); } /* * Output and update for atomic system: * '/g_ausINCARRATE_RISING_DIFF_R[8]' * '/g_ausINCARRATE_RISING_DIFF_R[8]' */ void g_ausINCARRATE_RISING_DIFF_R8(uint16_t *rty_f_g_ausINCARRATE_RISING_DIFF_R) { /* : f_g_ausINCARRATE_RISING_DIFF_R = g_ausINCARRATE_RISING_DIFF_R(8); */ *rty_f_g_ausINCARRATE_RISING_DIFF_R = g_ausINCARRATE_RISING_DIFF_R[7]; } /* * Output and update for atomic system: * '/INCARRATE_RISING_DIFF_R[7]' * '/INCARRATE_RISING_DIFF_R[7]' */ void INCARRATE_RISING_DIFF_R7(uint16_t *rty_f_g_ausINCARRATE_RISING_DIFF_R) { /* : f_g_ausINCARRATE_RISING_DIFF_R = g_ausINCARRATE_RISING_DIFF_R(7); */ *rty_f_g_ausINCARRATE_RISING_DIFF_R = g_ausINCARRATE_RISING_DIFF_R[6]; } /* * Output and update for action system: * '/обычный режим повышения' * '/обычный режим повышения' */ void u_ew(uint8_t rtu_lvl, uint16_t *rty_out) { /* SignalConversion generated from: '/out' incorporates: * MATLAB Function: '/обычное повышение темп.' */ u_j(rtu_lvl, rty_out); } /* * System initialize for atomic system: * '/Zone_Climate_Logic_Auto_FL1' * '/Zone_Climate_Logic_Auto_FL4' */ void Zone_Climate_Logic_Auto_FL1_Init(uint8_t *rty_out_def, uint8_t *rty_out_face, uint8_t *rty_out_foot, uint8_t *rty_out_auto, double *rty_out_ac, DW_Zone_Climate_Logic_Auto_FL1 *localDW) { *rty_out_def = 0U; *rty_out_face = 0U; *rty_out_foot = 0U; *rty_out_auto = 0U; *rty_out_ac = 0.0; localDW->is_active_c23_HVAC_model = 0U; localDW->is_c23_HVAC_model = IN_NO_ACTIVE_CHILD; localDW->is_AC_SUB = IN_NO_ACTIVE_CHILD; localDW->is_DEF_SUB = IN_NO_ACTIVE_CHILD; localDW->is_FACE_SUB = IN_NO_ACTIVE_CHILD; localDW->is_FOOT_SUB = IN_NO_ACTIVE_CHILD; localDW->is_AC_SUB_g = IN_NO_ACTIVE_CHILD; } /* * Output and update for atomic system: * '/Zone_Climate_Logic_Auto_FL1' * '/Zone_Climate_Logic_Auto_FL4' */ void Zone_Climate_Logic_Auto_FL1(uint8_t rtu_btn_def, uint8_t rtu_btn_face, uint8_t rtu_btn_foot, uint8_t rtu_btn_auto, uint8_t rtu_btn_ac, uint8_t *rty_out_def, uint8_t *rty_out_face, uint8_t *rty_out_foot, uint8_t *rty_out_auto, double *rty_out_ac, DW_Zone_Climate_Logic_Auto_FL1 *localDW) { /* Chart: '/Zone_Climate_Logic_Auto_FL1' */ if (localDW->is_active_c23_HVAC_model == 0U) { localDW->is_active_c23_HVAC_model = 1U; localDW->is_c23_HVAC_model = IN_MANUAL_MODE; /* : out_def = 0; */ *rty_out_def = 0U; /* : out_face = 1; */ *rty_out_face = 1U; /* : out_foot = 1; */ *rty_out_foot = 1U; /* : mem_def = 0; */ /* : mem_face = 0; */ /* : mem_foot = 0; */ localDW->is_DEF_SUB = IN_Def_Off; localDW->is_FACE_SUB = IN_Face_Off; localDW->is_FOOT_SUB = IN_Foot_Off; localDW->is_AC_SUB_g = IN_AC_Off; } else if (localDW->is_c23_HVAC_model == IN_AUTO_MODE) { /* : sf_internal_predicateOutput = btn_auto == 0 || btn_def == 1 || btn_face == 1 || btn_foot == 1; */ if ((rtu_btn_auto == 0) || (rtu_btn_def == 1) || (rtu_btn_face == 1) || (rtu_btn_foot == 1)) { /* : out_def = mem_def; */ /* : out_face = mem_face; */ /* : out_foot = mem_foot; */ /* : out_auto=0; */ *rty_out_auto = 0U; localDW->is_AC_SUB = IN_NO_ACTIVE_CHILD; localDW->is_c23_HVAC_model = IN_MANUAL_MODE; /* : out_def = 0; */ *rty_out_def = 0U; /* : out_face = 1; */ *rty_out_face = 1U; /* : out_foot = 1; */ *rty_out_foot = 1U; /* : mem_def = 0; */ /* : mem_face = 0; */ /* : mem_foot = 0; */ localDW->is_DEF_SUB = IN_Def_Off; localDW->is_FACE_SUB = IN_Face_Off; localDW->is_FOOT_SUB = IN_Foot_Off; localDW->is_AC_SUB_g = IN_AC_Off; } else if (localDW->is_AC_SUB == IN_AC_Off) { /* : sf_internal_predicateOutput = btn_ac == 1; */ if (rtu_btn_ac == 1) { /* : out_ac=1 */ localDW->is_AC_SUB = IN_AC_On; /* : out_ac = 1; */ *rty_out_ac = 1.0; } /* case IN_AC_On: */ /* : sf_internal_predicateOutput = btn_ac == 0; */ } else if (rtu_btn_ac == 0) { /* : out_ac=0 */ *rty_out_ac = 0.0; localDW->is_AC_SUB = IN_AC_Off; } /* case IN_MANUAL_MODE: */ /* : sf_internal_predicateOutput = btn_auto == 1 || (out_def == 0 && out_face == 0 && out_foot == 0); */ } else if ((rtu_btn_auto == 1) || ((*rty_out_def == 0) && (*rty_out_face == 0) && (*rty_out_foot == 0))) { /* : mem_def = out_def; */ /* : mem_face = out_face; */ /* : mem_foot = out_foot; */ /* : out_auto=1; */ localDW->is_AC_SUB_g = IN_NO_ACTIVE_CHILD; localDW->is_FOOT_SUB = IN_NO_ACTIVE_CHILD; localDW->is_FACE_SUB = IN_NO_ACTIVE_CHILD; localDW->is_DEF_SUB = IN_NO_ACTIVE_CHILD; localDW->is_c23_HVAC_model = IN_AUTO_MODE; /* : out_auto = 1; */ *rty_out_auto = 1U; /* : out_def = 0; */ *rty_out_def = 0U; /* : out_face = 0; */ *rty_out_face = 0U; /* : out_foot = 0; */ *rty_out_foot = 0U; localDW->is_AC_SUB = IN_AC_On; /* : out_ac = 1; */ *rty_out_ac = 1.0; } else { if (localDW->is_DEF_SUB == IN_Def_Off) { /* : sf_internal_predicateOutput = btn_def == 1; */ if (rtu_btn_def == 1) { /* : out_def=1 */ *rty_out_def = 1U; localDW->is_DEF_SUB = IN_Def_On; } /* case IN_Def_On: */ /* : sf_internal_predicateOutput = btn_def == 0; */ } else if (rtu_btn_def == 0) { /* : out_def=0 */ *rty_out_def = 0U; localDW->is_DEF_SUB = IN_Def_Off; } if (localDW->is_FACE_SUB == IN_Face_Off) { /* : sf_internal_predicateOutput = btn_face == 1; */ if (rtu_btn_face == 1) { /* : out_face=1 */ *rty_out_face = 1U; localDW->is_FACE_SUB = IN_Face_On; } /* case IN_Face_On: */ /* : sf_internal_predicateOutput = btn_face == 0; */ } else if (rtu_btn_face == 0) { /* : out_face=0 */ *rty_out_face = 0U; localDW->is_FACE_SUB = IN_Face_Off; } if (localDW->is_FOOT_SUB == IN_Foot_Off) { /* : sf_internal_predicateOutput = btn_foot == 1; */ if (rtu_btn_foot == 1) { /* : out_foot=1 */ *rty_out_foot = 1U; localDW->is_FOOT_SUB = IN_Foot_On; } /* case IN_Foot_On: */ /* : sf_internal_predicateOutput = btn_foot == 0; */ } else if (rtu_btn_foot == 0) { /* : out_foot=0 */ *rty_out_foot = 0U; localDW->is_FOOT_SUB = IN_Foot_Off; } if (localDW->is_AC_SUB_g == IN_AC_Off) { /* : sf_internal_predicateOutput = btn_ac == 1; */ if (rtu_btn_ac == 1) { /* : out_ac=1 */ *rty_out_ac = 1.0; localDW->is_AC_SUB_g = IN_AC_On; } /* case IN_AC_On: */ /* : sf_internal_predicateOutput = btn_ac == 0; */ } else if (rtu_btn_ac == 0) { /* : out_ac=0 */ *rty_out_ac = 0.0; localDW->is_AC_SUB_g = IN_AC_Off; } } /* End of Chart: '/Zone_Climate_Logic_Auto_FL1' */ } /* * System initialize for atomic system: * '/Zone_Climate_Logic_Auto_FL2' * '/Zone_Climate_Logic_Auto_FL3' */ void Zone_Climate_Logic_Auto_FL2_Init(uint8_t *rty_out_def, uint8_t *rty_out_face, uint8_t *rty_out_foot, uint8_t *rty_out_auto, double *rty_out_ac, DW_Zone_Climate_Logic_Auto_FL2 *localDW) { *rty_out_def = 0U; *rty_out_face = 0U; *rty_out_foot = 0U; *rty_out_auto = 0U; *rty_out_ac = 0.0; localDW->is_active_c783_HVAC_model = 0U; localDW->is_c783_HVAC_model = IN_NO_ACTIVE_CHILD_g; localDW->is_AC_SUB = IN_NO_ACTIVE_CHILD_g; localDW->is_DEF_SUB = IN_NO_ACTIVE_CHILD_g; localDW->is_FACE_SUB = IN_NO_ACTIVE_CHILD_g; localDW->is_FOOT_SUB = IN_NO_ACTIVE_CHILD_g; localDW->is_AC_SUB_b = IN_NO_ACTIVE_CHILD_g; } /* * Output and update for atomic system: * '/Zone_Climate_Logic_Auto_FL2' * '/Zone_Climate_Logic_Auto_FL3' */ void Zone_Climate_Logic_Auto_FL2(double rtu_btn_def, uint8_t rtu_btn_face, uint8_t rtu_btn_foot, uint8_t rtu_btn_auto, uint8_t rtu_btn_ac, uint8_t *rty_out_def, uint8_t *rty_out_face, uint8_t *rty_out_foot, uint8_t *rty_out_auto, double *rty_out_ac, DW_Zone_Climate_Logic_Auto_FL2 *localDW) { /* Chart: '/Zone_Climate_Logic_Auto_FL2' */ if (localDW->is_active_c783_HVAC_model == 0U) { localDW->is_active_c783_HVAC_model = 1U; localDW->is_c783_HVAC_model = IN_MANUAL_MODE_e; /* : out_def = 0; */ *rty_out_def = 0U; /* : out_face = 1; */ *rty_out_face = 1U; /* : out_foot = 1; */ *rty_out_foot = 1U; /* : mem_def = 0; */ /* : mem_face = 0; */ /* : mem_foot = 0; */ localDW->is_DEF_SUB = IN_Def_Off_d; localDW->is_FACE_SUB = IN_Face_Off_n; localDW->is_FOOT_SUB = IN_Foot_Off_o; localDW->is_AC_SUB_b = IN_AC_Off_p; } else if (localDW->is_c783_HVAC_model == IN_AUTO_MODE_k) { /* : sf_internal_predicateOutput = btn_auto == 0 || btn_def == 1 || btn_face == 1 || btn_foot == 1; */ if ((rtu_btn_auto == 0) || (rtu_btn_def == 1.0) || (rtu_btn_face == 1) || (rtu_btn_foot == 1)) { /* : out_def = mem_def; */ /* : out_face = mem_face; */ /* : out_foot = mem_foot; */ /* : out_auto=0; */ *rty_out_auto = 0U; localDW->is_AC_SUB = IN_NO_ACTIVE_CHILD_g; localDW->is_c783_HVAC_model = IN_MANUAL_MODE_e; /* : out_def = 0; */ *rty_out_def = 0U; /* : out_face = 1; */ *rty_out_face = 1U; /* : out_foot = 1; */ *rty_out_foot = 1U; /* : mem_def = 0; */ /* : mem_face = 0; */ /* : mem_foot = 0; */ localDW->is_DEF_SUB = IN_Def_Off_d; localDW->is_FACE_SUB = IN_Face_Off_n; localDW->is_FOOT_SUB = IN_Foot_Off_o; localDW->is_AC_SUB_b = IN_AC_Off_p; } else if (localDW->is_AC_SUB == IN_AC_Off_p) { /* : sf_internal_predicateOutput = btn_ac == 1; */ if (rtu_btn_ac == 1) { /* : out_ac=1 */ localDW->is_AC_SUB = IN_AC_On_k; /* : out_ac = 1; */ *rty_out_ac = 1.0; } /* case IN_AC_On: */ /* : sf_internal_predicateOutput = btn_ac == 0; */ } else if (rtu_btn_ac == 0) { /* : out_ac=0 */ *rty_out_ac = 0.0; localDW->is_AC_SUB = IN_AC_Off_p; } /* case IN_MANUAL_MODE: */ /* : sf_internal_predicateOutput = btn_auto == 1 || (out_def == 0 && out_face == 0 && out_foot == 0); */ } else if ((rtu_btn_auto == 1) || ((*rty_out_def == 0) && (*rty_out_face == 0) && (*rty_out_foot == 0))) { /* : mem_def = out_def; */ /* : mem_face = out_face; */ /* : mem_foot = out_foot; */ /* : out_auto=1; */ localDW->is_AC_SUB_b = IN_NO_ACTIVE_CHILD_g; localDW->is_FOOT_SUB = IN_NO_ACTIVE_CHILD_g; localDW->is_FACE_SUB = IN_NO_ACTIVE_CHILD_g; localDW->is_DEF_SUB = IN_NO_ACTIVE_CHILD_g; localDW->is_c783_HVAC_model = IN_AUTO_MODE_k; /* : out_auto = 1; */ *rty_out_auto = 1U; /* : out_def = 0; */ *rty_out_def = 0U; /* : out_face = 0; */ *rty_out_face = 0U; /* : out_foot = 0; */ *rty_out_foot = 0U; localDW->is_AC_SUB = IN_AC_On_k; /* : out_ac = 1; */ *rty_out_ac = 1.0; } else { if (localDW->is_DEF_SUB == IN_Def_Off_d) { /* : sf_internal_predicateOutput = btn_def == 1; */ if (rtu_btn_def == 1.0) { /* : out_def=1 */ *rty_out_def = 1U; localDW->is_DEF_SUB = IN_Def_On_k; } /* case IN_Def_On: */ /* : sf_internal_predicateOutput = btn_def == 0; */ } else if (rtu_btn_def == 0.0) { /* : out_def=0 */ *rty_out_def = 0U; localDW->is_DEF_SUB = IN_Def_Off_d; } if (localDW->is_FACE_SUB == IN_Face_Off_n) { /* : sf_internal_predicateOutput = btn_face == 1; */ if (rtu_btn_face == 1) { /* : out_face=1 */ *rty_out_face = 1U; localDW->is_FACE_SUB = IN_Face_On_k; } /* case IN_Face_On: */ /* : sf_internal_predicateOutput = btn_face == 0; */ } else if (rtu_btn_face == 0) { /* : out_face=0 */ *rty_out_face = 0U; localDW->is_FACE_SUB = IN_Face_Off_n; } if (localDW->is_FOOT_SUB == IN_Foot_Off_o) { /* : sf_internal_predicateOutput = btn_foot == 1; */ if (rtu_btn_foot == 1) { /* : out_foot=1 */ *rty_out_foot = 1U; localDW->is_FOOT_SUB = IN_Foot_On_j; } /* case IN_Foot_On: */ /* : sf_internal_predicateOutput = btn_foot == 0; */ } else if (rtu_btn_foot == 0) { /* : out_foot=0 */ *rty_out_foot = 0U; localDW->is_FOOT_SUB = IN_Foot_Off_o; } if (localDW->is_AC_SUB_b == IN_AC_Off_p) { /* : sf_internal_predicateOutput = btn_ac == 1; */ if (rtu_btn_ac == 1) { /* : out_ac=1 */ *rty_out_ac = 1.0; localDW->is_AC_SUB_b = IN_AC_On_k; } /* case IN_AC_On: */ /* : sf_internal_predicateOutput = btn_ac == 0; */ } else if (rtu_btn_ac == 0) { /* : out_ac=0 */ *rty_out_ac = 0.0; localDW->is_AC_SUB_b = IN_AC_Off_p; } } /* End of Chart: '/Zone_Climate_Logic_Auto_FL2' */ } /* * Output and update for atomic system: * '/AF for Bi Level' * '/AF for Bi Level' */ void AFforBiLevel(uint8_t rtu_blower_speed, uint16_t *rty_out) { int32_t tmp; /* : out = uint16(g_ausFLOW_FR_BI2BLR_AF(blower_speed + 1)); */ tmp = (int32_t)(rtu_blower_speed + 1U); if (rtu_blower_speed + 1U > 255U) { tmp = 255; } *rty_out = g_ausFLOW_FR_BI2BLR_AF[tmp - 1]; } /* * Output and update for atomic system: * '/AF for Def' * '/AF for Def' */ void AFforDef(uint8_t rtu_blower_speed, uint16_t *rty_out) { int32_t tmp; /* : out = uint16(g_ausFLOW_FR_DE2BLR_AF(blower_speed + 1)); */ tmp = (int32_t)(rtu_blower_speed + 1U); if (rtu_blower_speed + 1U > 255U) { tmp = 255; } *rty_out = g_ausFLOW_FR_DE2BLR_AF[tmp - 1]; } /* * Output and update for atomic system: * '/AF for Foor + Def' * '/AF for Foor + Def' */ void AFforFoorDef(uint8_t rtu_blower_speed, uint16_t *rty_out) { int32_t tmp; /* : out = uint16(g_ausFLOW_FR_FD2BLR_AF(blower_speed + 1)); */ tmp = (int32_t)(rtu_blower_speed + 1U); if (rtu_blower_speed + 1U > 255U) { tmp = 255; } *rty_out = g_ausFLOW_FR_FD2BLR_AF[tmp - 1]; } /* * Output and update for atomic system: * '/AF for Foot' * '/AF for Foot' */ void AFforFoot(uint8_t rtu_blower_speed, uint16_t *rty_out) { int32_t tmp; /* : out = uint16(g_ausFLOW_FR_FO2BLR_AF(blower_speed + 1)); */ tmp = (int32_t)(rtu_blower_speed + 1U); if (rtu_blower_speed + 1U > 255U) { tmp = 255; } *rty_out = g_ausFLOW_FR_FO2BLR_AF[tmp - 1]; } /* * Output and update for atomic system: * '/AF for Hi_Level' * '/AF for Hi_Level' */ void AFforHi_Level(uint8_t rtu_blower_speed, uint16_t *rty_out) { int32_t tmp; /* : out = uint16(g_ausFLOW_FR_HI2BLR_AF(blower_speed + 1)); */ tmp = (int32_t)(rtu_blower_speed + 1U); if (rtu_blower_speed + 1U > 255U) { tmp = 255; } *rty_out = g_ausFLOW_FR_HI2BLR_AF[tmp - 1]; } /* * Output and update for atomic system: * '/AF for Tri-Level' * '/AF for Tri-Level' */ void AFforTriLevel(uint8_t rtu_blower_speed, uint16_t *rty_out) { int32_t tmp; /* : out = uint16(g_ausFLOW_FR_TR2BLR_AF(blower_speed + 1)); */ tmp = (int32_t)(rtu_blower_speed + 1U); if (rtu_blower_speed + 1U > 255U) { tmp = 255; } *rty_out = g_ausFLOW_FR_TR2BLR_AF[tmp - 1]; } /* * Output and update for atomic system: * '/AF for Vent mode' * '/AF for Vent mode' */ void AFforVentmode(uint8_t rtu_blower_speed, uint16_t *rty_out) { int32_t tmp; /* : out = uint16(g_ausFLOW_FR_VE2BLR_AF(blower_speed + 1)); */ tmp = (int32_t)(rtu_blower_speed + 1U); if (rtu_blower_speed + 1U > 255U) { tmp = 255; } *rty_out = g_ausFLOW_FR_VE2BLR_AF[tmp - 1]; } /* * Output and update for enable system: * '/Rear Left AF - manual directions' * '/Rear Right AF - manual directions' */ void RearLeftAFmanualdirections(bool rtu_Enable, uint8_t rtu_blowerspeed, uint8_t rtu_faceison, uint8_t rtu_footison, uint16_t *rty_AFout) { int32_t tmp; /* Outputs for Enabled SubSystem: '/Rear Left AF - manual directions' incorporates: * EnablePort: '/Enable' */ if (rtu_Enable) { /* MultiPortSwitch: '/Multiport Switch' incorporates: * Constant: '/Constant1' * Constant: '/Constant2' * Constant: '/Constant3' * Gain: '/Gain2' * MATLAB Function: '/AF for Bi Level R' * MATLAB Function: '/AF for Foot R' * MATLAB Function: '/AF for Vent mode R' * RelationalOperator: '/Relational Operator1' * RelationalOperator: '/Relational Operator2' * Sum: '/Add' */ /* : out = uint16(g_ausFLOW_RE_BI2BLR_AF(blower_speed + 1)); */ /* : out = uint16(g_ausFLOW_RE_FO2BLR_AF(blower_speed + 1)); */ /* : out = uint16(g_ausFLOW_RE_VE2BLR_AF(blower_speed + 1)); */ switch ((int32_t)((uint32_t)((rtu_footison == 1) << 1) + (uint32_t) (rtu_faceison == 1))) { case 0: *rty_AFout = 0U; break; case 1: /* MATLAB Function: '/AF for Vent mode R' */ tmp = (int32_t)(rtu_blowerspeed + 1U); if (rtu_blowerspeed + 1U > 255U) { tmp = 255; } *rty_AFout = g_ausFLOW_RE_VE2BLR_AF[tmp - 1]; break; case 2: /* MATLAB Function: '/AF for Foot R' */ tmp = (int32_t)(rtu_blowerspeed + 1U); if (rtu_blowerspeed + 1U > 255U) { tmp = 255; } *rty_AFout = g_ausFLOW_RE_FO2BLR_AF[tmp - 1]; break; default: /* MATLAB Function: '/AF for Bi Level R' */ tmp = (int32_t)(rtu_blowerspeed + 1U); if (rtu_blowerspeed + 1U > 255U) { tmp = 255; } *rty_AFout = g_ausFLOW_RE_BI2BLR_AF[tmp - 1]; break; } /* End of MultiPortSwitch: '/Multiport Switch' */ } /* End of Outputs for SubSystem: '/Rear Left AF - manual directions' */ } /* * Output and update for atomic system: * '/func g_ascAUTO_STEP_AF_F' * '/func g_ascAUTO_STEP_AF_F' */ void funcg_ascAUTO_STEP_AF_F(int8_t rtu_AF_STEP, int8_t *rty_y) { /* : y = g_ascAUTO_STEP_AF_F(AF_STEP); */ *rty_y = g_ascAUTO_STEP_AF_F[rtu_AF_STEP - 1]; } /* * Output and update for atomic system: * '/X1-X4 для Vtg_FX_incar' * '/X1-X4 для Vtg_RX_incar' */ void X1X4Vtg_FX_incar(int16_t rtu_SET, uint8_t rtu_LVL, int16_t rty_y[5]) { int32_t i; int32_t tmp_3; int32_t tmp_4; int32_t tmp_5; int32_t tmp_6; int32_t tmp_7; int16_t tmp[42]; int16_t tmp_0[42]; int16_t tmp_1[42]; int16_t tmp_2[42]; /* : all_lvl_x1 = [g_assVR_INC_X1_LV0; g_assVR_INC_X1_LV1; g_assVR_INC_X1_LV2; g_assVR_INC_X1_LV3; g_assVR_INC_X1_LV4; g_assVR_INC_X1_LV5]; */ /* : all_lvl_x2 = [g_assVR_INC_X2_LV0; g_assVR_INC_X2_LV1; g_assVR_INC_X2_LV2; g_assVR_INC_X2_LV3; g_assVR_INC_X2_LV4; g_assVR_INC_X2_LV5]; */ /* : all_lvl_x3 = [g_assVR_INC_X3_LV0; g_assVR_INC_X3_LV1; g_assVR_INC_X3_LV2; g_assVR_INC_X3_LV3; g_assVR_INC_X3_LV4; g_assVR_INC_X3_LV5]; */ /* : all_lvl_x4 = [g_assVR_INC_X4_LV0; g_assVR_INC_X4_LV1; g_assVR_INC_X4_LV2; g_assVR_INC_X4_LV3; g_assVR_INC_X4_LV5; g_assVR_INC_X4_LV4]; */ /* : y = [all_lvl_x1(LVL + 1, idivide(SET - 16 + 1, 2)), all_lvl_x2(LVL + 1, idivide(SET - 16 + 1, 2)), 0, all_lvl_x3(LVL + 1, idivide(SET - 16 + 1, 2)), all_lvl_x4(LVL + 1, idivide(SET - 16 + 1, 2))]; */ for (i = 0; i < 7; i++) { tmp[6 * i] = g_assVR_INC_X1_LV0[i]; tmp_3 = 6 * i + 1; tmp[tmp_3] = g_assVR_INC_X1_LV1[i]; tmp_4 = 6 * i + 2; tmp[tmp_4] = g_assVR_INC_X1_LV2[i]; tmp_5 = 6 * i + 3; tmp[tmp_5] = g_assVR_INC_X1_LV3[i]; tmp_6 = 6 * i + 4; tmp[tmp_6] = g_assVR_INC_X1_LV4[i]; tmp_7 = 6 * i + 5; tmp[tmp_7] = g_assVR_INC_X1_LV5[i]; tmp_0[6 * i] = g_assVR_INC_X2_LV0[i]; tmp_0[tmp_3] = g_assVR_INC_X2_LV1[i]; tmp_0[tmp_4] = g_assVR_INC_X2_LV2[i]; tmp_0[tmp_5] = g_assVR_INC_X2_LV3[i]; tmp_0[tmp_6] = g_assVR_INC_X2_LV4[i]; tmp_0[tmp_7] = g_assVR_INC_X2_LV5[i]; tmp_1[6 * i] = g_assVR_INC_X3_LV0[i]; tmp_1[tmp_3] = g_assVR_INC_X3_LV1[i]; tmp_1[tmp_4] = g_assVR_INC_X3_LV2[i]; tmp_1[tmp_5] = g_assVR_INC_X3_LV3[i]; tmp_1[tmp_6] = g_assVR_INC_X3_LV4[i]; tmp_1[tmp_7] = g_assVR_INC_X3_LV5[i]; tmp_2[6 * i] = g_assVR_INC_X4_LV0[i]; tmp_2[tmp_3] = g_assVR_INC_X4_LV1[i]; tmp_2[tmp_4] = g_assVR_INC_X4_LV2[i]; tmp_2[tmp_5] = g_assVR_INC_X4_LV3[i]; tmp_2[tmp_6] = g_assVR_INC_X4_LV5[i]; tmp_2[tmp_7] = g_assVR_INC_X4_LV4[i]; } i = rtu_SET - 16; if (rtu_SET - 16 < -32768) { i = -32768; } tmp_3 = rtu_SET - 16; if (rtu_SET - 16 < -32768) { tmp_3 = -32768; } tmp_4 = rtu_SET - 16; if (rtu_SET - 16 < -32768) { tmp_4 = -32768; } tmp_5 = rtu_SET - 16; if (rtu_SET - 16 < -32768) { tmp_5 = -32768; } tmp_6 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_6 = 255; } rty_y[0] = tmp[(((int32_t)trunc(((double)i + 1.0) / 2.0) - 1) * 6 + tmp_6) - 1]; i = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { i = 255; } rty_y[1] = tmp_0[(((int32_t)trunc(((double)tmp_3 + 1.0) / 2.0) - 1) * 6 + i) - 1]; rty_y[2] = 0; i = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { i = 255; } rty_y[3] = tmp_1[(((int32_t)trunc(((double)tmp_4 + 1.0) / 2.0) - 1) * 6 + i) - 1]; i = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { i = 255; } rty_y[4] = tmp_2[(((int32_t)trunc(((double)tmp_5 + 1.0) / 2.0) - 1) * 6 + i) - 1]; } /* * Output and update for atomic system: * '/Y1-Y4 для Vtg_FX_incar' * '/Y1-Y4 для Vtg_RX_incar' */ void Y1Y4Vtg_FX_incar(int16_t rtu_SET, uint8_t rtu_LVL, int16_t rty_y[5]) { int32_t i; int32_t tmp_3; int32_t tmp_4; int32_t tmp_5; int32_t tmp_6; int32_t tmp_7; int16_t tmp[42]; int16_t tmp_0[42]; int16_t tmp_1[42]; int16_t tmp_2[42]; /* : all_lvl_y1 = [g_assVR_INC_Y1_LV0; g_assVR_INC_Y1_LV1; g_assVR_INC_Y1_LV2; g_assVR_INC_Y1_LV3; g_assVR_INC_Y1_LV4; g_assVR_INC_Y1_LV5]; */ /* : all_lvl_y2 = [g_assVR_INC_Y2_LV0; g_assVR_INC_Y2_LV1; g_assVR_INC_Y2_LV2; g_assVR_INC_Y2_LV3; g_assVR_INC_Y2_LV4; g_assVR_INC_Y2_LV5]; */ /* : all_lvl_y3 = [g_assVR_INC_Y3_LV0; g_assVR_INC_Y3_LV1; g_assVR_INC_Y3_LV2; g_assVR_INC_Y3_LV3; g_assVR_INC_Y3_LV4; g_assVR_INC_Y3_LV5]; */ /* : all_lvl_y4 = [g_assVR_INC_Y4_LV0; g_assVR_INC_Y4_LV1; g_assVR_INC_Y4_LV2; g_assVR_INC_Y4_LV3; g_assVR_INC_Y4_LV4; g_assVR_INC_Y4_LV5]; */ /* : y = [all_lvl_y1(LVL + 1, idivide(SET - 16 + 1, 2)), all_lvl_y2(LVL + 1, idivide(SET - 16 + 1, 2)), 0, all_lvl_y3(LVL + 1, idivide(SET - 16 + 1, 2)), all_lvl_y4(LVL + 1, idivide(SET - 16 + 1, 2))]; */ for (i = 0; i < 7; i++) { tmp[6 * i] = g_assVR_INC_Y1_LV0[i]; tmp_3 = 6 * i + 1; tmp[tmp_3] = g_assVR_INC_Y1_LV1[i]; tmp_4 = 6 * i + 2; tmp[tmp_4] = g_assVR_INC_Y1_LV2[i]; tmp_5 = 6 * i + 3; tmp[tmp_5] = g_assVR_INC_Y1_LV3[i]; tmp_6 = 6 * i + 4; tmp[tmp_6] = g_assVR_INC_Y1_LV4[i]; tmp_7 = 6 * i + 5; tmp[tmp_7] = g_assVR_INC_Y1_LV5[i]; tmp_0[6 * i] = g_assVR_INC_Y2_LV0[i]; tmp_0[tmp_3] = g_assVR_INC_Y2_LV1[i]; tmp_0[tmp_4] = g_assVR_INC_Y2_LV2[i]; tmp_0[tmp_5] = g_assVR_INC_Y2_LV3[i]; tmp_0[tmp_6] = g_assVR_INC_Y2_LV4[i]; tmp_0[tmp_7] = g_assVR_INC_Y2_LV5[i]; tmp_1[6 * i] = g_assVR_INC_Y3_LV0[i]; tmp_1[tmp_3] = g_assVR_INC_Y3_LV1[i]; tmp_1[tmp_4] = g_assVR_INC_Y3_LV2[i]; tmp_1[tmp_5] = g_assVR_INC_Y3_LV3[i]; tmp_1[tmp_6] = g_assVR_INC_Y3_LV4[i]; tmp_1[tmp_7] = g_assVR_INC_Y3_LV5[i]; tmp_2[6 * i] = g_assVR_INC_Y4_LV0[i]; tmp_2[tmp_3] = g_assVR_INC_Y4_LV1[i]; tmp_2[tmp_4] = g_assVR_INC_Y4_LV2[i]; tmp_2[tmp_5] = g_assVR_INC_Y4_LV3[i]; tmp_2[tmp_6] = g_assVR_INC_Y4_LV4[i]; tmp_2[tmp_7] = g_assVR_INC_Y4_LV5[i]; } i = rtu_SET - 16; if (rtu_SET - 16 < -32768) { i = -32768; } tmp_3 = rtu_SET - 16; if (rtu_SET - 16 < -32768) { tmp_3 = -32768; } tmp_4 = rtu_SET - 16; if (rtu_SET - 16 < -32768) { tmp_4 = -32768; } tmp_5 = rtu_SET - 16; if (rtu_SET - 16 < -32768) { tmp_5 = -32768; } tmp_6 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_6 = 255; } rty_y[0] = tmp[(((int32_t)trunc(((double)i + 1.0) / 2.0) - 1) * 6 + tmp_6) - 1]; i = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { i = 255; } rty_y[1] = tmp_0[(((int32_t)trunc(((double)tmp_3 + 1.0) / 2.0) - 1) * 6 + i) - 1]; rty_y[2] = 0; i = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { i = 255; } rty_y[3] = tmp_1[(((int32_t)trunc(((double)tmp_4 + 1.0) / 2.0) - 1) * 6 + i) - 1]; i = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { i = 255; } rty_y[4] = tmp_2[(((int32_t)trunc(((double)tmp_5 + 1.0) / 2.0) - 1) * 6 + i) - 1]; } /* * Output and update for atomic system: * '/Amb_Tg ' * '/Amb_Tg ' */ void Amb_Tg(uint8_t rtu_LVL, int16_t *rty_y) { int32_t tmp; /* : y = g_assAMB_LV_TG(LVL + 1); */ tmp = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp = 255; } *rty_y = g_assAMB_LV_TG[tmp - 1]; } /* * Output and update for atomic system: * '/Y1-Y2 для Vtg_RL_amb' * '/Y1-Y4 для Vtg_RX_amb' */ void Y1Y2Vtg_RL_amb(int16_t rtu_SET, uint8_t rtu_LVL, int16_t rty_y[3]) { int32_t i; int32_t tmp_1; int32_t tmp_2; int32_t tmp_3; int32_t tmp_4; int32_t tmp_5; int16_t tmp[42]; int16_t tmp_0[42]; /* : all_lvl_y1 = [g_assVR_AMB_Y1_LV0; g_assVR_AMB_Y1_LV1; g_assVR_AMB_Y1_LV2; g_assVR_AMB_Y1_LV3; g_assVR_AMB_Y1_LV4; g_assVR_AMB_Y1_LV5]; */ /* : all_lvl_y2 = [g_assVR_AMB_Y2_LV0; g_assVR_AMB_Y2_LV1; g_assVR_AMB_Y2_LV2; g_assVR_AMB_Y2_LV3; g_assVR_AMB_Y2_LV4; g_assVR_AMB_Y2_LV5]; */ /* : y = [all_lvl_y1(LVL + 1, idivide(SET - 16 + 1, 2)), 0, all_lvl_y2(LVL + 1, idivide(SET - 16 + 1, 2))]; */ for (i = 0; i < 7; i++) { tmp[6 * i] = g_assVR_AMB_Y1_LV0[i]; tmp_1 = 6 * i + 1; tmp[tmp_1] = g_assVR_AMB_Y1_LV1[i]; tmp_2 = 6 * i + 2; tmp[tmp_2] = g_assVR_AMB_Y1_LV2[i]; tmp_3 = 6 * i + 3; tmp[tmp_3] = g_assVR_AMB_Y1_LV3[i]; tmp_4 = 6 * i + 4; tmp[tmp_4] = g_assVR_AMB_Y1_LV4[i]; tmp_5 = 6 * i + 5; tmp[tmp_5] = g_assVR_AMB_Y1_LV5[i]; tmp_0[6 * i] = g_assVR_AMB_Y2_LV0[i]; tmp_0[tmp_1] = g_assVR_AMB_Y2_LV1[i]; tmp_0[tmp_2] = g_assVR_AMB_Y2_LV2[i]; tmp_0[tmp_3] = g_assVR_AMB_Y2_LV3[i]; tmp_0[tmp_4] = g_assVR_AMB_Y2_LV4[i]; tmp_0[tmp_5] = g_assVR_AMB_Y2_LV5[i]; } i = rtu_SET - 16; if (rtu_SET - 16 < -32768) { i = -32768; } tmp_1 = rtu_SET - 16; if (rtu_SET - 16 < -32768) { tmp_1 = -32768; } tmp_2 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_2 = 255; } rty_y[0] = tmp[(((int32_t)trunc(((double)i + 1.0) / 2.0) - 1) * 6 + tmp_2) - 1]; rty_y[1] = 0; i = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { i = 255; } rty_y[2] = tmp_0[(((int32_t)trunc(((double)tmp_1 + 1.0) / 2.0) - 1) * 6 + i) - 1]; } /* * Output and update for atomic system: * '/X1-X2 для Vtg_FX_sun' * '/X1-X4 для Vtg_RX_sun' */ void X1X2Vtg_FX_sun(int16_t rtu_SET, uint8_t rtu_LVL, int16_t rty_y[3]) { int32_t i; int32_t tmp_1; int32_t tmp_2; int32_t tmp_3; int32_t tmp_4; int32_t tmp_5; int16_t tmp[42]; int16_t tmp_0[42]; /* : all_lvl_x1 = [g_assVR_SUN_X1_LV0; g_assVR_SUN_X1_LV1; g_assVR_SUN_X1_LV2; g_assVR_SUN_X1_LV3; g_assVR_SUN_X1_LV4; g_assVR_SUN_X1_LV5]; */ /* : all_lvl_x2 = [g_assVR_SUN_X2_LV0; g_assVR_SUN_X2_LV1; g_assVR_SUN_X2_LV2; g_assVR_SUN_X2_LV3; g_assVR_SUN_X2_LV4; g_assVR_SUN_X2_LV5]; */ /* : y = [0, all_lvl_x1(LVL + 1, idivide(SET - 16 + 1, 2)),all_lvl_x2(LVL + 1, idivide(SET - 16 + 1, 2))]; */ for (i = 0; i < 7; i++) { tmp[6 * i] = g_assVR_SUN_X1_LV0[i]; tmp_1 = 6 * i + 1; tmp[tmp_1] = g_assVR_SUN_X1_LV1[i]; tmp_2 = 6 * i + 2; tmp[tmp_2] = g_assVR_SUN_X1_LV2[i]; tmp_3 = 6 * i + 3; tmp[tmp_3] = g_assVR_SUN_X1_LV3[i]; tmp_4 = 6 * i + 4; tmp[tmp_4] = g_assVR_SUN_X1_LV4[i]; tmp_5 = 6 * i + 5; tmp[tmp_5] = g_assVR_SUN_X1_LV5[i]; tmp_0[6 * i] = g_assVR_SUN_X2_LV0[i]; tmp_0[tmp_1] = g_assVR_SUN_X2_LV1[i]; tmp_0[tmp_2] = g_assVR_SUN_X2_LV2[i]; tmp_0[tmp_3] = g_assVR_SUN_X2_LV3[i]; tmp_0[tmp_4] = g_assVR_SUN_X2_LV4[i]; tmp_0[tmp_5] = g_assVR_SUN_X2_LV5[i]; } i = rtu_SET - 16; if (rtu_SET - 16 < -32768) { i = -32768; } tmp_1 = rtu_SET - 16; if (rtu_SET - 16 < -32768) { tmp_1 = -32768; } rty_y[0] = 0; tmp_2 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_2 = 255; } rty_y[1] = tmp[(((int32_t)trunc(((double)i + 1.0) / 2.0) - 1) * 6 + tmp_2) - 1]; i = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { i = 255; } rty_y[2] = tmp_0[(((int32_t)trunc(((double)tmp_1 + 1.0) / 2.0) - 1) * 6 + i) - 1]; } /* * Output and update for atomic system: * '/Y1-Y2 для Vtg_RX_sun' * '/Y1-Y4 для Vtg_RX_sun' */ void Y1Y2Vtg_RX_sun(int16_t rtu_SET, uint8_t rtu_LVL, int16_t rty_y[3]) { int32_t i; int32_t tmp_1; int32_t tmp_2; int32_t tmp_3; int32_t tmp_4; int32_t tmp_5; int16_t tmp[42]; int16_t tmp_0[42]; /* : all_lvl_y1 = [g_assVR_SUN_Y1_LV0; g_assVR_SUN_Y1_LV1; g_assVR_SUN_Y1_LV2; g_assVR_SUN_Y1_LV3; g_assVR_SUN_Y1_LV4; g_assVR_SUN_Y1_LV5]; */ /* : all_lvl_y2 = [g_assVR_SUN_Y2_LV0; g_assVR_SUN_Y2_LV1; g_assVR_SUN_Y2_LV2; g_assVR_SUN_Y2_LV3; g_assVR_SUN_Y2_LV4; g_assVR_SUN_Y2_LV5]; */ /* : y = [0, all_lvl_y1(LVL + 1, idivide(SET - 16 + 1, 2)), all_lvl_y2(LVL + 1, idivide(SET - 16 + 1, 2))]; */ for (i = 0; i < 7; i++) { tmp[6 * i] = g_assVR_SUN_Y1_LV0[i]; tmp_1 = 6 * i + 1; tmp[tmp_1] = g_assVR_SUN_Y1_LV1[i]; tmp_2 = 6 * i + 2; tmp[tmp_2] = g_assVR_SUN_Y1_LV2[i]; tmp_3 = 6 * i + 3; tmp[tmp_3] = g_assVR_SUN_Y1_LV3[i]; tmp_4 = 6 * i + 4; tmp[tmp_4] = g_assVR_SUN_Y1_LV4[i]; tmp_5 = 6 * i + 5; tmp[tmp_5] = g_assVR_SUN_Y1_LV5[i]; tmp_0[6 * i] = g_assVR_SUN_Y2_LV0[i]; tmp_0[tmp_1] = g_assVR_SUN_Y2_LV1[i]; tmp_0[tmp_2] = g_assVR_SUN_Y2_LV2[i]; tmp_0[tmp_3] = g_assVR_SUN_Y2_LV3[i]; tmp_0[tmp_4] = g_assVR_SUN_Y2_LV4[i]; tmp_0[tmp_5] = g_assVR_SUN_Y2_LV5[i]; } i = rtu_SET - 16; if (rtu_SET - 16 < -32768) { i = -32768; } tmp_1 = rtu_SET - 16; if (rtu_SET - 16 < -32768) { tmp_1 = -32768; } rty_y[0] = 0; tmp_2 = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { tmp_2 = 255; } rty_y[1] = tmp[(((int32_t)trunc(((double)i + 1.0) / 2.0) - 1) * 6 + tmp_2) - 1]; i = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { i = 255; } rty_y[2] = tmp_0[(((int32_t)trunc(((double)tmp_1 + 1.0) / 2.0) - 1) * 6 + i) - 1]; } /* * Output and update for atomic system: * '/Vtg_RX_plus_max' * '/Vtg_RX_plus_max' */ void Vtg_RX_plus_max(int16_t rtu_SET, uint8_t rtu_LVL, int16_t *rty_y) { int32_t i; int32_t tmp_0; int16_t tmp[42]; /* : all_min = [g_assVR_MIN_LV0; g_assVR_MIN_LV1; g_assVR_MIN_LV2; g_assVR_MIN_LV3; g_assVR_MIN_LV4; g_assVR_MIN_LV5]; */ /* : all_max = [g_assVR_MAX_LV0; g_assVR_MAX_LV1; g_assVR_MAX_LV2; g_assVR_MAX_LV3; g_assVR_MAX_LV4; g_assVR_MAX_LV5]; */ /* : y = all_max(LVL + 1, idivide(SET - 16 + 1, 2)); */ for (i = 0; i < 7; i++) { tmp[6 * i] = g_assVR_MAX_LV0[i]; tmp[6 * i + 1] = g_assVR_MAX_LV1[i]; tmp[6 * i + 2] = g_assVR_MAX_LV2[i]; tmp[6 * i + 3] = g_assVR_MAX_LV3[i]; tmp[6 * i + 4] = g_assVR_MAX_LV4[i]; tmp[6 * i + 5] = g_assVR_MAX_LV5[i]; } i = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { i = 255; } tmp_0 = rtu_SET - 16; if (rtu_SET - 16 < -32768) { tmp_0 = -32768; } *rty_y = tmp[(((int32_t)trunc(((double)tmp_0 + 1.0) / 2.0) - 1) * 6 + i) - 1]; } /* * Output and update for atomic system: * '/Vtg_RX_plus_min' * '/Vtg_RX_plus_min' */ void Vtg_RX_plus_min(int16_t rtu_SET, uint8_t rtu_LVL, int16_t *rty_y) { int32_t i; int32_t tmp_0; int16_t tmp[42]; /* : all_min = [g_assVR_MIN_LV0; g_assVR_MIN_LV1; g_assVR_MIN_LV2; g_assVR_MIN_LV3; g_assVR_MIN_LV4; g_assVR_MIN_LV5]; */ /* : all_max = [g_assVR_MAX_LV0; g_assVR_MAX_LV1; g_assVR_MAX_LV2; g_assVR_MAX_LV3; g_assVR_MAX_LV4; g_assVR_MAX_LV5]; */ /* : y = all_min(LVL + 1, idivide(SET - 16 + 1, 2)); */ for (i = 0; i < 7; i++) { tmp[6 * i] = g_assVR_MIN_LV0[i]; tmp[6 * i + 1] = g_assVR_MIN_LV1[i]; tmp[6 * i + 2] = g_assVR_MIN_LV2[i]; tmp[6 * i + 3] = g_assVR_MIN_LV3[i]; tmp[6 * i + 4] = g_assVR_MIN_LV4[i]; tmp[6 * i + 5] = g_assVR_MIN_LV5[i]; } i = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { i = 255; } tmp_0 = rtu_SET - 16; if (rtu_SET - 16 < -32768) { tmp_0 = -32768; } *rty_y = tmp[(((int32_t)trunc(((double)tmp_0 + 1.0) / 2.0) - 1) * 6 + i) - 1]; } /* * Output and update for atomic system: * '/обычное понижение темп.' * '/обычное повышение темп.' * '/обычное понижение темп.' * '/обычное повышение темп.' * '/обычное понижение темп.' * '/обычное повышение темп.' */ void u_bs(int16_t rtu_lvl, uint8_t *rty_f_g_aucAMBRATE_FALLING) { int32_t tmp; /* : f_g_aucAMBRATE_FALLING = g_aucAMBRATE_FALLING(lvl + 1); */ tmp = rtu_lvl + 1; if (rtu_lvl + 1 > 32767) { tmp = 32767; } *rty_f_g_aucAMBRATE_FALLING = g_aucAMBRATE_FALLING[tmp - 1]; } /* * Output and update for action system: * '/включен ускоренный режим' * '/включен ускоренный режим' * '/включен ускоренный режим' */ void u_de(int16_t rtu_amb_raw, int16_t rtu_lvl, uint8_t *rty_out, const double *rtd_AMB_store, double *rtd_KEEP_FALLING_UNTIL_LIMIT) { int32_t tmp; /* If: '/If' incorporates: * Abs: '/ABS(AMBraw - AMB)' * DataStoreRead: '/Read Amb' * MATLAB Function: '/AMBRATE_RISING_DIFF[8]' * RelationalOperator: '/Relational Operator' * Sum: '/Add' */ /* : f_g_aucAMBRATE_FALLING_DIFF = g_aucAMBRATE_FALLING_DIFF(8); */ if (fabs((double)rtu_amb_raw - *rtd_AMB_store) <= g_aucAMBRATE_FALLING_DIFF[7]) { /* Outputs for IfAction SubSystem: '/Отключаем ускоренный режим' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ *rtd_KEEP_FALLING_UNTIL_LIMIT = 0.0; /* SignalConversion generated from: '/out' incorporates: * MATLAB Function: '/обычное понижение темп.' * Merge: '/Merge' */ u_bs(rtu_lvl, rty_out); /* End of Outputs for SubSystem: '/Отключаем ускоренный режим' */ } else { /* Outputs for IfAction SubSystem: '/Продолжаем в ускоренном' incorporates: * ActionPort: '/Action Port' */ /* MATLAB Function: '/ускоренное повышение темп.' */ /* : f_g_aucAMBRATE_FALLING_DIFF = g_aucAMBRATE_FALLING_DIFF(lvl + 1); */ tmp = rtu_lvl + 1; if (rtu_lvl + 1 > 32767) { tmp = 32767; } /* SignalConversion generated from: '/out' incorporates: * MATLAB Function: '/ускоренное повышение темп.' * Merge: '/Merge' */ *rty_out = g_aucAMBRATE_FALLING_DIFF[tmp - 1]; /* End of Outputs for SubSystem: '/Продолжаем в ускоренном' */ } /* End of If: '/If' */ } /* * Output and update for action system: * '/обычный режим' * '/обычный режим' * '/обычный режим' */ void u_co(int16_t rtu_amb_raw, int16_t rtu_lvl, uint8_t *rty_riseperminute, const double *rtd_AMB_store, double *rtd_KEEP_FALLING_UNTIL_LIMIT) { int32_t tmp; /* If: '/If' incorporates: * Abs: '/ABS(AMBraw - AMB)' * DataStoreRead: '/Read Amb' * MATLAB Function: '/AMBRATE_FALLING_DIFF[7]' * RelationalOperator: '/Relational Operator' * Sum: '/Add' */ /* : f_g_aucAMBRATE_FALLING_DIFF = g_aucAMBRATE_FALLING_DIFF(7); */ if (fabs((double)rtu_amb_raw - *rtd_AMB_store) > g_aucAMBRATE_FALLING_DIFF[6]) { /* Outputs for IfAction SubSystem: '/включаем ускоренный режим' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ *rtd_KEEP_FALLING_UNTIL_LIMIT = 1.0; /* MATLAB Function: '/ускоренное повышение темп.' */ /* : f_g_aucAMBRATE_FALLING_DIFF_LVL = g_aucAMBRATE_FALLING_DIFF(lvl + 1); */ tmp = rtu_lvl + 1; if (rtu_lvl + 1 > 32767) { tmp = 32767; } /* SignalConversion generated from: '/rise per minute' incorporates: * MATLAB Function: '/ускоренное повышение темп.' * Merge: '/Merge' */ *rty_riseperminute = g_aucAMBRATE_FALLING_DIFF[tmp - 1]; /* End of Outputs for SubSystem: '/включаем ускоренный режим' */ } else { /* Outputs for IfAction SubSystem: '/обычный режим повышения' incorporates: * ActionPort: '/Action Port' */ /* SignalConversion generated from: '/rise per minute' incorporates: * MATLAB Function: '/обычное повышение темп.' * Merge: '/Merge' */ u_bs(rtu_lvl, rty_riseperminute); /* End of Outputs for SubSystem: '/обычный режим повышения' */ } /* End of If: '/If' */ } /* * Output and update for atomic system: * '/обычное повышение темп.' * '/обычное повышение темп.' * '/обычное повышение темп.' * '/обычное повышение темп.' * '/обычное повышение темп.' * '/обычное повышение темп.' */ void u_bq(int16_t rtu_lvl, uint8_t *rty_f_g_aucAMBRATE_RISING) { int32_t tmp; /* : f_g_aucAMBRATE_RISING = g_aucAMBRATE_RISING(lvl + 1); */ tmp = rtu_lvl + 1; if (rtu_lvl + 1 > 32767) { tmp = 32767; } *rty_f_g_aucAMBRATE_RISING = g_aucAMBRATE_RISING[tmp - 1]; } /* * Output and update for atomic system: * '/ускоренное повышение темп.' * '/ускоренное повышение темп.' * '/ускоренное повышение темп.' * '/ускоренное повышение темп.' * '/ускоренное повышение темп.' * '/ускоренное повышение темп.' */ void u_gw(int16_t rtu_lvl, uint8_t *rty_f_g_aucAMBRATE_RISING_DIFF_LVL) { int32_t tmp; /* : f_g_aucAMBRATE_RISING_DIFF_LVL = g_aucAMBRATE_RISING_DIFF(lvl + 1); */ tmp = rtu_lvl + 1; if (rtu_lvl + 1 > 32767) { tmp = 32767; } *rty_f_g_aucAMBRATE_RISING_DIFF_LVL = g_aucAMBRATE_RISING_DIFF[tmp - 1]; } /* * Output and update for action system: * '/включен ускоренный режим' * '/включен ускоренный режим' * '/включен ускоренный режим' */ void u_hd(int16_t rtu_amb_raw, int16_t rtu_lvl, uint8_t *rty_out, const double *rtd_AMB_store, double *rtd_KEEP_RISING_UNTIL_LIMIT) { /* If: '/If' incorporates: * Abs: '/ABS(AMBraw - AMB)' * DataStoreRead: '/Read Amb' * MATLAB Function: '/AMBRATE_RISING_DIFF[8]' * RelationalOperator: '/Relational Operator' * Sum: '/Add' */ /* : f_g_aucAMBRATE_RISING_DIFF = g_aucAMBRATE_RISING_DIFF(8); */ if (fabs((double)rtu_amb_raw - *rtd_AMB_store) <= g_aucAMBRATE_RISING_DIFF[7]) { /* Outputs for IfAction SubSystem: '/Отключаем ускоренный режим' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ *rtd_KEEP_RISING_UNTIL_LIMIT = 0.0; /* SignalConversion generated from: '/out' incorporates: * MATLAB Function: '/обычное повышение темп.' */ u_bq(rtu_lvl, rty_out); /* End of Outputs for SubSystem: '/Отключаем ускоренный режим' */ } else { /* Outputs for IfAction SubSystem: '/Продолжаем в ускоренном' incorporates: * ActionPort: '/Action Port' */ /* SignalConversion generated from: '/out' incorporates: * MATLAB Function: '/ускоренное повышение темп.' */ u_gw(rtu_lvl, rty_out); /* End of Outputs for SubSystem: '/Продолжаем в ускоренном' */ } /* End of If: '/If' */ } /* * Output and update for action system: * '/обычный режим' * '/обычный режим' * '/обычный режим' */ void u_a5(int16_t rtu_amb_raw, int16_t rtu_lvl, uint8_t *rty_riseperminute, const double *rtd_AMB_store, double *rtd_KEEP_RISING_UNTIL_LIMIT) { /* If: '/If' incorporates: * Abs: '/ABS(AMBraw - AMB)' * DataStoreRead: '/Read Amb' * MATLAB Function: '/AMBRATE_RISING_DIFF[7]' * RelationalOperator: '/Relational Operator' * Sum: '/Add' */ /* : f_g_aucAMBRATE_RISING_DIFF = g_aucAMBRATE_RISING_DIFF(7); */ if (fabs((double)rtu_amb_raw - *rtd_AMB_store) > g_aucAMBRATE_RISING_DIFF[6]) { /* Outputs for IfAction SubSystem: '/включаем ускоренный режим' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ *rtd_KEEP_RISING_UNTIL_LIMIT = 1.0; /* SignalConversion generated from: '/out' incorporates: * MATLAB Function: '/ускоренное повышение темп.' */ u_gw(rtu_lvl, rty_riseperminute); /* End of Outputs for SubSystem: '/включаем ускоренный режим' */ } else { /* Outputs for IfAction SubSystem: '/обычный режим повышения' incorporates: * ActionPort: '/Action Port' */ /* SignalConversion generated from: '/out' incorporates: * MATLAB Function: '/обычное повышение темп.' */ u_bq(rtu_lvl, rty_riseperminute); /* End of Outputs for SubSystem: '/обычный режим повышения' */ } /* End of If: '/If' */ } /* * Output and update for action system: * '/If Action Subsystem' * '/If Action Subsystem' * '/If Action Subsystem' */ void IfActionSubsystem(int8_t *rty_Out1, double *rtd_ErrorHomming_private, double *rtd_Start_timer_n, int8_t *rtd_stepSig_private) { /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ *rtd_stepSig_private = 1; /* DataStoreWrite: '/Data Store Write1' incorporates: * Constant: '/Constant2' * DataStoreRead: '/Data Store Read1' * Sum: '/step inc' */ (*rtd_ErrorHomming_private)++; /* DataStoreWrite: '/Data Store Write2' incorporates: * Constant: '/Constant3' */ *rtd_Start_timer_n = 0.0; /* SignalConversion generated from: '/Out1' incorporates: * Constant: '/Constant1' */ *rty_Out1 = 2; } /* * System initialize for atomic system: * '/MATLAB Function' * '/MATLAB Function' * '/MATLAB Function' */ void MATLABFunction_Init(DW_MATLABFunction *localDW) { localDW->t_start_not_empty = false; localDW->cond_prev = 0.0; } /* * Output and update for atomic system: * '/MATLAB Function' * '/MATLAB Function' * '/MATLAB Function' */ void MATLABFunction(double rtu_cond, uint32_t rtu_t_now, uint32_t *rty_dt, DW_MATLABFunction *localDW) { /* : dt = uint32(0); */ /* : if isempty(t_start) */ if (!localDW->t_start_not_empty) { /* : t_start = t_now; */ localDW->t_start = rtu_t_now; localDW->t_start_not_empty = true; /* : cond_prev = 0; */ } /* : if cond > 0.5 && cond_prev <= 0.5 */ if ((rtu_cond > 0.5) && (localDW->cond_prev <= 0.5)) { /* : t_start = t_now; */ localDW->t_start = rtu_t_now; } /* : if cond > 0.5 */ if (rtu_cond > 0.5) { uint32_t qY; /* : dt = uint32(t_now - t_start); */ /* MW:begin MISRA2012:D4.1 CERT-C:INT30-C 'Justifying MISRA CPP rule violation' */ qY = rtu_t_now - /*MW:OvSatOk*/ localDW->t_start; /* MW:end MISRA2012:D4.1 CERT-C:INT30-C */ if (qY > rtu_t_now) { qY = 0U; } *rty_dt = qY; } else { /* : else */ /* : dt = uint32(0); */ *rty_dt = 0U; } /* : cond_prev = cond; */ localDW->cond_prev = rtu_cond; } /* * Output and update for action system: * '/If Action Subsystem1' * '/If Action Subsystem1' * '/If Action Subsystem1' */ void IfActionSubsystem1(int8_t *rty_Output, uint8_t *rtd_CCU_ActuatorErrF_Stat_private, uint8_t rtd_COM_private[9], uint8_t rtd_ErrorActuator[9], uint8_t rtd_ErrorCalibration_private[9], const double *rtd_LOGGER_LIN, uint8_t rtd_MODE_private[9], uint8_t rtd_dtc_state_error_model[127]) { int32_t i; bool tmp; /* Logic: '/Logical Operator' incorporates: * DataStoreRead: '/Data Store Read' */ tmp = (rtd_ErrorCalibration_private[0] != 0); for (i = 0; i < 8; i++) { tmp = (tmp || (rtd_ErrorCalibration_private[i + 1] != 0)); } /* DataTypeConversion: '/Data Type Conversion' incorporates: * DataStoreWrite: '/Data Store Write1' * Logic: '/Logical Operator' */ *rtd_CCU_ActuatorErrF_Stat_private = tmp; for (i = 0; i < 9; i++) { /* DataStoreWrite: '/Data Store Write2' incorporates: * DataStoreRead: '/Data Store Read' */ rtd_COM_private[i] = rtd_ErrorCalibration_private[i]; /* DataStoreWrite: '/Data Store Write' */ rtd_MODE_private[i] = 2U; } /* MATLAB Function: '/Write ERROR' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreRead: '/Data Store Read6' */ /* : if(LOGGER==1) */ if (*rtd_LOGGER_LIN == 1.0) { /* : for i = 1:numel(ErrCallibration) */ for (i = 0; i < 9; i++) { /* : if ErrCallibration(i) == 1 */ if (rtd_ErrorCalibration_private[i] == 1) { /* : fprintf('LIN1 Failure with actuator #%d\n', int16(i)); */ printf("LIN1 Failure with actuator #%d\n", (int16_t)(i + 1)); fflush(stdout); } } } /* End of MATLAB Function: '/Write ERROR' */ for (i = 0; i < 9; i++) { uint8_t rtd_ErrorCalibration_private_0; /* Logic: '/Logical Operator1' incorporates: * DataStoreRead: '/Data Store Read' */ rtd_ErrorCalibration_private_0 = rtd_ErrorCalibration_private[i]; /* DataTypeConversion: '/Data Type Conversion1' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write3' * Logic: '/Logical Operator1' */ rtd_ErrorActuator[i] = (uint8_t)((rtd_ErrorCalibration_private_0 != 0) || (rtd_ErrorActuator[i] != 0)); /* DataStoreWrite: '/Data Store Write' */ rtd_dtc_state_error_model[i + 54] = rtd_ErrorCalibration_private_0; /* DataStoreWrite: '/Data Store Write' */ rtd_ErrorCalibration_private[i] = 0U; } /* SignalConversion generated from: '/Output' incorporates: * Constant: '/Constant' */ *rty_Output = 4; } /* * Output and update for atomic system: * '/MODE_for_set_and_lvl' * '/MODE_for_set_and_lvl1' */ void MODE_for_set_and_lvl(uint8_t rtu_LVL, int16_t rtu_SET, uint8_t *rty_get_mode) { int32_t i; int32_t tmp_0; uint8_t tmp[78]; /* : modes_array = [ */ /* : g_aucMODE_BY_SET_F_LV0; */ /* : g_aucMODE_BY_SET_F_LV1; */ /* : g_aucMODE_BY_SET_F_LV2; */ /* : g_aucMODE_BY_SET_F_LV3; */ /* : g_aucMODE_BY_SET_F_LV4; */ /* : g_aucMODE_BY_SET_F_LV5]; */ /* : get_mode = modes_array(LVL + 1, SET - 16); */ for (i = 0; i < 13; i++) { tmp[6 * i] = g_aucMODE_BY_SET_F_LV0[i]; tmp[6 * i + 1] = g_aucMODE_BY_SET_F_LV1[i]; tmp[6 * i + 2] = g_aucMODE_BY_SET_F_LV2[i]; tmp[6 * i + 3] = g_aucMODE_BY_SET_F_LV3[i]; tmp[6 * i + 4] = g_aucMODE_BY_SET_F_LV4[i]; tmp[6 * i + 5] = g_aucMODE_BY_SET_F_LV5[i]; } i = (int32_t)(rtu_LVL + 1U); if (rtu_LVL + 1U > 255U) { i = 255; } tmp_0 = rtu_SET - 16; if (rtu_SET - 16 < -32768) { tmp_0 = -32768; } *rty_get_mode = tmp[((tmp_0 - 1) * 6 + i) - 1]; } /* * Output and update for atomic system: * '/increase' * '/increase' */ void increase(int16_t rtu_duct_tg, const uint16_t rtu_mode_array[7], uint16_t *rty_y) { /* : threshold_low = mode_array(2); */ /* : threshold_high = mode_array(4); */ /* : value_low = mode_array(5); */ /* : value_mid = mode_array(6); */ /* : value_high = mode_array(7); */ /* : if duct_tg < threshold_low */ if (rtu_duct_tg < rtu_mode_array[1]) { /* : y = value_low; */ *rty_y = rtu_mode_array[4]; } else if (rtu_duct_tg < rtu_mode_array[3]) { /* : elseif duct_tg < threshold_high */ /* : y = value_mid; */ *rty_y = rtu_mode_array[5]; } else { /* : else */ /* : y = value_high; */ *rty_y = rtu_mode_array[6]; } } /* * Output and update for atomic system: * '/decrease' * '/decrease' */ void decrease(int16_t rtu_duct_tg, const uint16_t rtu_mode_array[7], uint16_t *rty_y) { /* : threshold_low = mode_array(1); */ /* : threshold_high = mode_array(3); */ /* : value_low = mode_array(5); */ /* : value_mid = mode_array(6); */ /* : value_high = mode_array(7); */ /* : if duct_tg < threshold_low */ if (rtu_duct_tg < rtu_mode_array[0]) { /* : y = value_low; */ *rty_y = rtu_mode_array[4]; } else if (rtu_duct_tg < rtu_mode_array[2]) { /* : elseif duct_tg < threshold_high */ /* : y = value_mid; */ *rty_y = rtu_mode_array[5]; } else { /* : else */ /* : y = value_high; */ *rty_y = rtu_mode_array[6]; } } /* * Output and update for atomic system: * '/valves_rear_left' * '/valves_rear_right' */ void valves_rear_left(uint16_t rtu_MODE, uint16_t rty_get_valves[6]) { int32_t q0; uint32_t qY; uint16_t tmp[54]; /* : modes_array = [ */ /* : g_ausFLOW_RE_VENT; */ /* : g_ausFLOW_RE_BI2VALVE; */ /* : g_ausFLOW_RE_FO2VALVE; */ /* : g_ausFLOW_RE_VENT_2; */ /* : g_ausFLOW_RE_BI2VALVE_2; */ /* : g_ausFLOW_RE_VENT_3; */ /* : g_ausFLOW_RE_BI2VALVE_3; */ /* : g_ausFLOW_RE_VENT_MANUAL; */ /* : g_ausFLOW_RE_BI2VALVE_MANUAL; */ /* : ]; */ /* : index = idivide(MODE, 10) - 11; */ /* : get_valves = modes_array(index, :); */ q0 = (int32_t)trunc((double)rtu_MODE / 10.0); /* MW:begin MISRA2012:D4.1 CERT-C:INT30-C 'Justifying MISRA CPP rule violation' */ qY = (uint32_t)q0 - 11U; /* MW:end MISRA2012:D4.1 CERT-C:INT30-C */ if ((uint32_t)q0 - 11U > (uint32_t)q0) { qY = 0U; } for (q0 = 0; q0 < 6; q0++) { tmp[9 * q0] = g_ausFLOW_RE_VENT[q0]; tmp[9 * q0 + 1] = g_ausFLOW_RE_BI2VALVE[q0]; tmp[9 * q0 + 2] = g_ausFLOW_RE_FO2VALVE[q0]; tmp[9 * q0 + 3] = g_ausFLOW_RE_VENT_2[q0]; tmp[9 * q0 + 4] = g_ausFLOW_RE_BI2VALVE_2[q0]; tmp[9 * q0 + 5] = g_ausFLOW_RE_VENT_3[q0]; tmp[9 * q0 + 6] = g_ausFLOW_RE_BI2VALVE_3[q0]; tmp[9 * q0 + 7] = g_ausFLOW_RE_VENT_MANUAL[q0]; tmp[9 * q0 + 8] = g_ausFLOW_RE_BI2VALVE_MANUAL[q0]; rty_get_valves[q0] = tmp[(9 * q0 + (int32_t)qY) - 1]; } } /* * Output and update for atomic system: * '/Valves for Bi Level' * '/Valves for Bi Level' */ void ValvesforBiLevel(uint16_t rty_out[9]) { int32_t i; for (i = 0; i < 9; i++) { rty_out[i] = g_ausFLOW_FR_BIVALVE_MANUAL[i]; } /* : out = g_ausFLOW_FR_BIVALVE_MANUAL; */ } /* * Output and update for atomic system: * '/Valves for Def' * '/Valves for Def' */ void ValvesforDef(uint16_t rty_out[9]) { int32_t i; for (i = 0; i < 9; i++) { rty_out[i] = g_ausFLOW_FR_DE2VALVE[i]; } /* : out = g_ausFLOW_FR_DE2VALVE; */ } /* * Output and update for atomic system: * '/Valves for Foot + Def' * '/Valves for Foot + Def' */ void ValvesforFootDef(uint16_t rty_out[9]) { int32_t i; for (i = 0; i < 9; i++) { rty_out[i] = g_ausFLOW_FR_FD2VALVE[i]; } /* : out = g_ausFLOW_FR_FD2VALVE; */ } /* * Output and update for atomic system: * '/Valves for Hi_Level' * '/Valves for Hi_Level' */ void ValvesforHi_Level(uint16_t rty_out[9]) { int32_t i; for (i = 0; i < 9; i++) { rty_out[i] = g_ausFLOW_FR_HI2VALVE[i]; } /* : out = g_ausFLOW_FR_HI2VALVE; */ } /* * Output and update for atomic system: * '/Valves for Tri-Level' * '/Valves for Tri-Level' */ void ValvesforTriLevel(uint16_t rty_out[9]) { int32_t i; for (i = 0; i < 9; i++) { rty_out[i] = g_ausFLOW_FR_TR2VALVE[i]; } /* : out = g_ausFLOW_FR_TR2VALVE; */ } /* * Output and update for atomic system: * '/AF for Bi Level' * '/AF for Bi Level' */ void AFforBiLevel_a(uint16_t rty_out[6]) { int32_t i; for (i = 0; i < 6; i++) { rty_out[i] = g_ausFLOW_RE_BI2VALVE_MANUAL[i]; } /* : out = g_ausFLOW_RE_BI2VALVE_MANUAL; */ } /* * Output and update for atomic system: * '/valves for Vent mode' * '/valves for Vent mode' */ void valvesforVentmode(uint16_t rty_out[6]) { int32_t i; for (i = 0; i < 6; i++) { rty_out[i] = g_ausFLOW_RE_VENT_MANUAL[i]; } /* : out = g_ausFLOW_RE_VENT_MANUAL; */ } /* Function for Chart: '/A//C Control' */ static void E_COMP_MANAGER(bool *Enable_Comp_PID, const int16_t *g_assEVA_TG_AMB_F_n, const int16_t *g_assEVA_TG_AMB_R_h) { if (rtDW.is_E_COMP_MANAGER == IN_COMP_OFF) { *Enable_Comp_PID = false; /* DataStoreRead: '/Data Store Read55' incorporates: * DataStoreRead: '/Data Store Read37' */ /* : sf_internal_predicateOutput = (FRONT_Start_request ==1 || REAR_Start_request == 1 || Chiller_Start_request ==1) && Pressure_Hi_Fault == 0 && Pressure_Condition_table_OK == 1 && eCompChiller_Err==false && BCM_T15_Stat == 1; */ if ((rtDW.FRONT_Start_request || rtDW.REAR_Start_request || rtDW.Chiller_Start_request) && (!rtDW.Pressure_Hi_Fault) && rtDW.Pressure_Condition_table_OK && (!rtDW.eCompChiller_Err) && (rtDW.BCM_T15_Stat == 1)) { rtDW.is_E_COMP_MANAGER = IN_COMP_ON; /* : Enable_Comp_PID = true; */ *Enable_Comp_PID = true; } } else { bool tmp; bool tmp_0; /* case IN_COMP_ON: */ *Enable_Comp_PID = true; /* : sf_internal_predicateOutput = [(FRONT_Start_request ==0 && REAR_Start_request == 0 && Chiller_Start_request ==0) || Pressure_Hi_Fault == 1 || Pressure_Condition_table_OK == 0 || eCompChiller_Err==true || BCM_T15_Stat == 0]; */ tmp = !rtDW.FRONT_Start_request; tmp_0 = !rtDW.REAR_Start_request; /* DataStoreRead: '/Data Store Read55' incorporates: * DataStoreRead: '/Data Store Read2' * DataStoreRead: '/Data Store Read37' * DataStoreRead: '/Data Store Read52' * DataStoreRead: '/Data Store Read54' */ if ((tmp && tmp_0 && (!rtDW.Chiller_Start_request)) || rtDW.Pressure_Hi_Fault || (!rtDW.Pressure_Condition_table_OK) || rtDW.eCompChiller_Err || (rtDW.BCM_T15_Stat == 0)) { rtDW.is_E_COMP_MANAGER = IN_COMP_OFF; /* : Enable_Comp_PID = false; */ *Enable_Comp_PID = false; /* : Chiller_Only_Flag = 0; */ rtB.Chiller_Only_Flag = 0.0; /* : Comp_Feedback_Temp = 0; */ rtB.Comp_Feedback_Temp = 0; /* : FRONT_eTXV = true; */ rtB.FRONT_eTXV = true; /* : REAR_eTXV = true; */ rtB.REAR_eTXV = true; /* : Chiller_eTXV = true; */ rtB.Chiller_eTXV = true; /* : Eva_Ctrl = 0; */ rtB.Eva_Ctrl = 0U; } else { bool tmp_1; bool tmp_2; /* : FRONT_eTXV = (FRONT_Start_request == 1); */ rtB.FRONT_eTXV = rtDW.FRONT_Start_request; /* : REAR_eTXV = (REAR_Start_request == 1); */ rtB.REAR_eTXV = rtDW.REAR_Start_request; /* : Chiller_eTXV = (Chiller_Start_request == 1); */ rtB.Chiller_eTXV = rtDW.Chiller_Start_request; /* : if FRONT_Start_request == 1 && REAR_Start_request == 1 */ tmp_1 = (rtDW.FRONT_Start_request && rtDW.REAR_Start_request); if (tmp_1) { /* : if Eva_R < Eva_F */ if (rtDW.Eva_R < rtDW.Eva_F) { /* : Comp_Feedback_Temp = Eva_R; */ rtB.Comp_Feedback_Temp = rtDW.Eva_R; /* : Comp_Target_Temp = Target_Rear; */ rtB.Comp_Target_Temp = *g_assEVA_TG_AMB_R_h; } else { /* : else */ /* : Comp_Feedback_Temp = Eva_F; */ rtB.Comp_Feedback_Temp = rtDW.Eva_F; /* : Comp_Target_Temp = Target_Front; */ rtB.Comp_Target_Temp = *g_assEVA_TG_AMB_F_n; } } else if (rtDW.FRONT_Start_request) { /* : elseif FRONT_Start_request == 1 */ /* : Comp_Feedback_Temp = Eva_F; */ rtB.Comp_Feedback_Temp = rtDW.Eva_F; /* : Comp_Target_Temp = Target_Front; */ rtB.Comp_Target_Temp = *g_assEVA_TG_AMB_F_n; } else if (rtDW.REAR_Start_request) { /* : elseif REAR_Start_request == 1 */ /* : Comp_Feedback_Temp = Eva_R; */ rtB.Comp_Feedback_Temp = rtDW.Eva_R; /* : Comp_Target_Temp = Target_Rear; */ rtB.Comp_Target_Temp = *g_assEVA_TG_AMB_R_h; } else { /* : else */ /* : Comp_Feedback_Temp = Eva_F; */ rtB.Comp_Feedback_Temp = rtDW.Eva_F; /* : Comp_Target_Temp = Target_Front; */ rtB.Comp_Target_Temp = *g_assEVA_TG_AMB_F_n; } /* : if Comp_Feedback_Temp == Eva_R */ if ((rtB.Comp_Feedback_Temp == rtDW.Eva_R) && (rtDW.CCU_SET_RL < 200)) { /* : if Rear_set_temp < 200 */ /* : Comp_Target_Temp = int16(30); */ rtB.Comp_Target_Temp = 30; } /* : if Chiller_Start_request == 1 && FRONT_Start_request == 0 && REAR_Start_request == 0 */ tmp_2 = (rtDW.Chiller_Start_request && tmp && tmp_0); if (tmp_2) { /* : Chiller_Only_Flag = 1; */ rtB.Chiller_Only_Flag = 1.0; } else { /* : else */ /* : Chiller_Only_Flag = 0; */ rtB.Chiller_Only_Flag = 0.0; } /* : if FRONT_Start_request == 1 && REAR_Start_request == 1 */ if (tmp_1) { /* : if Eva_R < Eva_F */ if (rtDW.Eva_R < rtDW.Eva_F) { /* : Eva_Ctrl = 5; */ rtB.Eva_Ctrl = 5U; } else { /* : else */ /* : Eva_Ctrl = 4; */ rtB.Eva_Ctrl = 4U; } } else if (rtDW.FRONT_Start_request && tmp_0) { /* : elseif FRONT_Start_request == 1 && REAR_Start_request == 0 */ /* : Eva_Ctrl = 2; */ rtB.Eva_Ctrl = 2U; } else if (tmp && rtDW.REAR_Start_request) { /* : elseif FRONT_Start_request == 0 && REAR_Start_request == 1 */ /* : Eva_Ctrl = 3; */ rtB.Eva_Ctrl = 3U; } else if (tmp_2) { /* : elseif Chiller_Start_request == 1 && FRONT_Start_request == 0 && REAR_Start_request == 0 */ /* : Eva_Ctrl = 1; */ rtB.Eva_Ctrl = 1U; } else { /* : else */ /* : Eva_Ctrl = 0; */ rtB.Eva_Ctrl = 0U; } } } } /* * Function for Chart: '/Chart' * function idx = find_index(delta) */ static double find_index(int16_t delta) { double idx; int32_t i; /* : idx = 1; */ idx = 1.0; /* : for i = 1:7 */ i = 0; while ((i < 7) && (delta >= g_assPREC_EVA_DIFF_FB_TG_F[i])) { /* : if delta >= g_assPREC_EVA_DIFF_FB_TG_F(i) */ /* : idx = i; */ idx = (double)i + 1.0; i++; } /* : else */ return idx; } /* Model step function */ void HVAC_model_step(void) { double rtb_Divide1_e[9]; double rtb_f_lower_upper_bounds[2]; double Blower_AF_FL; double Blower_AF_FR; double rtb_Divide1; double rtb_Divide10; double rtb_Divide11; double rtb_Divide1_cf; double rtb_Divide1_ea; double rtb_Divide1_l5; double rtb_Divide3; double rtb_Divide3_hk; double rtb_Divide8; double rtb_u8Vtg_FX_plus; int64_t rtb_IntegralGain; int64_t rtb_SumI2_b; int64_t rtb_SumI2_c; int64_t rtb_SumI2_e; int64_t rtb_SumI2_je; int64_t rtb_SumI2_o; int32_t i; int32_t i_0; int32_t rpm_phys; int32_t rtb_Gain2; int32_t rtb_Gain3; int32_t rtb_Gain4; int32_t rtb_Gain5; int32_t rtb_Gain_pl; int32_t rtb_Switch_fs; uint32_t rtb_Gain_fc_tmp_tmp; uint32_t rtb_Gain_fc_tmp_tmp_0; uint32_t rtb_Subtract; uint32_t rtb_dt_an; int16_t Vtg_RLU[78]; int16_t tmp[42]; int16_t tmp_0[42]; int16_t rtb_MultiportSwitch1[7]; int16_t rtb_uDLookupTable7_g[7]; int16_t tmp_3[6]; int16_t Duct_FRL_Tg_DBG[5]; int16_t Duct_FRU_Tg_DBG[5]; int16_t rtb_VectorConcatenate_bp[5]; int16_t rtb_VectorConcatenate_j[5]; int16_t rtb_VectorConcatenate_jn[5]; int16_t rtb_VectorConcatenate_lo[5]; int16_t rtb_VectorConcatenate_bl[3]; int16_t rtb_VectorConcatenate_e0[3]; int16_t rtb_VectorConcatenate_km[3]; int16_t rtb_VectorConcatenate_lg[3]; int16_t rtb_out_mt[2]; int16_t Duct3_R; int16_t Duct4_R; int16_t g_assEVA_TG_AMB_F_n; int16_t g_assEVA_TG_AMB_R_h; int16_t rtb_Bias1_h; int16_t rtb_Bias2; int16_t rtb_Bias3; int16_t rtb_Bias4; int16_t rtb_Bias5; int16_t rtb_Bias_ct; int16_t rtb_FLU_tg_correct; int16_t rtb_FLU_tg_correct_b; int16_t rtb_FLU_tg_correct_de; int16_t rtb_FLU_tg_correct_g; int16_t rtb_MultiportSwitch1_h; int16_t rtb_MultiportSwitch_ae; int16_t rtb_MultiportSwitch_o; int16_t rtb_Selector_p; int16_t rtb_u5FLU_tg_incar; int16_t rtb_u5FLU_tg_incar_l; int16_t rtb_u6FLU_tg_amb; int16_t rtb_u6FLU_tg_amb_hq; int16_t rtb_y_ar; int16_t rtb_y_bf; int16_t rtb_y_ck; int16_t rtb_y_fe; int16_t rtb_y_h5; int16_t rtb_y_lg; uint16_t tmp_1[45]; uint16_t tmp_2[42]; uint16_t rtb_out_c[9]; uint16_t rtb_out_dwb[9]; uint16_t rtb_out_f1[9]; uint16_t rtb_out_ff[9]; uint16_t rtb_out_fl[9]; uint16_t rtb_out_fw[9]; uint16_t rtb_get_mode[7]; uint16_t rtb_Gain1_nj[6]; uint16_t rtb_TmpSignalConversionAt1DLookupTable7Inport1[6]; uint16_t rtb_out_g4[2]; uint16_t Gain; uint16_t Gain1; uint16_t rtb_out_aq0; uint16_t rtb_out_ddc; uint16_t rtb_out_e5; uint16_t rtb_out_eu; uint16_t rtb_out_p4; int8_t rtb_y_b2; int8_t tmp_4; uint8_t rtb_get_modes_for_levels[78]; uint8_t Actuator_pos_percent_Ch1[9]; uint8_t rtb_DataTypeConversion_bh[9]; uint8_t rtb_DataTypeConversion_bq[9]; uint8_t rtb_DataTypeConversion_fb[9]; uint8_t rtb_DataTypeConversion2_ie[6]; uint8_t Blower_AF_RL; uint8_t Comp_Max_RPM_Allowed; uint8_t EN_BATTChiller; uint8_t ShutOffRear_EN; uint8_t Valve_2_way; uint8_t rtb_Merge_g; uint8_t rtb_Merge_hu; uint8_t rtb_Merge_j; uint8_t rtb_Merge_m2; uint8_t rtb_Saturation4_l; uint8_t rtb_Saturation9; uint8_t rtb_Switch3_ed; uint8_t rtb_Switch_gs; uint8_t rtb_Switch_m5; uint8_t rtb_timer_out; uint8_t rtb_u_gnq; bool rtb_LogicalOperator3_i5[9]; bool rtb_Compare_le[8]; bool rtb_LogicalOperator3_n1[6]; bool Enable_Comp_PID; bool eComp_stop; bool guard1; bool guard2; bool guard3; bool guard4; bool rtb_Compare; bool rtb_Compare_ah; bool rtb_Compare_au; bool rtb_Compare_b; bool rtb_Compare_bu; bool rtb_Compare_ck; bool rtb_Compare_dd; bool rtb_Compare_dq; bool rtb_Compare_e; bool rtb_Compare_e3; bool rtb_Compare_em; bool rtb_Compare_eu; bool rtb_Compare_fr; bool rtb_Compare_g4; bool rtb_Compare_gl; bool rtb_Compare_gs; bool rtb_Compare_h2; bool rtb_Compare_i; bool rtb_Compare_i5; bool rtb_Compare_j; bool rtb_Compare_jt; bool rtb_Compare_kmz; bool rtb_Compare_kt; bool rtb_Compare_l; bool rtb_Compare_lb; bool rtb_Compare_m; bool rtb_Compare_n2; bool rtb_Compare_nq; bool rtb_Compare_ofn; bool rtb_Compare_p; bool rtb_Compare_p1p; bool rtb_FailCond; bool rtb_FailCond_fn; bool rtb_FailCond_gk; bool rtb_FailCond_h; bool rtb_FailCond_lt; bool rtb_LogicalOperator1; bool rtb_LogicalOperator10; bool rtb_LogicalOperator11; bool rtb_LogicalOperator1_f; bool rtb_LogicalOperator1_f1; bool rtb_LogicalOperator1_m2; bool rtb_LogicalOperator1_n; bool rtb_LogicalOperator3; bool rtb_LogicalOperator3_nz; bool rtb_LogicalOperator3_p5; bool rtb_LogicalOperator4_fo; bool rtb_LogicalOperator5; bool rtb_LogicalOperator6; bool rtb_LogicalOperator8; /* Gain: '/Gain' incorporates: * DataStoreRead: '/Data Store Read' */ Gain = (uint16_t)(10U * rtDW.PWM_front); /* Gain: '/Gain1' incorporates: * DataStoreRead: '/Data Store Read47' */ Gain1 = (uint16_t)(10U * rtDW.PWM_rear); /* Product: '/Divide1' incorporates: * Constant: '/Constant' * Constant: '/Constant1' * DataStoreRead: '/Data Store Read1' * Product: '/Divide' */ rtb_Divide1 = (double)rtDW.ADC_Data_Model.Sensor_AC_Pressure / 4095.0 * 5.0; /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' */ rtb_Compare = (rtb_Divide1 < 0.1); /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' */ rtb_Compare_ah = (rtb_Divide1 > 4.9); /* Logic: '/Logical Operator' */ rtb_FailCond = (rtb_Compare || rtb_Compare_ah); /* Logic: '/Logical Operator1' incorporates: * Constant: '/Constant' * DataStoreRead: '/Data Store Read4' * RelationalOperator: '/Compare' * Sum: '/Subtract' * UnitDelay: '/t_start_delay_private ' */ rtb_LogicalOperator1 = (rtb_FailCond && (rtDW.t_now - rtDW.t_start_delay_private_DSTATE >= 3000U)); /* Product: '/Divide1' incorporates: * Constant: '/Constant' * Constant: '/Constant1' * DataStoreRead: '/Data Store Read1' * Product: '/Divide' */ rtb_Divide1_cf = (double)rtDW.ADC_Data_Model.Sensor_Evap_Temp / 4095.0 * 5.0; /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' */ rtb_Compare_eu = (rtb_Divide1_cf < 0.1); /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' */ rtb_Compare_e3 = (rtb_Divide1_cf > 4.9); /* Logic: '/Logical Operator' */ rtb_FailCond_fn = (rtb_Compare_eu || rtb_Compare_e3); /* Logic: '/Logical Operator1' incorporates: * Constant: '/Constant' * DataStoreRead: '/Data Store Read4' * RelationalOperator: '/Compare' * Sum: '/Subtract' * UnitDelay: '/t_start_delay_private ' */ rtb_LogicalOperator1_f1 = (rtb_FailCond_fn && (rtDW.t_now - rtDW.t_start_delay_private_DSTATE_g >= 3000U)); /* Product: '/Divide1' incorporates: * Constant: '/Constant' * Constant: '/Constant1' * DataStoreRead: '/Data Store Read1' * Product: '/Divide' */ rtb_Divide1_ea = (double)rtDW.ADC_Data_Model.Sensor_Rear_Evap_Temp / 4095.0 * 5.0; /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' */ rtb_Compare_fr = (rtb_Divide1_ea < 0.1); /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' */ rtb_Compare_b = (rtb_Divide1_ea > 4.9); /* Logic: '/Logical Operator' */ rtb_FailCond_gk = (rtb_Compare_fr || rtb_Compare_b); /* Logic: '/Logical Operator1' incorporates: * Constant: '/Constant' * DataStoreRead: '/Data Store Read4' * RelationalOperator: '/Compare' * Sum: '/Subtract' * UnitDelay: '/t_start_delay_private ' */ rtb_LogicalOperator1_f = (rtb_FailCond_gk && (rtDW.t_now - rtDW.t_start_delay_private_DSTATE_c >= 3000U)); /* Lookup_n-D: '/g_assEVA_TG_AMB_F' incorporates: * DataStoreRead: '/Data Store Read45' */ g_assEVA_TG_AMB_F_n = look1_is16lu64n32Ds32_binlcs(rtDW.AMB, &g_assFAILURE_AMB_TEMP[0], &g_assEVA_TG_AMB_F[0], 12U); /* Lookup_n-D: '/g_assEVA_TG_AMB_R' incorporates: * DataStoreRead: '/Data Store Read45' */ g_assEVA_TG_AMB_R_h = look1_is16lu64n32Ds32_binlcs(rtDW.AMB, &g_assFAILURE_AMB_TEMP[0], &g_assEVA_TG_AMB_R[0], 12U); /* Chart: '/A//C Control' incorporates: * DataStoreRead: '/Data Store Read2' * DataStoreRead: '/Data Store Read37' * DataStoreRead: '/Data Store Read44' * DataStoreRead: '/Data Store Read45' * DataStoreRead: '/Data Store Read50' * DataStoreRead: '/Data Store Read51' * DataStoreRead: '/Data Store Read52' * DataStoreRead: '/Data Store Read53' * DataStoreRead: '/Data Store Read58' * DataStoreRead: '/Data Store Read59' * DataTypeConversion: '/Data Type Conversion' * DataTypeConversion: '/Data Type Conversion3' * DataTypeConversion: '/Data Type Conversion' * DataTypeConversion: '/Data Type Conversion' * DataTypeConversion: '/Data Type Conversion' * Gain: '/Gain2' * Gain: '/Gain3' * Lookup_n-D: '/1-D Lookup Table' * Lookup_n-D: '/1-D Lookup Table1' */ if (rtDW.is_active_c621_HVAC_model == 0U) { rtDW.is_active_c621_HVAC_model = 1U; rtDW.is_PRESSURE_MONITOR = IN_PRESSURE_OK; /* : Pressure_Condition_table_OK = true; */ rtDW.Pressure_Condition_table_OK = true; /* : Pressure_Hi_Fault = false; */ rtDW.Pressure_Hi_Fault = false; rtDW.is_FRONT_CONTOUR = IN_Front_A_C_OFF; /* : FRONT_Start_request = false; */ rtDW.FRONT_Start_request = false; rtDW.is_REAR_CONTOUR = IN_Rear_A_C_OFF; /* : REAR_Start_request = false; */ rtDW.REAR_Start_request = false; rtDW.is_CHILLER_CONTOUR = IN_Chiller_OFF; /* : Chiller_Start_request = false; */ rtDW.Chiller_Start_request = false; rtDW.is_E_COMP_MANAGER = IN_COMP_OFF; /* : Enable_Comp_PID = false; */ Enable_Comp_PID = false; /* : Chiller_Only_Flag = 0; */ rtB.Chiller_Only_Flag = 0.0; /* : Comp_Feedback_Temp = 0; */ rtB.Comp_Feedback_Temp = 0; /* : FRONT_eTXV = true; */ rtB.FRONT_eTXV = true; /* : REAR_eTXV = true; */ rtB.REAR_eTXV = true; /* : Chiller_eTXV = true; */ rtB.Chiller_eTXV = true; /* : Eva_Ctrl = 0; */ rtB.Eva_Ctrl = 0U; rtDW.is_COMP_PROTECTION = IN_PROT_LEVEL_0; /* BusCreator: '/Bus Creator' incorporates: * DataStoreWrite: '/Data Store Write' */ /* : Logic_Ac_Comp_Protection_Level = 0; */ rtDW.dbg_Logic_Ac_model.Logic_Ac_Comp_Protection_Level = 0U; /* : Comp_Max_RPM_Allowed = 170; */ Comp_Max_RPM_Allowed = 170U; /* : Evap_Target_Offset = 0; */ g_assEVA_TG_AMB_F_n = 0; } else { switch (rtDW.is_PRESSURE_MONITOR) { case IN_FAULT_HIGH_PRESS: /* Switch: '/Switch' incorporates: * Constant: '/Constant3' * Constant: '/Constant4' * DataStoreRead: '/Data Store Read45' */ /* : sf_internal_predicateOutput = Pressure_sen < P_Hi_CutOff; */ if (rtDW.AMB > 400) { rtb_FLU_tg_correct_g = g_assAC_PRESSURE_HYS_HI_ENG_ON[0]; } else { rtb_FLU_tg_correct_g = g_assAC_PRESSURE_HYS_HI_ENG_ON[2]; } /* Gain: '/Gain2' incorporates: * Switch: '/Switch' */ i = 15857 * rtb_FLU_tg_correct_g; if (rtDW.Pressure < ((((uint32_t)i & 8192U) != 0U) && ((((uint32_t)i & 8191U) != 0U) || (i > 0))) + (i >> 14)) { rtDW.is_PRESSURE_MONITOR = IN_PRESSURE_OK; /* : Pressure_Condition_table_OK = true; */ rtDW.Pressure_Condition_table_OK = true; /* : Pressure_Hi_Fault = false; */ rtDW.Pressure_Hi_Fault = false; } break; case IN_FAULT_LOW_PRESS: /* : sf_internal_predicateOutput = Pressure_sen > P_threshold_UP; */ if (rtDW.Pressure > look1_is16lu64n32Ds32_binlcs(rtDW.AMB, &g_assFAILURE_AMB_TEMP[0], &g_assAC_PRESSURE_LOW_HYS_UP[0], 12U)) { rtDW.is_PRESSURE_MONITOR = IN_PRESSURE_OK; /* : Pressure_Condition_table_OK = true; */ rtDW.Pressure_Condition_table_OK = true; /* : Pressure_Hi_Fault = false; */ rtDW.Pressure_Hi_Fault = false; } break; default: /* case IN_PRESSURE_OK: */ /* : sf_internal_predicateOutput = Pressure_sen < P_threshold_DN; */ if (rtDW.Pressure < look1_is16lu64n32Ds32_binlcs(rtDW.AMB, &g_assFAILURE_AMB_TEMP[0], &g_assAC_PRESSURE_LOW_HYS_DN[0], 12U)) { rtDW.is_PRESSURE_MONITOR = IN_FAULT_LOW_PRESS; /* : Pressure_Condition_table_OK = false; */ rtDW.Pressure_Condition_table_OK = false; } else { /* Gain: '/Gain3' incorporates: * Constant: '/Constant5' */ /* : sf_internal_predicateOutput = Pressure_sen > P_Hi_Return; */ i = 15857 * g_assAC_PRESSURE_HYS_HI_ENG_ON[1]; if (rtDW.Pressure > ((((uint32_t)i & 8192U) != 0U) && ((((uint32_t)i & 8191U) != 0U) || (i > 0))) + (i >> 14)) { rtDW.is_PRESSURE_MONITOR = IN_FAULT_HIGH_PRESS; /* : Pressure_Hi_Fault = true; */ rtDW.Pressure_Hi_Fault = true; } } break; } if (rtDW.is_FRONT_CONTOUR == IN_Front_A_C_OFF) { /* : sf_internal_predicateOutput = AC_Req_MMS == 1 && pwm_front>= (g_ausMIN_PWM(1)-1) && Error_PressSen == 0 && Error_Eva_F == 0 && Eva_F > 0 && amb_temp>g_assAC_CUT_OFF_AMB_F(1) && Pressure_Condition_table_OK == 1; */ rtb_Subtract = g_ausMIN_PWM[0] - 1U; if (g_ausMIN_PWM[0] - 1U > g_ausMIN_PWM[0]) { rtb_Subtract = 0U; } if ((rtDW.CCU_AC_FRONT != 0) && ((Gain >= (int32_t)rtb_Subtract) && ((!rtb_LogicalOperator1) && (!rtb_LogicalOperator1_f1) && (rtDW.Eva_F > 0) && ((rtDW.AMB > g_assAC_CUT_OFF_AMB_F[0]) && rtDW.Pressure_Condition_table_OK)))) { rtDW.is_FRONT_CONTOUR = IN_Front_A_C_ON; /* : FRONT_Start_request = true; */ rtDW.FRONT_Start_request = true; } } else { /* case IN_Front_A_C_ON: */ /* : sf_internal_predicateOutput = AC_Req_MMS == 0 || pwm_front < (g_ausMIN_PWM(1)-1) || Error_PressSen == 1 || Error_Eva_F == 1 || Eva_F <= 0 || amb_temp<=g_assAC_CUT_OFF_AMB_F(1) || Pressure_Condition_table_OK == 0; */ rtb_Subtract = g_ausMIN_PWM[0] - 1U; if (g_ausMIN_PWM[0] - 1U > g_ausMIN_PWM[0]) { rtb_Subtract = 0U; } if ((rtDW.CCU_AC_FRONT == 0) || ((Gain < (int32_t)rtb_Subtract) || (rtb_LogicalOperator1 || rtb_LogicalOperator1_f1 || (rtDW.Eva_F <= 0) || ((rtDW.AMB <= g_assAC_CUT_OFF_AMB_F[0]) || ((rtDW.AMB > g_assAC_CUT_OFF_AMB_F[0]) && (!rtDW.Pressure_Condition_table_OK)))))) { rtDW.is_FRONT_CONTOUR = IN_Front_A_C_OFF; /* : FRONT_Start_request = false; */ rtDW.FRONT_Start_request = false; } } if (rtDW.is_REAR_CONTOUR == IN_Rear_A_C_OFF) { /* : sf_internal_predicateOutput = AC_Req_MMS_Rear == 1 && pwm_rear >= (g_ausMIN_PWM(2)-1) && Error_PressSen == 0 && Error_Eva_R == 0 && Eva_R > 0 && amb_temp>g_assAC_CUT_OFF_AMB_F(2) && Pressure_Condition_table_OK == 1; */ rtb_Subtract = g_ausMIN_PWM[1] - 1U; if (g_ausMIN_PWM[1] - 1U > g_ausMIN_PWM[1]) { rtb_Subtract = 0U; } if ((rtDW.CCU_AC_REAR != 0) && ((Gain1 >= (int32_t)rtb_Subtract) && ((!rtb_LogicalOperator1) && (!rtb_LogicalOperator1_f) && (rtDW.Eva_R > 0) && ((rtDW.AMB > g_assAC_CUT_OFF_AMB_F[1]) && rtDW.Pressure_Condition_table_OK)))) { rtDW.is_REAR_CONTOUR = IN_Rear_A_C_ON; /* : REAR_Start_request = true; */ rtDW.REAR_Start_request = true; } } else { /* case IN_Rear_A_C_ON: */ /* : sf_internal_predicateOutput = [AC_Req_MMS_Rear == 0 || pwm_rear < (g_ausMIN_PWM(2)-1) || Error_PressSen == 1 || Error_Eva_R == 1 || Eva_R <= 0 || amb_temp<=g_assAC_CUT_OFF_AMB_F(2) || Pressure_Condition_table_OK == 0]; */ rtb_Subtract = g_ausMIN_PWM[1] - 1U; if (g_ausMIN_PWM[1] - 1U > g_ausMIN_PWM[1]) { rtb_Subtract = 0U; } if ((rtDW.CCU_AC_REAR == 0) || ((Gain1 < (int32_t)rtb_Subtract) || (rtb_LogicalOperator1 || rtb_LogicalOperator1_f || (rtDW.Eva_R <= 0) || ((rtDW.AMB <= g_assAC_CUT_OFF_AMB_F[1]) || ((rtDW.AMB > g_assAC_CUT_OFF_AMB_F[1]) && (!rtDW.Pressure_Condition_table_OK)))))) { rtDW.is_REAR_CONTOUR = IN_Rear_A_C_OFF; /* : REAR_Start_request = false; */ rtDW.REAR_Start_request = false; } } if (rtDW.is_CHILLER_CONTOUR == IN_Chiller_OFF) { /* : sf_internal_predicateOutput = eCompChiller_Req==1 && Pressure_Condition_table_OK == 1 && Error_PressSen == 0 && BCM_T15_Stat==1; */ if ((rtDW.eCompChiller_Req == 1) && rtDW.Pressure_Condition_table_OK && (!rtb_LogicalOperator1) && (rtDW.BCM_T15_Stat == 1)) { rtDW.is_CHILLER_CONTOUR = IN_Chiller_ON; /* : Chiller_Start_request = true; */ rtDW.Chiller_Start_request = true; } /* case IN_Chiller_ON: */ /* : sf_internal_predicateOutput = eCompChiller_Req==0 || Pressure_Condition_table_OK == 0 || Error_PressSen == 1; */ } else if ((rtDW.eCompChiller_Req == 0) || (!rtDW.Pressure_Condition_table_OK) || rtb_LogicalOperator1) { rtDW.is_CHILLER_CONTOUR = IN_Chiller_OFF; /* : Chiller_Start_request = false; */ rtDW.Chiller_Start_request = false; } E_COMP_MANAGER(&Enable_Comp_PID, &g_assEVA_TG_AMB_F_n, &g_assEVA_TG_AMB_R_h); switch (rtDW.is_COMP_PROTECTION) { case IN_PROT_LEVEL_0: /* BusCreator: '/Bus Creator' incorporates: * DataStoreWrite: '/Data Store Write' */ rtDW.dbg_Logic_Ac_model.Logic_Ac_Comp_Protection_Level = 0U; Comp_Max_RPM_Allowed = 170U; g_assEVA_TG_AMB_F_n = 0; /* : sf_internal_predicateOutput = HVC_CompInputC_Val >= 160 || HVC_CompInvTemp_Val >= 1100; */ if ((rtDW.eComp_InputC >= 40960) || (rtDW.eComp_Temp >= 1100)) { rtDW.is_COMP_PROTECTION = IN_PROT_LEVEL_1; /* BusCreator: '/Bus Creator' incorporates: * DataStoreWrite: '/Data Store Write' */ /* : Logic_Ac_Comp_Protection_Level = 1; */ rtDW.dbg_Logic_Ac_model.Logic_Ac_Comp_Protection_Level = 1U; /* : Comp_Max_RPM_Allowed = 140; */ Comp_Max_RPM_Allowed = 140U; /* : Evap_Target_Offset = 10; */ g_assEVA_TG_AMB_F_n = 10; } break; case IN_PROT_LEVEL_1: /* BusCreator: '/Bus Creator' incorporates: * DataStoreWrite: '/Data Store Write' */ rtDW.dbg_Logic_Ac_model.Logic_Ac_Comp_Protection_Level = 1U; Comp_Max_RPM_Allowed = 140U; g_assEVA_TG_AMB_F_n = 10; /* : sf_internal_predicateOutput = HVC_CompInputC_Val < 155 && HVC_CompInvTemp_Val < 1090; */ if ((rtDW.eComp_InputC < 39680) && (rtDW.eComp_Temp < 1090)) { rtDW.is_COMP_PROTECTION = IN_PROT_LEVEL_0; /* BusCreator: '/Bus Creator' incorporates: * DataStoreWrite: '/Data Store Write' */ /* : Logic_Ac_Comp_Protection_Level = 0; */ rtDW.dbg_Logic_Ac_model.Logic_Ac_Comp_Protection_Level = 0U; /* : Comp_Max_RPM_Allowed = 170; */ Comp_Max_RPM_Allowed = 170U; /* : Evap_Target_Offset = 0; */ g_assEVA_TG_AMB_F_n = 0; /* : sf_internal_predicateOutput = HVC_CompInputC_Val >= 180 || HVC_CompInvTemp_Val >= 1200; */ } else if ((rtDW.eComp_InputC >= 46080) || (rtDW.eComp_Temp >= 1200)) { rtDW.is_COMP_PROTECTION = IN_PROT_LEVEL_2; /* BusCreator: '/Bus Creator' incorporates: * DataStoreWrite: '/Data Store Write' */ /* : Logic_Ac_Comp_Protection_Level = 2; */ rtDW.dbg_Logic_Ac_model.Logic_Ac_Comp_Protection_Level = 2U; /* : Comp_Max_RPM_Allowed = 120; */ Comp_Max_RPM_Allowed = 120U; /* : Evap_Target_Offset = 20; */ g_assEVA_TG_AMB_F_n = 20; } break; default: /* BusCreator: '/Bus Creator' incorporates: * DataStoreWrite: '/Data Store Write' */ /* case IN_PROT_LEVEL_2: */ rtDW.dbg_Logic_Ac_model.Logic_Ac_Comp_Protection_Level = 2U; Comp_Max_RPM_Allowed = 120U; g_assEVA_TG_AMB_F_n = 20; /* : sf_internal_predicateOutput = HVC_CompInputC_Val < 175 && HVC_CompInvTemp_Val < 1190; */ if ((rtDW.eComp_InputC < 44800) && (rtDW.eComp_Temp < 1190)) { rtDW.is_COMP_PROTECTION = IN_PROT_LEVEL_1; /* BusCreator: '/Bus Creator' incorporates: * DataStoreWrite: '/Data Store Write' */ /* : Logic_Ac_Comp_Protection_Level = 1; */ rtDW.dbg_Logic_Ac_model.Logic_Ac_Comp_Protection_Level = 1U; /* : Comp_Max_RPM_Allowed = 140; */ Comp_Max_RPM_Allowed = 140U; /* : Evap_Target_Offset = 10; */ g_assEVA_TG_AMB_F_n = 10; } break; } } /* End of Chart: '/A//C Control' */ /* DataTypeConversion: '/Data Type Conversion6' incorporates: * DataStoreWrite: '/Data Store Write11' */ EN_BATTChiller = rtB.Chiller_eTXV; /* MATLAB Function: '/MATLAB Function1' incorporates: * DataStoreRead: '/Data Store Read' * MATLAB Function: '/MATLAB Function' */ /* : if isempty(t_start) */ if (!rtDW.t_start_not_empty) { /* : t_start = t_now; */ rtDW.t_start = rtDW.t_now; rtDW.t_start_not_empty = true; /* : is_running = uint8(0); */ } /* : if Enable_Comp_PID == 0 */ rtb_LogicalOperator1_n = !Enable_Comp_PID; if (rtb_LogicalOperator1_n) { /* : t_start = t_now; */ rtDW.t_start = rtDW.t_now; /* : is_running = uint8(0); */ rtDW.is_running = 0U; /* : timer_out = uint8(0); */ rtb_timer_out = 0U; } else { /* : else */ /* : if is_running == 0 */ if (rtDW.is_running == 0) { /* : t_start = t_now; */ rtDW.t_start = rtDW.t_now; /* : is_running = uint8(1); */ rtDW.is_running = 1U; } /* : if (t_now - t_start) >= 60000.0 */ rtb_Subtract = rtDW.t_now - /*MW:OvSatOk*/ rtDW.t_start; if (rtb_Subtract > rtDW.t_now) { rtb_Subtract = 0U; } if (rtb_Subtract >= 60000U) { /* : timer_out = uint8(1); */ rtb_timer_out = 1U; } else { /* : else */ /* : timer_out = uint8(0); */ rtb_timer_out = 0U; } } /* End of MATLAB Function: '/MATLAB Function1' */ /* Switch: '/Switch2' incorporates: * Constant: '/Constant' * DataStoreRead: '/Data Store Read32' * Gain: '/Gain2' * RelationalOperator: '/Compare' */ if (rtDW.Engine_speed > 500.0) { /* Switch: '/Switch' incorporates: * Constant: '/Constant1' */ if (rtb_timer_out <= 0) { Comp_Max_RPM_Allowed = 120U; } /* End of Switch: '/Switch' */ } else { /* Gain: '/Gain2' incorporates: * Constant: '/Constant4' */ rtb_Subtract = 41943U * g_usCMP_MAX_ENG_OFF; Comp_Max_RPM_Allowed = (uint8_t)((uint32_t)((rtb_Subtract & 1048576U) != 0U) + (rtb_Subtract >> 21)); } /* End of Switch: '/Switch2' */ /* Sum: '/Sum' incorporates: * DataStoreWrite: '/Data Store Write14' */ g_assEVA_TG_AMB_F_n += rtB.Comp_Target_Temp; /* Sum: '/Sum' incorporates: * DataStoreWrite: '/Data Store Write14' */ rtb_Selector_p = (int16_t)(g_assEVA_TG_AMB_F_n - rtB.Comp_Feedback_Temp); /* DiscreteIntegrator: '/Integrator' */ if (Enable_Comp_PID || (rtDW.Integrator_PrevResetState != 0)) { rtDW.Integrator_DSTATE_l = 0; } /* Sum: '/Sum' incorporates: * DiscreteIntegrator: '/Integrator' * Gain: '/Proportional Gain' */ rtb_SumI2_e = (((int64_t)(-2 * rtb_Selector_p) << 16) + rtDW.Integrator_DSTATE_l) >> 16; if (rtb_SumI2_e < 0LL) { rtb_SumI2_e = 0LL; } else if (rtb_SumI2_e > 255LL) { rtb_SumI2_e = 255LL; } /* Switch: '/Switch3' incorporates: * Constant: '/Constant3' * Constant: '/Constant5' */ if (Enable_Comp_PID) { rtb_Switch3_ed = 16U; } else { rtb_Switch3_ed = 0U; } /* End of Switch: '/Switch3' */ /* Switch: '/Switch2' incorporates: * RelationalOperator: '/LowerRelop1' * RelationalOperator: '/UpperRelop' * Sum: '/Sum' * Switch: '/Switch' */ if ((uint8_t)rtb_SumI2_e > Comp_Max_RPM_Allowed) { rtb_timer_out = Comp_Max_RPM_Allowed; } else if ((uint8_t)rtb_SumI2_e < rtb_Switch3_ed) { /* Switch: '/Switch' */ rtb_timer_out = rtb_Switch3_ed; } else { rtb_timer_out = (uint8_t)rtb_SumI2_e; } /* End of Switch: '/Switch2' */ /* RateLimiter: '/Rate Limiter' */ i = rtb_timer_out - rtDW.PrevY; if (i > 2) { rtb_timer_out = (uint8_t)(rtDW.PrevY + 2); } else if (i < -2) { rtb_timer_out = (uint8_t)(rtDW.PrevY - 2); } rtDW.PrevY = rtb_timer_out; /* End of RateLimiter: '/Rate Limiter' */ /* Switch: '/Switch1' incorporates: * Constant: '/Constant' */ if (rtB.Chiller_Only_Flag > 0.0) { rtb_timer_out = g_ucAC_EXTRA_RPM; } /* End of Switch: '/Switch1' */ /* Gain: '/Gain1' incorporates: * Constant: '/Constant2' */ for (i = 0; i < 6; i++) { rtb_Gain1_nj[i] = (uint16_t)((41943U * g_ausCMP_RPM_RESONANCE[i]) >> 21); } /* End of Gain: '/Gain1' */ /* MATLAB Function: '/MATLAB Function' */ /* : rpm_phys = double(rpm_in); */ rpm_phys = rtb_timer_out; /* : low1 = double(res_cal(1)); */ /* : high1 = double(res_cal(2)); */ /* : low2 = double(res_cal(3)); */ /* : high2 = double(res_cal(4)); */ /* : low3 = double(res_cal(5)); */ /* : high3 = double(res_cal(6)); */ /* : if (rpm_phys >= low1) && (rpm_phys <= high1) */ if ((rtb_timer_out >= rtb_Gain1_nj[0]) && (rtb_timer_out <= rtb_Gain1_nj[1])) { /* : if (rpm_phys - low1) < (high1 - rpm_phys) */ if (rtb_timer_out - rtb_Gain1_nj[0] < rtb_Gain1_nj[1] - rtb_timer_out) { /* : rpm_phys = low1; */ rpm_phys = rtb_Gain1_nj[0]; } else { /* : else */ /* : rpm_phys = high1; */ rpm_phys = rtb_Gain1_nj[1]; } } /* : if (rpm_phys >= low2) && (rpm_phys <= high2) */ if ((rpm_phys >= rtb_Gain1_nj[2]) && (rpm_phys <= rtb_Gain1_nj[3])) { /* : if (rpm_phys - low2) < (high2 - rpm_phys) */ if (rpm_phys - rtb_Gain1_nj[2] < rtb_Gain1_nj[3] - rpm_phys) { /* : rpm_phys = low2; */ rpm_phys = rtb_Gain1_nj[2]; } else { /* : else */ /* : rpm_phys = high2; */ rpm_phys = rtb_Gain1_nj[3]; } } /* : if (rpm_phys >= low3) && (rpm_phys <= high3) */ if ((rpm_phys >= rtb_Gain1_nj[4]) && (rpm_phys <= rtb_Gain1_nj[5])) { /* : if (rpm_phys - low3) < (high3 - rpm_phys) */ if (rpm_phys - rtb_Gain1_nj[4] < rtb_Gain1_nj[5] - rpm_phys) { /* : rpm_phys = low3; */ rpm_phys = rtb_Gain1_nj[4]; } else { /* : else */ /* : rpm_phys = high3; */ rpm_phys = rtb_Gain1_nj[5]; } } /* : rpm_can = uint8(rpm_phys); */ if (rpm_phys > 255) { rpm_phys = 255; } /* MATLAB Function: '/MATLAB Function' incorporates: * Constant: '/Constant1' * Constant: '/Constant6' * Constant: '/Constant' * DataStoreRead: '/Data Store Read31' * DataStoreRead: '/Data Store Read32' * DataStoreWrite: '/Data Store Write25' * DataTypeConversion: '/Data Type Conversion' * Lookup_n-D: '/Fan_Speed_By_Pressure' * RelationalOperator: '/Compare' */ /* : fan_speed_out = uint8(0); */ Valve_2_way = 0U; /* : comp_emergency_stop = false; */ eComp_stop = false; /* : if (comp_state ~= 1) */ if (!rtb_LogicalOperator1_n) { /* : if pressure_failed */ if (rtb_LogicalOperator1) { /* : fan_speed_out = uint8(100); */ Valve_2_way = 100U; /* : comp_emergency_stop = true; */ eComp_stop = true; /* : if pressure_val <= g_assPRESSURE_TO_FAN_X */ } else if (rtDW.Pressure > g_assPRESSURE_TO_FAN_X[0]) { /* : fan_speed_out = uint8(fan_speed_table); */ rtb_FLU_tg_correct_g = look1_is16lu64n32tu8Ds16Is16_binlcs(rtDW.Pressure, &g_assPRESSURE_TO_FAN_X[0], &g_aucPRESSURE_TO_FAN_Y[0], 6U); if (rtb_FLU_tg_correct_g < 0) { rtb_FLU_tg_correct_g = 0; } else if (rtb_FLU_tg_correct_g > 255) { rtb_FLU_tg_correct_g = 255; } Valve_2_way = (uint8_t)rtb_FLU_tg_correct_g; /* : if engine_on == false */ if ((rtDW.Engine_speed <= 500.0) && (rtb_FLU_tg_correct_g > g_ucFAN_MAX_ENG_OFF)) { /* : if(fan_speed_out>g_ucFAN_MAX_ENG_OFF) */ /* : fan_speed_out = uint8(g_ucFAN_MAX_ENG_OFF); */ Valve_2_way = g_ucFAN_MAX_ENG_OFF; } } else { /* : fan_speed_out = uint8(0); */ } } /* DataTypeConversion: '/Data Type Conversion1' incorporates: * DataStoreWrite: '/Data Store Write8' */ rtb_timer_out = rtB.FRONT_eTXV; /* DataTypeConversion: '/Data Type Conversion4' incorporates: * DataStoreWrite: '/Data Store Write9' */ ShutOffRear_EN = rtB.REAR_eTXV; /* Switch: '/Switch4' */ if (rtB.Chiller_Only_Flag > 0.0) { /* BusCreator: '/Bus Creator' incorporates: * Constant: '/Constant' * DataStoreWrite: '/Data Store Write' */ rtDW.dbg_Logic_Ac_model.Logic_Ac_Comp_LimitRpm_ro = g_ucAC_EXTRA_RPM; } else { /* BusCreator: '/Bus Creator' incorporates: * DataStoreWrite: '/Data Store Write' */ rtDW.dbg_Logic_Ac_model.Logic_Ac_Comp_LimitRpm_ro = Comp_Max_RPM_Allowed; } /* End of Switch: '/Switch4' */ /* Switch: '/Switch' incorporates: * RelationalOperator: '/u_GTE_up' * Sum: '/Sum' */ if ((uint8_t)rtb_SumI2_e < Comp_Max_RPM_Allowed) { /* Switch: '/Switch1' incorporates: * RelationalOperator: '/u_GT_lo' */ if ((uint8_t)rtb_SumI2_e > rtb_Switch3_ed) { Comp_Max_RPM_Allowed = (uint8_t)rtb_SumI2_e; } else { Comp_Max_RPM_Allowed = rtb_Switch3_ed; } /* End of Switch: '/Switch1' */ } /* End of Switch: '/Switch' */ /* Sum: '/Diff' incorporates: * Sum: '/Sum' */ Comp_Max_RPM_Allowed = (uint8_t)((uint8_t)rtb_SumI2_e - Comp_Max_RPM_Allowed); /* Switch: '/Switch1' incorporates: * Constant: '/Constant' * Constant: '/Constant2' * RelationalOperator: '/fix for DT propagation issue' */ if (Comp_Max_RPM_Allowed > 0) { rtb_y_b2 = 1; } else { rtb_y_b2 = -1; } /* End of Switch: '/Switch1' */ /* Gain: '/Integral Gain' incorporates: * Gain: '/Gain' */ rtb_Gain_pl = -26214 * rtb_Selector_p; /* Switch: '/Switch2' incorporates: * Constant: '/Constant3' * Constant: '/Constant4' * Gain: '/Gain' * RelationalOperator: '/fix for DT propagation issue1' */ if (rtb_Gain_pl > 0) { tmp_4 = 1; } else { tmp_4 = -1; } /* Switch: '/Switch' incorporates: * Constant: '/Constant1' * Gain: '/Gain' * Logic: '/AND3' * RelationalOperator: '/Equal1' * RelationalOperator: '/Relational Operator' * Switch: '/Switch2' */ if ((Comp_Max_RPM_Allowed != 0) && (rtb_y_b2 == tmp_4)) { rtb_Switch_fs = 0; } else { rtb_Switch_fs = rtb_Gain_pl; } /* End of Switch: '/Switch' */ /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' * DataStoreRead: '/Data Store Read12' */ rtb_LogicalOperator5 = (rtDW.CAN_LoHi_Front == 11); /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' * DataStoreRead: '/Data Store Read12' */ rtb_Compare_dq = (rtDW.CAN_LoHi_Front == 22); /* Chart: '/13,1,3,15 Valve control' incorporates: * DataStoreRead: '/Data Store Read11' * DataStoreRead: '/Data Store Read34' * DataStoreRead: '/Data Store Read35' * DataStoreRead: '/Data Store Read36' */ if (rtDW.is_active_c775_HVAC_model == 0U) { rtDW.is_active_c775_HVAC_model = 1U; rtDW.is_ThreeWay_Logic = IN_Wait_3W; /* : Cmd_3Way = 2; */ rtB.Cmd_3Way = 2U; /* : Cmd_FrontTemp = -1; */ /* : Cmd_RearTemp_3W = -1; */ rtDW.Cmd_RearTemp_3W = -1.0; rtDW.is_TwoWay_Logic = IN_Wait_2W; /* : Cmd_2Way = 1; */ rtB.Cmd_2Way = 1U; /* : Cmd_RearTemp_2W = -1; */ rtDW.Cmd_RearTemp_2W = -1.0; } else { switch (rtDW.is_ThreeWay_Logic) { case IN_Entry_3W: /* : sf_internal_predicateOutput = D_tg_RR > g_assTHREEWAY_DUCT_TGT_R(1) && LO_MODE_FULL == false && (t_now - t_start_1) > 60000 && LO_HI_MODE_RR ~= 2 && HI_MODE_FRONT ==false; */ rtb_dt_an = rtDW.t_now - /*MW:OvSatOk*/ rtDW.t_start_1; rtb_Subtract = rtb_dt_an; if (rtb_dt_an > rtDW.t_now) { rtb_Subtract = 0U; } rtb_LogicalOperator1_n = !rtb_Compare_dq; if ((rtDW.Duct_RR_Tg > g_assTHREEWAY_DUCT_TGT_R[0]) && (rtb_LogicalOperator1_n && (rtb_Subtract > 60000U) && (rtDW.LO_HI_MODE_RR != 2) && (!rtb_LogicalOperator5))) { rtDW.is_ThreeWay_Logic = IN_ExitSeq_3W; /* : Cmd_3Way = 1; */ rtB.Cmd_3Way = 1U; /* : Cmd_FrontTemp = 0; */ /* : Cmd_RearTemp_3W = 0; */ rtDW.Cmd_RearTemp_3W = 0.0; /* : t_start_2 = t_now; */ rtDW.t_start_2 = rtDW.t_now; } else { /* : sf_internal_predicateOutput = (D_tg_RR > g_assTHREEWAY_DUCT_TGT_R(1) && LO_MODE_FULL == false && ECT>g_ssTHREEWAY_WATER && (t_now - t_start_1) <= 60000) || (LO_HI_MODE_RR == 2 && HI_MODE_FRONT == true); */ if (rtDW.Duct_RR_Tg > g_assTHREEWAY_DUCT_TGT_R[0]) { if (rtb_dt_an > rtDW.t_now) { rtb_dt_an = 0U; } if (rtb_LogicalOperator1_n && (rtDW.ECT > g_ssTHREEWAY_WATER) && (rtb_dt_an <= 60000U)) { rtb_LogicalOperator5 = true; } else { rtb_LogicalOperator5 = ((rtDW.LO_HI_MODE_RR == 2) && rtb_LogicalOperator5); } } else { rtb_LogicalOperator5 = ((rtDW.LO_HI_MODE_RR == 2) && rtb_LogicalOperator5); } if (rtb_LogicalOperator5) { rtDW.is_ThreeWay_Logic = IN_Wait_3W; /* : Cmd_3Way = 2; */ rtB.Cmd_3Way = 2U; /* : Cmd_FrontTemp = -1; */ /* : Cmd_RearTemp_3W = -1; */ rtDW.Cmd_RearTemp_3W = -1.0; } } break; case IN_ExitSeq_3W: /* : sf_internal_predicateOutput = (t_now - t_start_2) >= 3000 || LO_HI_MODE_RR == 2; */ rtb_Subtract = rtDW.t_now - /*MW:OvSatOk*/ rtDW.t_start_2; if (rtb_Subtract > rtDW.t_now) { rtb_Subtract = 0U; } if ((rtb_Subtract >= 3000U) || (rtDW.LO_HI_MODE_RR == 2)) { /* : Cmd_FrontTemp = -1; */ /* : Cmd_RearTemp_3W = -1 */ rtDW.is_ThreeWay_Logic = IN_Wait_3W; /* : Cmd_3Way = 2; */ rtB.Cmd_3Way = 2U; /* : Cmd_FrontTemp = -1; */ /* : Cmd_RearTemp_3W = -1; */ rtDW.Cmd_RearTemp_3W = -1.0; } else { /* : Cmd_3Way = 1; */ rtB.Cmd_3Way = 1U; /* : Cmd_FrontTemp = 0; */ /* : Cmd_RearTemp_3W = 0; */ rtDW.Cmd_RearTemp_3W = 0.0; /* : t_start_2 = t_now; */ rtDW.t_start_2 = rtDW.t_now; } break; default: /* case IN_Wait_3W: */ /* : sf_internal_predicateOutput = (D_tg_RR <= g_assTHREEWAY_DUCT_TGT_R(2) || LO_MODE_FULL == true || ECT<=g_ssTHREEWAY_WATER)&& (LO_HI_MODE_RR ~= 2 || HI_MODE_FRONT ==false); */ if ((rtDW.Duct_RR_Tg <= g_assTHREEWAY_DUCT_TGT_R[1]) || (rtb_Compare_dq || (rtDW.ECT <= g_ssTHREEWAY_WATER))) { rtb_LogicalOperator5 = ((rtDW.LO_HI_MODE_RR != 2) || (!rtb_LogicalOperator5)); } else { rtb_LogicalOperator5 = false; } if (rtb_LogicalOperator5) { rtDW.is_ThreeWay_Logic = IN_Entry_3W; /* : Cmd_3Way = 1; */ rtB.Cmd_3Way = 1U; /* : t_start_1 = t_now; */ rtDW.t_start_1 = rtDW.t_now; } break; } switch (rtDW.is_TwoWay_Logic) { case IN_Entry_2W: /* : sf_internal_predicateOutput = D_tg_RR > g_assTWOWAY_REAR_DUCTTGT_R(1) && (t_now - t_start_3) > 60000 && LO_HI_MODE_RR ~= 2; */ rtb_Subtract = rtDW.t_now - /*MW:OvSatOk*/ rtDW.t_start_3; if (rtb_Subtract > rtDW.t_now) { rtb_Subtract = 0U; } if ((rtDW.Duct_RR_Tg > g_assTWOWAY_REAR_DUCTTGT_R[0]) && ((rtb_Subtract > 60000U) && (rtDW.LO_HI_MODE_RR != 2))) { /* : Cmd_RearTemp_2W = -1; */ rtDW.is_TwoWay_Logic = IN_ExitSeq_2W; /* : Cmd_2Way = 0; */ rtB.Cmd_2Way = 0U; /* : Cmd_RearTemp_2W = 0; */ rtDW.Cmd_RearTemp_2W = 0.0; /* : t_start_4 = t_now; */ rtDW.t_start_4 = rtDW.t_now; } else { /* : sf_internal_predicateOutput = (D_tg_RR > g_assTWOWAY_REAR_DUCTTGT_R(1) && (t_now - t_start_3) <= 60000) || LO_HI_MODE_RR == 2; */ if (rtDW.Duct_RR_Tg > g_assTWOWAY_REAR_DUCTTGT_R[0]) { rtb_Subtract = rtDW.t_now - /*MW:OvSatOk*/ rtDW.t_start_3; if (rtb_Subtract > rtDW.t_now) { rtb_Subtract = 0U; } if (rtb_Subtract <= 60000U) { rtb_LogicalOperator5 = true; } else { rtb_LogicalOperator5 = (rtDW.LO_HI_MODE_RR == 2); } } else { rtb_LogicalOperator5 = (rtDW.LO_HI_MODE_RR == 2); } if (rtb_LogicalOperator5) { /* : Cmd_RearTemp_2W = -1; */ rtDW.is_TwoWay_Logic = IN_Wait_2W; /* : Cmd_2Way = 1; */ rtB.Cmd_2Way = 1U; /* : Cmd_RearTemp_2W = -1; */ rtDW.Cmd_RearTemp_2W = -1.0; } } break; case IN_ExitSeq_2W: /* : sf_internal_predicateOutput = (t_now - t_start_4) >= 3000 || LO_HI_MODE_RR == 2; */ rtb_Subtract = rtDW.t_now - /*MW:OvSatOk*/ rtDW.t_start_4; if (rtb_Subtract > rtDW.t_now) { rtb_Subtract = 0U; } if ((rtb_Subtract >= 3000U) || (rtDW.LO_HI_MODE_RR == 2)) { /* : Cmd_RearTemp_2W = -1; */ rtDW.is_TwoWay_Logic = IN_Wait_2W; /* : Cmd_2Way = 1; */ rtB.Cmd_2Way = 1U; /* : Cmd_RearTemp_2W = -1; */ rtDW.Cmd_RearTemp_2W = -1.0; } break; default: /* case IN_Wait_2W: */ /* : sf_internal_predicateOutput = D_tg_RR <= g_assTWOWAY_REAR_DUCTTGT_R(2) && LO_HI_MODE_RR ~= 2; */ if ((rtDW.Duct_RR_Tg <= g_assTWOWAY_REAR_DUCTTGT_R[1]) && (rtDW.LO_HI_MODE_RR != 2)) { rtDW.is_TwoWay_Logic = IN_Entry_2W; /* : Cmd_2Way = 0; */ rtB.Cmd_2Way = 0U; /* : t_start_3 = t_now; */ rtDW.t_start_3 = rtDW.t_now; /* : if RL_Seat_Occupied == 0 */ if (rtDW.SeatOccupied == 0) { /* : Cmd_RearTemp_2W = 10; */ rtDW.Cmd_RearTemp_2W = 10.0; } else { /* : else */ /* : Cmd_RearTemp_2W = 10; */ rtDW.Cmd_RearTemp_2W = 10.0; } } else { /* : Cmd_2Way = 1; */ rtB.Cmd_2Way = 1U; /* : Cmd_RearTemp_2W = -1; */ rtDW.Cmd_RearTemp_2W = -1.0; } break; } /* : if Cmd_RearTemp_3W == 0 || Cmd_RearTemp_2W == 0 */ } /* End of Chart: '/13,1,3,15 Valve control' */ /* MultiPortSwitch: '/Multiport Switch1' incorporates: * Constant: '/Constant' */ for (i = 0; i < 7; i++) { rtb_uDLookupTable7_g[i] = g_assDTG_FU_MAX_LV0[i]; } /* End of MultiPortSwitch: '/Multiport Switch1' */ /* Saturate: '/Saturation' incorporates: * DataStoreRead: '/Data Store Read16' */ if (rtDW.CCU_SET_FL > 290) { Gain = 290U; } else if (rtDW.CCU_SET_FL < 170) { Gain = 170U; } else { Gain = rtDW.CCU_SET_FL; } /* End of Saturate: '/Saturation' */ /* Gain: '/Gain' incorporates: * Gain: '/Gain2' */ rtb_Subtract = 52429U * Gain; /* DataTypeConversion: '/Data Type Conversion2' incorporates: * Gain: '/Gain' * Gain: '/Gain2' */ rtb_dt_an = rtb_Subtract >> 19; /* Gain: '/Gain1' incorporates: * Bias: '/Bias' * DataTypeConversion: '/Data Type Conversion2' * Gain: '/Gain3' */ i = ((int32_t)rtb_dt_an + -15) << 14; /* DataTypeConversion: '/Data Type Conversion1' incorporates: * DataTypeConversion: '/Data Type Conversion3' * Gain: '/Gain1' */ Comp_Max_RPM_Allowed = (uint8_t)((((uint32_t)i & 16384U) != 0U) + (i >> 15)); /* Selector: '/Selector' incorporates: * DataTypeConversion: '/Data Type Conversion1' */ rtb_Selector_p = rtb_uDLookupTable7_g[Comp_Max_RPM_Allowed - 1]; /* Saturate: '/Saturation4' incorporates: * DataStoreRead: '/Data Store Read28' */ if (rtDW.LEVEL <= 5) { rtb_Switch3_ed = rtDW.LEVEL; } else { rtb_Switch3_ed = 5U; } /* End of Saturate: '/Saturation4' */ /* MultiPortSwitch: '/Multiport Switch' incorporates: * Lookup_n-D: '/1-D Lookup Table' * Lookup_n-D: '/1-D Lookup Table1' * Lookup_n-D: '/1-D Lookup Table2' * Lookup_n-D: '/1-D Lookup Table3' * Lookup_n-D: '/1-D Lookup Table4' * Lookup_n-D: '/1-D Lookup Table5' * Saturate: '/Saturation' */ switch (rtb_Switch3_ed) { case 0: g_assEVA_TG_AMB_R_h = look1_iu16lu64n48ts16Ds32_binlcs(Gain, rtConstP.pooled72, &g_assTG_FLU_LV0[0], 12U); /* MultiPortSwitch: '/Multiport Switch' incorporates: * Lookup_n-D: '/1-D Lookup Table' * Lookup_n-D: '/1-D Lookup Table' * Saturate: '/Saturation' */ rtb_MultiportSwitch_o = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain, rtConstP.pooled51, &g_assINCAR_TG_FL_LV0[0], 12U); break; case 1: g_assEVA_TG_AMB_R_h = look1_iu16lu64n48ts16Ds32_binlcs(Gain, rtConstP.pooled72, &g_assTG_FLU_LV1[0], 12U); /* MultiPortSwitch: '/Multiport Switch' incorporates: * Lookup_n-D: '/1-D Lookup Table1' * Lookup_n-D: '/1-D Lookup Table1' * Saturate: '/Saturation' */ rtb_MultiportSwitch_o = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain, rtConstP.pooled51, &g_assINCAR_TG_FL_LV1[0], 12U); break; case 2: g_assEVA_TG_AMB_R_h = look1_iu16lu64n48ts16Ds32_binlcs(Gain, rtConstP.pooled72, &g_assTG_FLU_LV2[0], 12U); /* MultiPortSwitch: '/Multiport Switch' incorporates: * Lookup_n-D: '/1-D Lookup Table2' * Lookup_n-D: '/1-D Lookup Table2' * Saturate: '/Saturation' */ rtb_MultiportSwitch_o = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain, rtConstP.pooled51, &g_assINCAR_TG_FL_LV2[0], 12U); break; case 3: g_assEVA_TG_AMB_R_h = look1_iu16lu64n48ts16Ds32_binlcs(Gain, rtConstP.pooled72, &g_assTG_FLU_LV3[0], 12U); /* MultiPortSwitch: '/Multiport Switch' incorporates: * Lookup_n-D: '/1-D Lookup Table3' * Lookup_n-D: '/1-D Lookup Table3' * Saturate: '/Saturation' */ rtb_MultiportSwitch_o = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain, rtConstP.pooled51, &g_assINCAR_TG_FL_LV3[0], 12U); break; case 4: g_assEVA_TG_AMB_R_h = look1_iu16lu64n48ts16Ds32_binlcs(Gain, rtConstP.pooled72, &g_assTG_FLU_LV4[0], 12U); /* MultiPortSwitch: '/Multiport Switch' incorporates: * Lookup_n-D: '/1-D Lookup Table4' * Lookup_n-D: '/1-D Lookup Table4' * Saturate: '/Saturation' */ rtb_MultiportSwitch_o = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain, rtConstP.pooled51, &g_assINCAR_TG_FL_LV4[0], 12U); break; default: g_assEVA_TG_AMB_R_h = look1_iu16lu64n48ts16Ds32_binlcs(Gain, rtConstP.pooled72, &g_assTG_FLU_LV5[0], 12U); /* MultiPortSwitch: '/Multiport Switch' incorporates: * Lookup_n-D: '/1-D Lookup Table5' * Lookup_n-D: '/1-D Lookup Table5' * Saturate: '/Saturation' */ rtb_MultiportSwitch_o = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain, rtConstP.pooled51, &g_assINCAR_TG_FL_LV5[0], 12U); break; } /* End of MultiPortSwitch: '/Multiport Switch' */ /* MultiPortSwitch: '/Multiport Switch1' incorporates: * Constant: '/Constant' */ for (i = 0; i < 7; i++) { rtb_uDLookupTable7_g[i] = g_assDTG_FU_INC_Y1_LV0[i]; } /* End of MultiPortSwitch: '/Multiport Switch1' */ /* Selector: '/Selector' incorporates: * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[0] = rtb_uDLookupTable7_g[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant6' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[1] = g_assDTG_FU_INC_Y2_LV0[Comp_Max_RPM_Allowed - 1]; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant24' */ rtb_VectorConcatenate_lo[2] = 0; /* Selector: '/Selector2' incorporates: * Constant: '/Constant14' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch3' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[3] = g_assDTG_FU_INC_Y3_LV0[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector3' incorporates: * Constant: '/Constant20' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch4' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[4] = g_assDTG_FU_INC_Y4_LV0[Comp_Max_RPM_Allowed - 1]; /* MultiPortSwitch: '/Multiport Switch1' incorporates: * Constant: '/Constant' */ for (i = 0; i < 7; i++) { rtb_uDLookupTable7_g[i] = g_assDTG_FU_INC_X1_LV0[i]; } /* End of MultiPortSwitch: '/Multiport Switch1' */ /* Selector: '/Selector' incorporates: * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[0] = rtb_uDLookupTable7_g[Comp_Max_RPM_Allowed - 1]; /* MultiPortSwitch: '/Multiport Switch2' incorporates: * Constant: '/Constant6' * Constant: '/Constant6' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector1' * Selector: '/Selector' * Selector: '/Selector1' */ rtb_FLU_tg_correct_de = g_assDTG_FU_INC_X2_LV0[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant6' * MultiPortSwitch: '/Multiport Switch2' */ rtb_VectorConcatenate_jn[1] = rtb_FLU_tg_correct_de; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant24' */ rtb_VectorConcatenate_jn[2] = 0; /* MultiPortSwitch: '/Multiport Switch3' incorporates: * Constant: '/Constant14' * Constant: '/Constant14' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch3' * Selector: '/Selector2' * Selector: '/Selector' * Selector: '/Selector2' */ rtb_Bias2 = g_assDTG_FU_INC_X3_LV0[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector2' incorporates: * Constant: '/Constant14' * MultiPortSwitch: '/Multiport Switch3' */ rtb_VectorConcatenate_jn[3] = rtb_Bias2; /* MultiPortSwitch: '/Multiport Switch4' incorporates: * Constant: '/Constant20' * Constant: '/Constant20' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch4' * Selector: '/Selector3' * Selector: '/Selector' * Selector: '/Selector3' */ rtb_Bias4 = g_assDTG_FU_INC_X4_LV0[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector3' incorporates: * Constant: '/Constant20' * MultiPortSwitch: '/Multiport Switch4' */ rtb_VectorConcatenate_jn[4] = rtb_Bias4; /* Lookup_n-D: '/2.5 FLU_tg_incar' incorporates: * DataStoreRead: '/Data Store Read21' * Sum: '/2.5. X = Inc_Tg - Incar_fb' */ rtb_u5FLU_tg_incar = look1_is16lu64n32Ds32_binlcn((int16_t) (rtb_MultiportSwitch_o - rtDW.Incar_FL), rtb_VectorConcatenate_jn, rtb_VectorConcatenate_lo, 4U); /* MultiPortSwitch: '/Multiport Switch1' incorporates: * Constant: '/Constant' */ for (i = 0; i < 7; i++) { rtb_uDLookupTable7_g[i] = g_assDTG_FU_AMB_Y1_LV0[i]; } /* End of MultiPortSwitch: '/Multiport Switch1' */ /* Selector: '/Selector' incorporates: * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_lg[0] = rtb_uDLookupTable7_g[Comp_Max_RPM_Allowed - 1]; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant24' */ rtb_VectorConcatenate_lg[1] = 0; /* Selector: '/Selector1' incorporates: * Constant: '/Constant6' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_lg[2] = g_assDTG_FU_AMB_Y2_LV0[Comp_Max_RPM_Allowed - 1]; /* MultiPortSwitch: '/Multiport Switch1' incorporates: * Constant: '/Constant' * Constant: '/Constant1' * Constant: '/Constant2' * Constant: '/Constant3' * Constant: '/Constant4' * Constant: '/Constant5' */ switch (rtb_Switch3_ed) { case 0: for (i = 0; i < 7; i++) { rtb_uDLookupTable7_g[i] = g_assDTG_FU_AMB_X1_LV0[i]; } break; case 1: for (i = 0; i < 7; i++) { rtb_uDLookupTable7_g[i] = g_assDTG_FU_AMB_X1_LV1[i]; } break; case 2: for (i = 0; i < 7; i++) { rtb_uDLookupTable7_g[i] = g_assDTG_FU_AMB_X1_LV2[i]; } break; case 3: for (i = 0; i < 7; i++) { rtb_uDLookupTable7_g[i] = g_assDTG_FU_AMB_X1_LV3[i]; } break; case 4: for (i = 0; i < 7; i++) { rtb_uDLookupTable7_g[i] = g_assDTG_FU_AMB_X1_LV4[i]; } break; default: for (i = 0; i < 7; i++) { rtb_uDLookupTable7_g[i] = g_assDTG_FU_AMB_X1_LV5[i]; } break; } /* End of MultiPortSwitch: '/Multiport Switch1' */ /* Selector: '/Selector' incorporates: * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[0] = rtb_uDLookupTable7_g[Comp_Max_RPM_Allowed - 1]; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant24' */ rtb_VectorConcatenate_e0[1] = 0; /* MultiPortSwitch: '/Multiport Switch2' */ switch (rtb_Switch3_ed) { case 0: /* Selector: '/Selector1' incorporates: * Constant: '/Constant6' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[2] = g_assDTG_FU_AMB_X2_LV0[Comp_Max_RPM_Allowed - 1]; break; case 1: /* Selector: '/Selector1' incorporates: * Constant: '/Constant7' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[2] = g_assDTG_FU_AMB_X2_LV1[Comp_Max_RPM_Allowed - 1]; break; case 2: /* Selector: '/Selector1' incorporates: * Constant: '/Constant8' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[2] = g_assDTG_FU_AMB_X2_LV2[Comp_Max_RPM_Allowed - 1]; break; case 3: /* Selector: '/Selector1' incorporates: * Constant: '/Constant9' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[2] = g_assDTG_FU_AMB_X2_LV3[Comp_Max_RPM_Allowed - 1]; break; case 4: /* Selector: '/Selector1' incorporates: * Constant: '/Constant10' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[2] = g_assDTG_FU_AMB_X2_LV4[Comp_Max_RPM_Allowed - 1]; break; default: /* Selector: '/Selector1' incorporates: * Constant: '/Constant11' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[2] = g_assDTG_FU_AMB_X2_LV5[Comp_Max_RPM_Allowed - 1]; break; } /* End of MultiPortSwitch: '/Multiport Switch2' */ /* Sum: '/2.6. X = Amb_Tg - Amb_Fb' incorporates: * Bias: '/Bias' * Constant: '/Constant' * DataStoreRead: '/Data Store Read20' * Selector: '/Selector1' * Sum: '/2.6. X = Amb_Tg - Amb_Fb' * Sum: '/2.6. X = Amb_Tg - Amb_Fb' * Sum: '/2.6. X = Amb_Tg - Amb_Fb' */ rtb_Bias5 = (int16_t)(g_assAMB_LV_TG[rtb_Switch3_ed] - rtDW.AMB); /* Lookup_n-D: '/2.6 FLU_tg_amb' incorporates: * Sum: '/2.6. X = Amb_Tg - Amb_Fb' */ rtb_y_lg = look1_is16lu64n32Ds32_binlcn(rtb_Bias5, rtb_VectorConcatenate_e0, rtb_VectorConcatenate_lg, 2U); /* MultiPortSwitch: '/Multiport Switch1' */ switch (rtb_Switch3_ed) { case 0: /* Selector: '/Selector' incorporates: * Constant: '/Constant' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[0] = g_assDTG_FU_SUN_Y1_LV0[Comp_Max_RPM_Allowed - 1]; break; case 1: /* Selector: '/Selector' incorporates: * Constant: '/Constant1' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[0] = g_assDTG_FU_SUN_Y1_LV1[Comp_Max_RPM_Allowed - 1]; break; case 2: /* Selector: '/Selector' incorporates: * Constant: '/Constant2' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[0] = g_assDTG_FU_SUN_Y1_LV2[Comp_Max_RPM_Allowed - 1]; break; case 3: /* Selector: '/Selector' incorporates: * Constant: '/Constant3' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[0] = g_assDTG_FU_SUN_Y1_LV3[Comp_Max_RPM_Allowed - 1]; break; case 4: /* Selector: '/Selector' incorporates: * Constant: '/Constant4' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[0] = g_assDTG_FU_SUN_Y1_LV4[Comp_Max_RPM_Allowed - 1]; break; default: /* Selector: '/Selector' incorporates: * Constant: '/Constant5' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[0] = g_assDTG_FU_SUN_Y1_LV5[Comp_Max_RPM_Allowed - 1]; break; } /* End of MultiPortSwitch: '/Multiport Switch1' */ /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant24' */ rtb_VectorConcatenate_e0[1] = 0; /* MultiPortSwitch: '/Multiport Switch2' */ switch (rtb_Switch3_ed) { case 0: /* Selector: '/Selector1' incorporates: * Constant: '/Constant6' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[2] = g_assDTG_FU_SUN_Y2_LV0[Comp_Max_RPM_Allowed - 1]; break; case 1: /* Selector: '/Selector1' incorporates: * Constant: '/Constant7' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[2] = g_assDTG_FU_SUN_Y2_LV1[Comp_Max_RPM_Allowed - 1]; break; case 2: /* Selector: '/Selector1' incorporates: * Constant: '/Constant8' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[2] = g_assDTG_FU_SUN_Y2_LV2[Comp_Max_RPM_Allowed - 1]; break; case 3: /* Selector: '/Selector1' incorporates: * Constant: '/Constant9' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[2] = g_assDTG_FU_SUN_Y2_LV3[Comp_Max_RPM_Allowed - 1]; break; case 4: /* Selector: '/Selector1' incorporates: * Constant: '/Constant10' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[2] = g_assDTG_FU_SUN_Y2_LV4[Comp_Max_RPM_Allowed - 1]; break; default: /* Selector: '/Selector1' incorporates: * Constant: '/Constant11' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[2] = g_assDTG_FU_SUN_Y2_LV5[Comp_Max_RPM_Allowed - 1]; break; } /* End of MultiPortSwitch: '/Multiport Switch2' */ /* Selector: '/Selector' incorporates: * Constant: '/Constant' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_lg[0] = g_assDTG_FU_AMB_X1_LV0[Comp_Max_RPM_Allowed - 1]; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant24' */ rtb_VectorConcatenate_lg[1] = 0; /* Selector: '/Selector1' incorporates: * Constant: '/Constant6' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_lg[2] = g_assDTG_FU_AMB_X2_LV0[Comp_Max_RPM_Allowed - 1]; /* Lookup_n-D: '/2.6 FLU_tg_amb' incorporates: * DataStoreRead: '/Data Store Read26' */ rtb_y_bf = look1_bs16ts16Dd_binlc(rtDW.Sun_L, rtb_VectorConcatenate_lg, rtb_VectorConcatenate_e0, 2U); /* Sum: '/FLU_tg_correct' */ rtb_FLU_tg_correct = (int16_t)((int16_t)((int16_t)(g_assEVA_TG_AMB_R_h + rtb_u5FLU_tg_incar) + rtb_y_lg) + rtb_y_bf); /* Switch: '/Switch2' incorporates: * DataStoreWrite: '/Data Store Write2' * RelationalOperator: '/LowerRelop1' */ if (rtb_FLU_tg_correct > rtb_Selector_p) { rtb_FLU_tg_correct = rtb_Selector_p; } else { /* MultiPortSwitch: '/Multiport Switch1' incorporates: * Constant: '/Constant' */ for (i = 0; i < 7; i++) { rtb_uDLookupTable7_g[i] = g_assDTG_FU_MIN_LV0[i]; } /* End of MultiPortSwitch: '/Multiport Switch1' */ /* Selector: '/Selector' incorporates: * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_FLU_tg_correct_g = rtb_uDLookupTable7_g[Comp_Max_RPM_Allowed - 1]; /* Switch: '/Switch' incorporates: * DataStoreWrite: '/Data Store Write2' * RelationalOperator: '/UpperRelop' * Selector: '/Selector' */ if (rtb_FLU_tg_correct < rtb_FLU_tg_correct_g) { rtb_FLU_tg_correct = rtb_FLU_tg_correct_g; } /* End of Switch: '/Switch' */ } /* End of Switch: '/Switch2' */ /* MultiPortSwitch: '/Multiport Switch1' incorporates: * Constant: '/Constant' */ for (i = 0; i < 7; i++) { rtb_uDLookupTable7_g[i] = g_assDTG_FU_MAX_LV0[i]; } /* End of MultiPortSwitch: '/Multiport Switch1' */ /* Saturate: '/Saturation1' incorporates: * DataStoreRead: '/Data Store Read17' */ if (rtDW.CCU_SET_FR > 290) { Gain1 = 290U; } else if (rtDW.CCU_SET_FR < 170) { Gain1 = 170U; } else { Gain1 = rtDW.CCU_SET_FR; } /* End of Saturate: '/Saturation1' */ /* Gain: '/Gain' incorporates: * Gain: '/Gain2' */ rtb_Gain_fc_tmp_tmp = 52429U * Gain1; /* DataTypeConversion: '/Data Type Conversion3' incorporates: * Gain: '/Gain' * Gain: '/Gain2' */ rtb_Gain_fc_tmp_tmp_0 = rtb_Gain_fc_tmp_tmp >> 19; /* Gain: '/Gain1' incorporates: * Bias: '/Bias' * DataTypeConversion: '/Data Type Conversion3' * Gain: '/Gain3' */ i = ((int32_t)rtb_Gain_fc_tmp_tmp_0 + -15) << 14; /* DataTypeConversion: '/Data Type Conversion2' incorporates: * DataTypeConversion: '/Data Type Conversion3' * Gain: '/Gain1' */ Blower_AF_RL = (uint8_t)((((uint32_t)i & 16384U) != 0U) + (i >> 15)); /* MultiPortSwitch: '/Multiport Switch' incorporates: * Lookup_n-D: '/1-D Lookup Table' * Lookup_n-D: '/1-D Lookup Table1' * Lookup_n-D: '/1-D Lookup Table2' * Lookup_n-D: '/1-D Lookup Table3' * Lookup_n-D: '/1-D Lookup Table4' * Lookup_n-D: '/1-D Lookup Table5' * Saturate: '/Saturation1' */ switch (rtb_Switch3_ed) { case 0: rtb_y_h5 = look1_iu16lu64n48ts16Ds32_binlcs(Gain1, rtConstP.pooled72, &g_assTG_FRU_LV0[0], 12U); /* MultiPortSwitch: '/Multiport Switch' incorporates: * Lookup_n-D: '/1-D Lookup Table' * Lookup_n-D: '/1-D Lookup Table' * Saturate: '/Saturation1' */ rtb_y_ck = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain1, rtConstP.pooled51, &g_assINCAR_TG_FR_LV0[0], 12U); break; case 1: rtb_y_h5 = look1_iu16lu64n48ts16Ds32_binlcs(Gain1, rtConstP.pooled72, &g_assTG_FRU_LV1[0], 12U); /* MultiPortSwitch: '/Multiport Switch' incorporates: * Lookup_n-D: '/1-D Lookup Table1' * Lookup_n-D: '/1-D Lookup Table1' * Saturate: '/Saturation1' */ rtb_y_ck = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain1, rtConstP.pooled51, &g_assINCAR_TG_FR_LV1[0], 12U); break; case 2: rtb_y_h5 = look1_iu16lu64n48ts16Ds32_binlcs(Gain1, rtConstP.pooled72, &g_assTG_FRU_LV2[0], 12U); /* MultiPortSwitch: '/Multiport Switch' incorporates: * Lookup_n-D: '/1-D Lookup Table2' * Lookup_n-D: '/1-D Lookup Table2' * Saturate: '/Saturation1' */ rtb_y_ck = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain1, rtConstP.pooled51, &g_assINCAR_TG_FR_LV2[0], 12U); break; case 3: rtb_y_h5 = look1_iu16lu64n48ts16Ds32_binlcs(Gain1, rtConstP.pooled72, &g_assTG_FRU_LV3[0], 12U); /* MultiPortSwitch: '/Multiport Switch' incorporates: * Lookup_n-D: '/1-D Lookup Table3' * Lookup_n-D: '/1-D Lookup Table3' * Saturate: '/Saturation1' */ rtb_y_ck = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain1, rtConstP.pooled51, &g_assINCAR_TG_FR_LV3[0], 12U); break; case 4: rtb_y_h5 = look1_iu16lu64n48ts16Ds32_binlcs(Gain1, rtConstP.pooled72, &g_assTG_FRU_LV4[0], 12U); /* MultiPortSwitch: '/Multiport Switch' incorporates: * Lookup_n-D: '/1-D Lookup Table4' * Lookup_n-D: '/1-D Lookup Table4' * Saturate: '/Saturation1' */ rtb_y_ck = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain1, rtConstP.pooled51, &g_assINCAR_TG_FR_LV4[0], 12U); break; default: rtb_y_h5 = look1_iu16lu64n48ts16Ds32_binlcs(Gain1, rtConstP.pooled72, &g_assTG_FRU_LV5[0], 12U); /* MultiPortSwitch: '/Multiport Switch' incorporates: * Lookup_n-D: '/1-D Lookup Table5' * Lookup_n-D: '/1-D Lookup Table5' * Saturate: '/Saturation1' */ rtb_y_ck = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain1, rtConstP.pooled51, &g_assINCAR_TG_FR_LV5[0], 12U); break; } /* End of MultiPortSwitch: '/Multiport Switch' */ /* Selector: '/Selector' incorporates: * Constant: '/Constant' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch1' */ rtb_VectorConcatenate_jn[0] = g_assDTG_FU_INC_Y1_LV0[Blower_AF_RL - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant6' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[1] = g_assDTG_FU_INC_Y2_LV0[Blower_AF_RL - 1]; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant24' */ rtb_VectorConcatenate_jn[2] = 0; /* Selector: '/Selector2' incorporates: * Constant: '/Constant14' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch3' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[3] = g_assDTG_FU_INC_Y3_LV0[Blower_AF_RL - 1]; /* Selector: '/Selector3' incorporates: * Constant: '/Constant20' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch4' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[4] = g_assDTG_FU_INC_Y4_LV0[Blower_AF_RL - 1]; /* MultiPortSwitch: '/Multiport Switch1' incorporates: * Constant: '/Constant' * Constant: '/Constant' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' * Selector: '/Selector' * Selector: '/Selector' */ rtb_Bias_ct = g_assDTG_FU_INC_X1_LV0[Blower_AF_RL - 1]; /* Selector: '/Selector' incorporates: * Constant: '/Constant' * MultiPortSwitch: '/Multiport Switch1' */ rtb_VectorConcatenate_lo[0] = rtb_Bias_ct; /* MultiPortSwitch: '/Multiport Switch2' incorporates: * Constant: '/Constant6' * Constant: '/Constant6' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector1' * Selector: '/Selector1' * Selector: '/Selector' */ rtb_FLU_tg_correct_b = g_assDTG_FU_INC_X2_LV0[Blower_AF_RL - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant6' * MultiPortSwitch: '/Multiport Switch2' */ rtb_VectorConcatenate_lo[1] = rtb_FLU_tg_correct_b; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant24' */ rtb_VectorConcatenate_lo[2] = 0; /* MultiPortSwitch: '/Multiport Switch3' incorporates: * Constant: '/Constant14' * Constant: '/Constant14' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch3' * Selector: '/Selector2' * Selector: '/Selector2' * Selector: '/Selector' */ rtb_Bias1_h = g_assDTG_FU_INC_X3_LV0[Blower_AF_RL - 1]; /* Selector: '/Selector2' incorporates: * Constant: '/Constant14' * MultiPortSwitch: '/Multiport Switch3' */ rtb_VectorConcatenate_lo[3] = rtb_Bias1_h; /* MultiPortSwitch: '/Multiport Switch4' incorporates: * Constant: '/Constant20' * Constant: '/Constant20' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch4' * Selector: '/Selector3' * Selector: '/Selector3' * Selector: '/Selector' */ Duct3_R = g_assDTG_FU_INC_X4_LV0[Blower_AF_RL - 1]; /* Selector: '/Selector3' incorporates: * Constant: '/Constant20' * MultiPortSwitch: '/Multiport Switch4' */ rtb_VectorConcatenate_lo[4] = Duct3_R; /* Lookup_n-D: '/2.5 FRU_tg_incar' incorporates: * DataStoreRead: '/Data Store Read22' * Sum: '/2.5. X = Inc_Tg - Incar_fb' */ rtb_y_fe = look1_is16lu64n32Ds32_binlcn((int16_t)(rtb_y_ck - rtDW.Incar_FR), rtb_VectorConcatenate_lo, rtb_VectorConcatenate_jn, 4U); /* Selector: '/Selector' incorporates: * Constant: '/Constant' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[0] = g_assDTG_FU_AMB_Y1_LV0[Blower_AF_RL - 1]; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant24' */ rtb_VectorConcatenate_e0[1] = 0; /* Selector: '/Selector1' incorporates: * Constant: '/Constant6' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[2] = g_assDTG_FU_AMB_Y2_LV0[Blower_AF_RL - 1]; /* MultiPortSwitch: '/Multiport Switch1' incorporates: * Constant: '/Constant' * Constant: '/Constant' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' * Selector: '/Selector' * Selector: '/Selector' */ rtb_u6FLU_tg_amb_hq = g_assDTG_FU_AMB_X1_LV0[Blower_AF_RL - 1]; /* Selector: '/Selector' incorporates: * Constant: '/Constant' * MultiPortSwitch: '/Multiport Switch1' */ rtb_VectorConcatenate_lg[0] = rtb_u6FLU_tg_amb_hq; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant24' */ rtb_VectorConcatenate_lg[1] = 0; /* MultiPortSwitch: '/Multiport Switch2' incorporates: * Constant: '/Constant6' * Constant: '/Constant6' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' * Selector: '/Selector1' * Selector: '/Selector1' */ rtb_u5FLU_tg_incar_l = g_assDTG_FU_AMB_X2_LV0[Blower_AF_RL - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant6' * MultiPortSwitch: '/Multiport Switch2' */ rtb_VectorConcatenate_lg[2] = rtb_u5FLU_tg_incar_l; /* Lookup_n-D: '/2.6 FRU_tg_amb' */ rtb_y_ar = look1_is16lu64n32Ds32_binlcn(rtb_Bias5, rtb_VectorConcatenate_lg, rtb_VectorConcatenate_e0, 2U); /* Selector: '/Selector' incorporates: * Constant: '/Constant' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[0] = g_assDTG_FU_SUN_Y1_LV0[Blower_AF_RL - 1]; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant24' */ rtb_VectorConcatenate_e0[1] = 0; /* Selector: '/Selector1' incorporates: * Constant: '/Constant6' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[2] = g_assDTG_FU_SUN_Y2_LV0[Blower_AF_RL - 1]; /* Selector: '/Selector' */ rtb_VectorConcatenate_lg[0] = rtb_u6FLU_tg_amb_hq; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant24' */ rtb_VectorConcatenate_lg[1] = 0; /* Selector: '/Selector1' */ rtb_VectorConcatenate_lg[2] = rtb_u5FLU_tg_incar_l; /* Lookup_n-D: '/2.6 FRU_tg_amb' incorporates: * DataStoreRead: '/Data Store Read27' */ rtb_u6FLU_tg_amb = look1_bs16ts16Dd_binlc(rtDW.Sun_R, rtb_VectorConcatenate_lg, rtb_VectorConcatenate_e0, 2U); /* Sum: '/FLU_tg_correct1' */ rtb_Selector_p = (int16_t)((int16_t)((int16_t)(rtb_y_h5 + rtb_y_fe) + rtb_y_ar) + rtb_u6FLU_tg_amb); /* Selector: '/Selector' incorporates: * DataTypeConversion: '/Data Type Conversion2' * Selector: '/Selector' */ rtb_FLU_tg_correct_g = rtb_uDLookupTable7_g[Blower_AF_RL - 1]; /* Switch: '/Switch2' incorporates: * DataStoreWrite: '/Data Store Write3' * RelationalOperator: '/LowerRelop1' * Selector: '/Selector' */ if (rtb_Selector_p > rtb_FLU_tg_correct_g) { rtb_Selector_p = rtb_FLU_tg_correct_g; } else { /* MultiPortSwitch: '/Multiport Switch1' incorporates: * Constant: '/Constant' */ for (i = 0; i < 7; i++) { rtb_uDLookupTable7_g[i] = g_assDTG_FU_MIN_LV0[i]; } /* End of MultiPortSwitch: '/Multiport Switch1' */ /* Selector: '/Selector' incorporates: * DataTypeConversion: '/Data Type Conversion2' * Selector: '/Selector' */ rtb_FLU_tg_correct_g = rtb_uDLookupTable7_g[Blower_AF_RL - 1]; /* Switch: '/Switch' incorporates: * DataStoreWrite: '/Data Store Write3' * RelationalOperator: '/UpperRelop' * Selector: '/Selector' */ if (rtb_Selector_p < rtb_FLU_tg_correct_g) { rtb_Selector_p = rtb_FLU_tg_correct_g; } /* End of Switch: '/Switch' */ } /* End of Switch: '/Switch2' */ /* DataStoreWrite: '/Data Store Write5' */ rtDW.Duct_RR_Tg = 0; /* MultiPortSwitch: '/Multiport Switch1' incorporates: * Constant: '/Constant' */ for (i = 0; i < 7; i++) { rtb_uDLookupTable7_g[i] = g_assDTG_FL_MAX_LV0[i]; } /* End of MultiPortSwitch: '/Multiport Switch1' */ /* MultiPortSwitch: '/Multiport Switch' incorporates: * Lookup_n-D: '/1-D Lookup Table' * Lookup_n-D: '/1-D Lookup Table1' * Lookup_n-D: '/1-D Lookup Table2' * Lookup_n-D: '/1-D Lookup Table3' * Lookup_n-D: '/1-D Lookup Table4' * Lookup_n-D: '/1-D Lookup Table5' * Saturate: '/Saturation' */ switch (rtb_Switch3_ed) { case 0: rtb_u6FLU_tg_amb_hq = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain, rtConstP.pooled51, &g_assTG_FLL_LV0[0], 12U); /* MultiPortSwitch: '/Multiport Switch' incorporates: * Lookup_n-D: '/1-D Lookup Table' * Lookup_n-D: '/1-D Lookup Table' * Saturate: '/Saturation' */ rtb_u5FLU_tg_incar_l = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain, rtConstP.pooled51, &g_assINCAR_TG_FL_LV0[0], 12U); /* Selector: '/Selector' incorporates: * Constant: '/Constant' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[0] = g_assDTG_FL_INC_Y1_LV0[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant6' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[1] = g_assDTG_FL_INC_Y2_LV0[Comp_Max_RPM_Allowed - 1]; break; case 1: rtb_u6FLU_tg_amb_hq = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain, rtConstP.pooled51, &g_assTG_FLL_LV1[0], 12U); /* MultiPortSwitch: '/Multiport Switch' incorporates: * Lookup_n-D: '/1-D Lookup Table1' * Lookup_n-D: '/1-D Lookup Table1' * Saturate: '/Saturation' */ rtb_u5FLU_tg_incar_l = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain, rtConstP.pooled51, &g_assINCAR_TG_FL_LV1[0], 12U); /* Selector: '/Selector' incorporates: * Constant: '/Constant1' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[0] = g_assDTG_FL_INC_Y1_LV1[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant7' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[1] = g_assDTG_FL_INC_Y2_LV1[Comp_Max_RPM_Allowed - 1]; break; case 2: rtb_u6FLU_tg_amb_hq = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain, rtConstP.pooled51, &g_assTG_FLL_LV2[0], 12U); /* MultiPortSwitch: '/Multiport Switch' incorporates: * Lookup_n-D: '/1-D Lookup Table2' * Lookup_n-D: '/1-D Lookup Table2' * Saturate: '/Saturation' */ rtb_u5FLU_tg_incar_l = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain, rtConstP.pooled51, &g_assINCAR_TG_FL_LV2[0], 12U); /* Selector: '/Selector' incorporates: * Constant: '/Constant2' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[0] = g_assDTG_FL_INC_Y1_LV2[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant8' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[1] = g_assDTG_FL_INC_Y2_LV2[Comp_Max_RPM_Allowed - 1]; break; case 3: rtb_u6FLU_tg_amb_hq = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain, rtConstP.pooled51, &g_assTG_FLL_LV3[0], 12U); /* MultiPortSwitch: '/Multiport Switch' incorporates: * Lookup_n-D: '/1-D Lookup Table3' * Lookup_n-D: '/1-D Lookup Table3' * Saturate: '/Saturation' */ rtb_u5FLU_tg_incar_l = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain, rtConstP.pooled51, &g_assINCAR_TG_FL_LV3[0], 12U); /* Selector: '/Selector' incorporates: * Constant: '/Constant3' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[0] = g_assDTG_FL_INC_Y1_LV3[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant9' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[1] = g_assDTG_FL_INC_Y2_LV3[Comp_Max_RPM_Allowed - 1]; break; case 4: rtb_u6FLU_tg_amb_hq = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain, rtConstP.pooled51, &g_assTG_FLL_LV4[0], 12U); /* MultiPortSwitch: '/Multiport Switch' incorporates: * Lookup_n-D: '/1-D Lookup Table4' * Lookup_n-D: '/1-D Lookup Table4' * Saturate: '/Saturation' */ rtb_u5FLU_tg_incar_l = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain, rtConstP.pooled51, &g_assINCAR_TG_FL_LV4[0], 12U); /* Selector: '/Selector' incorporates: * Constant: '/Constant4' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[0] = g_assDTG_FL_INC_Y1_LV4[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant10' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[1] = g_assDTG_FL_INC_Y2_LV4[Comp_Max_RPM_Allowed - 1]; break; default: rtb_u6FLU_tg_amb_hq = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain, rtConstP.pooled51, &g_assTG_FLL_LV5[0], 12U); /* MultiPortSwitch: '/Multiport Switch' incorporates: * Lookup_n-D: '/1-D Lookup Table5' * Lookup_n-D: '/1-D Lookup Table5' * Saturate: '/Saturation' */ rtb_u5FLU_tg_incar_l = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain, rtConstP.pooled51, &g_assINCAR_TG_FL_LV5[0], 12U); /* Selector: '/Selector' incorporates: * Constant: '/Constant5' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[0] = g_assDTG_FL_INC_Y1_LV5[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant11' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[1] = g_assDTG_FL_INC_Y2_LV5[Comp_Max_RPM_Allowed - 1]; break; } /* End of MultiPortSwitch: '/Multiport Switch' */ /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant24' */ rtb_VectorConcatenate_jn[2] = 0; /* MultiPortSwitch: '/Multiport Switch3' */ switch (rtb_Switch3_ed) { case 0: /* Selector: '/Selector2' incorporates: * Constant: '/Constant14' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[3] = g_assDTG_FL_INC_Y3_LV0[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector3' incorporates: * Constant: '/Constant20' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch4' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[4] = g_assDTG_FL_INC_Y4_LV0[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector' incorporates: * Constant: '/Constant' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[0] = g_assDTG_FU_INC_X1_LV0[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector1' */ rtb_VectorConcatenate_lo[1] = rtb_FLU_tg_correct_de; break; case 1: /* Selector: '/Selector2' incorporates: * Constant: '/Constant15' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[3] = g_assDTG_FL_INC_Y3_LV1[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector3' incorporates: * Constant: '/Constant21' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch4' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[4] = g_assDTG_FL_INC_Y4_LV1[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector' incorporates: * Constant: '/Constant1' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[0] = g_assDTG_FU_INC_X1_LV1[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant7' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[1] = g_assDTG_FU_INC_X2_LV1[Comp_Max_RPM_Allowed - 1]; break; case 2: /* Selector: '/Selector2' incorporates: * Constant: '/Constant16' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[3] = g_assDTG_FL_INC_Y3_LV2[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector3' incorporates: * Constant: '/Constant22' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch4' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[4] = g_assDTG_FL_INC_Y4_LV2[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector' incorporates: * Constant: '/Constant2' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[0] = g_assDTG_FU_INC_X1_LV2[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant8' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[1] = g_assDTG_FU_INC_X2_LV2[Comp_Max_RPM_Allowed - 1]; break; case 3: /* Selector: '/Selector2' incorporates: * Constant: '/Constant17' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[3] = g_assDTG_FL_INC_Y3_LV3[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector3' incorporates: * Constant: '/Constant23' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch4' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[4] = g_assDTG_FL_INC_Y4_LV3[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector' incorporates: * Constant: '/Constant3' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[0] = g_assDTG_FU_INC_X1_LV3[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant9' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[1] = g_assDTG_FU_INC_X2_LV3[Comp_Max_RPM_Allowed - 1]; break; case 4: /* Selector: '/Selector2' incorporates: * Constant: '/Constant12' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[3] = g_assDTG_FL_INC_Y3_LV4[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector3' incorporates: * Constant: '/Constant18' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch4' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[4] = g_assDTG_FL_INC_Y4_LV4[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector' incorporates: * Constant: '/Constant4' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[0] = g_assDTG_FU_INC_X1_LV4[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant10' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[1] = g_assDTG_FU_INC_X2_LV4[Comp_Max_RPM_Allowed - 1]; break; default: /* Selector: '/Selector2' incorporates: * Constant: '/Constant13' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[3] = g_assDTG_FL_INC_Y3_LV5[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector3' incorporates: * Constant: '/Constant19' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch4' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[4] = g_assDTG_FL_INC_Y4_LV5[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector' incorporates: * Constant: '/Constant5' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[0] = g_assDTG_FU_INC_X1_LV5[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant11' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[1] = g_assDTG_FU_INC_X2_LV5[Comp_Max_RPM_Allowed - 1]; break; } /* End of MultiPortSwitch: '/Multiport Switch3' */ /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant24' */ rtb_VectorConcatenate_lo[2] = 0; /* MultiPortSwitch: '/Multiport Switch3' */ switch (rtb_Switch3_ed) { case 0: /* Selector: '/Selector2' */ rtb_VectorConcatenate_lo[3] = rtb_Bias2; /* Selector: '/Selector3' */ rtb_VectorConcatenate_lo[4] = rtb_Bias4; break; case 1: /* Selector: '/Selector2' incorporates: * Constant: '/Constant15' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[3] = g_assDTG_FU_INC_X3_LV1[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector3' incorporates: * Constant: '/Constant21' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch4' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[4] = g_assDTG_FU_INC_X4_LV1[Comp_Max_RPM_Allowed - 1]; break; case 2: /* Selector: '/Selector2' incorporates: * Constant: '/Constant16' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[3] = g_assDTG_FU_INC_X3_LV2[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector3' incorporates: * Constant: '/Constant22' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch4' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[4] = g_assDTG_FU_INC_X4_LV2[Comp_Max_RPM_Allowed - 1]; break; case 3: /* Selector: '/Selector2' incorporates: * Constant: '/Constant17' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[3] = g_assDTG_FU_INC_X3_LV3[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector3' incorporates: * Constant: '/Constant23' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch4' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[4] = g_assDTG_FU_INC_X4_LV3[Comp_Max_RPM_Allowed - 1]; break; case 4: /* Selector: '/Selector2' incorporates: * Constant: '/Constant12' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[3] = g_assDTG_FU_INC_X3_LV4[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector3' incorporates: * Constant: '/Constant18' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch4' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[4] = g_assDTG_FU_INC_X4_LV4[Comp_Max_RPM_Allowed - 1]; break; default: /* Selector: '/Selector2' incorporates: * Constant: '/Constant13' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[3] = g_assDTG_FU_INC_X3_LV5[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector3' incorporates: * Constant: '/Constant19' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch4' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[4] = g_assDTG_FU_INC_X4_LV5[Comp_Max_RPM_Allowed - 1]; break; } /* Lookup_n-D: '/2.5 FLL_tg_incar' incorporates: * DataStoreRead: '/Data Store Read21' * Sum: '/2.5. X = Inc_Tg - Incar_fb' */ rtb_MultiportSwitch_ae = look1_is16lu64n32Ds32_binlcn((int16_t) (rtb_u5FLU_tg_incar_l - rtDW.Incar_FL), rtb_VectorConcatenate_lo, rtb_VectorConcatenate_jn, 4U); /* MultiPortSwitch: '/Multiport Switch1' */ switch (rtb_Switch3_ed) { case 0: /* Selector: '/Selector' incorporates: * Constant: '/Constant' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[0] = g_assDTG_FL_AMB_Y1_LV0[Comp_Max_RPM_Allowed - 1]; break; case 1: /* Selector: '/Selector' incorporates: * Constant: '/Constant1' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[0] = g_assDTG_FL_AMB_Y1_LV1[Comp_Max_RPM_Allowed - 1]; break; case 2: /* Selector: '/Selector' incorporates: * Constant: '/Constant2' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[0] = g_assDTG_FL_AMB_Y1_LV2[Comp_Max_RPM_Allowed - 1]; break; case 3: /* Selector: '/Selector' incorporates: * Constant: '/Constant3' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[0] = g_assDTG_FL_AMB_Y1_LV3[Comp_Max_RPM_Allowed - 1]; break; case 4: /* Selector: '/Selector' incorporates: * Constant: '/Constant4' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[0] = g_assDTG_FL_AMB_Y1_LV4[Comp_Max_RPM_Allowed - 1]; break; default: /* Selector: '/Selector' incorporates: * Constant: '/Constant5' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[0] = g_assDTG_FL_AMB_Y1_LV5[Comp_Max_RPM_Allowed - 1]; break; } /* End of MultiPortSwitch: '/Multiport Switch1' */ /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant24' */ rtb_VectorConcatenate_e0[1] = 0; /* MultiPortSwitch: '/Multiport Switch2' */ switch (rtb_Switch3_ed) { case 0: /* Selector: '/Selector1' incorporates: * Constant: '/Constant6' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[2] = g_assDTG_FL_AMB_Y2_LV0[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector' incorporates: * Constant: '/Constant' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_lg[0] = g_assDTG_FL_AMB_X1_LV0[Comp_Max_RPM_Allowed - 1]; break; case 1: /* Selector: '/Selector1' incorporates: * Constant: '/Constant7' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[2] = g_assDTG_FL_AMB_Y2_LV1[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector' incorporates: * Constant: '/Constant1' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_lg[0] = g_assDTG_FL_AMB_X1_LV1[Comp_Max_RPM_Allowed - 1]; break; case 2: /* Selector: '/Selector1' incorporates: * Constant: '/Constant8' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[2] = g_assDTG_FL_AMB_Y2_LV2[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector' incorporates: * Constant: '/Constant2' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_lg[0] = g_assDTG_FL_AMB_X1_LV2[Comp_Max_RPM_Allowed - 1]; break; case 3: /* Selector: '/Selector1' incorporates: * Constant: '/Constant9' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[2] = g_assDTG_FL_AMB_Y2_LV3[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector' incorporates: * Constant: '/Constant3' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_lg[0] = g_assDTG_FL_AMB_X1_LV3[Comp_Max_RPM_Allowed - 1]; break; case 4: /* Selector: '/Selector1' incorporates: * Constant: '/Constant10' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[2] = g_assDTG_FL_AMB_Y2_LV4[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector' incorporates: * Constant: '/Constant4' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_lg[0] = g_assDTG_FL_AMB_X1_LV4[Comp_Max_RPM_Allowed - 1]; break; default: /* Selector: '/Selector1' incorporates: * Constant: '/Constant11' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[2] = g_assDTG_FL_AMB_Y2_LV5[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector' incorporates: * Constant: '/Constant5' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_lg[0] = g_assDTG_FL_AMB_X1_LV5[Comp_Max_RPM_Allowed - 1]; break; } /* End of MultiPortSwitch: '/Multiport Switch2' */ /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant24' */ rtb_VectorConcatenate_lg[1] = 0; /* MultiPortSwitch: '/Multiport Switch2' */ switch (rtb_Switch3_ed) { case 0: /* Selector: '/Selector1' incorporates: * Constant: '/Constant6' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_lg[2] = g_assDTG_FL_AMB_X2_LV0[Comp_Max_RPM_Allowed - 1]; break; case 1: /* Selector: '/Selector1' incorporates: * Constant: '/Constant7' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_lg[2] = g_assDTG_FL_AMB_X2_LV1[Comp_Max_RPM_Allowed - 1]; break; case 2: /* Selector: '/Selector1' incorporates: * Constant: '/Constant8' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_lg[2] = g_assDTG_FL_AMB_X2_LV2[Comp_Max_RPM_Allowed - 1]; break; case 3: /* Selector: '/Selector1' incorporates: * Constant: '/Constant9' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_lg[2] = g_assDTG_FL_AMB_X2_LV3[Comp_Max_RPM_Allowed - 1]; break; case 4: /* Selector: '/Selector1' incorporates: * Constant: '/Constant10' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_lg[2] = g_assDTG_FL_AMB_X2_LV4[Comp_Max_RPM_Allowed - 1]; break; default: /* Selector: '/Selector1' incorporates: * Constant: '/Constant11' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_lg[2] = g_assDTG_FL_AMB_X2_LV5[Comp_Max_RPM_Allowed - 1]; break; } /* End of MultiPortSwitch: '/Multiport Switch2' */ /* Lookup_n-D: '/2.6 FLL_tg_amb' */ rtb_MultiportSwitch1_h = look1_is16lu64n32Ds32_binlcn(rtb_Bias5, rtb_VectorConcatenate_lg, rtb_VectorConcatenate_e0, 2U); /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant24' */ rtb_VectorConcatenate_bl[0] = 0; /* MultiPortSwitch: '/Multiport Switch1' */ switch (rtb_Switch3_ed) { case 0: /* Selector: '/Selector' incorporates: * Constant: '/Constant' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_bl[1] = g_assDTG_FL_SUN_Y1_LV0[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant6' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_bl[2] = g_assDTG_FL_SUN_Y2_LV0[Comp_Max_RPM_Allowed - 1]; break; case 1: /* Selector: '/Selector' incorporates: * Constant: '/Constant1' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_bl[1] = g_assDTG_FL_SUN_Y1_LV1[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant7' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_bl[2] = g_assDTG_FL_SUN_Y2_LV1[Comp_Max_RPM_Allowed - 1]; break; case 2: /* Selector: '/Selector' incorporates: * Constant: '/Constant2' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_bl[1] = g_assDTG_FL_SUN_Y1_LV2[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant8' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_bl[2] = g_assDTG_FL_SUN_Y2_LV2[Comp_Max_RPM_Allowed - 1]; break; case 3: /* Selector: '/Selector' incorporates: * Constant: '/Constant3' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_bl[1] = g_assDTG_FL_SUN_Y1_LV3[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant9' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_bl[2] = g_assDTG_FL_SUN_Y2_LV3[Comp_Max_RPM_Allowed - 1]; break; case 4: /* Selector: '/Selector' incorporates: * Constant: '/Constant4' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_bl[1] = g_assDTG_FL_SUN_Y1_LV4[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant10' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_bl[2] = g_assDTG_FL_SUN_Y2_LV4[Comp_Max_RPM_Allowed - 1]; break; default: /* Selector: '/Selector' incorporates: * Constant: '/Constant5' * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_VectorConcatenate_bl[1] = g_assDTG_FL_SUN_Y1_LV5[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant11' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_bl[2] = g_assDTG_FL_SUN_Y2_LV5[Comp_Max_RPM_Allowed - 1]; break; } /* End of MultiPortSwitch: '/Multiport Switch1' */ /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant24' */ rtb_VectorConcatenate_km[0] = 0; /* Selector: '/Selector' incorporates: * Constant: '/Constant' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_km[1] = g_assDTG_FL_AMB_X1_LV0[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant6' * DataTypeConversion: '/Data Type Conversion1' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_km[2] = g_assDTG_FL_AMB_X2_LV0[Comp_Max_RPM_Allowed - 1]; /* Lookup_n-D: '/2.6 FLL_tg_amb' incorporates: * DataStoreRead: '/Data Store Read26' */ rtb_Bias3 = look1_bs16ts16Dd_binlc(rtDW.Sun_L, rtb_VectorConcatenate_km, rtb_VectorConcatenate_bl, 2U); /* Sum: '/FLU_tg_correct' */ rtb_FLU_tg_correct_de = (int16_t)((int16_t)((int16_t)(rtb_u6FLU_tg_amb_hq + rtb_MultiportSwitch_ae) + rtb_MultiportSwitch1_h) + rtb_Bias3); /* Selector: '/Selector' incorporates: * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_FLU_tg_correct_g = rtb_uDLookupTable7_g[Comp_Max_RPM_Allowed - 1]; /* Switch: '/Switch2' incorporates: * DataStoreWrite: '/Data Store Write6' * RelationalOperator: '/LowerRelop1' * Selector: '/Selector' */ if (rtb_FLU_tg_correct_de > rtb_FLU_tg_correct_g) { rtb_FLU_tg_correct_de = rtb_FLU_tg_correct_g; } else { /* MultiPortSwitch: '/Multiport Switch1' incorporates: * Constant: '/Constant' */ for (i = 0; i < 7; i++) { rtb_uDLookupTable7_g[i] = g_assDTG_FL_MIN_LV0[i]; } /* End of MultiPortSwitch: '/Multiport Switch1' */ /* Selector: '/Selector' incorporates: * DataTypeConversion: '/Data Type Conversion1' * Selector: '/Selector' */ rtb_FLU_tg_correct_g = rtb_uDLookupTable7_g[Comp_Max_RPM_Allowed - 1]; /* Switch: '/Switch' incorporates: * DataStoreWrite: '/Data Store Write6' * RelationalOperator: '/UpperRelop' * Selector: '/Selector' */ if (rtb_FLU_tg_correct_de < rtb_FLU_tg_correct_g) { rtb_FLU_tg_correct_de = rtb_FLU_tg_correct_g; } /* End of Switch: '/Switch' */ } /* End of Switch: '/Switch2' */ /* MultiPortSwitch: '/Multiport Switch1' incorporates: * Constant: '/Constant' */ for (i = 0; i < 7; i++) { rtb_uDLookupTable7_g[i] = g_assDTG_FL_MAX_LV0[i]; } /* End of MultiPortSwitch: '/Multiport Switch1' */ /* MultiPortSwitch: '/Multiport Switch' incorporates: * Lookup_n-D: '/1-D Lookup Table' * Lookup_n-D: '/1-D Lookup Table1' * Lookup_n-D: '/1-D Lookup Table2' * Lookup_n-D: '/1-D Lookup Table3' * Lookup_n-D: '/1-D Lookup Table4' * Lookup_n-D: '/1-D Lookup Table5' * Saturate: '/Saturation1' */ switch (rtb_Switch3_ed) { case 0: rtb_Bias2 = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain1, rtConstP.pooled51, &g_assTG_FRL_LV0[0], 12U); /* MultiPortSwitch: '/Multiport Switch' incorporates: * Lookup_n-D: '/1-D Lookup Table' * Lookup_n-D: '/1-D Lookup Table' * Saturate: '/Saturation1' */ rtb_Bias4 = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain1, rtConstP.pooled51, &g_assINCAR_TG_FR_LV0[0], 12U); /* Selector: '/Selector' incorporates: * Constant: '/Constant' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[0] = g_assDTG_FL_INC_Y1_LV0[Blower_AF_RL - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant6' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[1] = g_assDTG_FL_INC_Y2_LV0[Blower_AF_RL - 1]; break; case 1: rtb_Bias2 = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain1, rtConstP.pooled51, &g_assTG_FRL_LV1[0], 12U); /* MultiPortSwitch: '/Multiport Switch' incorporates: * Lookup_n-D: '/1-D Lookup Table1' * Lookup_n-D: '/1-D Lookup Table1' * Saturate: '/Saturation1' */ rtb_Bias4 = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain1, rtConstP.pooled51, &g_assINCAR_TG_FR_LV1[0], 12U); /* Selector: '/Selector' incorporates: * Constant: '/Constant1' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[0] = g_assDTG_FL_INC_Y1_LV1[Blower_AF_RL - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant7' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[1] = g_assDTG_FL_INC_Y2_LV1[Blower_AF_RL - 1]; break; case 2: rtb_Bias2 = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain1, rtConstP.pooled51, &g_assTG_FRL_LV2[0], 12U); /* MultiPortSwitch: '/Multiport Switch' incorporates: * Lookup_n-D: '/1-D Lookup Table2' * Lookup_n-D: '/1-D Lookup Table2' * Saturate: '/Saturation1' */ rtb_Bias4 = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain1, rtConstP.pooled51, &g_assINCAR_TG_FR_LV2[0], 12U); /* Selector: '/Selector' incorporates: * Constant: '/Constant2' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[0] = g_assDTG_FL_INC_Y1_LV2[Blower_AF_RL - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant8' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[1] = g_assDTG_FL_INC_Y2_LV2[Blower_AF_RL - 1]; break; case 3: rtb_Bias2 = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain1, rtConstP.pooled51, &g_assTG_FRL_LV3[0], 12U); /* MultiPortSwitch: '/Multiport Switch' incorporates: * Lookup_n-D: '/1-D Lookup Table3' * Lookup_n-D: '/1-D Lookup Table3' * Saturate: '/Saturation1' */ rtb_Bias4 = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain1, rtConstP.pooled51, &g_assINCAR_TG_FR_LV3[0], 12U); /* Selector: '/Selector' incorporates: * Constant: '/Constant3' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[0] = g_assDTG_FL_INC_Y1_LV3[Blower_AF_RL - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant9' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[1] = g_assDTG_FL_INC_Y2_LV3[Blower_AF_RL - 1]; break; case 4: rtb_Bias2 = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain1, rtConstP.pooled51, &g_assTG_FRL_LV4[0], 12U); /* MultiPortSwitch: '/Multiport Switch' incorporates: * Lookup_n-D: '/1-D Lookup Table4' * Lookup_n-D: '/1-D Lookup Table4' * Saturate: '/Saturation1' */ rtb_Bias4 = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain1, rtConstP.pooled51, &g_assINCAR_TG_FR_LV4[0], 12U); /* Selector: '/Selector' incorporates: * Constant: '/Constant4' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[0] = g_assDTG_FL_INC_Y1_LV4[Blower_AF_RL - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant10' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[1] = g_assDTG_FL_INC_Y2_LV4[Blower_AF_RL - 1]; break; default: rtb_Bias2 = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain1, rtConstP.pooled51, &g_assTG_FRL_LV5[0], 12U); /* MultiPortSwitch: '/Multiport Switch' incorporates: * Lookup_n-D: '/1-D Lookup Table5' * Lookup_n-D: '/1-D Lookup Table5' * Saturate: '/Saturation1' */ rtb_Bias4 = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain1, rtConstP.pooled51, &g_assINCAR_TG_FR_LV5[0], 12U); /* Selector: '/Selector' incorporates: * Constant: '/Constant5' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[0] = g_assDTG_FL_INC_Y1_LV5[Blower_AF_RL - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant11' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[1] = g_assDTG_FL_INC_Y2_LV5[Blower_AF_RL - 1]; break; } /* End of MultiPortSwitch: '/Multiport Switch' */ /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant24' */ rtb_VectorConcatenate_jn[2] = 0; /* MultiPortSwitch: '/Multiport Switch3' */ switch (rtb_Switch3_ed) { case 0: /* Selector: '/Selector2' incorporates: * Constant: '/Constant14' * DataTypeConversion: '/Data Type Conversion2' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[3] = g_assDTG_FL_INC_Y3_LV0[Blower_AF_RL - 1]; /* Selector: '/Selector3' incorporates: * Constant: '/Constant20' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch4' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[4] = g_assDTG_FL_INC_Y4_LV0[Blower_AF_RL - 1]; /* Selector: '/Selector' */ rtb_VectorConcatenate_lo[0] = rtb_Bias_ct; /* Selector: '/Selector1' */ rtb_VectorConcatenate_lo[1] = rtb_FLU_tg_correct_b; break; case 1: /* Selector: '/Selector2' incorporates: * Constant: '/Constant15' * DataTypeConversion: '/Data Type Conversion2' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[3] = g_assDTG_FL_INC_Y3_LV1[Blower_AF_RL - 1]; /* Selector: '/Selector3' incorporates: * Constant: '/Constant21' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch4' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[4] = g_assDTG_FL_INC_Y4_LV1[Blower_AF_RL - 1]; /* Selector: '/Selector' incorporates: * Constant: '/Constant1' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[0] = g_assDTG_FU_INC_X1_LV1[Blower_AF_RL - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant7' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[1] = g_assDTG_FU_INC_X2_LV1[Blower_AF_RL - 1]; break; case 2: /* Selector: '/Selector2' incorporates: * Constant: '/Constant16' * DataTypeConversion: '/Data Type Conversion2' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[3] = g_assDTG_FL_INC_Y3_LV2[Blower_AF_RL - 1]; /* Selector: '/Selector3' incorporates: * Constant: '/Constant22' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch4' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[4] = g_assDTG_FL_INC_Y4_LV2[Blower_AF_RL - 1]; /* Selector: '/Selector' incorporates: * Constant: '/Constant2' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[0] = g_assDTG_FU_INC_X1_LV2[Blower_AF_RL - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant8' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[1] = g_assDTG_FU_INC_X2_LV2[Blower_AF_RL - 1]; break; case 3: /* Selector: '/Selector2' incorporates: * Constant: '/Constant17' * DataTypeConversion: '/Data Type Conversion2' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[3] = g_assDTG_FL_INC_Y3_LV3[Blower_AF_RL - 1]; /* Selector: '/Selector3' incorporates: * Constant: '/Constant23' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch4' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[4] = g_assDTG_FL_INC_Y4_LV3[Blower_AF_RL - 1]; /* Selector: '/Selector' incorporates: * Constant: '/Constant3' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[0] = g_assDTG_FU_INC_X1_LV3[Blower_AF_RL - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant9' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[1] = g_assDTG_FU_INC_X2_LV3[Blower_AF_RL - 1]; break; case 4: /* Selector: '/Selector2' incorporates: * Constant: '/Constant12' * DataTypeConversion: '/Data Type Conversion2' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[3] = g_assDTG_FL_INC_Y3_LV4[Blower_AF_RL - 1]; /* Selector: '/Selector3' incorporates: * Constant: '/Constant18' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch4' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[4] = g_assDTG_FL_INC_Y4_LV4[Blower_AF_RL - 1]; /* Selector: '/Selector' incorporates: * Constant: '/Constant4' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[0] = g_assDTG_FU_INC_X1_LV4[Blower_AF_RL - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant10' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[1] = g_assDTG_FU_INC_X2_LV4[Blower_AF_RL - 1]; break; default: /* Selector: '/Selector2' incorporates: * Constant: '/Constant13' * DataTypeConversion: '/Data Type Conversion2' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[3] = g_assDTG_FL_INC_Y3_LV5[Blower_AF_RL - 1]; /* Selector: '/Selector3' incorporates: * Constant: '/Constant19' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch4' * Selector: '/Selector' */ rtb_VectorConcatenate_jn[4] = g_assDTG_FL_INC_Y4_LV5[Blower_AF_RL - 1]; /* Selector: '/Selector' incorporates: * Constant: '/Constant5' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[0] = g_assDTG_FU_INC_X1_LV5[Blower_AF_RL - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant11' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[1] = g_assDTG_FU_INC_X2_LV5[Blower_AF_RL - 1]; break; } /* End of MultiPortSwitch: '/Multiport Switch3' */ /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant24' */ rtb_VectorConcatenate_lo[2] = 0; /* MultiPortSwitch: '/Multiport Switch3' */ switch (rtb_Switch3_ed) { case 0: /* Selector: '/Selector2' */ rtb_VectorConcatenate_lo[3] = rtb_Bias1_h; /* Selector: '/Selector3' */ rtb_VectorConcatenate_lo[4] = Duct3_R; break; case 1: /* Selector: '/Selector2' incorporates: * Constant: '/Constant15' * DataTypeConversion: '/Data Type Conversion2' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[3] = g_assDTG_FU_INC_X3_LV1[Blower_AF_RL - 1]; /* Selector: '/Selector3' incorporates: * Constant: '/Constant21' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch4' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[4] = g_assDTG_FU_INC_X4_LV1[Blower_AF_RL - 1]; break; case 2: /* Selector: '/Selector2' incorporates: * Constant: '/Constant16' * DataTypeConversion: '/Data Type Conversion2' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[3] = g_assDTG_FU_INC_X3_LV2[Blower_AF_RL - 1]; /* Selector: '/Selector3' incorporates: * Constant: '/Constant22' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch4' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[4] = g_assDTG_FU_INC_X4_LV2[Blower_AF_RL - 1]; break; case 3: /* Selector: '/Selector2' incorporates: * Constant: '/Constant17' * DataTypeConversion: '/Data Type Conversion2' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[3] = g_assDTG_FU_INC_X3_LV3[Blower_AF_RL - 1]; /* Selector: '/Selector3' incorporates: * Constant: '/Constant23' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch4' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[4] = g_assDTG_FU_INC_X4_LV3[Blower_AF_RL - 1]; break; case 4: /* Selector: '/Selector2' incorporates: * Constant: '/Constant12' * DataTypeConversion: '/Data Type Conversion2' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[3] = g_assDTG_FU_INC_X3_LV4[Blower_AF_RL - 1]; /* Selector: '/Selector3' incorporates: * Constant: '/Constant18' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch4' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[4] = g_assDTG_FU_INC_X4_LV4[Blower_AF_RL - 1]; break; default: /* Selector: '/Selector2' incorporates: * Constant: '/Constant13' * DataTypeConversion: '/Data Type Conversion2' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[3] = g_assDTG_FU_INC_X3_LV5[Blower_AF_RL - 1]; /* Selector: '/Selector3' incorporates: * Constant: '/Constant19' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch4' * Selector: '/Selector' */ rtb_VectorConcatenate_lo[4] = g_assDTG_FU_INC_X4_LV5[Blower_AF_RL - 1]; break; } /* Lookup_n-D: '/2.5 FRL_tg_incar' incorporates: * DataStoreRead: '/Data Store Read22' * Sum: '/2.5. X = Inc_Tg - Incar_fb' */ rtb_Bias1_h = look1_is16lu64n32Ds32_binlcn((int16_t)(rtb_Bias4 - rtDW.Incar_FR), rtb_VectorConcatenate_lo, rtb_VectorConcatenate_jn, 4U); /* MultiPortSwitch: '/Multiport Switch1' */ switch (rtb_Switch3_ed) { case 0: /* Selector: '/Selector' incorporates: * Constant: '/Constant' * DataTypeConversion: '/Data Type Conversion2' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[0] = g_assDTG_FL_AMB_Y1_LV0[Blower_AF_RL - 1]; break; case 1: /* Selector: '/Selector' incorporates: * Constant: '/Constant1' * DataTypeConversion: '/Data Type Conversion2' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[0] = g_assDTG_FL_AMB_Y1_LV1[Blower_AF_RL - 1]; break; case 2: /* Selector: '/Selector' incorporates: * Constant: '/Constant2' * DataTypeConversion: '/Data Type Conversion2' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[0] = g_assDTG_FL_AMB_Y1_LV2[Blower_AF_RL - 1]; break; case 3: /* Selector: '/Selector' incorporates: * Constant: '/Constant3' * DataTypeConversion: '/Data Type Conversion2' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[0] = g_assDTG_FL_AMB_Y1_LV3[Blower_AF_RL - 1]; break; case 4: /* Selector: '/Selector' incorporates: * Constant: '/Constant4' * DataTypeConversion: '/Data Type Conversion2' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[0] = g_assDTG_FL_AMB_Y1_LV4[Blower_AF_RL - 1]; break; default: /* Selector: '/Selector' incorporates: * Constant: '/Constant5' * DataTypeConversion: '/Data Type Conversion2' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[0] = g_assDTG_FL_AMB_Y1_LV5[Blower_AF_RL - 1]; break; } /* End of MultiPortSwitch: '/Multiport Switch1' */ /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant24' */ rtb_VectorConcatenate_e0[1] = 0; /* MultiPortSwitch: '/Multiport Switch2' */ switch (rtb_Switch3_ed) { case 0: /* Selector: '/Selector1' incorporates: * Constant: '/Constant6' * DataTypeConversion: '/Data Type Conversion2' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[2] = g_assDTG_FL_AMB_Y2_LV0[Blower_AF_RL - 1]; /* Selector: '/Selector' incorporates: * Constant: '/Constant' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_lg[0] = g_assDTG_FL_AMB_X1_LV0[Blower_AF_RL - 1]; break; case 1: /* Selector: '/Selector1' incorporates: * Constant: '/Constant7' * DataTypeConversion: '/Data Type Conversion2' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[2] = g_assDTG_FL_AMB_Y2_LV1[Blower_AF_RL - 1]; /* Selector: '/Selector' incorporates: * Constant: '/Constant1' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_lg[0] = g_assDTG_FL_AMB_X1_LV1[Blower_AF_RL - 1]; break; case 2: /* Selector: '/Selector1' incorporates: * Constant: '/Constant8' * DataTypeConversion: '/Data Type Conversion2' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[2] = g_assDTG_FL_AMB_Y2_LV2[Blower_AF_RL - 1]; /* Selector: '/Selector' incorporates: * Constant: '/Constant2' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_lg[0] = g_assDTG_FL_AMB_X1_LV2[Blower_AF_RL - 1]; break; case 3: /* Selector: '/Selector1' incorporates: * Constant: '/Constant9' * DataTypeConversion: '/Data Type Conversion2' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[2] = g_assDTG_FL_AMB_Y2_LV3[Blower_AF_RL - 1]; /* Selector: '/Selector' incorporates: * Constant: '/Constant3' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_lg[0] = g_assDTG_FL_AMB_X1_LV3[Blower_AF_RL - 1]; break; case 4: /* Selector: '/Selector1' incorporates: * Constant: '/Constant10' * DataTypeConversion: '/Data Type Conversion2' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[2] = g_assDTG_FL_AMB_Y2_LV4[Blower_AF_RL - 1]; /* Selector: '/Selector' incorporates: * Constant: '/Constant4' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_lg[0] = g_assDTG_FL_AMB_X1_LV4[Blower_AF_RL - 1]; break; default: /* Selector: '/Selector1' incorporates: * Constant: '/Constant11' * DataTypeConversion: '/Data Type Conversion2' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[2] = g_assDTG_FL_AMB_Y2_LV5[Blower_AF_RL - 1]; /* Selector: '/Selector' incorporates: * Constant: '/Constant5' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_lg[0] = g_assDTG_FL_AMB_X1_LV5[Blower_AF_RL - 1]; break; } /* End of MultiPortSwitch: '/Multiport Switch2' */ /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant24' */ rtb_VectorConcatenate_lg[1] = 0; /* MultiPortSwitch: '/Multiport Switch2' */ switch (rtb_Switch3_ed) { case 0: /* Selector: '/Selector1' incorporates: * Constant: '/Constant6' * DataTypeConversion: '/Data Type Conversion2' * Selector: '/Selector' */ rtb_VectorConcatenate_lg[2] = g_assDTG_FL_AMB_X2_LV0[Blower_AF_RL - 1]; break; case 1: /* Selector: '/Selector1' incorporates: * Constant: '/Constant7' * DataTypeConversion: '/Data Type Conversion2' * Selector: '/Selector' */ rtb_VectorConcatenate_lg[2] = g_assDTG_FL_AMB_X2_LV1[Blower_AF_RL - 1]; break; case 2: /* Selector: '/Selector1' incorporates: * Constant: '/Constant8' * DataTypeConversion: '/Data Type Conversion2' * Selector: '/Selector' */ rtb_VectorConcatenate_lg[2] = g_assDTG_FL_AMB_X2_LV2[Blower_AF_RL - 1]; break; case 3: /* Selector: '/Selector1' incorporates: * Constant: '/Constant9' * DataTypeConversion: '/Data Type Conversion2' * Selector: '/Selector' */ rtb_VectorConcatenate_lg[2] = g_assDTG_FL_AMB_X2_LV3[Blower_AF_RL - 1]; break; case 4: /* Selector: '/Selector1' incorporates: * Constant: '/Constant10' * DataTypeConversion: '/Data Type Conversion2' * Selector: '/Selector' */ rtb_VectorConcatenate_lg[2] = g_assDTG_FL_AMB_X2_LV4[Blower_AF_RL - 1]; break; default: /* Selector: '/Selector1' incorporates: * Constant: '/Constant11' * DataTypeConversion: '/Data Type Conversion2' * Selector: '/Selector' */ rtb_VectorConcatenate_lg[2] = g_assDTG_FL_AMB_X2_LV5[Blower_AF_RL - 1]; break; } /* End of MultiPortSwitch: '/Multiport Switch2' */ /* Lookup_n-D: '/2.6 FLL_tg_amb' */ rtb_Bias_ct = look1_is16lu64n32Ds32_binlcn(rtb_Bias5, rtb_VectorConcatenate_lg, rtb_VectorConcatenate_e0, 2U); /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant24' */ rtb_VectorConcatenate_bl[0] = 0; /* Selector: '/Selector' incorporates: * Constant: '/Constant' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_bl[1] = g_assDTG_FL_SUN_Y1_LV0[Blower_AF_RL - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant6' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_bl[2] = g_assDTG_FL_SUN_Y2_LV0[Blower_AF_RL - 1]; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant24' */ rtb_VectorConcatenate_km[0] = 0; /* MultiPortSwitch: '/Multiport Switch1' */ switch (rtb_Switch3_ed) { case 0: /* Selector: '/Selector' incorporates: * Constant: '/Constant' * DataTypeConversion: '/Data Type Conversion2' * Selector: '/Selector' */ rtb_VectorConcatenate_km[1] = g_assDTG_FL_AMB_X1_LV0[Blower_AF_RL - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant6' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_km[2] = g_assDTG_FL_AMB_X2_LV0[Blower_AF_RL - 1]; break; case 1: /* Selector: '/Selector' incorporates: * Constant: '/Constant1' * DataTypeConversion: '/Data Type Conversion2' * Selector: '/Selector' */ rtb_VectorConcatenate_km[1] = g_assDTG_FL_AMB_X1_LV1[Blower_AF_RL - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant7' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_km[2] = g_assDTG_FL_AMB_X2_LV1[Blower_AF_RL - 1]; break; case 2: /* Selector: '/Selector' incorporates: * Constant: '/Constant2' * DataTypeConversion: '/Data Type Conversion2' * Selector: '/Selector' */ rtb_VectorConcatenate_km[1] = g_assDTG_FL_AMB_X1_LV2[Blower_AF_RL - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant8' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_km[2] = g_assDTG_FL_AMB_X2_LV2[Blower_AF_RL - 1]; break; case 3: /* Selector: '/Selector' incorporates: * Constant: '/Constant3' * DataTypeConversion: '/Data Type Conversion2' * Selector: '/Selector' */ rtb_VectorConcatenate_km[1] = g_assDTG_FL_AMB_X1_LV3[Blower_AF_RL - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant9' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_km[2] = g_assDTG_FL_AMB_X2_LV3[Blower_AF_RL - 1]; break; case 4: /* Selector: '/Selector' incorporates: * Constant: '/Constant4' * DataTypeConversion: '/Data Type Conversion2' * Selector: '/Selector' */ rtb_VectorConcatenate_km[1] = g_assDTG_FL_AMB_X1_LV4[Blower_AF_RL - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant10' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_km[2] = g_assDTG_FL_AMB_X2_LV4[Blower_AF_RL - 1]; break; default: /* Selector: '/Selector' incorporates: * Constant: '/Constant5' * DataTypeConversion: '/Data Type Conversion2' * Selector: '/Selector' */ rtb_VectorConcatenate_km[1] = g_assDTG_FL_AMB_X1_LV5[Blower_AF_RL - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant11' * DataTypeConversion: '/Data Type Conversion2' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_km[2] = g_assDTG_FL_AMB_X2_LV5[Blower_AF_RL - 1]; break; } /* End of MultiPortSwitch: '/Multiport Switch1' */ /* Lookup_n-D: '/2.6 FLL_tg_amb' incorporates: * DataStoreRead: '/Data Store Read27' */ rtb_Bias5 = look1_bs16ts16Dd_binlc(rtDW.Sun_R, rtb_VectorConcatenate_km, rtb_VectorConcatenate_bl, 2U); /* Sum: '/FLU_tg_correct' */ rtb_FLU_tg_correct_b = (int16_t)((int16_t)((int16_t)(rtb_Bias2 + rtb_Bias1_h) + rtb_Bias_ct) + rtb_Bias5); /* Selector: '/Selector' incorporates: * DataTypeConversion: '/Data Type Conversion2' * Selector: '/Selector' */ rtb_FLU_tg_correct_g = rtb_uDLookupTable7_g[Blower_AF_RL - 1]; /* Switch: '/Switch2' incorporates: * DataStoreWrite: '/Data Store Write7' * RelationalOperator: '/LowerRelop1' * Selector: '/Selector' */ if (rtb_FLU_tg_correct_b > rtb_FLU_tg_correct_g) { rtb_FLU_tg_correct_b = rtb_FLU_tg_correct_g; } else { /* MultiPortSwitch: '/Multiport Switch1' incorporates: * Constant: '/Constant' */ for (i = 0; i < 7; i++) { rtb_uDLookupTable7_g[i] = g_assDTG_FL_MIN_LV0[i]; } /* End of MultiPortSwitch: '/Multiport Switch1' */ /* Selector: '/Selector' incorporates: * DataTypeConversion: '/Data Type Conversion2' * Selector: '/Selector' */ rtb_FLU_tg_correct_g = rtb_uDLookupTable7_g[Blower_AF_RL - 1]; /* Switch: '/Switch' incorporates: * DataStoreWrite: '/Data Store Write7' * RelationalOperator: '/UpperRelop' * Selector: '/Selector' */ if (rtb_FLU_tg_correct_b < rtb_FLU_tg_correct_g) { rtb_FLU_tg_correct_b = rtb_FLU_tg_correct_g; } /* End of Switch: '/Switch' */ } /* End of Switch: '/Switch2' */ /* SignalConversion generated from: '/Vector Concatenate' */ rtb_VectorConcatenate_lo[0] = rtb_u6FLU_tg_amb_hq; /* SignalConversion generated from: '/Vector Concatenate' */ rtb_VectorConcatenate_lo[1] = rtb_MultiportSwitch_ae; /* SignalConversion generated from: '/Vector Concatenate' */ rtb_VectorConcatenate_lo[2] = rtb_MultiportSwitch1_h; /* SignalConversion generated from: '/Vector Concatenate' */ rtb_VectorConcatenate_lo[3] = rtb_Bias3; /* SignalConversion generated from: '/Vector Concatenate' */ rtb_VectorConcatenate_lo[4] = rtb_u5FLU_tg_incar_l; /* SignalConversion generated from: '/Vector Concatenate' */ rtb_VectorConcatenate_jn[2] = rtb_y_lg; /* SignalConversion generated from: '/Vector Concatenate' */ rtb_VectorConcatenate_jn[3] = rtb_y_bf; /* SignalConversion generated from: '/Vector Concatenate' */ rtb_VectorConcatenate_j[0] = rtb_Bias2; /* SignalConversion generated from: '/Vector Concatenate' */ rtb_VectorConcatenate_j[1] = rtb_Bias1_h; /* SignalConversion generated from: '/Vector Concatenate' */ rtb_VectorConcatenate_j[2] = rtb_Bias_ct; /* SignalConversion generated from: '/Vector Concatenate' */ rtb_VectorConcatenate_j[3] = rtb_Bias5; /* SignalConversion generated from: '/Vector Concatenate' */ rtb_VectorConcatenate_j[4] = rtb_Bias4; /* SignalConversion generated from: '/Vector Concatenate' */ rtb_VectorConcatenate_bp[0] = rtb_y_h5; /* SignalConversion generated from: '/Vector Concatenate' */ rtb_VectorConcatenate_bp[1] = rtb_y_fe; /* SignalConversion generated from: '/Vector Concatenate' */ rtb_VectorConcatenate_bp[2] = rtb_y_ar; /* SignalConversion generated from: '/Vector Concatenate' */ rtb_VectorConcatenate_bp[3] = rtb_u6FLU_tg_amb; /* SignalConversion generated from: '/Vector Concatenate' */ rtb_VectorConcatenate_bp[4] = rtb_y_ck; for (i = 0; i < 5; i++) { /* DataStoreWrite: '/Data Store Write' */ Duct_FRL_Tg_DBG[i] = rtb_VectorConcatenate_j[i]; /* DataStoreWrite: '/Data Store Write' */ Duct_FRU_Tg_DBG[i] = rtb_VectorConcatenate_bp[i]; } /* MATLAB Function: '/is_ending_with_5' */ is_ending_with_5(Gain, &rtb_LogicalOperator5); /* MATLAB Function: '/correction rate' incorporates: * Gain: '/Gain2' */ /* : correct_after_time = [g_assCORRECT_DUCT_MAX_LV0; g_assCORRECT_DUCT_MAX_LV1; g_assCORRECT_DUCT_MAX_LV2; g_assCORRECT_DUCT_MAX_LV3; g_assCORRECT_DUCT_MAX_LV4; g_assCORRECT_DUCT_MAX_LV5]; */ /* : y = correct_after_time(LVL + 1, idivide(SET - 16 + 1, 2)); */ correctionrate((int16_t)(rtb_dt_an + (uint32_t)((rtb_Subtract & 262144U) != 0U)), rtb_Switch3_ed, &rtb_Bias5); /* MATLAB Function: '/is_ending_with_5' */ /* : correct_after_time = [g_assCORRECT_DUCT_TIME_FL_LV0; g_assCORRECT_DUCT_TIME_FL_LV1; g_assCORRECT_DUCT_TIME_FL_LV2; g_assCORRECT_DUCT_TIME_FL_LV3; g_assCORRECT_DUCT_TIME_FL_LV4; g_assCORRECT_DUCT_TIME_FL_LV5]; */ /* : y = correct_after_time(LVL + 1, idivide(SET - 16 + 1, 2)); */ is_ending_with_5(Gain1, &rtb_LogicalOperator5); /* MATLAB Function: '/correction rate' incorporates: * Gain: '/Gain2' */ /* : correct_after_time = [g_assCORRECT_DUCT_MAX_LV0; g_assCORRECT_DUCT_MAX_LV1; g_assCORRECT_DUCT_MAX_LV2; g_assCORRECT_DUCT_MAX_LV3; g_assCORRECT_DUCT_MAX_LV4; g_assCORRECT_DUCT_MAX_LV5]; */ /* : y = correct_after_time(LVL + 1, idivide(SET - 16 + 1, 2)); */ correctionrate((int16_t)(rtb_Gain_fc_tmp_tmp_0 + (uint32_t) ((rtb_Gain_fc_tmp_tmp & 262144U) != 0U)), rtb_Switch3_ed, &rtb_Bias5); /* Outputs for Enabled SubSystem: '/Front Left AF - manual directions' incorporates: * EnablePort: '/Enable' */ /* RelationalOperator: '/Equal2' incorporates: * Constant: '/Constant2' * DataStoreRead: '/Data Store Read44' */ /* : correct_after_time = [g_assCORRECT_DUCT_TIME_FR_LV0; g_assCORRECT_DUCT_TIME_FR_LV1; g_assCORRECT_DUCT_TIME_FR_LV2; g_assCORRECT_DUCT_TIME_FR_LV3; g_assCORRECT_DUCT_TIME_FR_LV4; g_assCORRECT_DUCT_TIME_FR_LV5]; */ /* : y = correct_after_time(LVL + 1, idivide(SET - 16 + 1, 2)); */ if (rtDW.CCU_MODE_FL == 0) { /* MATLAB Function: '/AF for Bi Level' incorporates: * DataStoreRead: '/Data Store Read11' */ AFforBiLevel(rtDW.CCU_BLOWERS_FL, &Gain); /* MATLAB Function: '/AF for Def' incorporates: * DataStoreRead: '/Data Store Read11' */ AFforDef(rtDW.CCU_BLOWERS_FL, &Gain1); /* MATLAB Function: '/AF for Foor + Def' incorporates: * DataStoreRead: '/Data Store Read11' */ AFforFoorDef(rtDW.CCU_BLOWERS_FL, &rtb_out_eu); /* MATLAB Function: '/AF for Foot' incorporates: * DataStoreRead: '/Data Store Read11' */ AFforFoot(rtDW.CCU_BLOWERS_FL, &rtb_out_aq0); /* MATLAB Function: '/AF for Hi_Level' incorporates: * DataStoreRead: '/Data Store Read11' */ AFforHi_Level(rtDW.CCU_BLOWERS_FL, &rtb_out_ddc); /* MATLAB Function: '/AF for Tri-Level' incorporates: * DataStoreRead: '/Data Store Read11' */ AFforTriLevel(rtDW.CCU_BLOWERS_FL, &rtB.MultiportSwitch_o2); /* MATLAB Function: '/AF for Vent mode' incorporates: * DataStoreRead: '/Data Store Read11' */ AFforVentmode(rtDW.CCU_BLOWERS_FL, &rtb_out_p4); /* RelationalOperator: '/Relational Operator2' incorporates: * Constant: '/Constant2' * DataStoreRead: '/Data Store Read9' */ rtb_LogicalOperator5 = (rtDW.CCU_FOOT_FL == 1); /* DataTypeConversion: '/Data Type Conversion5' */ rtb_Switch_gs = rtb_LogicalOperator5; /* MultiPortSwitch: '/Multiport Switch' incorporates: * Constant: '/Constant' * Constant: '/Constant1' * DataStoreRead: '/Data Store Read6' * DataStoreRead: '/Data Store Read8' * DataTypeConversion: '/Data Type Conversion5' * Gain: '/Gain1' * Gain: '/Gain2' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator1' * Sum: '/Add' */ switch ((int32_t)(((uint32_t)((rtDW.CCU_FACE_FL == 1) << 1) + (uint32_t) (rtDW.CCU_DEF_FL == 1)) + (uint32_t)(rtb_LogicalOperator5 << 2))) { case 0: /* MultiPortSwitch: '/Multiport Switch' incorporates: * Constant: '/Constant3' */ rtB.MultiportSwitch_o2 = 0U; break; case 1: /* MultiPortSwitch: '/Multiport Switch' */ rtB.MultiportSwitch_o2 = Gain1; break; case 2: /* MultiPortSwitch: '/Multiport Switch' */ rtB.MultiportSwitch_o2 = rtb_out_p4; break; case 3: /* MultiPortSwitch: '/Multiport Switch' */ rtB.MultiportSwitch_o2 = rtb_out_ddc; break; case 4: /* MultiPortSwitch: '/Multiport Switch' */ rtB.MultiportSwitch_o2 = rtb_out_aq0; break; case 5: /* MultiPortSwitch: '/Multiport Switch' */ rtB.MultiportSwitch_o2 = rtb_out_eu; break; case 6: /* MultiPortSwitch: '/Multiport Switch' */ rtB.MultiportSwitch_o2 = Gain; break; } /* End of MultiPortSwitch: '/Multiport Switch' */ } /* End of RelationalOperator: '/Equal2' */ /* End of Outputs for SubSystem: '/Front Left AF - manual directions' */ /* MATLAB Function: '/func g_ascAUTO_STEP_AF_F' incorporates: * DataStoreRead: '/Data Store Read' * DataTypeConversion: '/Data Type Conversion1' */ funcg_ascAUTO_STEP_AF_F((int8_t)rtDW.CCU_AUTOMODE_FL, &rtb_y_b2); /* MultiPortSwitch: '/Multiport Switch1' incorporates: * Constant: '/Constant' */ for (i = 0; i < 7; i++) { rtb_uDLookupTable7_g[i] = g_assVF_MAX_LV0[i]; } /* End of MultiPortSwitch: '/Multiport Switch1' */ /* Saturate: '/Saturation5' incorporates: * DataStoreRead: '/Data Store Read30' */ if (rtDW.CCU_SET_FL > 290) { Gain = 290U; } else if (rtDW.CCU_SET_FL < 170) { Gain = 170U; } else { Gain = rtDW.CCU_SET_FL; } /* End of Saturate: '/Saturation5' */ /* Gain: '/Gain4' incorporates: * Bias: '/Bias1' * DataTypeConversion: '/Data Type Conversion4' * Gain: '/Gain3' * Gain: '/Gain' */ rtb_Gain_pl = ((int32_t)((52429U * Gain) >> 19) + -15) << 14; /* DataTypeConversion: '/Data Type Conversion3' incorporates: * Gain: '/Gain' * Saturate: '/Saturation1' */ Comp_Max_RPM_Allowed = (uint8_t)((((uint32_t)rtb_Gain_pl & 16384U) != 0U) + (rtb_Gain_pl >> 15)); /* Selector: '/Selector' */ rtb_Bias5 = rtb_uDLookupTable7_g[Comp_Max_RPM_Allowed - 1]; /* Saturate: '/Saturation9' incorporates: * DataStoreRead: '/Data Store Read42' */ if (rtDW.LEVEL <= 5) { rtb_Saturation9 = rtDW.LEVEL; } else { rtb_Saturation9 = 5U; } /* End of Saturate: '/Saturation9' */ /* MultiPortSwitch: '/Multiport Switch1' incorporates: * Lookup_n-D: '/1-D Lookup Table10' * Lookup_n-D: '/1-D Lookup Table11' * Lookup_n-D: '/1-D Lookup Table6' * Lookup_n-D: '/1-D Lookup Table7' * Lookup_n-D: '/1-D Lookup Table8' * Lookup_n-D: '/1-D Lookup Table9' * Saturate: '/Saturation5' */ switch (rtb_Saturation9) { case 0: rtb_Bias_ct = look1_iu16lu64n48ts16Ds32_binlcs(Gain, rtConstP.pooled72, &g_assVTG_FL_LV0[0], 12U); /* MultiPortSwitch: '/Multiport Switch' incorporates: * Lookup_n-D: '/1-D Lookup Table6' * Lookup_n-D: '/1-D Lookup Table' * Saturate: '/Saturation5' */ rtb_Bias1_h = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain, rtConstP.pooled51, &g_assINCAR_TG_FL_LV0[0], 12U); break; case 1: rtb_Bias_ct = look1_iu16lu64n48ts16Ds32_binlcs(Gain, rtConstP.pooled72, &g_assVTG_FL_LV1[0], 12U); /* MultiPortSwitch: '/Multiport Switch' incorporates: * Lookup_n-D: '/1-D Lookup Table7' * Lookup_n-D: '/1-D Lookup Table1' * Saturate: '/Saturation5' */ rtb_Bias1_h = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain, rtConstP.pooled51, &g_assINCAR_TG_FL_LV1[0], 12U); break; case 2: rtb_Bias_ct = look1_iu16lu64n48ts16Ds32_binlcs(Gain, rtConstP.pooled72, &g_assVTG_FL_LV1[0], 12U); /* MultiPortSwitch: '/Multiport Switch' incorporates: * Lookup_n-D: '/1-D Lookup Table8' * Lookup_n-D: '/1-D Lookup Table2' * Saturate: '/Saturation5' */ rtb_Bias1_h = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain, rtConstP.pooled51, &g_assINCAR_TG_FL_LV2[0], 12U); break; case 3: rtb_Bias_ct = look1_iu16lu64n48ts16Ds32_binlcs(Gain, rtConstP.pooled72, &g_assVTG_FL_LV3[0], 12U); /* MultiPortSwitch: '/Multiport Switch' incorporates: * Lookup_n-D: '/1-D Lookup Table9' * Lookup_n-D: '/1-D Lookup Table3' * Saturate: '/Saturation5' */ rtb_Bias1_h = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain, rtConstP.pooled51, &g_assINCAR_TG_FL_LV3[0], 12U); break; case 4: rtb_Bias_ct = look1_iu16lu64n48ts16Ds32_binlcs(Gain, rtConstP.pooled72, &g_assVTG_FL_LV4[0], 12U); /* MultiPortSwitch: '/Multiport Switch' incorporates: * Lookup_n-D: '/1-D Lookup Table10' * Lookup_n-D: '/1-D Lookup Table4' * Saturate: '/Saturation5' */ rtb_Bias1_h = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain, rtConstP.pooled51, &g_assINCAR_TG_FL_LV4[0], 12U); break; default: rtb_Bias_ct = look1_iu16lu64n48ts16Ds32_binlcs(Gain, rtConstP.pooled72, &g_assVTG_FL_LV5[0], 12U); /* MultiPortSwitch: '/Multiport Switch' incorporates: * Lookup_n-D: '/1-D Lookup Table11' * Lookup_n-D: '/1-D Lookup Table5' * Saturate: '/Saturation5' */ rtb_Bias1_h = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain, rtConstP.pooled51, &g_assINCAR_TG_FL_LV5[0], 12U); break; } /* End of MultiPortSwitch: '/Multiport Switch1' */ /* Selector: '/Selector' incorporates: * Constant: '/Constant' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_bp[0] = g_assVF_INC_Y1_LV0[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant6' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_bp[1] = g_assVF_INC_Y2_LV0[Comp_Max_RPM_Allowed - 1]; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant24' */ rtb_VectorConcatenate_bp[2] = 0; /* Selector: '/Selector2' incorporates: * Constant: '/Constant14' * MultiPortSwitch: '/Multiport Switch3' * Selector: '/Selector' */ rtb_VectorConcatenate_bp[3] = g_assVF_INC_Y3_LV0[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector3' incorporates: * Constant: '/Constant20' * MultiPortSwitch: '/Multiport Switch4' * Selector: '/Selector' */ rtb_VectorConcatenate_bp[4] = g_assVF_INC_Y4_LV0[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector' incorporates: * Constant: '/Constant' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_j[0] = g_assVF_INC_X1_LV0[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant6' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_j[1] = g_assVF_INC_X2_LV0[Comp_Max_RPM_Allowed - 1]; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant24' */ rtb_VectorConcatenate_j[2] = 0; /* Selector: '/Selector2' incorporates: * Constant: '/Constant14' * MultiPortSwitch: '/Multiport Switch3' * Selector: '/Selector' */ rtb_VectorConcatenate_j[3] = g_assVF_INC_X3_LV0[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector3' incorporates: * Constant: '/Constant20' * MultiPortSwitch: '/Multiport Switch4' * Selector: '/Selector' */ rtb_VectorConcatenate_j[4] = g_assVF_INC_X4_LV0[Comp_Max_RPM_Allowed - 1]; /* Lookup_n-D: '/2.5 Vtg_Fx_tg_incar' incorporates: * DataStoreRead: '/Data Store Read35' * Sum: '/2.5. X = Incar_Tg - Incar_fb' */ rtb_Bias4 = look1_is16lu64n32Ds32_binlcn((int16_t)(rtb_Bias1_h - rtDW.Incar_FL), rtb_VectorConcatenate_j, rtb_VectorConcatenate_bp, 4U); /* Selector: '/Selector' incorporates: * Constant: '/Constant' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[0] = g_assVF_AMB_Y1_LV0[Comp_Max_RPM_Allowed - 1]; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant24' */ rtb_VectorConcatenate_e0[1] = 0; /* Selector: '/Selector1' incorporates: * Constant: '/Constant6' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[2] = g_assVF_AMB_Y2_LV0[Comp_Max_RPM_Allowed - 1]; /* MultiPortSwitch: '/Multiport Switch1' incorporates: * Constant: '/Constant' * Constant: '/Constant' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' * Selector: '/Selector' * Selector: '/Selector' */ rtb_u6FLU_tg_amb_hq = g_assVF_AMB_X1_LV0[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector' incorporates: * Constant: '/Constant' * MultiPortSwitch: '/Multiport Switch1' */ rtb_VectorConcatenate_lg[0] = rtb_u6FLU_tg_amb_hq; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant24' */ rtb_VectorConcatenate_lg[1] = 0; /* MultiPortSwitch: '/Multiport Switch2' incorporates: * Constant: '/Constant6' * Constant: '/Constant6' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' * Selector: '/Selector1' * Selector: '/Selector1' */ rtb_u5FLU_tg_incar_l = g_assVF_AMB_X2_LV0[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant6' * MultiPortSwitch: '/Multiport Switch2' */ rtb_VectorConcatenate_lg[2] = rtb_u5FLU_tg_incar_l; /* Sum: '/2.6. X = Amb_Tg - Amb_Fb' incorporates: * Bias: '/Bias1' * Constant: '/Constant1' * DataStoreRead: '/Data Store Read34' * Selector: '/Selector2' * Sum: '/2.6. X = Amb_Tg - Amb_Fb' */ rtb_u6FLU_tg_amb = (int16_t)(g_assAMB_LV_TG[rtb_Saturation9] - rtDW.AMB); /* Lookup_n-D: '/2.6 Vtg_Fx_tg_amb' incorporates: * Sum: '/2.6. X = Amb_Tg - Amb_Fb' */ rtb_Bias2 = look1_is16lu64n32Ds32_binlcn(rtb_u6FLU_tg_amb, rtb_VectorConcatenate_lg, rtb_VectorConcatenate_e0, 2U); /* Selector: '/Selector' incorporates: * Constant: '/Constant' * MultiPortSwitch: '/Multiport Switch1' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[0] = g_assVF_SUN_Y1_LV0[Comp_Max_RPM_Allowed - 1]; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant24' */ rtb_VectorConcatenate_e0[1] = 0; /* Selector: '/Selector1' incorporates: * Constant: '/Constant6' * MultiPortSwitch: '/Multiport Switch2' * Selector: '/Selector' */ rtb_VectorConcatenate_e0[2] = g_assVF_SUN_Y2_LV0[Comp_Max_RPM_Allowed - 1]; /* Selector: '/Selector' */ rtb_VectorConcatenate_lg[0] = rtb_u6FLU_tg_amb_hq; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant24' */ rtb_VectorConcatenate_lg[1] = 0; /* Selector: '/Selector1' */ rtb_VectorConcatenate_lg[2] = rtb_u5FLU_tg_incar_l; /* Lookup_n-D: '/2.6 Vtg_Fx_tg_amb' incorporates: * DataStoreRead: '/Data Store Read39' */ rtb_Bias3 = look1_bs16ts16Dd_binlc(rtDW.Sun_L, rtb_VectorConcatenate_lg, rtb_VectorConcatenate_e0, 2U); /* Sum: '/2.8. Vtg_FX_plus' */ rtb_u5FLU_tg_incar_l = (int16_t)((int16_t)((int16_t)(rtb_Bias_ct + rtb_Bias4) + rtb_Bias2) + rtb_Bias3); /* Switch: '/Switch2' incorporates: * RelationalOperator: '/LowerRelop1' */ if (rtb_u5FLU_tg_incar_l <= rtb_Bias5) { /* MultiPortSwitch: '/Multiport Switch1' incorporates: * Constant: '/Constant' */ for (i = 0; i < 7; i++) { rtb_uDLookupTable7_g[i] = g_assVF_MIN_LV0[i]; } /* End of MultiPortSwitch: '/Multiport Switch1' */ /* Selector: '/Selector' incorporates: * Selector: '/Selector' */ rtb_Bias5 = rtb_uDLookupTable7_g[Comp_Max_RPM_Allowed - 1]; /* Switch: '/Switch' incorporates: * RelationalOperator: '/UpperRelop' * Selector: '/Selector' */ if (rtb_u5FLU_tg_incar_l >= rtb_Bias5) { rtb_Bias5 = rtb_u5FLU_tg_incar_l; } /* End of Switch: '/Switch' */ } /* End of Switch: '/Switch2' */ /* DataTypeConversion: '/Data Type Conversion3' incorporates: * DataStoreWrite: '/Data Store Write' */ Comp_Max_RPM_Allowed = (uint8_t)rtb_Bias5; /* Switch: '/Switch' incorporates: * Constant: '/manual' * DataStoreRead: '/Data Store Read46' * DataStoreWrite: '/Data Store Write19' * DataTypeConversion: '/Data Type Conversion3' * DataTypeConversion: '/Data Type Conversion' * DataTypeConversion: '/Data Type Conversion3' * Gain: '/Gain' * Product: '/Product' * RelationalOperator: '/Equal1' * Sum: '/Add' */ if (rtDW.CCU_MODE_FL == 0) { Blower_AF_FL = (uint8_t)rtB.MultiportSwitch_o2; } else { Blower_AF_FL = 0.01 * (double)rtb_y_b2 * (double)(uint8_t)rtb_Bias5 + (double)(uint8_t)rtb_Bias5; } /* End of Switch: '/Switch' */ /* Outputs for Enabled SubSystem: '/Front Right AF - manual directions' incorporates: * EnablePort: '/Enable' */ /* RelationalOperator: '/Equal3' incorporates: * Constant: '/Constant3' * DataStoreRead: '/Data Store Read45' */ if (rtDW.CCU_MODE_FR == 0) { /* MATLAB Function: '/AF for Bi Level' incorporates: * DataStoreRead: '/Data Store Read7' */ AFforBiLevel(rtDW.CCU_BLOWERS_FR, &Gain1); /* MATLAB Function: '/AF for Def' incorporates: * DataStoreRead: '/Data Store Read7' */ AFforDef(rtDW.CCU_BLOWERS_FR, &rtb_out_eu); /* MATLAB Function: '/AF for Foor + Def' incorporates: * DataStoreRead: '/Data Store Read7' */ AFforFoorDef(rtDW.CCU_BLOWERS_FR, &rtb_out_aq0); /* MATLAB Function: '/AF for Foot' incorporates: * DataStoreRead: '/Data Store Read7' */ AFforFoot(rtDW.CCU_BLOWERS_FR, &rtb_out_ddc); /* MATLAB Function: '/AF for Hi_Level' incorporates: * DataStoreRead: '/Data Store Read7' */ AFforHi_Level(rtDW.CCU_BLOWERS_FR, &rtb_out_p4); /* MATLAB Function: '/AF for Tri-Level' incorporates: * DataStoreRead: '/Data Store Read7' */ AFforTriLevel(rtDW.CCU_BLOWERS_FR, &rtB.MultiportSwitch_a); /* MATLAB Function: '/AF for Vent mode' incorporates: * DataStoreRead: '/Data Store Read7' */ AFforVentmode(rtDW.CCU_BLOWERS_FR, &rtb_out_e5); /* RelationalOperator: '/Relational Operator2' incorporates: * Constant: '/Constant2' * DataStoreRead: '/Data Store Read14' */ rtb_LogicalOperator5 = (rtDW.CCU_FOOT_FR == 1); /* DataTypeConversion: '/Data Type Conversion5' */ rtb_Switch_gs = rtb_LogicalOperator5; /* MultiPortSwitch: '/Multiport Switch' incorporates: * Constant: '/Constant' * Constant: '/Constant1' * DataStoreRead: '/Data Store Read12' * DataStoreRead: '/Data Store Read13' * DataTypeConversion: '/Data Type Conversion5' * Gain: '/Gain1' * Gain: '/Gain2' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator1' * Sum: '/Add' */ switch ((int32_t)(((uint32_t)((rtDW.CCU_FACE_FR == 1) << 1) + (uint32_t) (rtDW.CCU_DEF_FR == 1)) + (uint32_t)(rtb_LogicalOperator5 << 2))) { case 0: /* MultiPortSwitch: '/Multiport Switch' incorporates: * Constant: '/Constant3' */ rtB.MultiportSwitch_a = 0U; break; case 1: /* MultiPortSwitch: '/Multiport Switch' */ rtB.MultiportSwitch_a = rtb_out_eu; break; case 2: /* MultiPortSwitch: '/Multiport Switch' */ rtB.MultiportSwitch_a = rtb_out_e5; break; case 3: /* MultiPortSwitch: '/Multiport Switch' */ rtB.MultiportSwitch_a = rtb_out_p4; break; case 4: /* MultiPortSwitch: '/Multiport Switch' */ rtB.MultiportSwitch_a = rtb_out_ddc; break; case 5: /* MultiPortSwitch: '/Multiport Switch' */ rtB.MultiportSwitch_a = rtb_out_aq0; break; case 6: /* MultiPortSwitch: '/Multiport Switch' */ rtB.MultiportSwitch_a = Gain1; break; } /* End of MultiPortSwitch: '/Multiport Switch' */ } /* End of RelationalOperator: '/Equal3' */ /* End of Outputs for SubSystem: '/Front Right AF - manual directions' */ /* MultiPortSwitch: '/Multiport Switch1' incorporates: * Constant: '/Constant' */ /* : y = g_ascAUTO_STEP_AF_F(AF_STEP); */ for (i = 0; i < 7; i++) { rtb_uDLookupTable7_g[i] = g_assVF_MAX_LV0[i]; } /* End of MultiPortSwitch: '/Multiport Switch1' */ /* Saturate: '/Saturation6' incorporates: * DataStoreRead: '/Data Store Read31' */ if (rtDW.CCU_SET_FR > 290) { Gain1 = 290U; } else if (rtDW.CCU_SET_FR < 170) { Gain1 = 170U; } else { Gain1 = rtDW.CCU_SET_FR; } /* End of Saturate: '/Saturation6' */ /* Selector: '/Selector' */ rtb_Bias5 = rtb_uDLookupTable7_g[6]; /* MultiPortSwitch: '/Multiport Switch1' incorporates: * Lookup_n-D: '/1-D Lookup Table6' * Saturate: '/Saturation6' */ rtb_MultiportSwitch1_h = look1_iu16lu64n48ts16Ds32_binlcs(Gain1, rtConstP.pooled72, &g_assVTG_FR_LV0[0], 12U); /* MultiPortSwitch: '/Multiport Switch' incorporates: * Lookup_n-D: '/1-D Lookup Table' * Lookup_n-D: '/1-D Lookup Table1' * Lookup_n-D: '/1-D Lookup Table2' * Lookup_n-D: '/1-D Lookup Table3' * Lookup_n-D: '/1-D Lookup Table4' * Lookup_n-D: '/1-D Lookup Table5' * Saturate: '/Saturation6' */ switch (rtb_Saturation9) { case 0: rtb_MultiportSwitch_ae = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain1, rtConstP.pooled51, &g_assINCAR_TG_FR_LV0[0], 12U); break; case 1: rtb_MultiportSwitch_ae = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain1, rtConstP.pooled51, &g_assINCAR_TG_FR_LV1[0], 12U); break; case 2: rtb_MultiportSwitch_ae = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain1, rtConstP.pooled51, &g_assINCAR_TG_FR_LV2[0], 12U); break; case 3: rtb_MultiportSwitch_ae = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain1, rtConstP.pooled51, &g_assINCAR_TG_FR_LV3[0], 12U); break; case 4: rtb_MultiportSwitch_ae = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain1, rtConstP.pooled51, &g_assINCAR_TG_FR_LV4[0], 12U); break; default: rtb_MultiportSwitch_ae = look1_iu16bs16lu64n32ts16Ds32_binlcs(Gain1, rtConstP.pooled51, &g_assINCAR_TG_FR_LV5[0], 12U); break; } /* End of MultiPortSwitch: '/Multiport Switch' */ /* Selector: '/Selector' incorporates: * Constant: '/Constant' * MultiPortSwitch: '/Multiport Switch1' */ rtb_VectorConcatenate_bp[0] = g_assVF_INC_Y1_LV0[6]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant6' * MultiPortSwitch: '/Multiport Switch2' */ rtb_VectorConcatenate_bp[1] = g_assVF_INC_Y2_LV0[6]; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant24' */ rtb_VectorConcatenate_bp[2] = 0; /* Selector: '/Selector2' incorporates: * Constant: '/Constant14' * MultiPortSwitch: '/Multiport Switch3' */ rtb_VectorConcatenate_bp[3] = g_assVF_INC_Y3_LV0[6]; /* Selector: '/Selector3' incorporates: * Constant: '/Constant20' * MultiPortSwitch: '/Multiport Switch4' */ rtb_VectorConcatenate_bp[4] = g_assVF_INC_Y4_LV0[6]; /* Selector: '/Selector' incorporates: * Constant: '/Constant' * MultiPortSwitch: '/Multiport Switch1' */ rtb_VectorConcatenate_j[0] = g_assVF_INC_X1_LV0[6]; /* Selector: '/Selector1' incorporates: * Constant: '/Constant6' * MultiPortSwitch: '/Multiport Switch2' */ rtb_VectorConcatenate_j[1] = g_assVF_INC_X2_LV0[6]; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant24' */ rtb_VectorConcatenate_j[2] = 0; /* Selector: '/Selector2' incorporates: * Constant: '/Constant14' * MultiPortSwitch: '/Multiport Switch3' */ rtb_VectorConcatenate_j[3] = g_assVF_INC_X3_LV0[6]; /* Selector: '/Selector3' incorporates: * Constant: '/Constant20' * MultiPortSwitch: '/Multiport Switch4' */ rtb_VectorConcatenate_j[4] = g_assVF_INC_X4_LV0[6]; /* Lookup_n-D: '/2.5 FLU_tg_incar' incorporates: * DataStoreRead: '/Data Store Read36' * Sum: '/2.5. X = Inc_Tg - Incar_fb' */ rtb_u5FLU_tg_incar_l = look1_is16lu64n32Ds32_binlcn((int16_t) (rtb_MultiportSwitch_ae - rtDW.Incar_FR), rtb_VectorConcatenate_j, rtb_VectorConcatenate_bp, 4U); /* Selector: '/Selector' incorporates: * Constant: '/Constant' * MultiPortSwitch: '/Multiport Switch1' */ rtb_VectorConcatenate_e0[0] = g_assVF_AMB_Y1_LV0[6]; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant24' */ rtb_VectorConcatenate_e0[1] = 0; /* Selector: '/Selector1' incorporates: * Constant: '/Constant6' * MultiPortSwitch: '/Multiport Switch2' */ rtb_VectorConcatenate_e0[2] = g_assVF_AMB_Y2_LV0[6]; /* Selector: '/Selector' incorporates: * Constant: '/Constant' * MultiPortSwitch: '/Multiport Switch1' */ rtb_VectorConcatenate_lg[0] = g_assVF_AMB_X1_LV0[6]; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant24' */ rtb_VectorConcatenate_lg[1] = 0; /* Selector: '/Selector1' incorporates: * Constant: '/Constant6' * MultiPortSwitch: '/Multiport Switch2' */ rtb_VectorConcatenate_lg[2] = g_assVF_AMB_X2_LV0[6]; /* Lookup_n-D: '/2.6 FLU_tg_amb' */ rtb_u6FLU_tg_amb_hq = look1_is16lu64n32Ds32_binlcn(rtb_u6FLU_tg_amb, rtb_VectorConcatenate_lg, rtb_VectorConcatenate_e0, 2U); /* Selector: '/Selector' incorporates: * Constant: '/Constant' * MultiPortSwitch: '/Multiport Switch1' */ rtb_VectorConcatenate_e0[0] = g_assVF_SUN_Y1_LV0[6]; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant24' */ rtb_VectorConcatenate_e0[1] = 0; /* Selector: '/Selector1' incorporates: * Constant: '/Constant6' * MultiPortSwitch: '/Multiport Switch2' */ rtb_VectorConcatenate_e0[2] = g_assVF_SUN_Y2_LV0[6]; /* Selector: '/Selector' incorporates: * Constant: '/Constant' * MultiPortSwitch: '/Multiport Switch1' */ rtb_VectorConcatenate_lg[0] = g_assVF_AMB_X1_LV0[6]; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant24' */ rtb_VectorConcatenate_lg[1] = 0; /* MultiPortSwitch: '/Multiport Switch2' incorporates: * Constant: '/Constant6' */ for (i = 0; i < 7; i++) { rtb_uDLookupTable7_g[i] = g_assVF_AMB_X2_LV0[i]; } /* Selector: '/Selector1' incorporates: * Constant: '/Constant6' * MultiPortSwitch: '/Multiport Switch2' */ rtb_VectorConcatenate_lg[2] = g_assVF_AMB_X2_LV0[6]; /* Lookup_n-D: '/2.6 FLU_tg_amb' incorporates: * DataStoreRead: '/Data Store Read41' */ rtb_u6FLU_tg_amb = look1_bs16ts16Dd_binlc(rtDW.Sun_R, rtb_VectorConcatenate_lg, rtb_VectorConcatenate_e0, 2U); /* Sum: '/FLU_tg_correct' */ rtb_FLU_tg_correct_g = (int16_t)((int16_t)((int16_t)(rtb_MultiportSwitch1_h + rtb_u5FLU_tg_incar_l) + rtb_u6FLU_tg_amb_hq) + rtb_u6FLU_tg_amb); /* Switch: '/Switch2' incorporates: * RelationalOperator: '/LowerRelop1' */ if (rtb_FLU_tg_correct_g <= rtb_Bias5) { /* MultiPortSwitch: '/Multiport Switch1' incorporates: * Constant: '/Constant' */ for (i = 0; i < 7; i++) { rtb_MultiportSwitch1[i] = g_assVF_MIN_LV0[i]; } /* End of MultiPortSwitch: '/Multiport Switch1' */ /* Switch: '/Switch' incorporates: * RelationalOperator: '/UpperRelop' * Selector: '/Selector' */ if (rtb_FLU_tg_correct_g < rtb_MultiportSwitch1[6]) { rtb_Bias5 = rtb_MultiportSwitch1[6]; } else { rtb_Bias5 = rtb_FLU_tg_correct_g; } /* End of Switch: '/Switch' */ } /* End of Switch: '/Switch2' */ /* DataTypeConversion: '/Data Type Conversion' incorporates: * DataStoreWrite: '/Data Store Write1' */ rtb_Switch3_ed = (uint8_t)rtb_Bias5; /* Switch: '/Switch1' incorporates: * Constant: '/manual1' * DataStoreRead: '/Data Store Read' * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write20' * DataTypeConversion: '/Data Type Conversion2' * DataTypeConversion: '/Data Type Conversion' * DataTypeConversion: '/Data Type Conversion' * Gain: '/Gain' * MATLAB Function: '/func g_ascAUTO_STEP_AF_F' * Product: '/Product' * RelationalOperator: '/Equal2' * Sum: '/Add' */ if (rtDW.CCU_MODE_FR == 0) { Blower_AF_FR = (uint8_t)rtB.MultiportSwitch_a; } else { Blower_AF_FR = (double)g_ascAUTO_STEP_AF_F[rtDW.CCU_AUTOMODE_FR - 1] * 0.01 * (double)(uint8_t)rtb_Bias5 + (double)(uint8_t)rtb_Bias5; } /* End of Switch: '/Switch1' */ /* Outputs for Enabled SubSystem: '/Rear Left AF - manual directions' */ /* RelationalOperator: '/Equal2' incorporates: * Constant: '/Constant2' * DataStoreRead: '/Data Store Read44' * DataStoreRead: '/Data Store Read18' * DataStoreRead: '/Data Store Read19' * DataStoreRead: '/Data Store Read20' */ RearLeftAFmanualdirections((rtDW.CCU_MODE_RL == 0), rtDW.CCU_BLOWERS_RL, rtDW.CCU_FACE_RL, rtDW.CCU_FOOT_RL, &rtB.MultiportSwitch_j); /* End of Outputs for SubSystem: '/Rear Left AF - manual directions' */ /* Saturate: '/Saturation7' incorporates: * DataStoreRead: '/Data Store Read32' */ /* : y = g_ascAUTO_STEP_AF_R(AF_STEP); */ if (rtDW.CCU_SET_RL > 290) { rtb_out_eu = 290U; } else if (rtDW.CCU_SET_RL < 170) { rtb_out_eu = 170U; } else { rtb_out_eu = rtDW.CCU_SET_RL; } /* End of Saturate: '/Saturation7' */ /* Gain: '/Gain2' */ rtb_Subtract = 52429U * rtb_out_eu; rtb_y_fe = (int16_t)((uint32_t)((rtb_Subtract & 262144U) != 0U) + (rtb_Subtract >> 19)); /* MATLAB Function: '/Vtg_RX_plus_max' */ Vtg_RX_plus_max(rtb_y_fe, rtb_Saturation9, &rtb_y_bf); /* MATLAB Function: '/is_ending_with_5' */ is_ending_with_5(rtb_out_eu, &rtb_LogicalOperator5); /* MATLAB Function: '/2.3 Vtg_RL' incorporates: * MATLAB Function: '/2.1 Incar target Left' */ /* : Vtg_RLU = [g_assVTG_RL_LV0; g_assVTG_RL_LV1; g_assVTG_RL_LV2; g_assVTG_RL_LV3; g_assVTG_RL_LV4; g_assVTG_RL_LV5]; */ for (i = 0; i < 13; i++) { Vtg_RLU[6 * i] = g_assVTG_RL_LV0[i]; Vtg_RLU[6 * i + 1] = g_assVTG_RL_LV1[i]; Vtg_RLU[6 * i + 2] = g_assVTG_RL_LV2[i]; Vtg_RLU[6 * i + 3] = g_assVTG_RL_LV3[i]; Vtg_RLU[6 * i + 4] = g_assVTG_RL_LV4[i]; Vtg_RLU[6 * i + 5] = g_assVTG_RL_LV5[i]; } /* : if set_has_half && (SET - 16 + 1 <= length(Vtg_RLU)) */ rtb_LogicalOperator1_n = (rtb_LogicalOperator5 && (rtb_y_fe - 15 <= 13)); if (rtb_LogicalOperator1_n) { /* : y = (Vtg_RLU(LVL + 1, SET - 16) + Vtg_RLU(LVL + 1, SET - 16 + 1)) / 2; */ i = Vtg_RLU[(rtb_y_fe - 17) * 6 + rtb_Saturation9] + Vtg_RLU[(rtb_y_fe - 16) * 6 + rtb_Saturation9]; if (i > 32767) { i = 32767; } else if (i < -32768) { i = -32768; } rtb_Bias5 = (int16_t)rt_roundd((double)i / 2.0); } else { /* : else */ /* : y = Vtg_RLU(LVL + 1, SET - 16); */ rtb_Bias5 = Vtg_RLU[(rtb_y_fe - 17) * 6 + rtb_Saturation9]; } /* End of MATLAB Function: '/2.3 Vtg_RL' */ /* MATLAB Function: '/2.1 Incar target Left' */ /* : incar_tg_all = [g_assINCAR_TG_RL_LV0; g_assINCAR_TG_RL_LV1; g_assINCAR_TG_RL_LV2; g_assINCAR_TG_RL_LV3; g_assINCAR_TG_RL_LV4; g_assINCAR_TG_RL_LV5]; */ for (i = 0; i < 13; i++) { Vtg_RLU[6 * i] = g_assINCAR_TG_RL_LV0[i]; Vtg_RLU[6 * i + 1] = g_assINCAR_TG_RL_LV1[i]; Vtg_RLU[6 * i + 2] = g_assINCAR_TG_RL_LV2[i]; Vtg_RLU[6 * i + 3] = g_assINCAR_TG_RL_LV3[i]; Vtg_RLU[6 * i + 4] = g_assINCAR_TG_RL_LV4[i]; Vtg_RLU[6 * i + 5] = g_assINCAR_TG_RL_LV5[i]; } /* : if set_has_half && (SET - 16 + 1 <= length(incar_tg_all)) */ if (rtb_LogicalOperator1_n) { /* : y = (incar_tg_all(LVL + 1, SET - 16) + incar_tg_all(LVL + 1, SET - 16 + 1)) / 2; */ i = Vtg_RLU[(rtb_y_fe - 17) * 6 + rtb_Saturation9] + Vtg_RLU[(rtb_y_fe - 16) * 6 + rtb_Saturation9]; if (i > 32767) { i = 32767; } else if (i < -32768) { i = -32768; } rtb_FLU_tg_correct_g = (int16_t)rt_roundd((double)i / 2.0); } else { /* : else */ /* : y = incar_tg_all(LVL + 1, SET - 16); */ rtb_FLU_tg_correct_g = Vtg_RLU[(rtb_y_fe - 17) * 6 + rtb_Saturation9]; } /* MATLAB Function: '/Y1-Y4 для Vtg_FX_incar' */ Y1Y4Vtg_FX_incar(rtb_y_fe, rtb_Saturation9, rtb_VectorConcatenate_j); /* MATLAB Function: '/X1-X4 для Vtg_FX_incar' */ X1X4Vtg_FX_incar(rtb_y_fe, rtb_Saturation9, rtb_VectorConcatenate_bp); /* MATLAB Function: '/Amb_Tg ' */ Amb_Tg(rtb_Saturation9, &rtb_y_lg); /* MATLAB Function: '/Y1-Y2 для Vtg_RL_amb' */ Y1Y2Vtg_RL_amb(rtb_y_fe, rtb_Saturation9, rtb_VectorConcatenate_lg); /* MATLAB Function: '/X1-X2 для Vtg_RL_amb' */ /* : all_lvl_x1 = [g_assVR_AMB_X1_LV0; g_assVR_AMB_X1_LV1; g_assVR_AMB_X1_LV2; g_assVR_AMB_X1_LV3; g_assVR_AMB_X1_LV4; g_assVR_AMB_X1_LV5]; */ /* : all_lvl_x2 = [g_assVR_AMB_X2_LV0; g_assVR_AMB_X2_LV1; g_assVR_AMB_X2_LV2; g_assVR_AMB_X2_LV3; g_assVR_AMB_X2_LV4; g_assVR_AMB_X2_LV5]; */ /* : y = [all_lvl_x1(LVL + 1, idivide(SET - 16 + 1, 2)), 0, all_lvl_x2(LVL + 1, idivide(SET - 16 + 1, 2))]; */ for (i = 0; i < 7; i++) { tmp[6 * i] = g_assVR_AMB_X1_LV0[i]; i_0 = 6 * i + 1; tmp[i_0] = g_assVR_AMB_X1_LV1[i]; rtb_Gain_pl = 6 * i + 2; tmp[rtb_Gain_pl] = g_assVR_AMB_X1_LV2[i]; rtb_Gain4 = 6 * i + 3; tmp[rtb_Gain4] = g_assVR_AMB_X1_LV3[i]; rtb_Gain5 = 6 * i + 4; tmp[rtb_Gain5] = g_assVR_AMB_X1_LV4[i]; rtb_Gain2 = 6 * i + 5; tmp[rtb_Gain2] = g_assVR_AMB_X1_LV5[i]; tmp_0[6 * i] = g_assVR_AMB_X2_LV0[i]; tmp_0[i_0] = g_assVR_AMB_X2_LV1[i]; tmp_0[rtb_Gain_pl] = g_assVR_AMB_X2_LV2[i]; tmp_0[rtb_Gain4] = g_assVR_AMB_X2_LV3[i]; tmp_0[rtb_Gain5] = g_assVR_AMB_X2_LV4[i]; tmp_0[rtb_Gain2] = g_assVR_AMB_X2_LV5[i]; } i = ((int32_t)trunc((((double)rtb_y_fe - 16.0) + 1.0) / 2.0) - 1) * 6 + rtb_Saturation9; rtb_VectorConcatenate_e0[0] = tmp[i]; rtb_VectorConcatenate_e0[1] = 0; rtb_VectorConcatenate_e0[2] = tmp_0[i]; /* End of MATLAB Function: '/X1-X2 для Vtg_RL_amb' */ /* MATLAB Function: '/Y1-Y2 для Vtg_RX_sun' */ Y1Y2Vtg_RX_sun(rtb_y_fe, rtb_Saturation9, rtb_VectorConcatenate_bl); /* MATLAB Function: '/X1-X2 для Vtg_FX_sun' */ X1X2Vtg_FX_sun(rtb_y_fe, rtb_Saturation9, rtb_VectorConcatenate_km); /* MATLAB Function: '/Vtg_RX_plus_min' */ Vtg_RX_plus_min(rtb_y_fe, rtb_Saturation9, &rtb_y_h5); /* Switch: '/Switch2' incorporates: * Constant: '/manual2' * DataStoreRead: '/Data Store Read' * DataStoreRead: '/Data Store Read2' * DataStoreWrite: '/Data Store Write21' * DataTypeConversion: '/Data Type Conversion4' * DataTypeConversion: '/Data Type Conversion' * DataTypeConversion: '/Data Type Conversion1' * DataTypeConversion: '/Data Type Conversion2' * Gain: '/Gain' * MATLAB Function: '/func g_ascAUTO_STEP_AF_F' * Product: '/Product' * RelationalOperator: '/Equal3' * Sum: '/Add' */ if (rtDW.CCU_MODE_RL == 0) { Blower_AF_RL = (uint8_t)rtB.MultiportSwitch_j; } else { /* Lookup_n-D: '/2.6 FLU_tg_amb' incorporates: * DataStoreRead: '/Data Store Read39' */ rtb_u8Vtg_FX_plus = look1_bs16ts16DdId_binlc(rtDW.Sun_L, rtb_VectorConcatenate_km, rtb_VectorConcatenate_bl, 2U); /* Lookup_n-D: '/2.6 FLU_tg_amb' incorporates: * DataStoreRead: '/Data Store Read34' * Sum: '/2.6. X = Amb_Tg - Amb_Fb' */ rtb_y_fe = look1_is16lu64n32Ds32_binlcn((int16_t)(rtb_y_lg - rtDW.AMB), rtb_VectorConcatenate_e0, rtb_VectorConcatenate_lg, 2U); /* Lookup_n-D: '/2.5 FLU_tg_incar' incorporates: * DataStoreRead: '/Data Store Read37' * Sum: '/2.5. X = Incar_Tg - Incar_fb' */ rtb_FLU_tg_correct_g = look1_is16lu64n32Ds32_binlcn((int16_t) (rtb_FLU_tg_correct_g - rtDW.Incar_RL), rtb_VectorConcatenate_bp, rtb_VectorConcatenate_j, 4U); /* Sum: '/2.8. Vtg_FX_plus' */ rtb_u8Vtg_FX_plus += (double)((rtb_Bias5 + rtb_FLU_tg_correct_g) + rtb_y_fe); /* Switch: '/Switch2' incorporates: * RelationalOperator: '/LowerRelop1' * RelationalOperator: '/UpperRelop' * Switch: '/Switch' */ if (rtb_u8Vtg_FX_plus > rtb_y_bf) { rtb_u8Vtg_FX_plus = rtb_y_bf; } else if (rtb_u8Vtg_FX_plus < rtb_y_h5) { /* Switch: '/Switch' */ rtb_u8Vtg_FX_plus = rtb_y_h5; } /* End of Switch: '/Switch2' */ /* DataTypeConversion: '/Data Type Conversion2' */ rtb_Divide1_l5 = fabs(rtb_u8Vtg_FX_plus); if (rtb_Divide1_l5 < 4.503599627370496E+15) { if (rtb_Divide1_l5 >= 0.5) { rtb_u8Vtg_FX_plus = floor(rtb_u8Vtg_FX_plus + 0.5); } else { rtb_u8Vtg_FX_plus = 0.0; } } Blower_AF_RL = (uint8_t)((double)g_ascAUTO_STEP_AF_R[(int8_t) rtDW.CCU_AUTOMODE_RL - 1] * 0.01 * (double)(uint8_t)rtb_u8Vtg_FX_plus + (double)(uint8_t)rtb_u8Vtg_FX_plus); } /* End of Switch: '/Switch2' */ /* Outputs for Enabled SubSystem: '/Rear Right AF - manual directions' */ /* RelationalOperator: '/Equal1' incorporates: * Constant: '/Constant3' * DataStoreRead: '/Data Store Read45' * DataStoreRead: '/Data Store Read15' * DataStoreRead: '/Data Store Read16' * DataStoreRead: '/Data Store Read17' */ RearLeftAFmanualdirections((rtDW.CCU_MODE_RR == 0), rtDW.CCU_BLOWERS_RR, rtDW.CCU_FACE_RR, rtDW.CCU_FOOT_RR, &rtB.MultiportSwitch_of); /* End of Outputs for SubSystem: '/Rear Right AF - manual directions' */ /* MATLAB Function: '/func g_ascAUTO_STEP_AF_F' incorporates: * DataStoreRead: '/Data Store Read' * DataTypeConversion: '/Data Type Conversion1' */ funcg_ascAUTO_STEP_AF_F((int8_t)rtDW.CCU_AUTOMODE_RR, &rtb_y_b2); /* Saturate: '/Saturation8' incorporates: * DataStoreRead: '/Data Store Read33' */ if (rtDW.CCU_SET_RR > 290) { rtb_out_eu = 290U; } else if (rtDW.CCU_SET_RR < 170) { rtb_out_eu = 170U; } else { rtb_out_eu = rtDW.CCU_SET_RR; } /* End of Saturate: '/Saturation8' */ /* Gain: '/Gain2' */ rtb_Subtract = 52429U * rtb_out_eu; rtb_y_bf = (int16_t)((uint32_t)((rtb_Subtract & 262144U) != 0U) + (rtb_Subtract >> 19)); /* MATLAB Function: '/Vtg_RX_plus_max' */ Vtg_RX_plus_max(rtb_y_bf, rtb_Saturation9, &rtb_y_fe); /* MATLAB Function: '/is_ending_with_5' */ is_ending_with_5(rtb_out_eu, &rtb_LogicalOperator5); /* MATLAB Function: '/2.3 Vtg_RR' incorporates: * MATLAB Function: '/2.1 Incar target Rear Right' */ /* : Vtg_RR = [g_assVTG_RR_LV0; g_assVTG_RR_LV1; g_assVTG_RR_LV2; g_assVTG_RR_LV3; g_assVTG_RR_LV4; g_assVTG_RR_LV5]; */ for (i = 0; i < 13; i++) { Vtg_RLU[6 * i] = g_assVTG_RR_LV0[i]; Vtg_RLU[6 * i + 1] = g_assVTG_RR_LV1[i]; Vtg_RLU[6 * i + 2] = g_assVTG_RR_LV2[i]; Vtg_RLU[6 * i + 3] = g_assVTG_RR_LV3[i]; Vtg_RLU[6 * i + 4] = g_assVTG_RR_LV4[i]; Vtg_RLU[6 * i + 5] = g_assVTG_RR_LV5[i]; } /* : if set_has_half && (SET - 16 + 1 <= length(Vtg_RR)) */ rtb_LogicalOperator1_n = (rtb_LogicalOperator5 && (rtb_y_bf - 15 <= 13)); if (rtb_LogicalOperator1_n) { /* : y = (Vtg_RR(LVL + 1, SET - 16) + Vtg_RR(LVL + 1, SET - 16 + 1)) / 2; */ i = Vtg_RLU[(rtb_y_bf - 17) * 6 + rtb_Saturation9] + Vtg_RLU[(rtb_y_bf - 16) * 6 + rtb_Saturation9]; if (i > 32767) { i = 32767; } else if (i < -32768) { i = -32768; } rtb_Bias5 = (int16_t)rt_roundd((double)i / 2.0); } else { /* : else */ /* : y = Vtg_RR(LVL + 1, SET - 16); */ rtb_Bias5 = Vtg_RLU[(rtb_y_bf - 17) * 6 + rtb_Saturation9]; } /* End of MATLAB Function: '/2.3 Vtg_RR' */ /* MATLAB Function: '/2.1 Incar target Rear Right' */ /* : incar_tg_all = [g_assINCAR_TG_RR_LV0; g_assINCAR_TG_RR_LV1; g_assINCAR_TG_RR_LV2; g_assINCAR_TG_RR_LV3; g_assINCAR_TG_RR_LV4; g_assINCAR_TG_RR_LV5]; */ for (i = 0; i < 13; i++) { Vtg_RLU[6 * i] = g_assINCAR_TG_RR_LV0[i]; Vtg_RLU[6 * i + 1] = g_assINCAR_TG_RR_LV1[i]; Vtg_RLU[6 * i + 2] = g_assINCAR_TG_RR_LV2[i]; Vtg_RLU[6 * i + 3] = g_assINCAR_TG_RR_LV3[i]; Vtg_RLU[6 * i + 4] = g_assINCAR_TG_RR_LV4[i]; Vtg_RLU[6 * i + 5] = g_assINCAR_TG_RR_LV5[i]; } /* : if set_has_half && (SET - 16 + 1 <= length(incar_tg_all)) */ if (rtb_LogicalOperator1_n) { /* : y = (incar_tg_all(LVL + 1, SET - 16) + incar_tg_all(LVL + 1, SET - 16 + 1)) / 2; */ i = Vtg_RLU[(rtb_y_bf - 17) * 6 + rtb_Saturation9] + Vtg_RLU[(rtb_y_bf - 16) * 6 + rtb_Saturation9]; if (i > 32767) { i = 32767; } else if (i < -32768) { i = -32768; } rtb_FLU_tg_correct_g = (int16_t)rt_roundd((double)i / 2.0); } else { /* : else */ /* : y = incar_tg_all(LVL + 1, SET - 16); */ rtb_FLU_tg_correct_g = Vtg_RLU[(rtb_y_bf - 17) * 6 + rtb_Saturation9]; } /* MATLAB Function: '/Y1-Y4 для Vtg_RX_incar' */ Y1Y4Vtg_FX_incar(rtb_y_bf, rtb_Saturation9, rtb_VectorConcatenate_j); /* MATLAB Function: '/X1-X4 для Vtg_RX_incar' */ X1X4Vtg_FX_incar(rtb_y_bf, rtb_Saturation9, rtb_VectorConcatenate_bp); /* MATLAB Function: '/Amb_Tg ' */ Amb_Tg(rtb_Saturation9, &rtb_y_ck); /* MATLAB Function: '/Y1-Y4 для Vtg_RX_amb' */ Y1Y2Vtg_RL_amb(rtb_y_bf, rtb_Saturation9, rtb_VectorConcatenate_lg); /* MATLAB Function: '/X1-X4 для Vtg_RX_amb' */ /* : all_lvl_x1 = [g_assVR_AMB_X1_LV0; g_assVR_AMB_X1_LV1; g_assVR_AMB_X1_LV2; g_assVR_AMB_X1_LV3; g_assVR_AMB_X1_LV4; g_assVR_AMB_X1_LV5]; */ /* : all_lvl_x2 = [g_assVR_AMB_X2_LV0; g_assVR_AMB_X2_LV1; g_assVR_AMB_X2_LV2; g_assVR_AMB_X2_LV3; g_assVR_AMB_X2_LV4; g_assVR_AMB_X2_LV5]; */ /* : y = [all_lvl_x1(LVL + 1, idivide(SET - 16 + 1, 2)), 0, all_lvl_x2(LVL + 1, idivide(SET - 16 + 1, 2))]; */ for (i = 0; i < 7; i++) { tmp[6 * i] = g_assVR_AMB_X1_LV0[i]; i_0 = 6 * i + 1; tmp[i_0] = g_assVR_AMB_X1_LV1[i]; rtb_Gain_pl = 6 * i + 2; tmp[rtb_Gain_pl] = g_assVR_AMB_X1_LV2[i]; rtb_Gain4 = 6 * i + 3; tmp[rtb_Gain4] = g_assVR_AMB_X1_LV3[i]; rtb_Gain5 = 6 * i + 4; tmp[rtb_Gain5] = g_assVR_AMB_X1_LV4[i]; rtb_Gain2 = 6 * i + 5; tmp[rtb_Gain2] = g_assVR_AMB_X1_LV5[i]; tmp_0[6 * i] = g_assVR_AMB_X2_LV0[i]; tmp_0[i_0] = g_assVR_AMB_X2_LV1[i]; tmp_0[rtb_Gain_pl] = g_assVR_AMB_X2_LV2[i]; tmp_0[rtb_Gain4] = g_assVR_AMB_X2_LV3[i]; tmp_0[rtb_Gain5] = g_assVR_AMB_X2_LV4[i]; tmp_0[rtb_Gain2] = g_assVR_AMB_X2_LV5[i]; } i = ((int32_t)trunc((((double)rtb_y_bf - 16.0) + 1.0) / 2.0) - 1) * 6 + rtb_Saturation9; rtb_VectorConcatenate_e0[0] = tmp[i]; rtb_VectorConcatenate_e0[1] = 0; rtb_VectorConcatenate_e0[2] = tmp_0[i]; /* End of MATLAB Function: '/X1-X4 для Vtg_RX_amb' */ /* MATLAB Function: '/Y1-Y4 для Vtg_RX_sun' */ Y1Y2Vtg_RX_sun(rtb_y_bf, rtb_Saturation9, rtb_VectorConcatenate_bl); /* MATLAB Function: '/X1-X4 для Vtg_RX_sun' */ X1X2Vtg_FX_sun(rtb_y_bf, rtb_Saturation9, rtb_VectorConcatenate_km); /* MATLAB Function: '/Vtg_RX_plus_min' */ Vtg_RX_plus_min(rtb_y_bf, rtb_Saturation9, &rtb_y_ar); /* Switch: '/Switch3' incorporates: * Constant: '/manual3' * DataStoreRead: '/Data Store Read3' * DataStoreWrite: '/Data Store Write22' * DataTypeConversion: '/Data Type Conversion5' * DataTypeConversion: '/Data Type Conversion' * DataTypeConversion: '/Data Type Conversion1' * Gain: '/Gain' * Product: '/Product' * RelationalOperator: '/Equal4' * Sum: '/Add' */ if (rtDW.CCU_MODE_RR == 0) { rtb_Saturation9 = (uint8_t)rtB.MultiportSwitch_of; } else { /* Lookup_n-D: '/2.6 FLU_tg_amb' incorporates: * DataStoreRead: '/Data Store Read41' */ rtb_u8Vtg_FX_plus = look1_bs16ts16DdId_binlc(rtDW.Sun_R, rtb_VectorConcatenate_km, rtb_VectorConcatenate_bl, 2U); /* Lookup_n-D: '/2.6 FLU_tg_amb' incorporates: * DataStoreRead: '/Data Store Read34' * Sum: '/2.6. X = Amb_Tg - Amb_Fb' */ rtb_y_bf = look1_is16lu64n32Ds32_binlcn((int16_t)(rtb_y_ck - rtDW.AMB), rtb_VectorConcatenate_e0, rtb_VectorConcatenate_lg, 2U); /* Lookup_n-D: '/2.5 FLU_tg_incar' incorporates: * DataStoreRead: '/Data Store Read38' * Sum: '/2.5. X = Inc_Tg - Incar_fb' */ rtb_FLU_tg_correct_g = look1_is16lu64n32Ds32_binlcn((int16_t) (rtb_FLU_tg_correct_g - rtDW.Incar_RR), rtb_VectorConcatenate_bp, rtb_VectorConcatenate_j, 4U); /* Sum: '/FLU_tg_correct' */ rtb_Bias5 = (int16_t)floor((double)((rtb_Bias5 + rtb_FLU_tg_correct_g) + rtb_y_bf) + rtb_u8Vtg_FX_plus); /* Switch: '/Switch2' incorporates: * RelationalOperator: '/LowerRelop1' * RelationalOperator: '/UpperRelop' * Switch: '/Switch' */ if (rtb_Bias5 > rtb_y_fe) { rtb_Bias5 = rtb_y_fe; } else if (rtb_Bias5 < rtb_y_ar) { /* Switch: '/Switch' */ rtb_Bias5 = rtb_y_ar; } /* End of Switch: '/Switch2' */ rtb_Saturation9 = (uint8_t)(0.01 * (double)rtb_y_b2 * (double)(uint8_t) rtb_Bias5 + (double)(uint8_t)rtb_Bias5); } /* End of Switch: '/Switch3' */ /* MATLAB Function: '/is_ending_with_5' */ is_ending_with_5(Gain, &rtb_LogicalOperator5); /* MATLAB Function: '/is_ending_with_5' */ /* : correct_after_time = [g_assCORRECT_AF_MAX_LV0; g_assCORRECT_AF_MAX_LV1; g_assCORRECT_AF_MAX_LV2; g_assCORRECT_AF_MAX_LV3; g_assCORRECT_AF_MAX_LV4; g_assCORRECT_AF_MAX_LV5]; */ /* : y = correct_after_time(LVL + 1, idivide(SET - 16 + 1, 2)); */ /* : correct_rate = [g_assCORRECT_AF_RATE_LV0; g_assCORRECT_AF_RATE_LV1; g_assCORRECT_AF_RATE_LV2; g_assCORRECT_AF_RATE_LV3; g_assCORRECT_AF_RATE_LV4; g_assCORRECT_AF_RATE_LV5]; */ /* : disp('all correction rate:') */ /* : disp(correct_rate) */ /* : y = correct_rate(LVL + 1, idivide(SET - 16 + 1, 2)); */ /* : disp('correction rate:') */ /* : disp(y) */ /* : correct_after_time = [g_assCORRECT_AF_TIME_FL_LV0; g_assCORRECT_AF_TIME_FL_LV1; g_assCORRECT_AF_TIME_FL_LV2; g_assCORRECT_AF_TIME_FL_LV3; g_assCORRECT_AF_TIME_FL_LV4; g_assCORRECT_AF_TIME_FL_LV5]; */ /* : y = correct_after_time(LVL + 1, idivide(SET - 16 + 1, 2)); */ is_ending_with_5(Gain1, &rtb_LogicalOperator5); /* MATLAB Function: '/MATLAB Function1' incorporates: * DataStoreWrite: '/Data Store Write29' */ /* : correct_after_time = [g_assCORRECT_AF_MAX_LV0; g_assCORRECT_AF_MAX_LV1; g_assCORRECT_AF_MAX_LV2; g_assCORRECT_AF_MAX_LV3; g_assCORRECT_AF_MAX_LV4; g_assCORRECT_AF_MAX_LV5]; */ /* : y = correct_after_time(LVL + 1, idivide(SET - 16 + 1, 2)); */ /* : correct_rate = [g_assCORRECT_AF_RATE_LV0; g_assCORRECT_AF_RATE_LV1; g_assCORRECT_AF_RATE_LV2; g_assCORRECT_AF_RATE_LV3; g_assCORRECT_AF_RATE_LV4; g_assCORRECT_AF_RATE_LV5]; */ /* : y = correct_rate(LVL + 1, idivide(SET - 16 + 1, 2)); */ /* : correct_after_time = [g_assCORRECT_AF_TIME_FR_LV0; g_assCORRECT_AF_TIME_FR_LV1; g_assCORRECT_AF_TIME_FR_LV2; g_assCORRECT_AF_TIME_FR_LV3; g_assCORRECT_AF_TIME_FR_LV4; g_assCORRECT_AF_TIME_FR_LV5]; */ /* : y = correct_after_time(LVL + 1, idivide(SET - 16 + 1, 2)); */ /* : IDLE = uint8(0); */ /* : LO_RIGHT = uint8(1); */ /* : HI_RIGHT = uint8(8); */ /* : LO_LEFT = uint8(10); */ /* : LO_BOTH = uint8(11); */ /* : LO_4ZONE = uint8(22); */ /* : HI_LEFT = uint8(80); */ /* : HI_BOTH = uint8(88); */ /* : HI_4ZONE = uint8(99); */ /* : CAN_LoHi_Front = IDLE; */ rtDW.CAN_LoHi_Front = 0U; /* BusCreator: '/Bus Creator' incorporates: * DataStoreWrite: '/Data Store Write' * MATLAB Function: '/MATLAB Function1' */ /* : CAN_LoHi_Rear = IDLE; */ rtDW.dbgCAN_Logic_State_model.Logic_LoHi_Rear = 0U; /* MATLAB Function: '/MATLAB Function1' incorporates: * DataStoreRead: '/Data Store Read40' * DataStoreRead: '/Data Store Read41' * DataStoreRead: '/Data Store Read42' * DataStoreRead: '/Data Store Read61' * DataStoreWrite: '/Data Store Write29' */ /* : is_HI_4zone = (FL == 2 && FR == 2 && RL == 2 && RR == 2); */ /* : is_LO_4zone = (FL == 1 && FR == 1 && RL == 1 && RR == 1); */ rtb_Compare_dq = ((rtDW.LO_HI_MODE_FL == 1) && (rtDW.LO_HI_MODE_FR == 1) && (rtDW.LO_HI_MODE_RL == 1) && (rtDW.LO_HI_MODE_RR == 1)); /* : if is_HI_4zone */ if ((rtDW.LO_HI_MODE_FL == 2) && (rtDW.LO_HI_MODE_FR == 2) && (rtDW.LO_HI_MODE_RL == 2) && (rtDW.LO_HI_MODE_RR == 2)) { /* : CAN_LoHi_Front = HI_4ZONE; */ rtDW.CAN_LoHi_Front = 99U; /* BusCreator: '/Bus Creator' incorporates: * DataStoreWrite: '/Data Store Write29' * DataStoreWrite: '/Data Store Write' */ /* : CAN_LoHi_Rear = HI_4ZONE; */ rtDW.dbgCAN_Logic_State_model.Logic_LoHi_Rear = 99U; } else { if ((rtDW.LO_HI_MODE_FL == 2) && (rtDW.LO_HI_MODE_FR == 2)) { /* : elseif FL == 2 && FR == 2 */ /* : CAN_LoHi_Front = HI_BOTH; */ rtDW.CAN_LoHi_Front = 88U; } else if (rtDW.LO_HI_MODE_FL == 2) { /* : elseif FL == 2 */ /* : CAN_LoHi_Front = HI_LEFT; */ rtDW.CAN_LoHi_Front = 80U; } else if (rtDW.LO_HI_MODE_FR == 2) { /* : elseif FR == 2 */ /* : CAN_LoHi_Front = HI_RIGHT; */ rtDW.CAN_LoHi_Front = 8U; } else if (rtb_Compare_dq) { /* : elseif is_LO_4zone */ /* : CAN_LoHi_Front = LO_4ZONE; */ rtDW.CAN_LoHi_Front = 22U; } else if ((rtDW.LO_HI_MODE_FL == 1) && (rtDW.LO_HI_MODE_FR == 1)) { /* : elseif FL == 1 && FR == 1 */ /* : CAN_LoHi_Front = LO_BOTH; */ rtDW.CAN_LoHi_Front = 11U; } else if (rtDW.LO_HI_MODE_FL == 1) { /* : elseif FL == 1 */ /* : CAN_LoHi_Front = LO_LEFT; */ rtDW.CAN_LoHi_Front = 10U; } else if (rtDW.LO_HI_MODE_FR == 1) { /* : elseif FR == 1 */ /* : CAN_LoHi_Front = LO_RIGHT; */ rtDW.CAN_LoHi_Front = 1U; } if ((rtDW.LO_HI_MODE_RL == 2) && (rtDW.LO_HI_MODE_RR == 2)) { /* BusCreator: '/Bus Creator' incorporates: * DataStoreWrite: '/Data Store Write' */ /* : elseif RL == 2 && RR == 2 */ /* : CAN_LoHi_Rear = HI_BOTH; */ rtDW.dbgCAN_Logic_State_model.Logic_LoHi_Rear = 88U; } else if (rtDW.LO_HI_MODE_RL == 2) { /* BusCreator: '/Bus Creator' incorporates: * DataStoreWrite: '/Data Store Write' */ /* : elseif RL == 2 */ /* : CAN_LoHi_Rear = HI_LEFT; */ rtDW.dbgCAN_Logic_State_model.Logic_LoHi_Rear = 80U; } else if (rtDW.LO_HI_MODE_RR == 2) { /* BusCreator: '/Bus Creator' incorporates: * DataStoreWrite: '/Data Store Write' */ /* : elseif RR == 2 */ /* : CAN_LoHi_Rear = HI_RIGHT; */ rtDW.dbgCAN_Logic_State_model.Logic_LoHi_Rear = 8U; } else if (rtb_Compare_dq) { /* BusCreator: '/Bus Creator' incorporates: * DataStoreWrite: '/Data Store Write' */ /* : elseif is_LO_4zone */ /* : CAN_LoHi_Rear = LO_4ZONE; */ rtDW.dbgCAN_Logic_State_model.Logic_LoHi_Rear = 22U; } else if ((rtDW.LO_HI_MODE_RL == 1) && (rtDW.LO_HI_MODE_RR == 1)) { /* BusCreator: '/Bus Creator' incorporates: * DataStoreWrite: '/Data Store Write' */ /* : elseif RL == 1 && RR == 1 */ /* : CAN_LoHi_Rear = LO_BOTH; */ rtDW.dbgCAN_Logic_State_model.Logic_LoHi_Rear = 11U; } else if (rtDW.LO_HI_MODE_RL == 1) { /* BusCreator: '/Bus Creator' incorporates: * DataStoreWrite: '/Data Store Write' */ /* : elseif RL == 1 */ /* : CAN_LoHi_Rear = LO_LEFT; */ rtDW.dbgCAN_Logic_State_model.Logic_LoHi_Rear = 10U; } else if (rtDW.LO_HI_MODE_RR == 1) { /* BusCreator: '/Bus Creator' incorporates: * DataStoreWrite: '/Data Store Write' */ /* : elseif RR == 1 */ /* : CAN_LoHi_Rear = LO_RIGHT; */ rtDW.dbgCAN_Logic_State_model.Logic_LoHi_Rear = 1U; } } /* Chart: '/Synchronization stateflow chart' incorporates: * DataStoreWrite: '/Data Store Write15' * DataStoreWrite: '/Data Store Write16' * DataStoreWrite: '/Data Store Write17' */ /* : if is_HI_4zone */ if (rtDW.is_active_c618_HVAC_model == 0U) { rtDW.is_active_c618_HVAC_model = 1U; rtDW.is_c618_HVAC_model = IN_NO_SYNC; /* : sync_front = 0; */ rtDW.CCU_FRONT_SYNC = 0U; /* : sync_rear = 0; */ rtDW.CCU_REAR_SYNC = 0U; /* : sync_all = 0; */ rtDW.CCU_ALL_ZONE_SYNC = 0U; } else { guard1 = false; guard2 = false; guard3 = false; guard4 = false; switch (rtDW.is_c618_HVAC_model) { case IN_FRONT_ONLY: rtDW.CCU_FRONT_SYNC = 1U; rtDW.CCU_REAR_SYNC = 0U; rtDW.CCU_ALL_ZONE_SYNC = 0U; /* : sf_internal_predicateOutput = enable_full_sync; */ if (rtDW.enable_full_sync != 0) { /* : enable_full_sync = 0; */ rtDW.enable_full_sync = 0U; rtDW.is_c618_HVAC_model = IN_FULL_SYNC; /* : sync_front = 0; */ rtDW.CCU_FRONT_SYNC = 0U; /* : sync_rear = 0; */ rtDW.CCU_REAR_SYNC = 0U; /* : sync_all = 1; */ rtDW.CCU_ALL_ZONE_SYNC = 1U; /* : sf_internal_predicateOutput = disable_front_sync; */ } else if (rtDW.disable_front_sync != 0) { /* : disable_front_sync = 0; */ rtDW.disable_front_sync = 0U; guard2 = true; /* : sf_internal_predicateOutput = enable_rear_sync; */ } else if (rtDW.enable_rear_sync != 0) { /* : enable_rear_sync = 0; */ rtDW.enable_rear_sync = 0U; rtDW.is_c618_HVAC_model = IN_SEPARATE_FRONT_AND_REAR; /* : sync_front = 1; */ rtDW.CCU_FRONT_SYNC = 1U; /* : sync_rear = 1; */ rtDW.CCU_REAR_SYNC = 1U; /* : sync_all = 0; */ rtDW.CCU_ALL_ZONE_SYNC = 0U; /* : sf_internal_predicateOutput = changed_FR_params; */ } else if (rtDW.changed_FR_params != 0) { /* : changed_FR_params = 0; */ rtDW.changed_FR_params = 0U; guard2 = true; } break; case IN_FULL_SYNC: rtDW.CCU_FRONT_SYNC = 0U; rtDW.CCU_REAR_SYNC = 0U; rtDW.CCU_ALL_ZONE_SYNC = 1U; /* : sf_internal_predicateOutput = disable_front_sync && ~enable_rear_sync; */ if ((rtDW.disable_front_sync != 0) && (rtDW.enable_rear_sync == 0)) { /* : disable_front_sync = 0; */ rtDW.disable_front_sync = 0U; guard3 = true; /* : sf_internal_predicateOutput = enable_front_sync; */ } else if (rtDW.enable_front_sync != 0) { /* : enable_front_sync = 0; */ rtDW.enable_front_sync = 0U; guard4 = true; /* : sf_internal_predicateOutput = enable_rear_sync; */ } else if (rtDW.enable_rear_sync != 0) { /* : enable_rear_sync = 0 */ rtDW.enable_rear_sync = 0U; guard4 = true; /* : sf_internal_predicateOutput = changed_FR_params; */ } else if (rtDW.changed_FR_params != 0) { /* : changed_FR_params = 0; */ rtDW.changed_FR_params = 0U; guard3 = true; /* : sf_internal_predicateOutput = changed_RL_params || changed_RR_params; */ } else if ((rtDW.changed_RL_params != 0) || (rtDW.changed_RR_params != 0)) { /* : changed_RL_params = 0; */ rtDW.changed_RL_params = 0U; /* : changed_RR_params = 0; */ rtDW.changed_RR_params = 0U; rtDW.is_c618_HVAC_model = IN_FRONT_ONLY; /* : sync_front = 1; */ rtDW.CCU_FRONT_SYNC = 1U; /* : sync_rear = 0; */ rtDW.CCU_REAR_SYNC = 0U; /* : sync_all = 0; */ rtDW.CCU_ALL_ZONE_SYNC = 0U; } break; case IN_NO_SYNC: rtDW.CCU_FRONT_SYNC = 0U; rtDW.CCU_REAR_SYNC = 0U; rtDW.CCU_ALL_ZONE_SYNC = 0U; /* : sf_internal_predicateOutput = enable_front_sync; */ if (rtDW.enable_front_sync != 0) { /* : enable_front_sync = 0; */ rtDW.enable_front_sync = 0U; rtDW.is_c618_HVAC_model = IN_FRONT_ONLY; /* : sync_front = 1; */ rtDW.CCU_FRONT_SYNC = 1U; /* : sync_rear = 0; */ rtDW.CCU_REAR_SYNC = 0U; /* : sync_all = 0; */ rtDW.CCU_ALL_ZONE_SYNC = 0U; /* : sf_internal_predicateOutput = enable_full_sync; */ } else if (rtDW.enable_full_sync != 0) { /* : enable_full_sync = 0; */ rtDW.enable_full_sync = 0U; rtDW.is_c618_HVAC_model = IN_FULL_SYNC; /* : sync_front = 0; */ rtDW.CCU_FRONT_SYNC = 0U; /* : sync_rear = 0; */ rtDW.CCU_REAR_SYNC = 0U; /* : sync_all = 1; */ rtDW.CCU_ALL_ZONE_SYNC = 1U; /* : sf_internal_predicateOutput = enable_rear_sync; */ } else if (rtDW.enable_rear_sync != 0) { /* : enable_rear_sync = 0; */ rtDW.enable_rear_sync = 0U; rtDW.is_c618_HVAC_model = IN_REAR_ONLY; /* : sync_front = 0; */ rtDW.CCU_FRONT_SYNC = 0U; /* : sync_rear = 1; */ rtDW.CCU_REAR_SYNC = 1U; /* : sync_all = 0; */ rtDW.CCU_ALL_ZONE_SYNC = 0U; } break; case IN_REAR_ONLY: rtDW.CCU_FRONT_SYNC = 0U; rtDW.CCU_REAR_SYNC = 1U; rtDW.CCU_ALL_ZONE_SYNC = 0U; /* : sf_internal_predicateOutput = enable_full_sync; */ if (rtDW.enable_full_sync != 0) { /* : enable_full_sync = 0; */ rtDW.enable_full_sync = 0U; rtDW.is_c618_HVAC_model = IN_FULL_SYNC; /* : sync_front = 0; */ rtDW.CCU_FRONT_SYNC = 0U; /* : sync_rear = 0; */ rtDW.CCU_REAR_SYNC = 0U; /* : sync_all = 1; */ rtDW.CCU_ALL_ZONE_SYNC = 1U; /* : sf_internal_predicateOutput = enable_front_sync; */ } else if (rtDW.enable_front_sync != 0) { /* : enable_front_sync = 0; */ rtDW.enable_front_sync = 0U; rtDW.is_c618_HVAC_model = IN_SEPARATE_FRONT_AND_REAR; /* : sync_front = 1; */ rtDW.CCU_FRONT_SYNC = 1U; /* : sync_rear = 1; */ rtDW.CCU_REAR_SYNC = 1U; /* : sync_all = 0; */ rtDW.CCU_ALL_ZONE_SYNC = 0U; /* : sf_internal_predicateOutput = disable_rear_sync || changed_RL_params; */ } else if ((rtDW.disable_rear_sync != 0) || (rtDW.changed_RL_params != 0)) { /* : disable_rear_sync = 0; */ rtDW.disable_rear_sync = 0U; /* : changed_RL_params = 0; */ rtDW.changed_RL_params = 0U; rtDW.is_c618_HVAC_model = IN_NO_SYNC; /* : sync_front = 0; */ rtDW.CCU_FRONT_SYNC = 0U; /* : sync_rear = 0; */ rtDW.CCU_REAR_SYNC = 0U; /* : sync_all = 0; */ rtDW.CCU_ALL_ZONE_SYNC = 0U; } break; default: /* case IN_SEPARATE_FRONT_AND_REAR: */ rtDW.CCU_FRONT_SYNC = 1U; rtDW.CCU_REAR_SYNC = 1U; rtDW.CCU_ALL_ZONE_SYNC = 0U; /* : sf_internal_predicateOutput = enable_full_sync; */ if (rtDW.enable_full_sync != 0) { /* : enable_full_sync = 0; */ rtDW.enable_full_sync = 0U; rtDW.is_c618_HVAC_model = IN_FULL_SYNC; /* : sync_front = 0; */ rtDW.CCU_FRONT_SYNC = 0U; /* : sync_rear = 0; */ rtDW.CCU_REAR_SYNC = 0U; /* : sync_all = 1; */ rtDW.CCU_ALL_ZONE_SYNC = 1U; /* : sf_internal_predicateOutput = disable_rear_sync || changed_RL_params; */ } else if ((rtDW.disable_rear_sync != 0) || (rtDW.changed_RL_params != 0)) { /* : disable_rear_sync = 0; */ rtDW.disable_rear_sync = 0U; /* : changed_RL_params = 0; */ rtDW.changed_RL_params = 0U; rtDW.is_c618_HVAC_model = IN_FRONT_ONLY; /* : sync_front = 1; */ rtDW.CCU_FRONT_SYNC = 1U; /* : sync_rear = 0; */ rtDW.CCU_REAR_SYNC = 0U; /* : sync_all = 0; */ rtDW.CCU_ALL_ZONE_SYNC = 0U; /* : sf_internal_predicateOutput = disable_front_sync || changed_FR_params; */ } else if ((rtDW.disable_front_sync != 0) || (rtDW.changed_FR_params != 0)) { /* : disable_front_sync = 0; */ rtDW.disable_front_sync = 0U; /* : changed_FR_params = 0; */ rtDW.changed_FR_params = 0U; guard1 = true; /* : sf_internal_predicateOutput = changed_FR_params; */ } else if (rtDW.changed_FR_params != 0) { /* : changed_FR_params = 0; */ rtDW.changed_FR_params = 0U; guard1 = true; } break; } if (guard4) { rtDW.is_c618_HVAC_model = IN_SEPARATE_FRONT_AND_REAR; /* : sync_front = 1; */ rtDW.CCU_FRONT_SYNC = 1U; /* : sync_rear = 1; */ rtDW.CCU_REAR_SYNC = 1U; /* : sync_all = 0; */ rtDW.CCU_ALL_ZONE_SYNC = 0U; } if (guard3) { rtDW.is_c618_HVAC_model = IN_REAR_ONLY; /* : sync_front = 0; */ rtDW.CCU_FRONT_SYNC = 0U; /* : sync_rear = 1; */ rtDW.CCU_REAR_SYNC = 1U; /* : sync_all = 0; */ rtDW.CCU_ALL_ZONE_SYNC = 0U; } if (guard2) { rtDW.is_c618_HVAC_model = IN_NO_SYNC; /* : sync_front = 0; */ rtDW.CCU_FRONT_SYNC = 0U; /* : sync_rear = 0; */ rtDW.CCU_REAR_SYNC = 0U; /* : sync_all = 0; */ rtDW.CCU_ALL_ZONE_SYNC = 0U; } if (guard1) { rtDW.is_c618_HVAC_model = IN_REAR_ONLY; /* : sync_front = 0; */ rtDW.CCU_FRONT_SYNC = 0U; /* : sync_rear = 1; */ rtDW.CCU_REAR_SYNC = 1U; /* : sync_all = 0; */ rtDW.CCU_ALL_ZONE_SYNC = 0U; } } /* End of Chart: '/Synchronization stateflow chart' */ /* Outputs for Enabled SubSystem: '/Front Left Valves - manual directions' incorporates: * EnablePort: '/Enable' */ /* RelationalOperator: '/Equal2' incorporates: * Constant: '/Constant2' * DataStoreRead: '/Data Store Read44' */ if (rtDW.CCU_MODE_FL == 0) { /* DataTypeConversion: '/Data Type Conversion5' incorporates: * Constant: '/Constant2' * DataStoreRead: '/Data Store Read10' * RelationalOperator: '/Relational Operator2' */ rtb_Switch_gs = (uint8_t)(rtDW.CCU_FOOT_FL == 1); /* MATLAB Function: '/Valves for Def' */ ValvesforDef(rtb_out_dwb); /* MATLAB Function: '/Valves for Hi_Level' */ /* : out = g_ausFLOW_FR_VE2VALVE; */ ValvesforHi_Level(rtb_out_ff); /* MATLAB Function: '/Valves for Foot + Def' */ /* : out = g_ausFLOW_FR_FO2VALVE; */ ValvesforFootDef(rtb_out_fw); /* MATLAB Function: '/Valves for Bi Level' */ ValvesforBiLevel(rtb_out_c); /* MATLAB Function: '/Valves for Tri-Level' */ ValvesforTriLevel(rtB.MultiportSwitch_f); /* MultiPortSwitch: '/Multiport Switch' incorporates: * Constant: '/Constant' * Constant: '/Constant1' * DataStoreRead: '/Data Store Read4' * DataStoreRead: '/Data Store Read5' * Gain: '/Gain1' * Gain: '/Gain2' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator1' * Sum: '/Add' */ switch ((int32_t)(((uint32_t)((rtDW.CCU_FACE_FL == 1) << 1) + (uint32_t) (rtDW.CCU_DEF_FL == 1)) + (uint32_t)(rtb_Switch_gs << 2))) { case 0: /* MultiPortSwitch: '/Multiport Switch' */ for (i = 0; i < 9; i++) { rtB.MultiportSwitch_f[i] = 0U; } break; case 1: /* MultiPortSwitch: '/Multiport Switch' */ for (i = 0; i < 9; i++) { rtB.MultiportSwitch_f[i] = rtb_out_dwb[i]; } break; case 2: /* MultiPortSwitch: '/Multiport Switch' incorporates: * MATLAB Function: '/Valves for Vent mode' */ for (i = 0; i < 9; i++) { rtB.MultiportSwitch_f[i] = g_ausFLOW_FR_VE2VALVE[i]; } break; case 3: /* MultiPortSwitch: '/Multiport Switch' */ for (i = 0; i < 9; i++) { rtB.MultiportSwitch_f[i] = rtb_out_ff[i]; } break; case 4: /* MultiPortSwitch: '/Multiport Switch' incorporates: * MATLAB Function: '/Valves for Foot' */ for (i = 0; i < 9; i++) { rtB.MultiportSwitch_f[i] = g_ausFLOW_FR_FO2VALVE[i]; } break; case 5: /* MultiPortSwitch: '/Multiport Switch' */ for (i = 0; i < 9; i++) { rtB.MultiportSwitch_f[i] = rtb_out_fw[i]; } break; case 6: /* MultiPortSwitch: '/Multiport Switch' */ for (i = 0; i < 9; i++) { rtB.MultiportSwitch_f[i] = rtb_out_c[i]; } break; } /* End of MultiPortSwitch: '/Multiport Switch' */ } /* End of RelationalOperator: '/Equal2' */ /* End of Outputs for SubSystem: '/Front Left Valves - manual directions' */ /* RelationalOperator: '/Equal1' incorporates: * Constant: '/manual' * DataStoreRead: '/Data Store Read46' */ rtb_LogicalOperator5 = (rtDW.CCU_MODE_FL == 0); /* Saturate: '/Saturation4' incorporates: * DataStoreRead: '/Data Store Read' */ if (rtDW.LEVEL <= 5) { rtb_Saturation4_l = rtDW.LEVEL; } else { rtb_Saturation4_l = 5U; } /* End of Saturate: '/Saturation4' */ /* Saturate: '/Saturation' incorporates: * DataStoreRead: '/Data Store Read16' */ if (rtDW.CCU_SET_FL > 290) { Gain = 290U; } else if (rtDW.CCU_SET_FL < 170) { Gain = 170U; } else { Gain = rtDW.CCU_SET_FL; } /* MATLAB Function: '/MODE_for_set_and_lvl' incorporates: * Gain: '/Gain2' * Saturate: '/Saturation' */ MODE_for_set_and_lvl(rtb_Saturation4_l, (int16_t)((52429U * Gain) >> 19), &rtb_Switch_gs); /* MATLAB Function: '/valves_front_left' */ /* : modes_array = [ */ /* : g_ausFLOW_FR_VE2VALVE; */ /* : g_ausFLOW_FR_BIVALVE; */ /* : g_ausFLOW_FR_BI2VALVE; */ /* : g_ausFLOW_FR_AF2VALVE; */ /* : g_ausFLOW_FR_AF2VALVE_SUMMER]; */ /* : index = idivide(MODE, 10); */ /* : get_valves = modes_array(index, :); */ i = (int32_t)trunc((double)rtb_Switch_gs / 10.0); for (i_0 = 0; i_0 < 9; i_0++) { tmp_1[5 * i_0] = g_ausFLOW_FR_VE2VALVE[i_0]; tmp_1[5 * i_0 + 1] = g_ausFLOW_FR_BIVALVE[i_0]; tmp_1[5 * i_0 + 2] = g_ausFLOW_FR_BI2VALVE[i_0]; tmp_1[5 * i_0 + 3] = g_ausFLOW_FR_AF2VALVE[i_0]; tmp_1[5 * i_0 + 4] = g_ausFLOW_FR_AF2VALVE_SUMMER[i_0]; /* Switch: '/Switch' */ if (rtb_LogicalOperator5) { /* DataStoreWrite: '/Data Store Write23' incorporates: * MultiPortSwitch: '/Multiport Switch' */ rtb_out_dwb[i_0] = rtB.MultiportSwitch_f[i_0]; } else { /* DataStoreWrite: '/Data Store Write23' */ rtb_out_dwb[i_0] = tmp_1[(5 * i_0 + i) - 1]; } /* End of Switch: '/Switch' */ } /* End of MATLAB Function: '/valves_front_left' */ /* MATLAB Function: '/Valves for Def' */ ValvesforDef(rtb_out_ff); /* MATLAB Function: '/Valves for Hi_Level' */ /* : out = g_ausFLOW_FR_VE2VALVE; */ ValvesforHi_Level(rtb_out_fw); /* MATLAB Function: '/Valves for Foot + Def' */ /* : out = g_ausFLOW_FR_FO2VALVE; */ ValvesforFootDef(rtb_out_c); /* MATLAB Function: '/Valves for Bi Level' */ ValvesforBiLevel(rtb_out_f1); /* MATLAB Function: '/Valves for Tri-Level' */ ValvesforTriLevel(rtb_out_fl); /* Saturate: '/Saturation1' incorporates: * DataStoreRead: '/Data Store Read17' */ if (rtDW.CCU_SET_FR > 290) { Gain = 290U; } else if (rtDW.CCU_SET_FR < 170) { Gain = 170U; } else { Gain = rtDW.CCU_SET_FR; } /* MATLAB Function: '/MODE_for_set_and_lvl1' incorporates: * Gain: '/Gain1' * Saturate: '/Saturation1' */ MODE_for_set_and_lvl(rtb_Saturation4_l, (int16_t)((52429U * Gain) >> 19), &rtb_Switch_gs); /* Switch: '/Switch1' incorporates: * Constant: '/manual1' * DataStoreRead: '/Data Store Read8' * RelationalOperator: '/Equal2' */ /* : modes_array = [ */ /* : g_ausFLOW_FR_VE2VALVE; */ /* : g_ausFLOW_FR_BIVALVE; */ /* : g_ausFLOW_FR_BI2VALVE; */ /* : g_ausFLOW_FR_AF2VALVE; */ /* : g_ausFLOW_FR_AF2VALVE_SUMMER]; */ /* : index = idivide(MODE, 10); */ /* : get_valves = modes_array(index, :); */ if (rtDW.CCU_MODE_FR == 0) { /* MultiPortSwitch: '/Multiport Switch' incorporates: * Constant: '/Constant' * Constant: '/Constant1' * Constant: '/Constant2' * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read2' * DataStoreRead: '/Data Store Read3' * Gain: '/Gain1' * Gain: '/Gain2' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator1' * RelationalOperator: '/Relational Operator2' * Sum: '/Add' */ switch ((int32_t)(((uint32_t)((rtDW.CCU_FACE_FR == 1) << 1) + (uint32_t) (rtDW.CCU_DEF_FR == 1)) + (uint32_t)((rtDW.CCU_FOOT_FR == 1) << 2))) { case 0: /* Switch: '/Switch1' */ for (i = 0; i < 9; i++) { rtb_out_fl[i] = 0U; } break; case 1: /* Switch: '/Switch1' */ for (i = 0; i < 9; i++) { rtb_out_fl[i] = rtb_out_ff[i]; } break; case 2: /* Switch: '/Switch1' incorporates: * MATLAB Function: '/Valves for Vent mode' */ for (i = 0; i < 9; i++) { rtb_out_fl[i] = g_ausFLOW_FR_VE2VALVE[i]; } break; case 3: /* Switch: '/Switch1' */ for (i = 0; i < 9; i++) { rtb_out_fl[i] = rtb_out_fw[i]; } break; case 4: /* Switch: '/Switch1' incorporates: * MATLAB Function: '/Valves for Foot' */ for (i = 0; i < 9; i++) { rtb_out_fl[i] = g_ausFLOW_FR_FO2VALVE[i]; } break; case 5: /* Switch: '/Switch1' */ for (i = 0; i < 9; i++) { rtb_out_fl[i] = rtb_out_c[i]; } break; case 6: /* Switch: '/Switch1' */ for (i = 0; i < 9; i++) { rtb_out_fl[i] = rtb_out_f1[i]; } break; } /* End of MultiPortSwitch: '/Multiport Switch' */ } else { /* MATLAB Function: '/valves_front_right' incorporates: * Switch: '/Switch1' */ i = (int32_t)trunc((double)rtb_Switch_gs / 10.0); for (i_0 = 0; i_0 < 9; i_0++) { tmp_1[5 * i_0] = g_ausFLOW_FR_VE2VALVE[i_0]; tmp_1[5 * i_0 + 1] = g_ausFLOW_FR_BIVALVE[i_0]; tmp_1[5 * i_0 + 2] = g_ausFLOW_FR_BI2VALVE[i_0]; tmp_1[5 * i_0 + 3] = g_ausFLOW_FR_AF2VALVE[i_0]; tmp_1[5 * i_0 + 4] = g_ausFLOW_FR_AF2VALVE_SUMMER[i_0]; rtb_out_fl[i_0] = tmp_1[(5 * i_0 + i) - 1]; } /* End of MATLAB Function: '/valves_front_right' */ } /* End of Switch: '/Switch1' */ /* Assignment: '/Присваивание в [3-4]' incorporates: * DataStoreWrite: '/Data Store Write23' */ rtb_out_dwb[2] = rtb_out_fl[2]; /* Assignment: '/Присваивание в [7-8]' incorporates: * DataStoreWrite: '/Data Store Write23' */ rtb_out_dwb[6] = rtb_out_fl[6]; /* Assignment: '/Присваивание в [3-4]' incorporates: * DataStoreWrite: '/Data Store Write23' */ rtb_out_dwb[3] = rtb_out_fl[3]; /* Assignment: '/Присваивание в [7-8]' incorporates: * DataStoreWrite: '/Data Store Write23' */ rtb_out_dwb[7] = rtb_out_fl[7]; /* Outputs for Enabled SubSystem: '/Rear valves left - manual directions' incorporates: * EnablePort: '/Enable' */ /* RelationalOperator: '/Equal2' incorporates: * Constant: '/Constant2' * DataStoreRead: '/Data Store Read44' */ if (rtDW.CCU_MODE_RL == 0) { /* MATLAB Function: '/AF for Bi Level' */ AFforBiLevel_a(rtB.MultiportSwitch_o); /* MATLAB Function: '/valves for Vent mode' */ /* : out = g_ausFLOW_RE_FO2VALVE; */ valvesforVentmode(rtb_Gain1_nj); /* MultiPortSwitch: '/Multiport Switch' incorporates: * Constant: '/Constant1' * Constant: '/Constant2' * DataStoreRead: '/Data Store Read23' * DataStoreRead: '/Data Store Read24' * Gain: '/Gain2' * RelationalOperator: '/Relational Operator1' * RelationalOperator: '/Relational Operator2' * Sum: '/Add' */ switch ((int32_t)((uint32_t)((rtDW.CCU_FOOT_RL == 1) << 1) + (uint32_t) (rtDW.CCU_FACE_RL == 1))) { case 0: /* MultiPortSwitch: '/Multiport Switch' */ for (i = 0; i < 6; i++) { rtB.MultiportSwitch_o[i] = 0U; } break; case 1: /* MultiPortSwitch: '/Multiport Switch' */ for (i = 0; i < 6; i++) { rtB.MultiportSwitch_o[i] = rtb_Gain1_nj[i]; } break; case 2: /* MultiPortSwitch: '/Multiport Switch' incorporates: * MATLAB Function: '/AF for Foot' */ for (i = 0; i < 6; i++) { rtB.MultiportSwitch_o[i] = g_ausFLOW_RE_FO2VALVE[i]; } break; } /* End of MultiPortSwitch: '/Multiport Switch' */ } /* End of RelationalOperator: '/Equal2' */ /* End of Outputs for SubSystem: '/Rear valves left - manual directions' */ /* RelationalOperator: '/Equal3' incorporates: * Constant: '/manual2' * DataStoreRead: '/Data Store Read9' */ rtb_LogicalOperator5 = (rtDW.CCU_MODE_RL == 0); /* MATLAB Function: '/MODE_by_duct_tg_R_for_LVL' */ /* : modes_array = [ */ /* : g_ausMODE_BY_DUCT_TG_R_LV0; */ /* : g_ausMODE_BY_DUCT_TG_R_LV1; */ /* : g_ausMODE_BY_DUCT_TG_R_LV2; */ /* : g_ausMODE_BY_DUCT_TG_R_LV3; */ /* : g_ausMODE_BY_DUCT_TG_R_LV4; */ /* : g_ausMODE_BY_DUCT_TG_R_LV5]; */ /* : get_mode = modes_array(LVL + 1, :); */ for (i = 0; i < 7; i++) { tmp_2[6 * i] = g_ausMODE_BY_DUCT_TG_R_LV0[i]; tmp_2[6 * i + 1] = g_ausMODE_BY_DUCT_TG_R_LV1[i]; tmp_2[6 * i + 2] = g_ausMODE_BY_DUCT_TG_R_LV2[i]; tmp_2[6 * i + 3] = g_ausMODE_BY_DUCT_TG_R_LV3[i]; tmp_2[6 * i + 4] = g_ausMODE_BY_DUCT_TG_R_LV4[i]; tmp_2[6 * i + 5] = g_ausMODE_BY_DUCT_TG_R_LV5[i]; rtb_get_mode[i] = tmp_2[6 * i + rtb_Saturation4_l]; } /* End of MATLAB Function: '/MODE_by_duct_tg_R_for_LVL' */ /* If: '/If' incorporates: * Sum: '/Subtract' * UnitDelay: '/Unit Delay' */ if ((int16_t)-rtDW.UnitDelay_DSTATE_lk >= 0) { /* Outputs for IfAction SubSystem: '/duct_tg увеличивается RL' incorporates: * ActionPort: '/Action Port' */ /* SignalConversion generated from: '/rear_mode_index' incorporates: * DataStoreWrite: '/Data Store Write4' * MATLAB Function: '/increase' */ increase(0, rtb_get_mode, &Gain); /* End of Outputs for SubSystem: '/duct_tg увеличивается RL' */ } else { /* Outputs for IfAction SubSystem: '/duct_tg уменьшается RL' incorporates: * ActionPort: '/Action Port' */ /* SignalConversion generated from: '/y' incorporates: * DataStoreWrite: '/Data Store Write4' * MATLAB Function: '/decrease' */ decrease(0, rtb_get_mode, &Gain); /* End of Outputs for SubSystem: '/duct_tg уменьшается RL' */ } /* End of If: '/If' */ /* MATLAB Function: '/valves_rear_left' */ valves_rear_left(Gain, rtb_TmpSignalConversionAt1DLookupTable7Inport1); for (i = 0; i < 6; i++) { /* Switch: '/Switch2' */ if (rtb_LogicalOperator5) { /* DataStoreWrite: '/Data Store Write24' incorporates: * MultiPortSwitch: '/Multiport Switch' */ rtb_Gain1_nj[i] = rtB.MultiportSwitch_o[i]; } else { /* DataStoreWrite: '/Data Store Write24' incorporates: * SignalConversion generated from: '/1-D Lookup Table7' */ rtb_Gain1_nj[i] = rtb_TmpSignalConversionAt1DLookupTable7Inport1[i]; } /* End of Switch: '/Switch2' */ } /* Outputs for Enabled SubSystem: '/Rear valves right - manual directions' incorporates: * EnablePort: '/Enable' */ /* RelationalOperator: '/Equal3' incorporates: * Constant: '/Constant3' * DataStoreRead: '/Data Store Read45' */ if (rtDW.CCU_MODE_RR == 0) { /* MATLAB Function: '/AF for Bi Level' */ AFforBiLevel_a(rtB.MultiportSwitch); /* MATLAB Function: '/valves for Vent mode' */ /* : out = g_ausFLOW_RE_FO2VALVE; */ valvesforVentmode(rtb_TmpSignalConversionAt1DLookupTable7Inport1); /* MultiPortSwitch: '/Multiport Switch' incorporates: * Constant: '/Constant1' * Constant: '/Constant2' * DataStoreRead: '/Data Store Read21' * DataStoreRead: '/Data Store Read22' * Gain: '/Gain2' * RelationalOperator: '/Relational Operator1' * RelationalOperator: '/Relational Operator2' * Sum: '/Add' */ switch ((int32_t)((uint32_t)((rtDW.CCU_FOOT_RR == 1) << 1) + (uint32_t) (rtDW.CCU_FACE_RR == 1))) { case 0: /* MultiPortSwitch: '/Multiport Switch' */ for (i = 0; i < 6; i++) { rtB.MultiportSwitch[i] = 0U; } break; case 1: /* MultiPortSwitch: '/Multiport Switch' */ for (i = 0; i < 6; i++) { rtB.MultiportSwitch[i] = rtb_TmpSignalConversionAt1DLookupTable7Inport1[i]; } break; case 2: /* MultiPortSwitch: '/Multiport Switch' incorporates: * MATLAB Function: '/AF for Foot' */ for (i = 0; i < 6; i++) { rtB.MultiportSwitch[i] = g_ausFLOW_RE_FO2VALVE[i]; } break; } /* End of MultiPortSwitch: '/Multiport Switch' */ } /* End of RelationalOperator: '/Equal3' */ /* End of Outputs for SubSystem: '/Rear valves right - manual directions' */ /* If: '/If1' incorporates: * DataStoreRead: '/Data Store Read7' * Sum: '/Subtract1' * UnitDelay: '/Unit Delay1' */ if ((int16_t)(rtDW.Duct_RR_Tg - rtDW.UnitDelay1_DSTATE) >= 0) { /* Outputs for IfAction SubSystem: '/duct_tg увеличивается RR' incorporates: * ActionPort: '/Action Port' */ /* SignalConversion generated from: '/y' incorporates: * MATLAB Function: '/increase' */ increase(rtDW.Duct_RR_Tg, rtb_get_mode, &Gain); /* End of Outputs for SubSystem: '/duct_tg увеличивается RR' */ } else { /* Outputs for IfAction SubSystem: '/duct_tg уменьшается RR' incorporates: * ActionPort: '/Action Port' */ /* SignalConversion generated from: '/y' incorporates: * MATLAB Function: '/decrease' */ decrease(rtDW.Duct_RR_Tg, rtb_get_mode, &Gain); /* End of Outputs for SubSystem: '/duct_tg уменьшается RR' */ } /* End of If: '/If1' */ /* MATLAB Function: '/valves_rear_right' */ valves_rear_left(Gain, rtb_TmpSignalConversionAt1DLookupTable7Inport1); /* Switch: '/Switch3' incorporates: * Constant: '/manual3' * DataStoreRead: '/Data Store Read11' * MultiPortSwitch: '/Multiport Switch' * RelationalOperator: '/Equal4' */ if (rtDW.CCU_MODE_RR == 0) { for (i = 0; i < 6; i++) { rtb_TmpSignalConversionAt1DLookupTable7Inport1[i] = rtB.MultiportSwitch[i]; } } /* End of Switch: '/Switch3' */ /* Assignment: '/Присваивание в [3-4] rear' incorporates: * DataStoreWrite: '/Data Store Write24' */ rtb_Gain1_nj[2] = rtb_TmpSignalConversionAt1DLookupTable7Inport1[2]; rtb_Gain1_nj[3] = rtb_TmpSignalConversionAt1DLookupTable7Inport1[3]; /* Assignment: '/Присваивание в [6] rear' incorporates: * DataStoreWrite: '/Data Store Write24' */ rtb_Gain1_nj[5] = rtb_TmpSignalConversionAt1DLookupTable7Inport1[5]; /* Saturate: '/Saturation' incorporates: * DataStoreRead: '/Data Store Read' */ if (rtDW.AMB > 1000) { rtb_Bias5 = 1000; } else if (rtDW.AMB < -1000) { rtb_Bias5 = -1000; } else { rtb_Bias5 = rtDW.AMB; } /* End of Saturate: '/Saturation' */ /* MATLAB Function: '/Convert_g_assAMB_LV_UP' */ /* : c_g_assAMB_LV_UP = [-1000, g_assAMB_LV_UP(5), g_assAMB_LV_UP(4), g_assAMB_LV_UP(3), g_assAMB_LV_UP(2), g_assAMB_LV_UP(1)]; */ tmp_3[0] = -1000; tmp_3[1] = g_assAMB_LV_UP[4]; tmp_3[2] = g_assAMB_LV_UP[3]; tmp_3[3] = g_assAMB_LV_UP[2]; tmp_3[4] = g_assAMB_LV_UP[1]; tmp_3[5] = g_assAMB_LV_UP[0]; /* SwitchCase: '/Switch Case' incorporates: * Lookup_n-D: '/1-D Lookup Table' * Saturate: '/Saturation' */ switch ((int8_t)rtConstP.pooled52[plook_u32s16_bincka(rtb_Bias5, tmp_3, 5U)]) { case 0: /* Outputs for IfAction SubSystem: '/Switch Case Action Subsystem' incorporates: * ActionPort: '/Action Port' */ /* Merge: '/Merge' incorporates: * Constant: '/Constant' * RelationalOperator: '/Relational Operator' * Switch: '/Switch' */ rtB.Merge_b = (uint8_t)(rtb_Bias5 <= g_assAMB_LV_UP[0]); /* End of Outputs for SubSystem: '/Switch Case Action Subsystem' */ break; case 1: /* Outputs for IfAction SubSystem: '/Switch Case Action Subsystem1' incorporates: * ActionPort: '/Action Port' */ /* Switch: '/Switch' incorporates: * MATLAB Function: '/Convert_g_assAMB_LV_UP_2' * RelationalOperator: '/Relational Operator' */ /* : c_g_assAMB_LV_DN_1 = g_assAMB_LV_DN(1); */ /* : c_g_assAMB_LV_UP_2 = g_assAMB_LV_UP(2); */ if (rtb_Bias5 > g_assAMB_LV_UP[1]) { /* Merge: '/Merge' incorporates: * MATLAB Function: '/Convert_g_assAMB_LV_DN_1' * RelationalOperator: '/Relational Operator1' */ rtB.Merge_b = (uint8_t)(rtb_Bias5 <= g_assAMB_LV_DN[0]); } else { /* Merge: '/Merge' incorporates: * Constant: '/Constant_Lv2' */ rtB.Merge_b = 2U; } /* End of Switch: '/Switch' */ /* End of Outputs for SubSystem: '/Switch Case Action Subsystem1' */ break; case 2: /* Outputs for IfAction SubSystem: '/Switch Case Action Subsystem2' incorporates: * ActionPort: '/Action Port' */ /* Switch: '/Switch2' incorporates: * MATLAB Function: '/Convert_g_assAMB_LV_UP_3' * RelationalOperator: '/Relational Operator' */ /* : c_g_assAMB_LV_DN_2 = g_assAMB_LV_DN(2); */ /* : c_g_assAMB_LV_UP_3 = g_assAMB_LV_UP(3); */ if (rtb_Bias5 > g_assAMB_LV_UP[2]) { /* Switch: '/Switch3' incorporates: * MATLAB Function: '/Convert_g_assAMB_LV_DN_2' * RelationalOperator: '/Relational Operator1' */ if (rtb_Bias5 > g_assAMB_LV_DN[1]) { /* Merge: '/Merge' incorporates: * Constant: '/Constant_Lv1' */ rtB.Merge_b = 1U; } else { /* Merge: '/Merge' incorporates: * Constant: '/Constant_Lv2' */ rtB.Merge_b = 2U; } /* End of Switch: '/Switch3' */ } else { /* Merge: '/Merge' incorporates: * Constant: '/Constant_Lv3' */ rtB.Merge_b = 3U; } /* End of Switch: '/Switch2' */ /* End of Outputs for SubSystem: '/Switch Case Action Subsystem2' */ break; case 3: /* Outputs for IfAction SubSystem: '/Switch Case Action Subsystem3' incorporates: * ActionPort: '/Action Port' */ /* Switch: '/Switch2' incorporates: * MATLAB Function: '/Convert_g_assAMB_LV_UP_4' * RelationalOperator: '/Relational Operator' */ /* : c_g_assAMB_LV_DN_3 = g_assAMB_LV_DN(3); */ /* : c_g_assAMB_LV_UP_4 = g_assAMB_LV_UP(4); */ if (rtb_Bias5 > g_assAMB_LV_UP[3]) { /* Switch: '/Switch3' incorporates: * MATLAB Function: '/Convert_g_assAMB_LV_DN_3' * RelationalOperator: '/Relational Operator1' */ if (rtb_Bias5 > g_assAMB_LV_DN[2]) { /* Merge: '/Merge' incorporates: * Constant: '/Constant_Lv2' */ rtB.Merge_b = 2U; } else { /* Merge: '/Merge' incorporates: * Constant: '/Constant_Lv3' */ rtB.Merge_b = 3U; } /* End of Switch: '/Switch3' */ } else { /* Merge: '/Merge' incorporates: * Constant: '/Constant_Lv4' */ rtB.Merge_b = 4U; } /* End of Switch: '/Switch2' */ /* End of Outputs for SubSystem: '/Switch Case Action Subsystem3' */ break; case 4: /* Outputs for IfAction SubSystem: '/Switch Case Action Subsystem4' incorporates: * ActionPort: '/Action Port' */ /* Switch: '/Switch2' incorporates: * MATLAB Function: '/Convert_g_assAMB_LV_UP_5' * RelationalOperator: '/Relational Operator' */ /* : c_g_assAMB_LV_DN_4 = g_assAMB_LV_DN(4); */ /* : c_g_assAMB_LV_UP_5 = g_assAMB_LV_UP(5); */ if (rtb_Bias5 > g_assAMB_LV_UP[4]) { /* Switch: '/Switch3' incorporates: * MATLAB Function: '/Convert_g_assAMB_LV_DN_4' * RelationalOperator: '/Relational Operator1' */ if (rtb_Bias5 > g_assAMB_LV_DN[3]) { /* Merge: '/Merge' incorporates: * Constant: '/Constant_Lv3' */ rtB.Merge_b = 3U; } else { /* Merge: '/Merge' incorporates: * Constant: '/Constant_Lv4' */ rtB.Merge_b = 4U; } /* End of Switch: '/Switch3' */ } else { /* Merge: '/Merge' incorporates: * Constant: '/Constant_Lv5' */ rtB.Merge_b = 5U; } /* End of Switch: '/Switch2' */ /* End of Outputs for SubSystem: '/Switch Case Action Subsystem4' */ break; case 5: /* Outputs for IfAction SubSystem: '/Switch Case Action Subsystem5' incorporates: * ActionPort: '/Action Port' */ /* Switch: '/Switch1' incorporates: * MATLAB Function: '/Convert_g_assAMB_LV_DN_5' * RelationalOperator: '/Relational Operator' */ /* : c_g_assAMB_LV_DN_5 = g_assAMB_LV_DN(5); */ if (rtb_Bias5 > g_assAMB_LV_DN[4]) { /* Merge: '/Merge' incorporates: * Constant: '/Constant_Lv4' */ rtB.Merge_b = 4U; } else { /* Merge: '/Merge' incorporates: * Constant: '/Constant_Lv5' */ rtB.Merge_b = 5U; } /* End of Switch: '/Switch1' */ /* End of Outputs for SubSystem: '/Switch Case Action Subsystem5' */ break; } /* End of SwitchCase: '/Switch Case' */ /* Saturate: '/Saturation' incorporates: * DataStoreRead: '/Data Store Read1' */ if (rtDW.CCU_SET_FL > 290) { i = 290; } else if (rtDW.CCU_SET_FL < 170) { i = 170; } else { i = rtDW.CCU_SET_FL; } /* Gain: '/Gain' incorporates: * Saturate: '/Saturation' */ i *= 13107; rtb_Switch_gs = (uint8_t)((((uint32_t)i & 65536U) != 0U) + (i >> 17)); /* MATLAB Function: '/Modes for levels' */ /* : get_modes_for_levels = [g_aucMODE_BY_SET_F_LV0; */ /* : g_aucMODE_BY_SET_F_LV1; */ /* : g_aucMODE_BY_SET_F_LV2; */ /* : g_aucMODE_BY_SET_F_LV3; */ /* : g_aucMODE_BY_SET_F_LV4; */ /* : g_aucMODE_BY_SET_F_LV5; */ /* : ]; */ for (i = 0; i < 13; i++) { rtb_get_modes_for_levels[6 * i] = g_aucMODE_BY_SET_F_LV0[i]; rtb_get_modes_for_levels[6 * i + 1] = g_aucMODE_BY_SET_F_LV1[i]; rtb_get_modes_for_levels[6 * i + 2] = g_aucMODE_BY_SET_F_LV2[i]; rtb_get_modes_for_levels[6 * i + 3] = g_aucMODE_BY_SET_F_LV3[i]; rtb_get_modes_for_levels[6 * i + 4] = g_aucMODE_BY_SET_F_LV4[i]; rtb_get_modes_for_levels[6 * i + 5] = g_aucMODE_BY_SET_F_LV5[i]; } /* End of MATLAB Function: '/Modes for levels' */ /* Lookup_n-D: '/Выбор режима Left' incorporates: * Gain: '/Gain' * Merge: '/Merge' */ rtb_u_gnq = look2_iu8bu8s16lu64n32_binlcse(rtB.Merge_b, rtb_Switch_gs, rtConstP.pooled112, rtConstP.pooled60, rtb_get_modes_for_levels, rtConstP.pooled49, 6U); /* MATLAB Function: '/Начальные положения заслонок left' */ left(rtb_u_gnq, rtb_out_ff); /* Saturate: '/Saturation1' incorporates: * DataStoreRead: '/Data Store Read2' */ if (rtDW.CCU_SET_FR > 290) { i = 290; } else if (rtDW.CCU_SET_FR < 170) { i = 170; } else { i = rtDW.CCU_SET_FR; } /* Gain: '/Gain2' incorporates: * Saturate: '/Saturation1' */ i *= 13107; rtb_Saturation4_l = (uint8_t)((((uint32_t)i & 65536U) != 0U) + (i >> 17)); /* SwitchCase: '/Switch for Left ' incorporates: * DataStoreRead: '/Data Store Read' */ switch (rtb_u_gnq) { case 10: break; case 20: for (i = 0; i < 9; i++) { /* Outputs for IfAction SubSystem: '/Bilevel' incorporates: * ActionPort: '/Action Port' */ rtb_out_fw[i] = rtb_out_ff[i]; /* End of Outputs for SubSystem: '/Bilevel' */ } /* Outputs for IfAction SubSystem: '/Bilevel' incorporates: * ActionPort: '/Action Port' */ Bilevel(rtDW.AMB, rtB.Merge_b, rtb_out_fw, rtb_Switch_gs, rtb_Saturation4_l); /* End of Outputs for SubSystem: '/Bilevel' */ break; case 30: for (i = 0; i < 9; i++) { /* Outputs for IfAction SubSystem: '/Bilevel2' incorporates: * ActionPort: '/Action Port' */ rtb_out_fw[i] = rtb_out_ff[i]; /* End of Outputs for SubSystem: '/Bilevel2' */ } /* Outputs for IfAction SubSystem: '/Bilevel2' incorporates: * ActionPort: '/Action Port' */ Bilevel2(rtDW.AMB, rtB.Merge_b, rtb_out_fw, rtb_Switch_gs, rtb_Saturation4_l); /* End of Outputs for SubSystem: '/Bilevel2' */ break; case 40: for (i = 0; i < 9; i++) { /* Outputs for IfAction SubSystem: '/Afoot' incorporates: * ActionPort: '/Action Port' */ rtb_out_fw[i] = rtb_out_ff[i]; /* End of Outputs for SubSystem: '/Afoot' */ } /* Outputs for IfAction SubSystem: '/Afoot' incorporates: * ActionPort: '/Action Port' */ Afoot(rtDW.AMB, rtB.Merge_b, rtb_out_fw, rtb_Switch_gs, rtb_Saturation4_l); /* End of Outputs for SubSystem: '/Afoot' */ break; case 50: for (i = 0; i < 9; i++) { /* Outputs for IfAction SubSystem: '/Afoot_Summer' incorporates: * ActionPort: '/Action Port' */ rtb_out_fw[i] = rtb_out_ff[i]; /* End of Outputs for SubSystem: '/Afoot_Summer' */ } /* Outputs for IfAction SubSystem: '/Afoot_Summer' incorporates: * ActionPort: '/Action Port' */ Afoot_Summer(rtDW.AMB, rtB.Merge_b, rtb_out_fw, rtb_Switch_gs, rtb_Saturation4_l); /* End of Outputs for SubSystem: '/Afoot_Summer' */ break; } /* End of SwitchCase: '/Switch for Left ' */ /* Lookup_n-D: '/Выбор режима Right' incorporates: * Gain: '/Gain2' * Merge: '/Merge' */ rtb_u_gnq = look2_iu8bu8s16lu64n32_binlcse(rtB.Merge_b, rtb_Saturation4_l, rtConstP.pooled112, rtConstP.pooled60, rtb_get_modes_for_levels, rtConstP.pooled49, 6U); /* MATLAB Function: '/Начальные положения заслонок right' */ left(rtb_u_gnq, rtb_out_ff); /* SwitchCase: '/Switch for Left ' incorporates: * DataStoreRead: '/Data Store Read' */ switch (rtb_u_gnq) { case 10: break; case 20: for (i = 0; i < 9; i++) { /* Outputs for IfAction SubSystem: '/Bilevel' incorporates: * ActionPort: '/Action Port' */ rtb_out_fw[i] = rtb_out_ff[i]; /* End of Outputs for SubSystem: '/Bilevel' */ } /* Outputs for IfAction SubSystem: '/Bilevel' incorporates: * ActionPort: '/Action Port' */ Bilevel(rtDW.AMB, rtB.Merge_b, rtb_out_fw, rtb_Switch_gs, rtb_Saturation4_l); /* End of Outputs for SubSystem: '/Bilevel' */ break; case 30: for (i = 0; i < 9; i++) { /* Outputs for IfAction SubSystem: '/Bilevel2' incorporates: * ActionPort: '/Action Port' */ rtb_out_fw[i] = rtb_out_ff[i]; /* End of Outputs for SubSystem: '/Bilevel2' */ } /* Outputs for IfAction SubSystem: '/Bilevel2' incorporates: * ActionPort: '/Action Port' */ Bilevel2(rtDW.AMB, rtB.Merge_b, rtb_out_fw, rtb_Switch_gs, rtb_Saturation4_l); /* End of Outputs for SubSystem: '/Bilevel2' */ break; case 40: for (i = 0; i < 9; i++) { /* Outputs for IfAction SubSystem: '/Afoot' incorporates: * ActionPort: '/Action Port' */ rtb_out_fw[i] = rtb_out_ff[i]; /* End of Outputs for SubSystem: '/Afoot' */ } /* Outputs for IfAction SubSystem: '/Afoot' incorporates: * ActionPort: '/Action Port' */ Afoot(rtDW.AMB, rtB.Merge_b, rtb_out_fw, rtb_Switch_gs, rtb_Saturation4_l); /* End of Outputs for SubSystem: '/Afoot' */ break; case 50: for (i = 0; i < 9; i++) { /* Outputs for IfAction SubSystem: '/Afoot_Summer' incorporates: * ActionPort: '/Action Port' */ rtb_out_fw[i] = rtb_out_ff[i]; /* End of Outputs for SubSystem: '/Afoot_Summer' */ } /* Outputs for IfAction SubSystem: '/Afoot_Summer' incorporates: * ActionPort: '/Action Port' */ Afoot_Summer(rtDW.AMB, rtB.Merge_b, rtb_out_fw, rtb_Switch_gs, rtb_Saturation4_l); /* End of Outputs for SubSystem: '/Afoot_Summer' */ break; } /* End of SwitchCase: '/Switch for Left ' */ /* DataStoreWrite: '/Data Store Write' */ rtDW.LEVEL = rtB.Merge_b; /* MATLAB Function: '/Log Ambient Lv' */ /* : if (isempty(current_Ambient_Lv)) */ if (!rtDW.current_Ambient_Lv_not_empty) { /* : current_Ambient_Lv = Ambient_Lv; */ rtDW.current_Ambient_Lv = rtB.Merge_b; rtDW.current_Ambient_Lv_not_empty = true; /* : fprintf("13.1.3.1 Ambient level: in_Amb_Fb = %d; Set Ambient lvl (init) = %u \n", in_Amb_Fb, Ambient_Lv); */ printf("13.1.3.1 Ambient level: in_Amb_Fb = %d; Set Ambient lvl (init) = %u \n", rtb_Bias5, rtB.Merge_b); fflush(stdout); /* : else */ /* : if (current_Ambient_Lv ~= Ambient_Lv) */ } else if (rtDW.current_Ambient_Lv != rtB.Merge_b) { /* : current_Ambient_Lv = Ambient_Lv; */ rtDW.current_Ambient_Lv = rtB.Merge_b; /* : fprintf("13.1.3.1 Ambient level: in_Amb_Fb = %d; Set Ambient lvl = %u \n", in_Amb_Fb, Ambient_Lv); */ printf("13.1.3.1 Ambient level: in_Amb_Fb = %d; Set Ambient lvl = %u \n", rtb_Bias5, rtB.Merge_b); fflush(stdout); } /* End of MATLAB Function: '/Log Ambient Lv' */ /* Chart: '/Spd_OSA_Trigger' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreRead: '/Data Store Read6' * DataStoreWrite: '/Data Store Write2' */ if (rtDW.is_active_c834_HVAC_model == 0U) { rtDW.is_active_c834_HVAC_model = 1U; rtDW.is_c834_HVAC_model = IN_OSA_OFF; /* : is_OSA_Active = 0; */ rtb_Switch_gs = 0U; } else if (rtDW.is_c834_HVAC_model == IN_OSA_OFF) { rtb_Switch_gs = 0U; /* : sf_internal_predicateOutput = VehicleSpeed > 20 && Full_Rec_Active == 0; */ if ((rtDW.VehicleSpeed > 20) && (rtDW.Full_Rec == 0)) { rtDW.is_c834_HVAC_model = IN_OSA_ON; /* : is_OSA_Active = 1; */ rtb_Switch_gs = 1U; } } else { /* case IN_OSA_ON: */ rtb_Switch_gs = 1U; /* : sf_internal_predicateOutput = VehicleSpeed == 0 || Full_Rec_Active == 1; */ if ((rtDW.VehicleSpeed == 0) || (rtDW.Full_Rec == 1)) { rtDW.is_c834_HVAC_model = IN_OSA_OFF; /* : is_OSA_Active = 0; */ rtb_Switch_gs = 0U; } } /* End of Chart: '/Spd_OSA_Trigger' */ /* Chart: '/Chart' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read2' * DataStoreRead: '/Data Store Read3' * DataStoreRead: '/Data Store Read4' * Gain: '/Gain' * Lookup_n-D: '/1-D Lookup Table' * Lookup_n-D: '/1-D Lookup Table1' * MATLAB Function: '/MATLAB Function' */ if (rtDW.is_active_c776_HVAC_model == 0U) { rtDW.is_active_c776_HVAC_model = 1U; rtDW.is_c776_HVAC_model = IN_PARTIAL_REC_OFF; /* : Comp_Active = 0; */ rtb_Saturation4_l = 0U; } else if (rtDW.is_c776_HVAC_model == IN_PARTIAL_REC_OFF) { rtb_Saturation4_l = 0U; /* : sf_internal_predicateOutput = Amb_temp >= g_ssPREC_REC_ON_AMB && Full_Rec_Active == 0; */ if ((rtDW.AMB >= g_ssPREC_REC_ON_AMB) && (rtDW.Full_Rec == 0)) { rtDW.is_c776_HVAC_model = IN_PARTIAL_REC_ON; /* : sf_internal_predicateOutput = Evap_F_Fb >= g_aucPREC_EVA_DIFF(1) && Evap_R_Fb >= g_aucPREC_EVA_DIFF(3); */ if ((rtDW.Eva_F >= g_aucPREC_EVA_DIFF[0]) && (rtDW.Eva_R >= g_aucPREC_EVA_DIFF[2])) { rtDW.is_PARTIAL_REC_ON = IN_COND_3; /* : Comp_Active = 3; */ rtb_Saturation4_l = 3U; /* : sf_internal_predicateOutput = E_comp_speed >= g_ausPREC_ENTRY_RPM(2); */ } else if ((uint8_t)rpm_phys >= g_ausPREC_ENTRY_RPM[1]) { rtDW.is_PARTIAL_REC_ON = IN_COND_2; /* : Comp_Active = 2; */ rtb_Saturation4_l = 2U; rtDW.is_COND_2 = IN_TRACKING; } else { rtDW.is_PARTIAL_REC_ON = IN_COND_1; /* : Comp_Active = 1; */ rtb_Saturation4_l = 1U; } } /* case IN_PARTIAL_REC_ON: */ /* : sf_internal_predicateOutput = Amb_temp < g_ssPREC_REC_ON_AMB || Full_Rec_Active == 1; */ } else if ((rtDW.AMB < g_ssPREC_REC_ON_AMB) || (rtDW.Full_Rec == 1)) { rtDW.is_COND_2 = IN_NO_ACTIVE_CHILD_o; rtDW.is_PARTIAL_REC_ON = IN_NO_ACTIVE_CHILD_o; rtDW.is_c776_HVAC_model = IN_PARTIAL_REC_OFF; /* : Comp_Active = 0; */ rtb_Saturation4_l = 0U; } else { switch (rtDW.is_PARTIAL_REC_ON) { case IN_COND_1: rtb_Saturation4_l = 1U; /* Gain: '/Gain' incorporates: * Gain: '/Gain1' * MATLAB Function: '/MATLAB Function' */ /* : req_OSA =PREC_OSA_SUMMER_1; */ Gain = (uint16_t)(5U * (uint8_t)rpm_phys); rtB.req_OSA = look1_iu16lu64n48tu8_binlcse(Gain, &g_ausPREC_COMP_SPD_1[0], &g_aucPREC_OSA_SUMMER_1[0], 2U); /* : req_REC =PREC_REC_SUMMER_1; */ rtB.req_REC = look1_iu16lu64n48tu8_binlcse(Gain, &g_ausPREC_COMP_SPD_1[0], &g_aucPREC_REC_SUMMER_1[0], 2U); break; case IN_COND_2: rtb_Saturation4_l = 2U; /* : sf_internal_predicateOutput = E_comp_speed 32767) { i = 32767; } else if (i < -32768) { i = -32768; } rtb_u8Vtg_FX_plus = find_index((int16_t)i); /* : X=g_assPREC_EVA_DIFF_FB_TG_F(x_idx); */ if (rtDW.is_COND_2 == IN_HOLDING) { /* : sf_internal_predicateOutput = X <= 0; */ rtb_Bias5 = g_assPREC_EVA_DIFF_FB_TG_F[(int32_t)rtb_u8Vtg_FX_plus - 1]; if (rtb_Bias5 <= 0) { rtDW.is_COND_2 = IN_TRACKING; /* : sf_internal_predicateOutput = X > X_prev; */ } else if (rtb_Bias5 > rtDW.X_prev) { rtDW.is_COND_2 = IN_TRACKING; } else { /* : X_prev = X; */ rtDW.X_prev = rtb_Bias5; } } else { /* case IN_TRACKING: */ /* : sf_internal_predicateOutput = X < X_prev && X > 0; */ i_0 = g_assPREC_EVA_DIFF_FB_TG_F[(int32_t)rtb_u8Vtg_FX_plus - 1]; if ((i_0 < rtDW.X_prev) && (i_0 > 0)) { rtDW.is_COND_2 = IN_HOLDING; } else { /* : req_OSA = g_aucPREC_OSA_SUMMER_2(x_idx); */ rtB.req_OSA = g_aucPREC_OSA_SUMMER_2[(int32_t)rtb_u8Vtg_FX_plus - 1]; /* : req_REC = g_aucPREC_REC_SUMMER_2(x_idx); */ rtB.req_REC = g_aucPREC_REC_SUMMER_2[(int32_t)rtb_u8Vtg_FX_plus - 1]; /* : X_prev = X; */ rtDW.X_prev = g_assPREC_EVA_DIFF_FB_TG_F[(int32_t)rtb_u8Vtg_FX_plus - 1]; } } } break; default: /* case IN_COND_3: */ rtb_Saturation4_l = 3U; /* : sf_internal_predicateOutput = Evap_F_Fb < g_aucPREC_EVA_DIFF(2) && Evap_R_Fb < g_aucPREC_EVA_DIFF(4); */ if ((rtDW.Eva_F < g_aucPREC_EVA_DIFF[1]) && (rtDW.Eva_R < g_aucPREC_EVA_DIFF[3])) { rtDW.is_PARTIAL_REC_ON = IN_COND_2; /* : Comp_Active = 2; */ rtb_Saturation4_l = 2U; rtDW.is_COND_2 = IN_TRACKING; } else { /* : req_OSA = g_ucPREC_OSA_SUMMER_3; */ rtB.req_OSA = g_ucPREC_OSA_SUMMER_3; /* : req_REC = g_ucPREC_REC_SUMMER_3; */ rtB.req_REC = g_ucPREC_REC_SUMMER_3; } break; } } /* End of Chart: '/Chart' */ /* Switch: '/Switch3' incorporates: * Constant: '/Constant4' * Constant: '/Constant5' * DataStoreRead: '/Data Store Read7' * DataStoreWrite: '/Data Store Write' * DataStoreWrite: '/Data Store Write1' * DataStoreWrite: '/Data Store Write2' * Switch: '/Switch' * Switch: '/Switch4' */ if (rtDW.Full_Rec > 0) { rtb_u_gnq = 0U; rtb_Switch_m5 = 100U; } else { if (rtb_Switch_gs > 0) { /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read6' * Lookup_n-D: '/1-D Lookup Table2' */ rtb_Switch_m5 = look1_iu16lu64n48tu8_binlcse(rtDW.VehicleSpeed, &g_ausVALVE_VEH_SPD[0], &g_aucPREC_VEH_SPD_OSA[0], 12U); } else { /* Switch: '/Switch' incorporates: * Constant: '/Constant' */ rtb_Switch_m5 = 100U; } /* Switch: '/Switch1' incorporates: * Constant: '/Constant1' */ if (rtb_Saturation4_l > 0) { rtb_u_gnq = rtB.req_OSA; } else { rtb_u_gnq = 100U; } /* MinMax: '/MinMax' incorporates: * Switch: '/Switch1' */ if (rtb_Switch_m5 <= rtb_u_gnq) { rtb_u_gnq = rtb_Switch_m5; } /* End of MinMax: '/MinMax' */ /* Switch: '/Switch2' incorporates: * Constant: '/Constant2' * DataStoreWrite: '/Data Store Write1' */ if (rtb_Saturation4_l > 0) { rtb_Switch_m5 = rtB.req_REC; } else { rtb_Switch_m5 = 0U; } /* End of Switch: '/Switch2' */ } /* End of Switch: '/Switch3' */ /* BusCreator: '/Bus Creator' incorporates: * DataStoreRead: '/Data Store Read10' * DataStoreRead: '/Data Store Read11' * DataStoreRead: '/Data Store Read4' * DataStoreRead: '/Data Store Read5' * DataStoreRead: '/Data Store Read6' * DataStoreRead: '/Data Store Read7' * DataStoreRead: '/Data Store Read8' * DataStoreRead: '/Data Store Read9' * DataStoreWrite: '/Data Store Write2' */ Status_Sensor_Model.Battery = 0; Status_Sensor_Model.AMB = rtDW.AMB; Status_Sensor_Model.Incar_FL = rtDW.Incar_FL; Status_Sensor_Model.Incar_FR = rtDW.Incar_FR; Status_Sensor_Model.Incar_RL = rtDW.Incar_RL; Status_Sensor_Model.Incar_RR = rtDW.Incar_RR; Status_Sensor_Model.Eva_F = rtDW.Eva_F; Status_Sensor_Model.Eva_R = rtDW.Eva_R; Status_Sensor_Model.Pressure = rtDW.Pressure; Status_Sensor_Model.Duct_FL_Upper = 0; Status_Sensor_Model.Duct_FL_Lower = 0; Status_Sensor_Model.Duct_FR_Upper = 0; Status_Sensor_Model.Duct_FR_Lower = 0; Status_Sensor_Model.Duct_RL = 0; Status_Sensor_Model.Duct_RR = 0; Status_Sensor_Model.Duct_Side_FL = 0; Status_Sensor_Model.Duct_Side_FR = 0; Status_Sensor_Model.Duct_Side_RL = 0; Status_Sensor_Model.Duct_Side_RR = 0; Status_Sensor_Model.AQS = 0; /* Product: '/Divide1' incorporates: * Constant: '/Constant' * Constant: '/Constant1' * DataStoreRead: '/Data Store Read1' * Product: '/Divide' */ rtb_u8Vtg_FX_plus = (double)rtDW.ADC_Data_Model.Sensor_Incar_Temp_FL / 4095.0 * 5.0; /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' */ rtb_Compare_p1p = (rtb_u8Vtg_FX_plus < 0.05); /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' */ rtb_Compare_bu = (rtb_u8Vtg_FX_plus > 4.9); /* Logic: '/Logical Operator' */ rtb_LogicalOperator5 = (rtb_Compare_p1p || rtb_Compare_bu); /* Logic: '/Logical Operator1' incorporates: * Constant: '/Constant' * DataStoreRead: '/Data Store Read4' * RelationalOperator: '/Compare' * Sum: '/Subtract' * UnitDelay: '/t_start_delay_private ' */ rtb_LogicalOperator1_n = (rtb_LogicalOperator5 && (rtDW.t_now - rtDW.t_start_delay_private_DSTATE_go >= 3000U)); /* Switch: '/Switch' incorporates: * Constant: '/Constant2' * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write1' * Lookup_n-D: '/1-D Lookup Table2' */ if (rtb_LogicalOperator1_n) { rtDW.Incar_FL = 200; } else { rtDW.Incar_FL = look1_iu16tdIs16_binlcs (rtDW.ADC_Data_Model.Sensor_Incar_Temp_FL, rtConstP.pooled73, rtConstP.pooled9, 1023U); } /* End of Switch: '/Switch' */ /* Product: '/Divide1' incorporates: * Constant: '/Constant' * Constant: '/Constant1' * DataStoreRead: '/Data Store Read1' * Product: '/Divide' */ rtb_Divide1_l5 = (double)rtDW.ADC_Data_Model.Sensor_Incar_Temp_FR / 4095.0 * 5.0; /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' */ rtb_Compare_kt = (rtb_Divide1_l5 < 0.05); /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' */ rtb_Compare_i5 = (rtb_Divide1_l5 > 4.9); /* Logic: '/Logical Operator' */ rtb_Compare_dq = (rtb_Compare_kt || rtb_Compare_i5); /* Logic: '/Logical Operator1' incorporates: * Constant: '/Constant' * DataStoreRead: '/Data Store Read4' * RelationalOperator: '/Compare' * Sum: '/Subtract' * UnitDelay: '/t_start_delay_private ' */ rtb_LogicalOperator1_m2 = (rtb_Compare_dq && (rtDW.t_now - rtDW.t_start_delay_private_DSTATE_k >= 3000U)); /* Switch: '/Switch' incorporates: * Constant: '/Constant2' * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write3' * Lookup_n-D: '/1-D Lookup Table2' */ if (rtb_LogicalOperator1_m2) { rtDW.Incar_FR = 200; } else { rtDW.Incar_FR = look1_iu16tdIs16_binlcs (rtDW.ADC_Data_Model.Sensor_Incar_Temp_FR, rtConstP.pooled73, rtConstP.pooled9, 1023U); } /* End of Switch: '/Switch' */ /* Product: '/Divide3' incorporates: * Constant: '/Constant3' * Constant: '/Constant4' * DataStoreRead: '/Data Store Read1' * Product: '/Divide2' */ rtb_Divide3 = (double)rtDW.ADC_Data_Model.Sensor_Incar_Temp_RL / 4095.0 * 5.0; /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' */ rtb_Compare_l = (rtb_Divide3 < 0.05); /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' */ rtb_Compare_j = (rtb_Divide3 > 4.9); /* Logic: '/Logical Operator2' */ rtb_FailCond_lt = (rtb_Compare_l || rtb_Compare_j); /* Logic: '/Logical Operator3' incorporates: * Constant: '/Constant' * DataStoreRead: '/Data Store Read4' * RelationalOperator: '/Compare' * Sum: '/Subtract' * UnitDelay: '/t_start_delay_private ' */ rtb_LogicalOperator3 = (rtb_FailCond_lt && (rtDW.t_now - rtDW.t_start_delay_private_DSTATE_j >= 3000U)); /* Switch: '/Switch1' incorporates: * Constant: '/Constant5' * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write4' * Lookup_n-D: '/1-D Lookup Table1' */ if (rtb_LogicalOperator3) { rtDW.Incar_RL = 200; } else { rtDW.Incar_RL = look1_iu16tdIs16_binlcs (rtDW.ADC_Data_Model.Sensor_Incar_Temp_RL, rtConstP.pooled73, rtConstP.pooled9, 1023U); } /* End of Switch: '/Switch1' */ /* Product: '/Divide3' incorporates: * Constant: '/Constant3' * Constant: '/Constant4' * DataStoreRead: '/Data Store Read1' * Product: '/Divide2' */ rtb_Divide3_hk = (double)rtDW.ADC_Data_Model.Sensor_Incar_Temp_RR / 4095.0 * 5.0; /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' */ rtb_Compare_g4 = (rtb_Divide3_hk < 0.05); /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' */ rtb_Compare_dd = (rtb_Divide3_hk > 4.9); /* Logic: '/Logical Operator2' */ rtb_FailCond_h = (rtb_Compare_g4 || rtb_Compare_dd); /* Logic: '/Logical Operator3' incorporates: * Constant: '/Constant' * DataStoreRead: '/Data Store Read4' * RelationalOperator: '/Compare' * Sum: '/Subtract' * UnitDelay: '/t_start_delay_private ' */ rtb_LogicalOperator3_p5 = (rtb_FailCond_h && (rtDW.t_now - rtDW.t_start_delay_private_DSTATE_gd >= 3000U)); /* Switch: '/Switch1' incorporates: * Constant: '/Constant5' * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write5' * Lookup_n-D: '/1-D Lookup Table1' */ if (rtb_LogicalOperator3_p5) { rtDW.Incar_RR = 200; } else { rtDW.Incar_RR = look1_iu16tdIs16_binlcs (rtDW.ADC_Data_Model.Sensor_Incar_Temp_RR, rtConstP.pooled73, rtConstP.pooled9, 1023U); } /* End of Switch: '/Switch1' */ /* Switch: '/Switch' incorporates: * Constant: '/Constant2' * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write1' * Lookup_n-D: '/1-D Lookup Table' */ if (rtb_LogicalOperator1_f1) { rtDW.Eva_F = -100; } else { rtDW.Eva_F = look1_iu16tdIs16_binlcs(rtDW.ADC_Data_Model.Sensor_Evap_Temp, rtConstP.pooled73, rtConstP.pooled8, 1023U); } /* End of Switch: '/Switch' */ /* DataStoreWrite: '/Data Store Write1' incorporates: * DataTypeConversion: '/Data Type Conversion' */ rtDW.dtc_state_error_model[12] = rtb_LogicalOperator1_f1; /* Switch: '/Switch' incorporates: * DataTypeConversion: '/Data Type Conversion' * Switch: '/Switch1' */ if (rtb_LogicalOperator1_f1) { /* DataStoreWrite: '/Data Store Write' incorporates: * DataTypeConversion: '/Data Type Conversion1' */ rtDW.dtc_state_error_model[13] = rtb_Compare_eu; /* DataStoreWrite: '/Data Store Write1' incorporates: * DataTypeConversion: '/Data Type Conversion2' */ rtDW.dtc_state_error_model[12] = rtb_Compare_e3; } else { /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.dtc_state_error_model[13] = 0U; } /* End of Switch: '/Switch' */ /* MATLAB Function: '/Write ERROR' incorporates: * DataStoreRead: '/Data Store Read' */ /* : if(LOGGER) */ if ((rtDW.LOGGER_ACP != 0.0) && rtb_LogicalOperator1_f1) { /* : if(EvapFErr) */ /* : fprintf('CCU_Body_Err.CCU_EvaTempSenErrF_Stat = 0x1 (Failure), Sensor_Evap_Temp = %f V\n',Sensor_Evap_Temp); */ printf("CCU_Body_Err.CCU_EvaTempSenErrF_Stat = 0x1 (Failure), Sensor_Evap_Temp = %f V\n", rtb_Divide1_cf); fflush(stdout); } /* End of MATLAB Function: '/Write ERROR' */ /* MATLAB Function: '/Write Eva_F' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write1' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('Eva_F = %d * 0.1 C\n',Eva_F); */ printf("Eva_F = %d * 0.1 C\n", rtDW.Eva_F); fflush(stdout); } /* End of MATLAB Function: '/Write Eva_F' */ /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read4' * Logic: '/Logical Operator3' * Logic: '/Logical Operator4' * UnitDelay: '/Cond_prev_private ' * UnitDelay: '/t_start_delay_private ' */ if (rtb_FailCond_fn && (!rtDW.Cond_prev_private_DSTATE)) { rtDW.t_start_delay_private_DSTATE_g = rtDW.t_now; } /* End of Switch: '/Switch' */ /* Switch: '/Switch' incorporates: * Constant: '/Constant2' * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write1' * Lookup_n-D: '/1-D Lookup Table' */ if (rtb_LogicalOperator1_f) { rtDW.Eva_R = -100; } else { rtDW.Eva_R = look1_iu16tdIs16_binlcs (rtDW.ADC_Data_Model.Sensor_Rear_Evap_Temp, rtConstP.pooled73, rtConstP.pooled8, 1023U); } /* End of Switch: '/Switch' */ /* DataStoreWrite: '/Data Store Write1' incorporates: * DataTypeConversion: '/Data Type Conversion' */ rtDW.dtc_state_error_model[14] = rtb_LogicalOperator1_f; /* Switch: '/Switch' incorporates: * DataTypeConversion: '/Data Type Conversion' * Switch: '/Switch1' */ if (rtb_LogicalOperator1_f) { /* DataStoreWrite: '/Data Store Write' incorporates: * DataTypeConversion: '/Data Type Conversion1' */ rtDW.dtc_state_error_model[15] = rtb_Compare_fr; /* DataStoreWrite: '/Data Store Write1' incorporates: * DataTypeConversion: '/Data Type Conversion2' */ rtDW.dtc_state_error_model[14] = rtb_Compare_b; } else { /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.dtc_state_error_model[15] = 0U; } /* End of Switch: '/Switch' */ /* MATLAB Function: '/Write ERROR' incorporates: * DataStoreRead: '/Data Store Read' */ /* : if(LOGGER) */ if ((rtDW.LOGGER_ACP != 0.0) && rtb_LogicalOperator1_f) { /* : if(EvapRErr) */ /* : fprintf('CCU_Body_Err.CCU_EvaTempSenErrR_Stat = 0x1 (Failure), Sensor_Rear_Evap_Temp = %f V\n',Sensor_Rear_Evap_Temp); */ printf("CCU_Body_Err.CCU_EvaTempSenErrR_Stat = 0x1 (Failure), Sensor_Rear_Evap_Temp = %f V\n", rtb_Divide1_ea); fflush(stdout); } /* End of MATLAB Function: '/Write ERROR' */ /* MATLAB Function: '/Write Eva_F' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write1' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('Eva_R = %d * 0.1 C\n',Eva_R); */ printf("Eva_R = %d * 0.1 C\n", rtDW.Eva_R); fflush(stdout); } /* End of MATLAB Function: '/Write Eva_F' */ /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read4' * Logic: '/Logical Operator3' * Logic: '/Logical Operator4' * UnitDelay: '/Cond_prev_private ' * UnitDelay: '/t_start_delay_private ' */ if (rtb_FailCond_gk && (!rtDW.Cond_prev_private_DSTATE_p)) { rtDW.t_start_delay_private_DSTATE_c = rtDW.t_now; } /* End of Switch: '/Switch' */ /* Switch: '/Switch' incorporates: * Constant: '/Constant2' * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write' * Lookup_n-D: '/1-D Lookup Table' */ if (rtb_LogicalOperator1) { rtDW.Pressure = 320; } else { rtDW.Pressure = look1_iu16tdIs16_binlcs (rtDW.ADC_Data_Model.Sensor_AC_Pressure, rtConstP.pooled73, rtConstP.uDLookupTable_tableData, 1023U); } /* End of Switch: '/Switch' */ /* DataStoreWrite: '/Data Store Write1' incorporates: * DataTypeConversion: '/Data Type Conversion' */ rtDW.dtc_state_error_model[51] = rtb_LogicalOperator1; /* Switch: '/Switch' incorporates: * DataTypeConversion: '/Data Type Conversion' * Switch: '/Switch1' */ if (rtb_LogicalOperator1) { /* DataStoreWrite: '/Data Store Write' incorporates: * DataTypeConversion: '/Data Type Conversion1' */ rtDW.dtc_state_error_model[50] = rtb_Compare; /* DataStoreWrite: '/Data Store Write1' incorporates: * DataTypeConversion: '/Data Type Conversion2' */ rtDW.dtc_state_error_model[51] = rtb_Compare_ah; } else { /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.dtc_state_error_model[50] = 0U; } /* End of Switch: '/Switch' */ /* MATLAB Function: '/Write' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('AC_Pressure = %d ATM\n',AC_Pressure); */ printf("AC_Pressure = %d ATM\n", rtDW.Pressure); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* MATLAB Function: '/Write ERROR' incorporates: * DataStoreRead: '/Data Store Read' */ /* : if(LOGGER) */ if ((rtDW.LOGGER_ACP != 0.0) && rtb_LogicalOperator1) { /* : if(AC_PressureErr) */ /* : fprintf('CCU_Body_Err.CCU_PressSenErr_Stat = 0x1 (Failure), Sensor_AC_Pressure = %f V\n',Sensor_AC_Pressure); */ printf("CCU_Body_Err.CCU_PressSenErr_Stat = 0x1 (Failure), Sensor_AC_Pressure = %f V\n", rtb_Divide1); fflush(stdout); } /* End of MATLAB Function: '/Write ERROR' */ /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read4' * Logic: '/Logical Operator3' * Logic: '/Logical Operator4' * UnitDelay: '/Cond_prev_private ' * UnitDelay: '/t_start_delay_private ' */ if (rtb_FailCond && (!rtDW.Cond_prev_private_DSTATE_a)) { rtDW.t_start_delay_private_DSTATE = rtDW.t_now; } /* End of Switch: '/Switch' */ /* Product: '/Divide4' incorporates: * Constant: '/Constant1' * Constant: '/Constant2' * DataStoreRead: '/Data Store Read1' * Product: '/Divide1' */ rtb_Divide1 = (double)rtDW.ADC_Data_Model.Sensor_Front_Duct2 / 4095.0 * 5.0; /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' */ rtb_Compare_m = (rtb_Divide1 < 0.15); /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' */ rtb_Compare_i = (rtb_Divide1 > 4.9); /* Logic: '/Logical Operator1' */ rtb_Compare = (rtb_Compare_m || rtb_Compare_i); /* Logic: '/Logical Operator4' incorporates: * Constant: '/Constant' * DataStoreRead: '/Data Store Read4' * RelationalOperator: '/Compare' * Sum: '/Subtract' * UnitDelay: '/t_start_delay_private ' */ rtb_LogicalOperator4_fo = (rtb_Compare && (rtDW.t_now - rtDW.t_start_delay_private_DSTATE_m >= 3000U)); /* SignalConversion generated from: '/1-D Lookup Table7' incorporates: * DataStoreRead: '/Data Store Read1' */ rtb_TmpSignalConversionAt1DLookupTable7Inport1[0] = rtDW.ADC_Data_Model.Sensor_Front_Duct1; rtb_TmpSignalConversionAt1DLookupTable7Inport1[1] = rtDW.ADC_Data_Model.Sensor_Front_Duct2; rtb_TmpSignalConversionAt1DLookupTable7Inport1[2] = rtDW.ADC_Data_Model.Sensor_Front_Duct3; rtb_TmpSignalConversionAt1DLookupTable7Inport1[3] = rtDW.ADC_Data_Model.Sensor_Front_Duct4; rtb_TmpSignalConversionAt1DLookupTable7Inport1[4] = rtDW.ADC_Data_Model.Sensor_Front_Duct5; rtb_TmpSignalConversionAt1DLookupTable7Inport1[5] = rtDW.ADC_Data_Model.Sensor_Front_Duct6; /* Lookup_n-D: '/1-D Lookup Table7' */ for (i = 0; i < 6; i++) { rtb_uDLookupTable7_g[i] = look1_iu16bs16lu64n32ts16Ds32_binlcs (rtb_TmpSignalConversionAt1DLookupTable7Inport1[i], rtConstP.pooled62, rtConstP.pooled61, 1023U); } /* End of Lookup_n-D: '/1-D Lookup Table7' */ /* Switch: '/Switch2' incorporates: * Constant: '/Constant6' * DataStoreWrite: '/Data Store Write1' */ if (rtb_LogicalOperator4_fo) { rtb_y_bf = 230; } else { rtb_y_bf = rtb_uDLookupTable7_g[1]; } /* End of Switch: '/Switch2' */ /* Product: '/Divide3' incorporates: * Constant: '/Constant3' * Constant: '/Constant4' * DataStoreRead: '/Data Store Read1' * Product: '/Divide2' */ rtb_Divide1_cf = (double)rtDW.ADC_Data_Model.Sensor_Front_Duct1 / 4095.0 * 5.0; /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' */ rtb_Compare_au = (rtb_Divide1_cf < 0.15); /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' */ rtb_Compare_gl = (rtb_Divide1_cf > 4.9); /* Logic: '/Logical Operator2' */ rtb_Compare_ah = (rtb_Compare_au || rtb_Compare_gl); /* Logic: '/Logical Operator3' incorporates: * Constant: '/Constant' * DataStoreRead: '/Data Store Read4' * RelationalOperator: '/Compare' * Sum: '/Subtract' * UnitDelay: '/t_start_delay_private ' */ rtb_LogicalOperator3_nz = (rtb_Compare_ah && (rtDW.t_now - rtDW.t_start_delay_private_DSTATE_kc >= 3000U)); /* Switch: '/Switch1' incorporates: * Constant: '/Constant5' * DataStoreWrite: '/Data Store Write2' */ if (rtb_LogicalOperator3_nz) { rtb_y_fe = 230; } else { rtb_y_fe = rtb_uDLookupTable7_g[0]; } /* End of Switch: '/Switch1' */ /* Product: '/Divide6' incorporates: * Constant: '/Constant7' * Constant: '/Constant8' * DataStoreRead: '/Data Store Read1' * Product: '/Divide5' */ rtb_Divide1_ea = (double)rtDW.ADC_Data_Model.Sensor_Front_Duct3 / 4095.0 * 5.0; /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' */ rtb_Compare_e = (rtb_Divide1_ea < 0.15); /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' */ rtb_Compare_gs = (rtb_Divide1_ea > 4.9); /* Logic: '/Logical Operator5' */ rtb_Compare_eu = (rtb_Compare_e || rtb_Compare_gs); /* Logic: '/Logical Operator6' incorporates: * Constant: '/Constant' * DataStoreRead: '/Data Store Read4' * RelationalOperator: '/Compare' * Sum: '/Subtract' * UnitDelay: '/t_start_delay_private ' */ rtb_LogicalOperator6 = (rtb_Compare_eu && (rtDW.t_now - rtDW.t_start_delay_private_DSTATE_p >= 3000U)); /* Switch: '/Switch3' incorporates: * Constant: '/Constant9' * DataStoreWrite: '/Data Store Write3' */ if (rtb_LogicalOperator6) { rtb_y_ar = 230; } else { rtb_y_ar = rtb_uDLookupTable7_g[2]; } /* End of Switch: '/Switch3' */ /* Product: '/Divide8' incorporates: * Constant: '/Constant10' * Constant: '/Constant11' * DataStoreRead: '/Data Store Read1' * Product: '/Divide7' */ rtb_Divide8 = (double)rtDW.ADC_Data_Model.Sensor_Front_Duct4 / 4095.0 * 5.0; /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' */ rtb_Compare_n2 = (rtb_Divide8 < 0.15); /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' */ rtb_Compare_jt = (rtb_Divide8 > 4.9); /* Logic: '/Logical Operator7' */ rtb_Compare_e3 = (rtb_Compare_n2 || rtb_Compare_jt); /* Logic: '/Logical Operator8' incorporates: * Constant: '/Constant' * DataStoreRead: '/Data Store Read4' * RelationalOperator: '/Compare' * Sum: '/Subtract' * UnitDelay: '/t_start_delay_private ' */ rtb_LogicalOperator8 = (rtb_Compare_e3 && (rtDW.t_now - rtDW.t_start_delay_private_DSTATE_h >= 3000U)); /* Switch: '/Switch4' incorporates: * Constant: '/Constant12' * DataStoreWrite: '/Data Store Write4' */ if (rtb_LogicalOperator8) { rtb_y_h5 = 230; } else { rtb_y_h5 = rtb_uDLookupTable7_g[3]; } /* End of Switch: '/Switch4' */ /* Product: '/Divide10' incorporates: * Constant: '/Constant13' * Constant: '/Constant14' * DataStoreRead: '/Data Store Read1' * Product: '/Divide9' */ rtb_Divide10 = (double)rtDW.ADC_Data_Model.Sensor_Front_Duct5 / 4095.0 * 5.0; /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' */ rtb_Compare_h2 = (rtb_Divide10 < 0.15); /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' */ rtb_Compare_nq = (rtb_Divide10 > 4.9); /* Logic: '/Logical Operator9' */ rtb_Compare_fr = (rtb_Compare_h2 || rtb_Compare_nq); /* Logic: '/Logical Operator10' incorporates: * Constant: '/Constant' * DataStoreRead: '/Data Store Read4' * RelationalOperator: '/Compare' * Sum: '/Subtract' * UnitDelay: '/t_start_delay_private ' */ rtb_LogicalOperator10 = (rtb_Compare_fr && (rtDW.t_now - rtDW.t_start_delay_private_DSTATE_i >= 3000U)); /* Switch: '/Switch5' incorporates: * Constant: '/Constant15' * DataStoreWrite: '/Data Store Write5' */ if (rtb_LogicalOperator10) { rtb_y_lg = 230; } else { rtb_y_lg = rtb_uDLookupTable7_g[4]; } /* End of Switch: '/Switch5' */ /* Product: '/Divide11' incorporates: * Constant: '/Constant16' * Constant: '/Constant17' * DataStoreRead: '/Data Store Read1' * Product: '/Divide12' */ rtb_Divide11 = (double)rtDW.ADC_Data_Model.Sensor_Front_Duct6 / 4095.0 * 5.0; /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' */ rtb_Compare_ck = (rtb_Divide11 < 0.15); /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' */ rtb_Compare_ofn = (rtb_Divide11 > 4.9); /* Logic: '/Logical Operator12' */ rtb_Compare_b = (rtb_Compare_ck || rtb_Compare_ofn); /* Logic: '/Logical Operator11' incorporates: * Constant: '/Constant' * DataStoreRead: '/Data Store Read4' * RelationalOperator: '/Compare' * Sum: '/Subtract' * UnitDelay: '/t_start_delay_private ' */ rtb_LogicalOperator11 = (rtb_Compare_b && (rtDW.t_now - rtDW.t_start_delay_private_DSTATE_cc >= 3000U)); /* Switch: '/Switch6' incorporates: * Constant: '/Constant18' * DataStoreWrite: '/Data Store Write6' */ if (rtb_LogicalOperator11) { rtb_y_ck = 230; } else { rtb_y_ck = rtb_uDLookupTable7_g[5]; } /* End of Switch: '/Switch6' */ /* DataStoreWrite: '/Data Store Write1' incorporates: * DataTypeConversion: '/Data Type Conversion' */ rtDW.dtc_state_error_model[17] = rtb_LogicalOperator3_nz; /* Switch: '/Switch' incorporates: * DataTypeConversion: '/Data Type Conversion' * Switch: '/Switch1' */ if (rtb_LogicalOperator3_nz) { /* DataStoreWrite: '/Data Store Write' incorporates: * DataTypeConversion: '/Data Type Conversion1' */ rtDW.dtc_state_error_model[18] = rtb_Compare_au; /* DataStoreWrite: '/Data Store Write1' incorporates: * DataTypeConversion: '/Data Type Conversion2' */ rtDW.dtc_state_error_model[17] = rtb_Compare_gl; } else { /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.dtc_state_error_model[18] = 0U; } /* End of Switch: '/Switch' */ /* DataStoreWrite: '/Data Store Write1' incorporates: * DataTypeConversion: '/Data Type Conversion' */ rtDW.dtc_state_error_model[19] = rtb_LogicalOperator4_fo; /* Switch: '/Switch' incorporates: * DataTypeConversion: '/Data Type Conversion' * Switch: '/Switch1' */ if (rtb_LogicalOperator4_fo) { /* DataStoreWrite: '/Data Store Write' incorporates: * DataTypeConversion: '/Data Type Conversion1' */ rtDW.dtc_state_error_model[20] = rtb_Compare_m; /* DataStoreWrite: '/Data Store Write1' incorporates: * DataTypeConversion: '/Data Type Conversion2' */ rtDW.dtc_state_error_model[19] = rtb_Compare_i; } else { /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.dtc_state_error_model[20] = 0U; } /* End of Switch: '/Switch' */ /* DataStoreWrite: '/Data Store Write1' incorporates: * DataTypeConversion: '/Data Type Conversion' */ rtDW.dtc_state_error_model[21] = rtb_LogicalOperator6; /* Switch: '/Switch' incorporates: * DataTypeConversion: '/Data Type Conversion' * Switch: '/Switch1' */ if (rtb_LogicalOperator6) { /* DataStoreWrite: '/Data Store Write' incorporates: * DataTypeConversion: '/Data Type Conversion1' */ rtDW.dtc_state_error_model[22] = rtb_Compare_e; /* DataStoreWrite: '/Data Store Write1' incorporates: * DataTypeConversion: '/Data Type Conversion2' */ rtDW.dtc_state_error_model[21] = rtb_Compare_gs; } else { /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.dtc_state_error_model[22] = 0U; } /* End of Switch: '/Switch' */ /* DataStoreWrite: '/Data Store Write1' incorporates: * DataTypeConversion: '/Data Type Conversion' */ rtDW.dtc_state_error_model[23] = rtb_LogicalOperator8; /* Switch: '/Switch' incorporates: * DataTypeConversion: '/Data Type Conversion' * Switch: '/Switch1' */ if (rtb_LogicalOperator8) { /* DataStoreWrite: '/Data Store Write' incorporates: * DataTypeConversion: '/Data Type Conversion1' */ rtDW.dtc_state_error_model[24] = rtb_Compare_n2; /* DataStoreWrite: '/Data Store Write1' incorporates: * DataTypeConversion: '/Data Type Conversion2' */ rtDW.dtc_state_error_model[23] = rtb_Compare_jt; } else { /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.dtc_state_error_model[24] = 0U; } /* End of Switch: '/Switch' */ /* DataStoreWrite: '/Data Store Write1' incorporates: * DataTypeConversion: '/Data Type Conversion' */ rtDW.dtc_state_error_model[25] = rtb_LogicalOperator10; /* Switch: '/Switch' incorporates: * DataTypeConversion: '/Data Type Conversion' * Switch: '/Switch1' */ if (rtb_LogicalOperator10) { /* DataStoreWrite: '/Data Store Write' incorporates: * DataTypeConversion: '/Data Type Conversion1' */ rtDW.dtc_state_error_model[26] = rtb_Compare_h2; /* DataStoreWrite: '/Data Store Write1' incorporates: * DataTypeConversion: '/Data Type Conversion2' */ rtDW.dtc_state_error_model[25] = rtb_Compare_nq; } else { /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.dtc_state_error_model[26] = 0U; } /* End of Switch: '/Switch' */ /* DataStoreWrite: '/Data Store Write1' incorporates: * DataTypeConversion: '/Data Type Conversion' */ rtDW.dtc_state_error_model[27] = rtb_LogicalOperator11; /* Switch: '/Switch' incorporates: * DataTypeConversion: '/Data Type Conversion' * Switch: '/Switch1' */ if (rtb_LogicalOperator11) { /* DataStoreWrite: '/Data Store Write' incorporates: * DataTypeConversion: '/Data Type Conversion1' */ rtDW.dtc_state_error_model[28] = rtb_Compare_ck; /* DataStoreWrite: '/Data Store Write1' incorporates: * DataTypeConversion: '/Data Type Conversion2' */ rtDW.dtc_state_error_model[27] = rtb_Compare_ofn; } else { /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.dtc_state_error_model[28] = 0U; } /* End of Switch: '/Switch' */ /* MATLAB Function: '/Write 1' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write2' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('Duct1_F = %d * 0.1 C\n',Sensor); */ printf("Duct1_F = %d * 0.1 C\n", rtb_y_fe); fflush(stdout); } /* End of MATLAB Function: '/Write 1' */ /* MATLAB Function: '/Write 2' incorporates: * DataStoreRead: '/Data Store Read2' * DataStoreWrite: '/Data Store Write1' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('Duct2_F = %d * 0.1 C\n',Sensor); */ printf("Duct2_F = %d * 0.1 C\n", rtb_y_bf); fflush(stdout); } /* End of MATLAB Function: '/Write 2' */ /* MATLAB Function: '/Write 3' incorporates: * DataStoreRead: '/Data Store Read3' * DataStoreWrite: '/Data Store Write3' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('Duct3_F = %d * 0.1 C\n',Sensor); */ printf("Duct3_F = %d * 0.1 C\n", rtb_y_ar); fflush(stdout); } /* End of MATLAB Function: '/Write 3' */ /* MATLAB Function: '/Write 4' incorporates: * DataStoreRead: '/Data Store Read4' * DataStoreWrite: '/Data Store Write4' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('Duct4_F = %d * 0.1 C\n',Sensor); */ printf("Duct4_F = %d * 0.1 C\n", rtb_y_h5); fflush(stdout); } /* End of MATLAB Function: '/Write 4' */ /* MATLAB Function: '/Write 5' incorporates: * DataStoreRead: '/Data Store Read5' * DataStoreWrite: '/Data Store Write5' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('Duct5_F = %d * 0.1 C\n',Sensor); */ printf("Duct5_F = %d * 0.1 C\n", rtb_y_lg); fflush(stdout); } /* End of MATLAB Function: '/Write 5' */ /* MATLAB Function: '/Write 6' incorporates: * DataStoreRead: '/Data Store Read6' * DataStoreWrite: '/Data Store Write6' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('Duct6_F = %d * 0.1 C\n',Sensor); */ printf("Duct6_F = %d * 0.1 C\n", rtb_y_ck); fflush(stdout); } /* End of MATLAB Function: '/Write 6' */ /* MATLAB Function: '/Write ERROR1' incorporates: * DataStoreRead: '/Data Store Read1' */ /* : if(LOGGER) */ if ((rtDW.LOGGER_ACP != 0.0) && rtb_LogicalOperator3_nz) { /* : if(Err) */ /* : fprintf('CCU_Body_Err.CCU_DuctTempSenErrF_Stat = 0x1 (Failure), Sensor_Duct1_F = %f V\n',Sensor); */ printf("CCU_Body_Err.CCU_DuctTempSenErrF_Stat = 0x1 (Failure), Sensor_Duct1_F = %f V\n", rtb_Divide1_cf); fflush(stdout); } /* End of MATLAB Function: '/Write ERROR1' */ /* MATLAB Function: '/Write ERROR2' incorporates: * DataStoreRead: '/Data Store Read2' */ /* : if(LOGGER) */ if ((rtDW.LOGGER_ACP != 0.0) && rtb_LogicalOperator4_fo) { /* : if(Err) */ /* : fprintf('CCU_Body_Err.CCU_DuctTempSenErrF_Stat = 0x1 (Failure), Sensor_Duct2_F = %f V\n',Sensor); */ printf("CCU_Body_Err.CCU_DuctTempSenErrF_Stat = 0x1 (Failure), Sensor_Duct2_F = %f V\n", rtb_Divide1); fflush(stdout); } /* End of MATLAB Function: '/Write ERROR2' */ /* MATLAB Function: '/Write ERROR3' incorporates: * DataStoreRead: '/Data Store Read3' */ /* : if(LOGGER) */ if ((rtDW.LOGGER_ACP != 0.0) && rtb_LogicalOperator6) { /* : if(Err) */ /* : fprintf('CCU_Body_Err.CCU_DuctTempSenErrF_Stat = 0x1 (Failure), Sensor_Duct3_F = %f V\n',Sensor); */ printf("CCU_Body_Err.CCU_DuctTempSenErrF_Stat = 0x1 (Failure), Sensor_Duct3_F = %f V\n", rtb_Divide1_ea); fflush(stdout); } /* End of MATLAB Function: '/Write ERROR3' */ /* MATLAB Function: '/Write ERROR4' incorporates: * DataStoreRead: '/Data Store Read4' */ /* : if(LOGGER) */ if ((rtDW.LOGGER_ACP != 0.0) && rtb_LogicalOperator8) { /* : if(Err) */ /* : fprintf('CCU_Body_Err.CCU_DuctTempSenErrF_Stat = 0x1 (Failure), Sensor_Duct4_F = %f V\n',Sensor); */ printf("CCU_Body_Err.CCU_DuctTempSenErrF_Stat = 0x1 (Failure), Sensor_Duct4_F = %f V\n", rtb_Divide8); fflush(stdout); } /* End of MATLAB Function: '/Write ERROR4' */ /* MATLAB Function: '/Write ERROR5' incorporates: * DataStoreRead: '/Data Store Read5' */ /* : if(LOGGER) */ if ((rtDW.LOGGER_ACP != 0.0) && rtb_LogicalOperator10) { /* : if(Err) */ /* : fprintf('CCU_Body_Err.CCU_DuctTempSenErrF_Stat = 0x1 (Failure), Sensor_Duct5_F = %f V\n',Sensor); */ printf("CCU_Body_Err.CCU_DuctTempSenErrF_Stat = 0x1 (Failure), Sensor_Duct5_F = %f V\n", rtb_Divide10); fflush(stdout); } /* End of MATLAB Function: '/Write ERROR5' */ /* MATLAB Function: '/Write ERROR6' incorporates: * DataStoreRead: '/Data Store Read6' */ /* : if(LOGGER) */ if ((rtDW.LOGGER_ACP != 0.0) && rtb_LogicalOperator11) { /* : if(Err) */ /* : fprintf('CCU_Body_Err.CCU_DuctTempSenErrF_Stat = 0x1 (Failure), Sensor_Duct6_F = %f V\n',Sensor); */ printf("CCU_Body_Err.CCU_DuctTempSenErrF_Stat = 0x1 (Failure), Sensor_Duct6_F = %f V\n", rtb_Divide11); fflush(stdout); } /* End of MATLAB Function: '/Write ERROR6' */ /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read4' * Logic: '/Logical Operator3' * Logic: '/Logical Operator4' * UnitDelay: '/Cond_prev_private ' * UnitDelay: '/t_start_delay_private ' */ if (rtb_Compare_ah && (!rtDW.Cond_prev_private_DSTATE_h)) { rtDW.t_start_delay_private_DSTATE_kc = rtDW.t_now; } /* End of Switch: '/Switch' */ /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read4' * Logic: '/Logical Operator3' * Logic: '/Logical Operator4' * UnitDelay: '/Cond_prev_private ' * UnitDelay: '/t_start_delay_private ' */ if (rtb_Compare && (!rtDW.Cond_prev_private_DSTATE_c)) { rtDW.t_start_delay_private_DSTATE_m = rtDW.t_now; } /* End of Switch: '/Switch' */ /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read4' * Logic: '/Logical Operator3' * Logic: '/Logical Operator4' * UnitDelay: '/Cond_prev_private ' * UnitDelay: '/t_start_delay_private ' */ if (rtb_Compare_eu && (!rtDW.Cond_prev_private_DSTATE_m)) { rtDW.t_start_delay_private_DSTATE_p = rtDW.t_now; } /* End of Switch: '/Switch' */ /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read4' * Logic: '/Logical Operator3' * Logic: '/Logical Operator4' * UnitDelay: '/Cond_prev_private ' * UnitDelay: '/t_start_delay_private ' */ if (rtb_Compare_e3 && (!rtDW.Cond_prev_private_DSTATE_j)) { rtDW.t_start_delay_private_DSTATE_h = rtDW.t_now; } /* End of Switch: '/Switch' */ /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read4' * Logic: '/Logical Operator3' * Logic: '/Logical Operator4' * UnitDelay: '/Cond_prev_private ' * UnitDelay: '/t_start_delay_private ' */ if (rtb_Compare_fr && (!rtDW.Cond_prev_private_DSTATE_f)) { rtDW.t_start_delay_private_DSTATE_i = rtDW.t_now; } /* End of Switch: '/Switch' */ /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read4' * Logic: '/Logical Operator3' * Logic: '/Logical Operator4' * UnitDelay: '/Cond_prev_private ' * UnitDelay: '/t_start_delay_private ' */ if (rtb_Compare_b && (!rtDW.Cond_prev_private_DSTATE_cn)) { rtDW.t_start_delay_private_DSTATE_cc = rtDW.t_now; } /* End of Switch: '/Switch' */ /* Product: '/Divide5' incorporates: * Constant: '/Constant6' * Constant: '/Constant7' * DataStoreRead: '/Data Store Read1' * Product: '/Divide4' */ rtb_Divide1 = (double)rtDW.ADC_Data_Model.Sensor_Rear_Duct3 / 4095.0 * 5.0; /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' */ rtb_Compare_h2 = (rtb_Divide1 < 0.15); /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' */ rtb_Compare_nq = (rtb_Divide1 > 4.9); /* Logic: '/Logical Operator5' */ rtb_Compare_m = (rtb_Compare_h2 || rtb_Compare_nq); /* Logic: '/Logical Operator6' incorporates: * Constant: '/Constant' * DataStoreRead: '/Data Store Read4' * RelationalOperator: '/Compare' * Sum: '/Subtract' * UnitDelay: '/t_start_delay_private ' */ rtb_Compare_e = (rtb_Compare_m && (rtDW.t_now - rtDW.t_start_delay_private_DSTATE_cd >= 3000U)); /* Switch: '/Switch2' incorporates: * Constant: '/Constant8' * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write1' * Lookup_n-D: '/1-D Lookup Table4' * SignalConversion generated from: '/1-D Lookup Table4' */ if (rtb_Compare_e) { rtb_MultiportSwitch_ae = 230; } else { rtb_MultiportSwitch_ae = look1_iu16bs16lu64n32ts16Ds32_binlcs (rtDW.ADC_Data_Model.Sensor_Rear_Duct3, rtConstP.pooled62, rtConstP.pooled61, 1023U); } /* End of Switch: '/Switch2' */ /* Product: '/Divide7' incorporates: * Constant: '/Constant10' * Constant: '/Constant9' * DataStoreRead: '/Data Store Read1' * Product: '/Divide6' */ rtb_Divide1_cf = (double)rtDW.ADC_Data_Model.Sensor_Rear_Duct4 / 4095.0 * 5.0; /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' */ rtb_Compare_ck = (rtb_Divide1_cf < 0.15); /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' */ rtb_Compare_ofn = (rtb_Divide1_cf > 4.9); /* Logic: '/Logical Operator7' */ rtb_Compare_i = (rtb_Compare_ck || rtb_Compare_ofn); /* Logic: '/Logical Operator8' incorporates: * Constant: '/Constant' * DataStoreRead: '/Data Store Read4' * RelationalOperator: '/Compare' * Sum: '/Subtract' * UnitDelay: '/t_start_delay_private ' */ rtb_Compare_gs = (rtb_Compare_i && (rtDW.t_now - rtDW.t_start_delay_private_DSTATE_o >= 3000U)); /* Switch: '/Switch3' incorporates: * Constant: '/Constant11' * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write2' * Lookup_n-D: '/1-D Lookup Table4' * SignalConversion generated from: '/1-D Lookup Table4' */ if (rtb_Compare_gs) { rtb_Bias1_h = 230; } else { rtb_Bias1_h = look1_iu16bs16lu64n32ts16Ds32_binlcs (rtDW.ADC_Data_Model.Sensor_Rear_Duct4, rtConstP.pooled62, rtConstP.pooled61, 1023U); } /* End of Switch: '/Switch3' */ /* Product: '/Divide1' incorporates: * Constant: '/Constant' * Constant: '/Constant1' * DataStoreRead: '/Data Store Read1' * Product: '/Divide' */ rtb_Divide1_ea = (double)rtDW.ADC_Data_Model.Sensor_Rear_Duct1 / 4095.0 * 5.0; /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' */ rtb_Compare_em = (rtb_Divide1_ea < 0.15); /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' */ rtb_Compare_p = (rtb_Divide1_ea > 4.9); /* Logic: '/Logical Operator' */ rtb_Compare_au = (rtb_Compare_em || rtb_Compare_p); /* Logic: '/Logical Operator1' incorporates: * Constant: '/Constant' * DataStoreRead: '/Data Store Read4' * RelationalOperator: '/Compare' * Sum: '/Subtract' * UnitDelay: '/t_start_delay_private ' */ rtb_Compare_n2 = (rtb_Compare_au && (rtDW.t_now - rtDW.t_start_delay_private_DSTATE_oj >= 3000U)); /* Switch: '/Switch' incorporates: * Constant: '/Constant2' * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write3' * Lookup_n-D: '/1-D Lookup Table4' * SignalConversion generated from: '/1-D Lookup Table4' */ if (rtb_Compare_n2) { Duct3_R = 230; } else { Duct3_R = look1_iu16bs16lu64n32ts16Ds32_binlcs (rtDW.ADC_Data_Model.Sensor_Rear_Duct1, rtConstP.pooled62, rtConstP.pooled61, 1023U); } /* End of Switch: '/Switch' */ /* Product: '/Divide3' incorporates: * Constant: '/Constant3' * Constant: '/Constant4' * DataStoreRead: '/Data Store Read1' * Product: '/Divide2' */ rtb_Divide8 = (double)rtDW.ADC_Data_Model.Sensor_Rear_Duct2 / 4095.0 * 5.0; /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' */ rtb_Compare_kmz = (rtb_Divide8 < 0.15); /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' */ rtb_Compare_lb = (rtb_Divide8 > 4.9); /* Logic: '/Logical Operator2' */ rtb_Compare_gl = (rtb_Compare_kmz || rtb_Compare_lb); /* Logic: '/Logical Operator3' incorporates: * Constant: '/Constant' * DataStoreRead: '/Data Store Read4' * RelationalOperator: '/Compare' * Sum: '/Subtract' * UnitDelay: '/t_start_delay_private ' */ rtb_Compare_jt = (rtb_Compare_gl && (rtDW.t_now - rtDW.t_start_delay_private_DSTATE_oy >= 3000U)); /* Switch: '/Switch1' incorporates: * Constant: '/Constant5' * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write4' * Lookup_n-D: '/1-D Lookup Table4' * SignalConversion generated from: '/1-D Lookup Table4' */ if (rtb_Compare_jt) { Duct4_R = 230; } else { Duct4_R = look1_iu16bs16lu64n32ts16Ds32_binlcs (rtDW.ADC_Data_Model.Sensor_Rear_Duct2, rtConstP.pooled62, rtConstP.pooled61, 1023U); } /* End of Switch: '/Switch1' */ /* DataStoreWrite: '/Data Store Write1' incorporates: * DataTypeConversion: '/Data Type Conversion' */ rtDW.dtc_state_error_model[29] = rtb_Compare_n2; /* Switch: '/Switch' incorporates: * DataTypeConversion: '/Data Type Conversion' * Switch: '/Switch1' */ if (rtb_Compare_n2) { /* DataStoreWrite: '/Data Store Write' incorporates: * DataTypeConversion: '/Data Type Conversion1' */ rtDW.dtc_state_error_model[30] = rtb_Compare_em; /* DataStoreWrite: '/Data Store Write1' incorporates: * DataTypeConversion: '/Data Type Conversion2' */ rtDW.dtc_state_error_model[29] = rtb_Compare_p; } else { /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.dtc_state_error_model[30] = 0U; } /* End of Switch: '/Switch' */ /* DataStoreWrite: '/Data Store Write1' incorporates: * DataTypeConversion: '/Data Type Conversion' */ rtDW.dtc_state_error_model[31] = rtb_Compare_jt; /* Switch: '/Switch' incorporates: * DataTypeConversion: '/Data Type Conversion' * Switch: '/Switch1' */ if (rtb_Compare_jt) { /* DataStoreWrite: '/Data Store Write' incorporates: * DataTypeConversion: '/Data Type Conversion1' */ rtDW.dtc_state_error_model[32] = rtb_Compare_kmz; /* DataStoreWrite: '/Data Store Write1' incorporates: * DataTypeConversion: '/Data Type Conversion2' */ rtDW.dtc_state_error_model[31] = rtb_Compare_lb; } else { /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.dtc_state_error_model[32] = 0U; } /* End of Switch: '/Switch' */ /* DataStoreWrite: '/Data Store Write1' incorporates: * DataTypeConversion: '/Data Type Conversion' */ rtDW.dtc_state_error_model[33] = rtb_Compare_e; /* Switch: '/Switch' incorporates: * DataTypeConversion: '/Data Type Conversion' * Switch: '/Switch1' */ if (rtb_Compare_e) { /* DataStoreWrite: '/Data Store Write' incorporates: * DataTypeConversion: '/Data Type Conversion1' */ rtDW.dtc_state_error_model[34] = rtb_Compare_h2; /* DataStoreWrite: '/Data Store Write1' incorporates: * DataTypeConversion: '/Data Type Conversion2' */ rtDW.dtc_state_error_model[33] = rtb_Compare_nq; } else { /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.dtc_state_error_model[34] = 0U; } /* End of Switch: '/Switch' */ /* DataStoreWrite: '/Data Store Write1' incorporates: * DataTypeConversion: '/Data Type Conversion' */ rtDW.dtc_state_error_model[35] = rtb_Compare_gs; /* Switch: '/Switch' incorporates: * DataTypeConversion: '/Data Type Conversion' * Switch: '/Switch1' */ if (rtb_Compare_gs) { /* DataStoreWrite: '/Data Store Write' incorporates: * DataTypeConversion: '/Data Type Conversion1' */ rtDW.dtc_state_error_model[36] = rtb_Compare_ck; /* DataStoreWrite: '/Data Store Write1' incorporates: * DataTypeConversion: '/Data Type Conversion2' */ rtDW.dtc_state_error_model[35] = rtb_Compare_ofn; } else { /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.dtc_state_error_model[36] = 0U; } /* End of Switch: '/Switch' */ /* MATLAB Function: '/Write ' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write3' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('Duct1_R = %d * 0.1 C %d V\n',Sensor, int16(V)); */ Gain = rtDW.ADC_Data_Model.Sensor_Rear_Duct1; if (rtDW.ADC_Data_Model.Sensor_Rear_Duct1 > 32767) { Gain = 32767U; } printf("Duct1_R = %d * 0.1 C %d V\n", Duct3_R, (int16_t)Gain); fflush(stdout); } /* End of MATLAB Function: '/Write ' */ /* MATLAB Function: '/Write 1' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write4' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('Duct2_R = %d * 0.1 C %d V\n',Sensor, int16(V)); */ Gain = rtDW.ADC_Data_Model.Sensor_Rear_Duct2; if (rtDW.ADC_Data_Model.Sensor_Rear_Duct2 > 32767) { Gain = 32767U; } printf("Duct2_R = %d * 0.1 C %d V\n", Duct4_R, (int16_t)Gain); fflush(stdout); } /* End of MATLAB Function: '/Write 1' */ /* MATLAB Function: '/Write 2' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read2' * DataStoreWrite: '/Data Store Write1' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('Duct3_R = %d * 0.1 C %d V\n',Sensor, int16(V)); */ Gain = rtDW.ADC_Data_Model.Sensor_Rear_Duct3; if (rtDW.ADC_Data_Model.Sensor_Rear_Duct3 > 32767) { Gain = 32767U; } printf("Duct3_R = %d * 0.1 C %d V\n", rtb_MultiportSwitch_ae, (int16_t)Gain); fflush(stdout); } /* End of MATLAB Function: '/Write 2' */ /* MATLAB Function: '/Write 3' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read3' * DataStoreWrite: '/Data Store Write2' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('Duct4_R = %d * 0.1 C %d V\n',Sensor, int16(V)); */ Gain = rtDW.ADC_Data_Model.Sensor_Rear_Duct4; if (rtDW.ADC_Data_Model.Sensor_Rear_Duct4 > 32767) { Gain = 32767U; } printf("Duct4_R = %d * 0.1 C %d V\n", rtb_Bias1_h, (int16_t)Gain); fflush(stdout); } /* End of MATLAB Function: '/Write 3' */ /* MATLAB Function: '/Write ERROR' incorporates: * DataStoreRead: '/Data Store Read' */ /* : if(LOGGER) */ if ((rtDW.LOGGER_ACP != 0.0) && rtb_Compare_n2) { /* : if(Err) */ /* : fprintf('CCU_Body_Err.CCU_DuctTempSenErrR_Stat = 0x1 (Failure), Sensor_Duct1_R = %f V\n',Sensor); */ printf("CCU_Body_Err.CCU_DuctTempSenErrR_Stat = 0x1 (Failure), Sensor_Duct1_R = %f V\n", rtb_Divide1_ea); fflush(stdout); } /* End of MATLAB Function: '/Write ERROR' */ /* MATLAB Function: '/Write ERROR1' incorporates: * DataStoreRead: '/Data Store Read1' */ /* : if(LOGGER) */ if ((rtDW.LOGGER_ACP != 0.0) && rtb_Compare_jt) { /* : if(Err) */ /* : fprintf('CCU_Body_Err.CCU_DuctTempSenErrR_Stat = 0x1 (Failure), Sensor_Duct2_R = %f V\n',Sensor); */ printf("CCU_Body_Err.CCU_DuctTempSenErrR_Stat = 0x1 (Failure), Sensor_Duct2_R = %f V\n", rtb_Divide8); fflush(stdout); } /* End of MATLAB Function: '/Write ERROR1' */ /* MATLAB Function: '/Write ERROR2' incorporates: * DataStoreRead: '/Data Store Read2' */ /* : if(LOGGER) */ if ((rtDW.LOGGER_ACP != 0.0) && rtb_Compare_e) { /* : if(Err) */ /* : fprintf('CCU_Body_Err.CCU_DuctTempSenErrR_Stat = 0x1 (Failure), Sensor_Duct3_R = %f V\n',Sensor); */ printf("CCU_Body_Err.CCU_DuctTempSenErrR_Stat = 0x1 (Failure), Sensor_Duct3_R = %f V\n", rtb_Divide1); fflush(stdout); } /* End of MATLAB Function: '/Write ERROR2' */ /* MATLAB Function: '/Write ERROR3' incorporates: * DataStoreRead: '/Data Store Read3' */ /* : if(LOGGER) */ if ((rtDW.LOGGER_ACP != 0.0) && rtb_Compare_gs) { /* : if(Err) */ /* : fprintf('CCU_Body_Err.CCU_DuctTempSenErrR_Stat = 0x1 (Failure), Sensor_Duct4_R = %f V\n',Sensor); */ printf("CCU_Body_Err.CCU_DuctTempSenErrR_Stat = 0x1 (Failure), Sensor_Duct4_R = %f V\n", rtb_Divide1_cf); fflush(stdout); } /* End of MATLAB Function: '/Write ERROR3' */ /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read4' * Logic: '/Logical Operator3' * Logic: '/Logical Operator4' * UnitDelay: '/Cond_prev_private ' * UnitDelay: '/t_start_delay_private ' */ if (rtb_Compare_au && (!rtDW.Cond_prev_private_DSTATE_l)) { rtDW.t_start_delay_private_DSTATE_oj = rtDW.t_now; } /* End of Switch: '/Switch' */ /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read4' * Logic: '/Logical Operator3' * Logic: '/Logical Operator4' * UnitDelay: '/Cond_prev_private ' * UnitDelay: '/t_start_delay_private ' */ if (rtb_Compare_gl && (!rtDW.Cond_prev_private_DSTATE_ja)) { rtDW.t_start_delay_private_DSTATE_oy = rtDW.t_now; } /* End of Switch: '/Switch' */ /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read4' * Logic: '/Logical Operator3' * Logic: '/Logical Operator4' * UnitDelay: '/Cond_prev_private ' * UnitDelay: '/t_start_delay_private ' */ if (rtb_Compare_m && (!rtDW.Cond_prev_private_DSTATE_g)) { rtDW.t_start_delay_private_DSTATE_cd = rtDW.t_now; } /* End of Switch: '/Switch' */ /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read4' * Logic: '/Logical Operator3' * Logic: '/Logical Operator4' * UnitDelay: '/Cond_prev_private ' * UnitDelay: '/t_start_delay_private ' */ if (rtb_Compare_i && (!rtDW.Cond_prev_private_DSTATE_cd)) { rtDW.t_start_delay_private_DSTATE_o = rtDW.t_now; } /* End of Switch: '/Switch' */ /* BusCreator: '/Bus Creator' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read2' * DataStoreRead: '/Data Store Read3' * DataStoreWrite: '/Data Store Write1' * DataStoreWrite: '/Data Store Write3' * DataStoreWrite: '/Data Store Write4' * DataStoreWrite: '/Data Store Write5' * DataStoreWrite: '/Data Store Write' */ rtDW.dbgCAN_dbg_Sen_Incar_model.dbg_Sen_Incar_MultMsg_Idx = 0U; rtDW.dbgCAN_dbg_Sen_Incar_model.dbg_Sen_Incar_Raw_FL_ro = rtDW.Incar_FL; rtDW.dbgCAN_dbg_Sen_Incar_model.dbg_Sen_Incar_FL_ro = rtDW.Incar_FL; rtDW.dbgCAN_dbg_Sen_Incar_model.dbg_Sen_Incar_Raw_FR_ro = rtDW.Incar_FR; rtDW.dbgCAN_dbg_Sen_Incar_model.dbg_Sen_Incar_FR_ro = rtDW.Incar_FR; rtDW.dbgCAN_dbg_Sen_Incar_model.dbg_Sen_Incar_Raw_RL_ro = rtDW.Incar_RL; rtDW.dbgCAN_dbg_Sen_Incar_model.dbg_Sen_Incar_RL_ro = rtDW.Incar_RL; rtDW.dbgCAN_dbg_Sen_Incar_model.dbg_Sen_Incar_Raw_RR_ro = rtDW.Incar_RR; rtDW.dbgCAN_dbg_Sen_Incar_model.dbg_Sen_Incar_RR_ro = rtDW.Incar_RR; /* DataStoreWrite: '/Data Store Write1' incorporates: * DataTypeConversion: '/Data Type Conversion' */ rtDW.dtc_state_error_model[2] = rtb_LogicalOperator1_n; /* Switch: '/Switch' incorporates: * DataTypeConversion: '/Data Type Conversion' * Switch: '/Switch1' */ if (rtb_LogicalOperator1_n) { /* DataStoreWrite: '/Data Store Write' incorporates: * DataTypeConversion: '/Data Type Conversion1' */ rtDW.dtc_state_error_model[3] = rtb_Compare_p1p; /* DataStoreWrite: '/Data Store Write1' incorporates: * DataTypeConversion: '/Data Type Conversion2' */ rtDW.dtc_state_error_model[2] = rtb_Compare_bu; } else { /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.dtc_state_error_model[3] = 0U; } /* End of Switch: '/Switch' */ /* DataStoreWrite: '/Data Store Write1' incorporates: * DataTypeConversion: '/Data Type Conversion' */ rtDW.dtc_state_error_model[6] = rtb_LogicalOperator3; /* Switch: '/Switch' incorporates: * DataTypeConversion: '/Data Type Conversion' * Switch: '/Switch1' */ if (rtb_LogicalOperator3) { /* DataStoreWrite: '/Data Store Write' incorporates: * DataTypeConversion: '/Data Type Conversion1' */ rtDW.dtc_state_error_model[7] = rtb_Compare_l; /* DataStoreWrite: '/Data Store Write1' incorporates: * DataTypeConversion: '/Data Type Conversion2' */ rtDW.dtc_state_error_model[6] = rtb_Compare_j; } else { /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.dtc_state_error_model[7] = 0U; } /* End of Switch: '/Switch' */ /* MATLAB Function: '/Write ERROR' incorporates: * DataStoreRead: '/Data Store Read' */ /* : if(LOGGER) */ if ((rtDW.LOGGER_ACP != 0.0) && rtb_LogicalOperator1_n) { /* : if(IncarFLErr) */ /* : fprintf('CCU_Body_Err.CCU_IncarTempErrF_Stat = 0x1 (Failure), Sensor_Incar_Temp_FL = %f V\n',Sensor_Incar_Temp_FL); */ printf("CCU_Body_Err.CCU_IncarTempErrF_Stat = 0x1 (Failure), Sensor_Incar_Temp_FL = %f V\n", rtb_u8Vtg_FX_plus); fflush(stdout); } /* End of MATLAB Function: '/Write ERROR' */ /* MATLAB Function: '/Write ERROR1' incorporates: * DataStoreRead: '/Data Store Read1' */ /* : if(LOGGER) */ if ((rtDW.LOGGER_ACP != 0.0) && rtb_LogicalOperator3) { /* : if(IncarRLErr) */ /* : fprintf('CCU_Body_Err.CCU_IncarTempErrF_Stat = 0x1 (Failure), Sensor_Incar_Temp_RL = %f V\n',Sensor_Incar_Temp_RL); */ printf("CCU_Body_Err.CCU_IncarTempErrF_Stat = 0x1 (Failure), Sensor_Incar_Temp_RL = %f V\n", rtb_Divide3); fflush(stdout); } /* End of MATLAB Function: '/Write ERROR1' */ /* MATLAB Function: '/Write IncarFL' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write1' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('IncarFL = %d * 0.1 C\n',IncarFL); */ printf("IncarFL = %d * 0.1 C\n", rtDW.Incar_FL); fflush(stdout); } /* End of MATLAB Function: '/Write IncarFL' */ /* MATLAB Function: '/Write IncarRL' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write4' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('IncarRL = %d * 0.1 C\n',IncarRL); */ printf("IncarRL = %d * 0.1 C\n", rtDW.Incar_RL); fflush(stdout); } /* End of MATLAB Function: '/Write IncarRL' */ /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read4' * Logic: '/Logical Operator3' * Logic: '/Logical Operator4' * UnitDelay: '/Cond_prev_private ' * UnitDelay: '/t_start_delay_private ' */ if (rtb_LogicalOperator5 && (!rtDW.Cond_prev_private_DSTATE_e)) { rtDW.t_start_delay_private_DSTATE_go = rtDW.t_now; } /* End of Switch: '/Switch' */ /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read4' * Logic: '/Logical Operator3' * Logic: '/Logical Operator4' * UnitDelay: '/Cond_prev_private ' * UnitDelay: '/t_start_delay_private ' */ if (rtb_FailCond_lt && (!rtDW.Cond_prev_private_DSTATE_mv)) { rtDW.t_start_delay_private_DSTATE_j = rtDW.t_now; } /* End of Switch: '/Switch' */ /* DataStoreWrite: '/Data Store Write1' incorporates: * DataTypeConversion: '/Data Type Conversion' */ rtDW.dtc_state_error_model[4] = rtb_LogicalOperator1_m2; /* Switch: '/Switch' incorporates: * DataTypeConversion: '/Data Type Conversion' * Switch: '/Switch1' */ if (rtb_LogicalOperator1_m2) { /* DataStoreWrite: '/Data Store Write' incorporates: * DataTypeConversion: '/Data Type Conversion1' */ rtDW.dtc_state_error_model[5] = rtb_Compare_kt; /* DataStoreWrite: '/Data Store Write1' incorporates: * DataTypeConversion: '/Data Type Conversion2' */ rtDW.dtc_state_error_model[4] = rtb_Compare_i5; } else { /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.dtc_state_error_model[5] = 0U; } /* End of Switch: '/Switch' */ /* DataStoreWrite: '/Data Store Write1' incorporates: * DataTypeConversion: '/Data Type Conversion' */ rtDW.dtc_state_error_model[8] = rtb_LogicalOperator3_p5; /* Switch: '/Switch' incorporates: * DataTypeConversion: '/Data Type Conversion' * Switch: '/Switch1' */ if (rtb_LogicalOperator3_p5) { /* DataStoreWrite: '/Data Store Write' incorporates: * DataTypeConversion: '/Data Type Conversion1' */ rtDW.dtc_state_error_model[9] = rtb_Compare_g4; /* DataStoreWrite: '/Data Store Write1' incorporates: * DataTypeConversion: '/Data Type Conversion2' */ rtDW.dtc_state_error_model[8] = rtb_Compare_dd; } else { /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.dtc_state_error_model[9] = 0U; } /* End of Switch: '/Switch' */ /* MATLAB Function: '/Write ERROR' incorporates: * DataStoreRead: '/Data Store Read' */ /* : if(LOGGER) */ if ((rtDW.LOGGER_ACP != 0.0) && rtb_LogicalOperator1_m2) { /* : if(IncarRLErr) */ /* : fprintf('CCU_Body_Err.CCU_IncarTempErrR_Stat = 0x1 (Failure), Sensor_Incar_Temp_FR = %f V\n',Sensor_Incar_Temp_FR); */ printf("CCU_Body_Err.CCU_IncarTempErrR_Stat = 0x1 (Failure), Sensor_Incar_Temp_FR = %f V\n", rtb_Divide1_l5); fflush(stdout); } /* End of MATLAB Function: '/Write ERROR' */ /* MATLAB Function: '/Write ERROR1' incorporates: * DataStoreRead: '/Data Store Read1' */ /* : if(LOGGER) */ if ((rtDW.LOGGER_ACP != 0.0) && rtb_LogicalOperator3_p5) { /* : if(IncarRLErr) */ /* : fprintf('CCU_Body_Err.CCU_IncarTempErrR_Stat = 0x1 (Failure), Sensor_Incar_Temp_RR = %f V\n',Sensor_Incar_Temp_RR); */ printf("CCU_Body_Err.CCU_IncarTempErrR_Stat = 0x1 (Failure), Sensor_Incar_Temp_RR = %f V\n", rtb_Divide3_hk); fflush(stdout); } /* End of MATLAB Function: '/Write ERROR1' */ /* MATLAB Function: '/Write IncarFR' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write3' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('IncarFR = %d * 0.1 C\n',IncarFR); */ printf("IncarFR = %d * 0.1 C\n", rtDW.Incar_FR); fflush(stdout); } /* End of MATLAB Function: '/Write IncarFR' */ /* MATLAB Function: '/Write IncarRR' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write5' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('IncarRR = %d * 0.1 C\n',IncarRR); */ printf("IncarRR = %d * 0.1 C\n", rtDW.Incar_RR); fflush(stdout); } /* End of MATLAB Function: '/Write IncarRR' */ /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read4' * Logic: '/Logical Operator3' * Logic: '/Logical Operator4' * UnitDelay: '/Cond_prev_private ' * UnitDelay: '/t_start_delay_private ' */ if (rtb_Compare_dq && (!rtDW.Cond_prev_private_DSTATE_jl)) { rtDW.t_start_delay_private_DSTATE_k = rtDW.t_now; } /* End of Switch: '/Switch' */ /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read4' * Logic: '/Logical Operator3' * Logic: '/Logical Operator4' * UnitDelay: '/Cond_prev_private ' * UnitDelay: '/t_start_delay_private ' */ if (rtb_FailCond_h && (!rtDW.Cond_prev_private_DSTATE_ei)) { rtDW.t_start_delay_private_DSTATE_gd = rtDW.t_now; } /* End of Switch: '/Switch' */ /* If: '/If' incorporates: * DataStoreRead: '/Data Store Read' * If: '/If1' * RelationalOperator: '/Relational Operator1' * UnitDelay: '/Unit Delay' */ if (rtDW.UnitDelay_DSTATE_da == -9999) { /* Outputs for IfAction SubSystem: '/Инициализация FL' incorporates: * ActionPort: '/Action Port' */ /* SignalConversion generated from: '/temp_fl' incorporates: * DataStoreWrite: '/Data Store Write' * DataStoreWrite: '/Data Store Write1' */ rtDW.Temp_FL_store = rtDW.Incar_FL; /* SignalConversion generated from: '/temp_out_fl' incorporates: * DataStoreWrite: '/Data Store Write' */ rtb_Bias5 = rtDW.Temp_FL_store; /* End of Outputs for SubSystem: '/Инициализация FL' */ } else { /* Outputs for IfAction SubSystem: '/Фильтрация FL температуры' incorporates: * ActionPort: '/Action Port' */ if (rtDW.KEEP_RISING_FL_UNTIL_LIMIT > 0.0) { /* Outputs for IfAction SubSystem: '/включен ускоренный режим' incorporates: * ActionPort: '/Action Port' */ /* If: '/If1' incorporates: * Abs: '/ABS(AMBraw - AMB)' * DataStoreRead: '/Read Amb' * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write1' * If: '/If' * MATLAB Function: '/g_ausINCARRATE_RISING_DIFF_F[8]' * RelationalOperator: '/Relational Operator' * Sum: '/Add' */ g_ausINCARRATE_RISING_DIFF_F8(&Gain); rtb_Bias5 = (int16_t)(rtDW.Incar_FL - rtDW.Temp_FL_store); if (rtb_Bias5 < 0) { rtb_Bias5 = (int16_t)-rtb_Bias5; } if (rtb_Bias5 <= Gain) { /* Outputs for IfAction SubSystem: '/Отключаем ускоренный режим' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.KEEP_RISING_FL_UNTIL_LIMIT = 0.0; /* SignalConversion generated from: '/out' incorporates: * DataStoreRead: '/Data Store Read' * MATLAB Function: '/обычное повышение темп.' */ u_e(rtDW.LEVEL, &Gain); /* End of Outputs for SubSystem: '/Отключаем ускоренный режим' */ } else { /* Outputs for IfAction SubSystem: '/Продолжаем в ускоренном' incorporates: * ActionPort: '/Action Port' */ u_cc(rtDW.LEVEL, &Gain); /* End of Outputs for SubSystem: '/Продолжаем в ускоренном' */ } /* End of Outputs for SubSystem: '/включен ускоренный режим' */ } else { /* Outputs for IfAction SubSystem: '/обычный режим' incorporates: * ActionPort: '/Action Port' */ /* If: '/If1' incorporates: * Abs: '/ABS(AMBraw - AMB)' * DataStoreRead: '/Read Amb' * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write1' * If: '/If' * MATLAB Function: '/INCARRATE_RISING_DIFF_F[7]' * RelationalOperator: '/Relational Operator' * Sum: '/Add' */ INCARRATE_RISING_DIFF_F7(&Gain); rtb_Bias5 = (int16_t)(rtDW.Incar_FL - rtDW.Temp_FL_store); if (rtb_Bias5 < 0) { rtb_Bias5 = (int16_t)-rtb_Bias5; } if (rtb_Bias5 > Gain) { /* Outputs for IfAction SubSystem: '/включаем ускоренный режим' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.KEEP_RISING_FL_UNTIL_LIMIT = 1.0; /* SignalConversion generated from: '/out' incorporates: * DataStoreRead: '/Data Store Read' * MATLAB Function: '/ускоренное повышение темп.' */ u_c(rtDW.LEVEL, &Gain); /* End of Outputs for SubSystem: '/включаем ускоренный режим' */ } else { /* Outputs for IfAction SubSystem: '/обычный режим повышения' incorporates: * ActionPort: '/Action Port' */ u_mu(rtDW.LEVEL, &Gain); /* End of Outputs for SubSystem: '/обычный режим повышения' */ } /* End of Outputs for SubSystem: '/обычный режим' */ } /* If: '/If1' incorporates: * DataStoreRead: '/Data Store Read' */ if (rtDW.KEEP_FALLING_FL_UNTIL_LIMIT > 0.0) { /* Outputs for IfAction SubSystem: '/включен ускоренный режим' incorporates: * ActionPort: '/Action Port' */ /* MATLAB Function: '/AMBRATE_RISING_DIFF[8]' */ AMBRATE_RISING_DIFF8(&Gain1); /* Sum: '/Add' incorporates: * DataStoreRead: '/Read temp' * DataStoreWrite: '/Data Store Write1' */ rtb_Bias5 = (int16_t)(rtDW.Incar_FL - rtDW.Temp_FL_store); /* Abs: '/ABS(AMBraw - AMB)' */ if (rtb_Bias5 < 0) { rtb_Bias5 = (int16_t)-rtb_Bias5; } /* If: '/If' incorporates: * Abs: '/ABS(AMBraw - AMB)' * RelationalOperator: '/Relational Operator' */ if (rtb_Bias5 <= Gain1) { /* Outputs for IfAction SubSystem: '/Отключаем ускоренный режим' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.KEEP_FALLING_FL_UNTIL_LIMIT = 0.0; /* SignalConversion generated from: '/out' incorporates: * DataStoreRead: '/Data Store Read' * MATLAB Function: '/обычное понижение темп.' */ u(rtDW.LEVEL, &Gain1); /* End of Outputs for SubSystem: '/Отключаем ускоренный режим' */ } else { /* Outputs for IfAction SubSystem: '/Продолжаем в ускоренном' incorporates: * ActionPort: '/Action Port' */ /* SignalConversion generated from: '/out' incorporates: * DataStoreRead: '/Data Store Read' */ u_h(rtDW.LEVEL, &Gain1); /* End of Outputs for SubSystem: '/Продолжаем в ускоренном' */ } /* End of If: '/If' */ /* End of Outputs for SubSystem: '/включен ускоренный режим' */ } else { /* Outputs for IfAction SubSystem: '/обычный режим' incorporates: * ActionPort: '/Action Port' */ /* MATLAB Function: '/AMBRATE_FALLING_DIFF[7]' */ AMBRATE_FALLING_DIFF7(&Gain1); /* Sum: '/Add' incorporates: * DataStoreRead: '/Read Amb' * DataStoreWrite: '/Data Store Write1' */ rtb_Bias5 = (int16_t)(rtDW.Incar_FL - rtDW.Temp_FL_store); /* Abs: '/ABS(AMBraw - AMB)' */ if (rtb_Bias5 < 0) { rtb_Bias5 = (int16_t)-rtb_Bias5; } /* If: '/If' incorporates: * Abs: '/ABS(AMBraw - AMB)' * RelationalOperator: '/Relational Operator' */ if (rtb_Bias5 > Gain1) { /* Outputs for IfAction SubSystem: '/включаем ускоренный режим' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.KEEP_FALLING_FL_UNTIL_LIMIT = 1.0; /* SignalConversion generated from: '/rise per minute' incorporates: * DataStoreRead: '/Data Store Read' * MATLAB Function: '/ускоренное повышение темп.' */ u_m(rtDW.LEVEL, &Gain1); /* End of Outputs for SubSystem: '/включаем ускоренный режим' */ } else { /* Outputs for IfAction SubSystem: '/обычный режим повышения' incorporates: * ActionPort: '/Action Port' */ /* SignalConversion generated from: '/rise per minute' incorporates: * DataStoreRead: '/Data Store Read' */ u_i(rtDW.LEVEL, &Gain1); /* End of Outputs for SubSystem: '/обычный режим повышения' */ } /* End of If: '/If' */ /* End of Outputs for SubSystem: '/обычный режим' */ } /* End of If: '/If1' */ /* Sum: '/Add' incorporates: * DataStoreRead: '/Read Amb' * DataStoreWrite: '/Data Store Write1' */ rtb_Bias5 = (int16_t)(rtDW.Incar_FL - rtDW.Temp_FL_store); /* Abs: '/Abs' */ if (rtb_Bias5 < 0) { rtb_Bias5 = (int16_t)-rtb_Bias5; } /* Switch: '/Switch1' incorporates: * Abs: '/Abs' * Constant: '/epsilon' * DataStoreRead: '/Read Amb' * DataStoreWrite: '/Data Store Write1' * RelationalOperator: '/AMBraw > AMB' * RelationalOperator: '/Relational Operator' * Switch: '/Switch' */ if (rtb_Bias5 <= 0.01) { /* SignalConversion generated from: '/temp_out' incorporates: * DataStoreRead: '/Read Amb' */ rtb_Bias5 = rtDW.Temp_FL_store; } else { if (rtDW.Incar_FL > rtDW.Temp_FL_store) { /* Switch: '/Switch' incorporates: * DataTypeConversion: '/Data Type Conversion' */ rtb_FLU_tg_correct_g = (int16_t)Gain; } else { /* Switch: '/Switch' incorporates: * DataTypeConversion: '/Data Type Conversion' * UnaryMinus: '/Unary Minus' */ rtb_FLU_tg_correct_g = (int16_t)-(int16_t)Gain1; } /* SignalConversion generated from: '/temp_out' incorporates: * Constant: '/Constant' * DataStoreRead: '/Read Amb' * DataStoreRead: '/Data Store Read12' * Product: '/Divide' * Product: '/Product' * Sum: '/Add' * Sum: '/Subtract' * Switch: '/Switch' * UnitDelay: '/Unit Delay' */ rtb_Bias5 = (int16_t)((int16_t)((uint16_t)((rtDW.t_now - rtDW.UnitDelay_DSTATE_bd) / 60000U) * rtb_FLU_tg_correct_g) + rtDW.Temp_FL_store); } /* End of Switch: '/Switch1' */ /* Update for UnitDelay: '/Unit Delay' incorporates: * DataStoreRead: '/Data Store Read12' */ rtDW.UnitDelay_DSTATE_bd = rtDW.t_now; /* End of Outputs for SubSystem: '/Фильтрация FL температуры' */ } /* End of If: '/If' */ /* DataStoreWrite: '/Write new FL' */ rtDW.Temp_FL_store = rtb_Bias5; /* If: '/If1' incorporates: * DataStoreRead: '/Data Store Read' * If: '/If1' * RelationalOperator: '/Relational Operator2' * UnitDelay: '/Unit Delay1' */ if (rtDW.UnitDelay1_DSTATE_k == -9999) { /* Outputs for IfAction SubSystem: '/Инициализация FR' incorporates: * ActionPort: '/Action Port' */ /* SignalConversion generated from: '/temp' incorporates: * DataStoreWrite: '/Data Store Write' * DataStoreWrite: '/Data Store Write3' */ rtDW.Temp_FR_store = rtDW.Incar_FR; /* SignalConversion generated from: '/temp_out' incorporates: * DataStoreWrite: '/Data Store Write' */ rtb_Bias5 = rtDW.Temp_FR_store; /* End of Outputs for SubSystem: '/Инициализация FR' */ } else { /* Outputs for IfAction SubSystem: '/Фильтрация FR температуры' incorporates: * ActionPort: '/Action Port' */ if (rtDW.KEEP_RISING_FR_UNTIL_LIMIT > 0.0) { /* Outputs for IfAction SubSystem: '/включен ускоренный режим' incorporates: * ActionPort: '/Action Port' */ /* If: '/If1' incorporates: * Abs: '/ABS(AMBraw - AMB)' * DataStoreRead: '/Read Amb' * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write3' * If: '/If' * MATLAB Function: '/g_ausINCARRATE_RISING_DIFF_F[8]' * RelationalOperator: '/Relational Operator' * Sum: '/Add' */ g_ausINCARRATE_RISING_DIFF_F8(&Gain); rtb_Bias5 = (int16_t)(rtDW.Incar_FR - rtDW.Temp_FR_store); if (rtb_Bias5 < 0) { rtb_Bias5 = (int16_t)-rtb_Bias5; } if (rtb_Bias5 <= Gain) { /* Outputs for IfAction SubSystem: '/Отключаем ускоренный режим' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.KEEP_RISING_FR_UNTIL_LIMIT = 0.0; /* SignalConversion generated from: '/out' incorporates: * DataStoreRead: '/Data Store Read' * MATLAB Function: '/обычное повышение темп.' */ u_e(rtDW.LEVEL, &Gain); /* End of Outputs for SubSystem: '/Отключаем ускоренный режим' */ } else { /* Outputs for IfAction SubSystem: '/Продолжаем в ускоренном' incorporates: * ActionPort: '/Action Port' */ u_cc(rtDW.LEVEL, &Gain); /* End of Outputs for SubSystem: '/Продолжаем в ускоренном' */ } /* End of Outputs for SubSystem: '/включен ускоренный режим' */ } else { /* Outputs for IfAction SubSystem: '/обычный режим' incorporates: * ActionPort: '/Action Port' */ /* If: '/If1' incorporates: * Abs: '/ABS(AMBraw - AMB)' * DataStoreRead: '/Read Amb' * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write3' * If: '/If' * MATLAB Function: '/INCARRATE_RISING_DIFF_F[7]' * RelationalOperator: '/Relational Operator' * Sum: '/Add' */ INCARRATE_RISING_DIFF_F7(&Gain); rtb_Bias5 = (int16_t)(rtDW.Incar_FR - rtDW.Temp_FR_store); if (rtb_Bias5 < 0) { rtb_Bias5 = (int16_t)-rtb_Bias5; } if (rtb_Bias5 > Gain) { /* Outputs for IfAction SubSystem: '/включаем ускоренный режим' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.KEEP_RISING_FR_UNTIL_LIMIT = 1.0; /* SignalConversion generated from: '/out' incorporates: * DataStoreRead: '/Data Store Read' * MATLAB Function: '/ускоренное повышение темп.' */ u_c(rtDW.LEVEL, &Gain); /* End of Outputs for SubSystem: '/включаем ускоренный режим' */ } else { /* Outputs for IfAction SubSystem: '/обычный режим повышения' incorporates: * ActionPort: '/Action Port' */ u_mu(rtDW.LEVEL, &Gain); /* End of Outputs for SubSystem: '/обычный режим повышения' */ } /* End of Outputs for SubSystem: '/обычный режим' */ } /* If: '/If1' incorporates: * DataStoreRead: '/Data Store Read' */ if (rtDW.KEEP_FALLING_FR_UNTIL_LIMIT > 0.0) { /* Outputs for IfAction SubSystem: '/включен ускоренный режим' incorporates: * ActionPort: '/Action Port' */ /* MATLAB Function: '/AMBRATE_RISING_DIFF[8]' */ AMBRATE_RISING_DIFF8(&Gain1); /* Sum: '/Add' incorporates: * DataStoreRead: '/Read temp' * DataStoreWrite: '/Data Store Write3' */ rtb_Bias5 = (int16_t)(rtDW.Incar_FR - rtDW.Temp_FR_store); /* Abs: '/ABS(AMBraw - AMB)' */ if (rtb_Bias5 < 0) { rtb_Bias5 = (int16_t)-rtb_Bias5; } /* If: '/If' incorporates: * Abs: '/ABS(AMBraw - AMB)' * RelationalOperator: '/Relational Operator' */ if (rtb_Bias5 <= Gain1) { /* Outputs for IfAction SubSystem: '/Отключаем ускоренный режим' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.KEEP_FALLING_FR_UNTIL_LIMIT = 0.0; /* SignalConversion generated from: '/out' incorporates: * DataStoreRead: '/Data Store Read' * MATLAB Function: '/обычное понижение темп.' */ u(rtDW.LEVEL, &Gain1); /* End of Outputs for SubSystem: '/Отключаем ускоренный режим' */ } else { /* Outputs for IfAction SubSystem: '/Продолжаем в ускоренном' incorporates: * ActionPort: '/Action Port' */ /* SignalConversion generated from: '/out' incorporates: * DataStoreRead: '/Data Store Read' */ u_h(rtDW.LEVEL, &Gain1); /* End of Outputs for SubSystem: '/Продолжаем в ускоренном' */ } /* End of If: '/If' */ /* End of Outputs for SubSystem: '/включен ускоренный режим' */ } else { /* Outputs for IfAction SubSystem: '/обычный режим' incorporates: * ActionPort: '/Action Port' */ /* MATLAB Function: '/AMBRATE_FALLING_DIFF[7]' */ AMBRATE_FALLING_DIFF7(&Gain1); /* Sum: '/Add' incorporates: * DataStoreRead: '/Read Amb' * DataStoreWrite: '/Data Store Write3' */ rtb_Bias5 = (int16_t)(rtDW.Incar_FR - rtDW.Temp_FR_store); /* Abs: '/ABS(AMBraw - AMB)' */ if (rtb_Bias5 < 0) { rtb_Bias5 = (int16_t)-rtb_Bias5; } /* If: '/If' incorporates: * Abs: '/ABS(AMBraw - AMB)' * RelationalOperator: '/Relational Operator' */ if (rtb_Bias5 > Gain1) { /* Outputs for IfAction SubSystem: '/включаем ускоренный режим' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.KEEP_FALLING_FR_UNTIL_LIMIT = 1.0; /* SignalConversion generated from: '/rise per minute' incorporates: * DataStoreRead: '/Data Store Read' * MATLAB Function: '/ускоренное повышение темп.' */ u_m(rtDW.LEVEL, &Gain1); /* End of Outputs for SubSystem: '/включаем ускоренный режим' */ } else { /* Outputs for IfAction SubSystem: '/обычный режим повышения' incorporates: * ActionPort: '/Action Port' */ /* SignalConversion generated from: '/rise per minute' incorporates: * DataStoreRead: '/Data Store Read' */ u_i(rtDW.LEVEL, &Gain1); /* End of Outputs for SubSystem: '/обычный режим повышения' */ } /* End of If: '/If' */ /* End of Outputs for SubSystem: '/обычный режим' */ } /* End of If: '/If1' */ /* Sum: '/Add' incorporates: * DataStoreRead: '/Read Amb' * DataStoreWrite: '/Data Store Write3' */ rtb_Bias5 = (int16_t)(rtDW.Incar_FR - rtDW.Temp_FR_store); /* Abs: '/Abs' */ if (rtb_Bias5 < 0) { rtb_Bias5 = (int16_t)-rtb_Bias5; } /* Switch: '/Switch1' incorporates: * Abs: '/Abs' * Constant: '/epsilon' * DataStoreRead: '/Read Amb' * DataStoreWrite: '/Data Store Write3' * RelationalOperator: '/AMBraw > AMB' * RelationalOperator: '/Relational Operator' * Switch: '/Switch' */ if (rtb_Bias5 <= 0.01) { /* SignalConversion generated from: '/temp_out' incorporates: * DataStoreRead: '/Read Amb' */ rtb_Bias5 = rtDW.Temp_FR_store; } else { if (rtDW.Incar_FR > rtDW.Temp_FR_store) { /* Switch: '/Switch' incorporates: * DataTypeConversion: '/Data Type Conversion' */ rtb_FLU_tg_correct_g = (int16_t)Gain; } else { /* Switch: '/Switch' incorporates: * DataTypeConversion: '/Data Type Conversion' * UnaryMinus: '/Unary Minus' */ rtb_FLU_tg_correct_g = (int16_t)-(int16_t)Gain1; } /* SignalConversion generated from: '/temp_out' incorporates: * Constant: '/Constant' * DataStoreRead: '/Read Amb' * DataStoreRead: '/Data Store Read12' * Product: '/Divide' * Product: '/Product' * Sum: '/Add' * Sum: '/Subtract' * Switch: '/Switch' * UnitDelay: '/Unit Delay' */ rtb_Bias5 = (int16_t)((int16_t)((uint16_t)((rtDW.t_now - rtDW.UnitDelay_DSTATE_b) / 60000U) * rtb_FLU_tg_correct_g) + rtDW.Temp_FR_store); } /* End of Switch: '/Switch1' */ /* Update for UnitDelay: '/Unit Delay' incorporates: * DataStoreRead: '/Data Store Read12' */ rtDW.UnitDelay_DSTATE_b = rtDW.t_now; /* End of Outputs for SubSystem: '/Фильтрация FR температуры' */ } /* End of If: '/If1' */ /* DataStoreWrite: '/Write new FR' */ rtDW.Temp_FR_store = rtb_Bias5; /* If: '/If' incorporates: * DataStoreRead: '/Data Store Read' * If: '/If1' * RelationalOperator: '/Relational Operator1' * UnitDelay: '/Unit Delay' */ if (rtDW.UnitDelay_DSTATE_my == -9999) { /* Outputs for IfAction SubSystem: '/Инициализация RL' incorporates: * ActionPort: '/Action Port' */ /* SignalConversion generated from: '/temp_in' incorporates: * DataStoreWrite: '/Data Store Write' * DataStoreWrite: '/Data Store Write4' */ rtDW.Temp_RL_store = rtDW.Incar_RL; /* SignalConversion generated from: '/temp_out' incorporates: * DataStoreWrite: '/Data Store Write' */ rtb_Bias5 = rtDW.Temp_RL_store; /* End of Outputs for SubSystem: '/Инициализация RL' */ } else { /* Outputs for IfAction SubSystem: '/Фильтрация RL температуры' incorporates: * ActionPort: '/Action Port' */ if (rtDW.KEEP_RISING_RL_UNTIL_LIMIT > 0.0) { /* Outputs for IfAction SubSystem: '/включен ускоренный режим' incorporates: * ActionPort: '/Action Port' */ /* If: '/If1' incorporates: * Abs: '/ABS(AMBraw - AMB)' * DataStoreRead: '/Read Amb' * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write4' * If: '/If' * MATLAB Function: '/g_ausINCARRATE_RISING_DIFF_R[8]' * RelationalOperator: '/Relational Operator' * Sum: '/Add' */ g_ausINCARRATE_RISING_DIFF_R8(&Gain); rtb_Bias5 = (int16_t)(rtDW.Incar_RL - rtDW.Temp_RL_store); if (rtb_Bias5 < 0) { rtb_Bias5 = (int16_t)-rtb_Bias5; } if (rtb_Bias5 <= Gain) { /* Outputs for IfAction SubSystem: '/Отключаем ускоренный режим' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.KEEP_RISING_RL_UNTIL_LIMIT = 0.0; /* SignalConversion generated from: '/out' incorporates: * DataStoreRead: '/Data Store Read' * MATLAB Function: '/обычное повышение темп.' */ u_j(rtDW.LEVEL, &Gain); /* End of Outputs for SubSystem: '/Отключаем ускоренный режим' */ } else { /* Outputs for IfAction SubSystem: '/Продолжаем в ускоренном' incorporates: * ActionPort: '/Action Port' */ u_jk(rtDW.LEVEL, &Gain); /* End of Outputs for SubSystem: '/Продолжаем в ускоренном' */ } /* End of Outputs for SubSystem: '/включен ускоренный режим' */ } else { /* Outputs for IfAction SubSystem: '/обычный режим' incorporates: * ActionPort: '/Action Port' */ /* If: '/If1' incorporates: * Abs: '/ABS(AMBraw - AMB)' * DataStoreRead: '/Read Amb' * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write4' * If: '/If' * MATLAB Function: '/INCARRATE_RISING_DIFF_R[7]' * RelationalOperator: '/Relational Operator' * Sum: '/Add' */ INCARRATE_RISING_DIFF_R7(&Gain); rtb_Bias5 = (int16_t)(rtDW.Incar_RL - rtDW.Temp_RL_store); if (rtb_Bias5 < 0) { rtb_Bias5 = (int16_t)-rtb_Bias5; } if (rtb_Bias5 > Gain) { /* Outputs for IfAction SubSystem: '/включаем ускоренный режим' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.KEEP_RISING_RL_UNTIL_LIMIT = 1.0; /* SignalConversion generated from: '/out' incorporates: * DataStoreRead: '/Data Store Read' * MATLAB Function: '/ускоренное повышение темп.' */ u_d(rtDW.LEVEL, &Gain); /* End of Outputs for SubSystem: '/включаем ускоренный режим' */ } else { /* Outputs for IfAction SubSystem: '/обычный режим повышения' incorporates: * ActionPort: '/Action Port' */ u_ew(rtDW.LEVEL, &Gain); /* End of Outputs for SubSystem: '/обычный режим повышения' */ } /* End of Outputs for SubSystem: '/обычный режим' */ } /* If: '/If1' incorporates: * DataStoreRead: '/Data Store Read' */ if (rtDW.KEEP_FALLING_RL_UNTIL_LIMIT > 0.0) { /* Outputs for IfAction SubSystem: '/включен ускоренный режим' incorporates: * ActionPort: '/Action Port' */ /* MATLAB Function: '/AMBRATE_RISING_DIFF[8]' */ AMBRATE_RISING_DIFF8_m(&Gain1); /* Sum: '/Add' incorporates: * DataStoreRead: '/Read temp' * DataStoreWrite: '/Data Store Write4' */ rtb_Bias5 = (int16_t)(rtDW.Incar_RL - rtDW.Temp_RL_store); /* Abs: '/ABS(AMBraw - AMB)' */ if (rtb_Bias5 < 0) { rtb_Bias5 = (int16_t)-rtb_Bias5; } /* If: '/If' incorporates: * Abs: '/ABS(AMBraw - AMB)' * RelationalOperator: '/Relational Operator' */ if (rtb_Bias5 <= Gain1) { /* Outputs for IfAction SubSystem: '/Отключаем ускоренный режим' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.KEEP_FALLING_RL_UNTIL_LIMIT = 0.0; /* SignalConversion generated from: '/out' incorporates: * DataStoreRead: '/Data Store Read' * MATLAB Function: '/обычное понижение темп.' */ u_a(rtDW.LEVEL, &Gain1); /* End of Outputs for SubSystem: '/Отключаем ускоренный режим' */ } else { /* Outputs for IfAction SubSystem: '/Продолжаем в ускоренном' incorporates: * ActionPort: '/Action Port' */ /* SignalConversion generated from: '/out' incorporates: * DataStoreRead: '/Data Store Read' */ u_g(rtDW.LEVEL, &Gain1); /* End of Outputs for SubSystem: '/Продолжаем в ускоренном' */ } /* End of If: '/If' */ /* End of Outputs for SubSystem: '/включен ускоренный режим' */ } else { /* Outputs for IfAction SubSystem: '/обычный режим' incorporates: * ActionPort: '/Action Port' */ /* MATLAB Function: '/AMBRATE_FALLING_DIFF[7]' */ AMBRATE_FALLING_DIFF7_a(&Gain1); /* Sum: '/Add' incorporates: * DataStoreRead: '/Read Amb' * DataStoreWrite: '/Data Store Write4' */ rtb_Bias5 = (int16_t)(rtDW.Incar_RL - rtDW.Temp_RL_store); /* Abs: '/ABS(AMBraw - AMB)' */ if (rtb_Bias5 < 0) { rtb_Bias5 = (int16_t)-rtb_Bias5; } /* If: '/If' incorporates: * Abs: '/ABS(AMBraw - AMB)' * RelationalOperator: '/Relational Operator' */ if (rtb_Bias5 > Gain1) { /* Outputs for IfAction SubSystem: '/включаем ускоренный режим' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.KEEP_FALLING_RL_UNTIL_LIMIT = 1.0; /* SignalConversion generated from: '/rise per minute' incorporates: * DataStoreRead: '/Data Store Read' * MATLAB Function: '/ускоренное повышение темп.' */ u_l(rtDW.LEVEL, &Gain1); /* End of Outputs for SubSystem: '/включаем ускоренный режим' */ } else { /* Outputs for IfAction SubSystem: '/обычный режим повышения' incorporates: * ActionPort: '/Action Port' */ /* SignalConversion generated from: '/rise per minute' incorporates: * DataStoreRead: '/Data Store Read' */ u_b(rtDW.LEVEL, &Gain1); /* End of Outputs for SubSystem: '/обычный режим повышения' */ } /* End of If: '/If' */ /* End of Outputs for SubSystem: '/обычный режим' */ } /* End of If: '/If1' */ /* Sum: '/Add' incorporates: * DataStoreRead: '/Read Amb' * DataStoreWrite: '/Data Store Write4' */ rtb_Bias5 = (int16_t)(rtDW.Incar_RL - rtDW.Temp_RL_store); /* Abs: '/Abs' */ if (rtb_Bias5 < 0) { rtb_Bias5 = (int16_t)-rtb_Bias5; } /* Switch: '/Switch1' incorporates: * Abs: '/Abs' * Constant: '/epsilon' * DataStoreRead: '/Read Amb' * DataStoreWrite: '/Data Store Write4' * RelationalOperator: '/AMBraw > AMB' * RelationalOperator: '/Relational Operator' * Switch: '/Switch' */ if (rtb_Bias5 <= 0.01) { /* SignalConversion generated from: '/temp_out' incorporates: * DataStoreRead: '/Read Amb' */ rtb_Bias5 = rtDW.Temp_RL_store; } else { if (rtDW.Incar_RL > rtDW.Temp_RL_store) { /* Switch: '/Switch' incorporates: * DataTypeConversion: '/Data Type Conversion' */ rtb_FLU_tg_correct_g = (int16_t)Gain; } else { /* Switch: '/Switch' incorporates: * DataTypeConversion: '/Data Type Conversion' * UnaryMinus: '/Unary Minus' */ rtb_FLU_tg_correct_g = (int16_t)-(int16_t)Gain1; } /* SignalConversion generated from: '/temp_out' incorporates: * Constant: '/Constant' * DataStoreRead: '/Read Amb' * DataStoreRead: '/Data Store Read12' * Product: '/Divide' * Product: '/Product' * Sum: '/Add' * Sum: '/Subtract' * Switch: '/Switch' * UnitDelay: '/Unit Delay' */ rtb_Bias5 = (int16_t)((int16_t)((uint16_t)((rtDW.t_now - rtDW.UnitDelay_DSTATE_a) / 60000U) * rtb_FLU_tg_correct_g) + rtDW.Temp_RL_store); } /* End of Switch: '/Switch1' */ /* Update for UnitDelay: '/Unit Delay' incorporates: * DataStoreRead: '/Data Store Read12' */ rtDW.UnitDelay_DSTATE_a = rtDW.t_now; /* End of Outputs for SubSystem: '/Фильтрация RL температуры' */ } /* End of If: '/If' */ /* DataStoreWrite: '/Write new RL' */ rtDW.Temp_RL_store = rtb_Bias5; /* If: '/If' incorporates: * DataStoreRead: '/Data Store Read' * If: '/If1' * RelationalOperator: '/Relational Operator1' * UnitDelay: '/Unit Delay' */ if (rtDW.UnitDelay_DSTATE_lt == -9999) { /* Outputs for IfAction SubSystem: '/Инициализация RR' incorporates: * ActionPort: '/Action Port' */ /* SignalConversion generated from: '/temp_in' incorporates: * DataStoreWrite: '/Data Store Write' * DataStoreWrite: '/Data Store Write5' */ rtDW.Temp_RR_store = rtDW.Incar_RR; /* SignalConversion generated from: '/temp_out' incorporates: * DataStoreWrite: '/Data Store Write' */ rtb_Bias5 = rtDW.Temp_RR_store; /* End of Outputs for SubSystem: '/Инициализация RR' */ } else { /* Outputs for IfAction SubSystem: '/Фильтрация RR температуры' incorporates: * ActionPort: '/Action Port' */ if (rtDW.KEEP_RISING_RR_UNTIL_LIMIT > 0.0) { /* Outputs for IfAction SubSystem: '/включен ускоренный режим' incorporates: * ActionPort: '/Action Port' */ /* If: '/If1' incorporates: * Abs: '/ABS(AMBraw - AMB)' * DataStoreRead: '/Read Amb' * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write5' * If: '/If' * MATLAB Function: '/g_ausINCARRATE_RISING_DIFF_R[8]' * RelationalOperator: '/Relational Operator' * Sum: '/Add' */ g_ausINCARRATE_RISING_DIFF_R8(&Gain); rtb_Bias5 = (int16_t)(rtDW.Incar_RR - rtDW.Temp_RR_store); if (rtb_Bias5 < 0) { rtb_Bias5 = (int16_t)-rtb_Bias5; } if (rtb_Bias5 <= Gain) { /* Outputs for IfAction SubSystem: '/Отключаем ускоренный режим' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.KEEP_RISING_RR_UNTIL_LIMIT = 0.0; /* SignalConversion generated from: '/out' incorporates: * DataStoreRead: '/Data Store Read' * MATLAB Function: '/обычное повышение темп.' */ u_j(rtDW.LEVEL, &Gain); /* End of Outputs for SubSystem: '/Отключаем ускоренный режим' */ } else { /* Outputs for IfAction SubSystem: '/Продолжаем в ускоренном' incorporates: * ActionPort: '/Action Port' */ u_jk(rtDW.LEVEL, &Gain); /* End of Outputs for SubSystem: '/Продолжаем в ускоренном' */ } /* End of Outputs for SubSystem: '/включен ускоренный режим' */ } else { /* Outputs for IfAction SubSystem: '/обычный режим' incorporates: * ActionPort: '/Action Port' */ /* If: '/If1' incorporates: * Abs: '/ABS(AMBraw - AMB)' * DataStoreRead: '/Read Amb' * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write5' * If: '/If' * MATLAB Function: '/INCARRATE_RISING_DIFF_R[7]' * RelationalOperator: '/Relational Operator' * Sum: '/Add' */ INCARRATE_RISING_DIFF_R7(&Gain); rtb_Bias5 = (int16_t)(rtDW.Incar_RR - rtDW.Temp_RR_store); if (rtb_Bias5 < 0) { rtb_Bias5 = (int16_t)-rtb_Bias5; } if (rtb_Bias5 > Gain) { /* Outputs for IfAction SubSystem: '/включаем ускоренный режим' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.KEEP_RISING_RR_UNTIL_LIMIT = 1.0; /* SignalConversion generated from: '/out' incorporates: * DataStoreRead: '/Data Store Read' * MATLAB Function: '/ускоренное повышение темп.' */ u_d(rtDW.LEVEL, &Gain); /* End of Outputs for SubSystem: '/включаем ускоренный режим' */ } else { /* Outputs for IfAction SubSystem: '/обычный режим повышения' incorporates: * ActionPort: '/Action Port' */ u_ew(rtDW.LEVEL, &Gain); /* End of Outputs for SubSystem: '/обычный режим повышения' */ } /* End of Outputs for SubSystem: '/обычный режим' */ } /* If: '/If1' incorporates: * DataStoreRead: '/Data Store Read' */ if (rtDW.KEEP_FALLING_RR_UNTIL_LIMIT > 0.0) { /* Outputs for IfAction SubSystem: '/включен ускоренный режим' incorporates: * ActionPort: '/Action Port' */ /* MATLAB Function: '/AMBRATE_RISING_DIFF[8]' */ AMBRATE_RISING_DIFF8_m(&Gain1); /* Sum: '/Add' incorporates: * DataStoreRead: '/Read temp' * DataStoreWrite: '/Data Store Write5' */ rtb_Bias5 = (int16_t)(rtDW.Incar_RR - rtDW.Temp_RR_store); /* Abs: '/ABS(AMBraw - AMB)' */ if (rtb_Bias5 < 0) { rtb_Bias5 = (int16_t)-rtb_Bias5; } /* If: '/If' incorporates: * Abs: '/ABS(AMBraw - AMB)' * RelationalOperator: '/Relational Operator' */ if (rtb_Bias5 <= Gain1) { /* Outputs for IfAction SubSystem: '/Отключаем ускоренный режим' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.KEEP_FALLING_RR_UNTIL_LIMIT = 0.0; /* SignalConversion generated from: '/out' incorporates: * DataStoreRead: '/Data Store Read' * MATLAB Function: '/обычное понижение темп.' */ u_a(rtDW.LEVEL, &Gain1); /* End of Outputs for SubSystem: '/Отключаем ускоренный режим' */ } else { /* Outputs for IfAction SubSystem: '/Продолжаем в ускоренном' incorporates: * ActionPort: '/Action Port' */ /* SignalConversion generated from: '/out' incorporates: * DataStoreRead: '/Data Store Read' */ u_g(rtDW.LEVEL, &Gain1); /* End of Outputs for SubSystem: '/Продолжаем в ускоренном' */ } /* End of If: '/If' */ /* End of Outputs for SubSystem: '/включен ускоренный режим' */ } else { /* Outputs for IfAction SubSystem: '/обычный режим' incorporates: * ActionPort: '/Action Port' */ /* MATLAB Function: '/AMBRATE_FALLING_DIFF[7]' */ AMBRATE_FALLING_DIFF7_a(&Gain1); /* Sum: '/Add' incorporates: * DataStoreRead: '/Read Amb' * DataStoreWrite: '/Data Store Write5' */ rtb_Bias5 = (int16_t)(rtDW.Incar_RR - rtDW.Temp_RR_store); /* Abs: '/ABS(AMBraw - AMB)' */ if (rtb_Bias5 < 0) { rtb_Bias5 = (int16_t)-rtb_Bias5; } /* If: '/If' incorporates: * Abs: '/ABS(AMBraw - AMB)' * RelationalOperator: '/Relational Operator' */ if (rtb_Bias5 > Gain1) { /* Outputs for IfAction SubSystem: '/включаем ускоренный режим' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.KEEP_FALLING_RR_UNTIL_LIMIT = 1.0; /* SignalConversion generated from: '/rise per minute' incorporates: * DataStoreRead: '/Data Store Read' * MATLAB Function: '/ускоренное повышение темп.' */ u_l(rtDW.LEVEL, &Gain1); /* End of Outputs for SubSystem: '/включаем ускоренный режим' */ } else { /* Outputs for IfAction SubSystem: '/обычный режим повышения' incorporates: * ActionPort: '/Action Port' */ /* SignalConversion generated from: '/rise per minute' incorporates: * DataStoreRead: '/Data Store Read' */ u_b(rtDW.LEVEL, &Gain1); /* End of Outputs for SubSystem: '/обычный режим повышения' */ } /* End of If: '/If' */ /* End of Outputs for SubSystem: '/обычный режим' */ } /* End of If: '/If1' */ /* Sum: '/Add' incorporates: * DataStoreRead: '/Read Amb' * DataStoreWrite: '/Data Store Write5' */ rtb_Bias5 = (int16_t)(rtDW.Incar_RR - rtDW.Temp_RR_store); /* Abs: '/Abs' */ if (rtb_Bias5 < 0) { rtb_Bias5 = (int16_t)-rtb_Bias5; } /* Switch: '/Switch1' incorporates: * Abs: '/Abs' * Constant: '/epsilon' * DataStoreRead: '/Read Amb' * DataStoreWrite: '/Data Store Write5' * RelationalOperator: '/AMBraw > AMB' * RelationalOperator: '/Relational Operator' * Switch: '/Switch' */ if (rtb_Bias5 <= 0.01) { /* SignalConversion generated from: '/temp_out' incorporates: * DataStoreRead: '/Read Amb' */ rtb_Bias5 = rtDW.Temp_RR_store; } else { if (rtDW.Incar_RR > rtDW.Temp_RR_store) { /* Switch: '/Switch' incorporates: * DataTypeConversion: '/Data Type Conversion' */ rtb_FLU_tg_correct_g = (int16_t)Gain; } else { /* Switch: '/Switch' incorporates: * DataTypeConversion: '/Data Type Conversion' * UnaryMinus: '/Unary Minus' */ rtb_FLU_tg_correct_g = (int16_t)-(int16_t)Gain1; } /* SignalConversion generated from: '/temp_out' incorporates: * Constant: '/Constant' * DataStoreRead: '/Read Amb' * DataStoreRead: '/Data Store Read12' * Product: '/Divide' * Product: '/Product' * Sum: '/Add' * Sum: '/Subtract' * Switch: '/Switch' * UnitDelay: '/Unit Delay' */ rtb_Bias5 = (int16_t)((int16_t)((uint16_t)((rtDW.t_now - rtDW.UnitDelay_DSTATE_n) / 60000U) * rtb_FLU_tg_correct_g) + rtDW.Temp_RR_store); } /* End of Switch: '/Switch1' */ /* Update for UnitDelay: '/Unit Delay' incorporates: * DataStoreRead: '/Data Store Read12' */ rtDW.UnitDelay_DSTATE_n = rtDW.t_now; /* End of Outputs for SubSystem: '/Фильтрация RR температуры' */ } /* End of If: '/If' */ /* DataStoreWrite: '/Write new RR' */ rtDW.Temp_RR_store = rtb_Bias5; /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.LOGGER_ACP = 0.0; /* Product: '/Divide1' incorporates: * Constant: '/Constant' * Constant: '/Constant1' * DataStoreRead: '/Data Store Read1' * Product: '/Divide' */ rtb_u8Vtg_FX_plus = (double) rtDW.ADC_Data_Model.BTS5120_2EKA_ShutoffValvePowerTXV1 / 4095.0 * 5.0; /* MATLAB Function: '/Write' incorporates: * Constant: '/Constant2' * Constant: '/Constant3' * DataStoreRead: '/Data Store Read' * Product: '/Divide2' * Product: '/Divide3' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('BTS5120_2EKA_ShutoffValvePowerTXV1 V = %f Iout = %f\n',U,I); */ printf("BTS5120_2EKA_ShutoffValvePowerTXV1 V = %f Iout = %f\n", rtb_u8Vtg_FX_plus, rtb_u8Vtg_FX_plus / 1200.0 * 550.0); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* Product: '/Divide1' incorporates: * Constant: '/Constant' * Constant: '/Constant1' * DataStoreRead: '/Data Store Read1' * Product: '/Divide' */ rtb_u8Vtg_FX_plus = (double) rtDW.ADC_Data_Model.BTS5120_2EKA_ShutoffValvePowerTXV2 / 4095.0 * 5.0; /* MATLAB Function: '/Write' incorporates: * Constant: '/Constant2' * Constant: '/Constant3' * DataStoreRead: '/Data Store Read' * Product: '/Divide2' * Product: '/Divide3' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('BTS5120_2EKA_ShutoffValvePowerTXV2 V = %f Iout = %f\n',U,I); */ printf("BTS5120_2EKA_ShutoffValvePowerTXV2 V = %f Iout = %f\n", rtb_u8Vtg_FX_plus, rtb_u8Vtg_FX_plus / 1200.0 * 550.0); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* Product: '/Divide1' incorporates: * Constant: '/Constant' * Constant: '/Constant1' * DataStoreRead: '/Data Store Read1' * Product: '/Divide' */ rtb_u8Vtg_FX_plus = (double)rtDW.ADC_Data_Model.BTS5180_2EKA_ChannelPTCPower1 / 4095.0 * 5.0; /* MATLAB Function: '/Write' incorporates: * Constant: '/Constant2' * Constant: '/Constant3' * DataStoreRead: '/Data Store Read' * Product: '/Divide2' * Product: '/Divide3' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('BTS5180_2EKA_ChannelPTCPower1 V = %f Iout = %f\n',U,I); */ printf("BTS5180_2EKA_ChannelPTCPower1 V = %f Iout = %f\n", rtb_u8Vtg_FX_plus, rtb_u8Vtg_FX_plus / 1200.0 * 550.0); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* Product: '/Divide1' incorporates: * Constant: '/Constant' * Constant: '/Constant1' * DataStoreRead: '/Data Store Read1' * Product: '/Divide' */ rtb_u8Vtg_FX_plus = (double)rtDW.ADC_Data_Model.BTS5180_2EKA_ChannelPTCPower2 / 4095.0 * 5.0; /* MATLAB Function: '/Write' incorporates: * Constant: '/Constant2' * Constant: '/Constant3' * DataStoreRead: '/Data Store Read' * Product: '/Divide2' * Product: '/Divide3' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('BTS5180_2EKA_ChannelPTCPower2 V = %f Iout = %f\n',U,I); */ printf("BTS5180_2EKA_ChannelPTCPower2 V = %f Iout = %f\n", rtb_u8Vtg_FX_plus, rtb_u8Vtg_FX_plus / 1200.0 * 550.0); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* Product: '/Divide1' incorporates: * Constant: '/Constant' * Constant: '/Constant1' * DataStoreRead: '/Data Store Read1' * Product: '/Divide' */ rtb_u8Vtg_FX_plus = (double)rtDW.ADC_Data_Model.BTS5180_2EKA_FrontIncarMotor / 4095.0 * 5.0; /* MATLAB Function: '/Write' incorporates: * Constant: '/Constant2' * Constant: '/Constant3' * DataStoreRead: '/Data Store Read' * Product: '/Divide2' * Product: '/Divide3' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('BTS5180_2EKA_FrontIncarMotor V = %f Iout = %f\n',U,I); */ printf("BTS5180_2EKA_FrontIncarMotor V = %f Iout = %f\n", rtb_u8Vtg_FX_plus, rtb_u8Vtg_FX_plus / 1200.0 * 550.0); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* Product: '/Divide1' incorporates: * Constant: '/Constant' * Constant: '/Constant1' * DataStoreRead: '/Data Store Read1' * Product: '/Divide' */ rtb_u8Vtg_FX_plus = (double)rtDW.ADC_Data_Model.BTS5180_2EKA_RearIncarMotor / 4095.0 * 5.0; /* MATLAB Function: '/Write' incorporates: * Constant: '/Constant2' * Constant: '/Constant3' * DataStoreRead: '/Data Store Read' * Product: '/Divide2' * Product: '/Divide3' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('BTS5180_2EKA_RearIncarMotor V = %f Iout = %f\n',U,I); */ printf("BTS5180_2EKA_RearIncarMotor V = %f Iout = %f\n", rtb_u8Vtg_FX_plus, rtb_u8Vtg_FX_plus / 1200.0 * 550.0); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* Product: '/Divide1' incorporates: * Constant: '/Constant' * Constant: '/Constant1' * DataStoreRead: '/Data Store Read1' * Product: '/Divide' */ rtb_u8Vtg_FX_plus = (double) rtDW.ADC_Data_Model.BTS5180_2EKA_ReservePowerSupply / 4095.0 * 5.0; /* MATLAB Function: '/Write' incorporates: * Constant: '/Constant2' * Constant: '/Constant3' * DataStoreRead: '/Data Store Read' * Product: '/Divide2' * Product: '/Divide3' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('BTS5180_2EKA_ReservePowerSupply V = %f Iout = %f\n',U,I); */ printf("BTS5180_2EKA_ReservePowerSupply V = %f Iout = %f\n", rtb_u8Vtg_FX_plus, rtb_u8Vtg_FX_plus / 1200.0 * 550.0); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* Product: '/Divide1' incorporates: * Constant: '/Constant' * Constant: '/Constant1' * DataStoreRead: '/Data Store Read1' * Product: '/Divide' */ rtb_u8Vtg_FX_plus = (double)rtDW.ADC_Data_Model.BTS5180_2EKA_ShutOFFValveFront / 4095.0 * 5.0; /* MATLAB Function: '/Write' incorporates: * Constant: '/Constant2' * Constant: '/Constant3' * DataStoreRead: '/Data Store Read' * Product: '/Divide2' * Product: '/Divide3' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('BTS5180_2EKA_ShutOFFValveFront V = %f Iout = %f\n',U,I); */ printf("BTS5180_2EKA_ShutOFFValveFront V = %f Iout = %f\n", rtb_u8Vtg_FX_plus, rtb_u8Vtg_FX_plus / 1200.0 * 550.0); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* Product: '/Divide1' incorporates: * Constant: '/Constant' * Constant: '/Constant1' * DataStoreRead: '/Data Store Read1' * Product: '/Divide' */ rtb_u8Vtg_FX_plus = (double)rtDW.ADC_Data_Model.BTS5180_2EKA_ShutOFFValveRear / 4095.0 * 5.0; /* MATLAB Function: '/Write' incorporates: * Constant: '/Constant2' * Constant: '/Constant3' * DataStoreRead: '/Data Store Read' * Product: '/Divide2' * Product: '/Divide3' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('BTS5180_2EKA_ShutOFFValveRear V = %f Iout = %f\n',U,I); */ printf("BTS5180_2EKA_ShutOFFValveRear V = %f Iout = %f\n", rtb_u8Vtg_FX_plus, rtb_u8Vtg_FX_plus / 1200.0 * 550.0); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* Product: '/Divide1' incorporates: * Constant: '/Constant' * Constant: '/Constant1' * DataStoreRead: '/Data Store Read1' * Product: '/Divide' */ rtb_u8Vtg_FX_plus = (double)rtDW.ADC_Data_Model.BTS5180_2EKA_TwoWayValve / 4095.0 * 5.0; /* MATLAB Function: '/Write' incorporates: * Constant: '/Constant2' * Constant: '/Constant3' * DataStoreRead: '/Data Store Read' * Product: '/Divide2' * Product: '/Divide3' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('BTS5180_2EKA_TwoWayValve V = %f Iout = %f\n',U,I); */ printf("BTS5180_2EKA_TwoWayValve V = %f Iout = %f\n", rtb_u8Vtg_FX_plus, rtb_u8Vtg_FX_plus / 1200.0 * 550.0); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* MATLAB Function: '/Write' incorporates: * Constant: '/Constant' * Constant: '/Constant1' * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read' * Product: '/Divide' * Product: '/Divide1' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('IGN_ANS = %f V\n',data); */ printf("IGN_ANS = %f V\n", (double)rtDW.ADC_Data_Model.IGN_ANS / 4095.0 * 27.75); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* MATLAB Function: '/Write' incorporates: * Constant: '/Constant' * Constant: '/Constant1' * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read' * Product: '/Divide' * Product: '/Divide1' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('PBATT_CHECK V = %f\n',U); */ printf("PBATT_CHECK V = %f\n", (double)rtDW.ADC_Data_Model.PBATT_CHECK / 4095.0 * 33.4375); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* MATLAB Function: '/Write' incorporates: * Constant: '/Constant' * Constant: '/Constant1' * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read' * Product: '/Divide' * Product: '/Divide1' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('Pressure_DIAG V = %f\n',U); */ printf("Pressure_DIAG V = %f\n", (double)rtDW.ADC_Data_Model.Pressure_DIAG / 4095.0 * 6.0638); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* MATLAB Function: '/Write' incorporates: * Constant: '/Constant' * Constant: '/Constant1' * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read' * Product: '/Divide' * Product: '/Divide1' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('Reserve_Sensor_Duct_Temp_1 V = %f\n',U); */ printf("Reserve_Sensor_Duct_Temp_1 V = %f\n", (double) rtDW.ADC_Data_Model.Reserve_Sensor_Duct_Temp_1 / 4095.0 * 5.0); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* MATLAB Function: '/Write' incorporates: * Constant: '/Constant' * Constant: '/Constant1' * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read' * Product: '/Divide' * Product: '/Divide1' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('Reserve_Sensor_Duct_Temp_2 V = %f\n',U); */ printf("Reserve_Sensor_Duct_Temp_2 V = %f\n", (double) rtDW.ADC_Data_Model.Reserve_Sensor_Duct_Temp_2 / 4095.0 * 5.0); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* MATLAB Function: '/Write' incorporates: * Constant: '/Constant' * Constant: '/Constant1' * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read' * Product: '/Divide' * Product: '/Divide1' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('Sensor_Front_Duct5 V = %f\n',U); */ printf("Sensor_Front_Duct5 V = %f\n", (double) rtDW.ADC_Data_Model.Sensor_Rear_Duct5 / 4095.0 * 5.0); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* MATLAB Function: '/Write' incorporates: * Constant: '/Constant' * Constant: '/Constant1' * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read' * Product: '/Divide' * Product: '/Divide1' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('Sensor_Front_Duct V = %f\n',U); */ printf("Sensor_Front_Duct V = %f\n", (double) rtDW.ADC_Data_Model.Sensor_Rear_Duct6 / 4095.0 * 5.0); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* MATLAB Function: '/Write' incorporates: * Constant: '/Constant' * Constant: '/Constant1' * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read' * Product: '/Divide' * Product: '/Divide1' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('VN7008AJ_DIAG_FrontLINActuatorPowerDriverAB V = %f\n',U); */ printf("VN7008AJ_DIAG_FrontLINActuatorPowerDriverAB V = %f\n", (double) rtDW.ADC_Data_Model.VN7008AJ_DIAG_FrontLINActuatorPowerDriverAB / 4095.0 * 17.5); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* MATLAB Function: '/Write' incorporates: * Constant: '/Constant' * Constant: '/Constant1' * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read' * Product: '/Divide' * Product: '/Divide1' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('VN7008AJ_DIAG_RearLINActuatorPowerDriverC V = %f\n',U); */ printf("VN7008AJ_DIAG_RearLINActuatorPowerDriverC V = %f\n", (double) rtDW.ADC_Data_Model.VN7008AJ_DIAG_RearLINActuatorPowerDriverC / 4095.0 * 17.5); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* Product: '/Divide1' incorporates: * Constant: '/Constant' * Constant: '/Constant1' * DataStoreRead: '/Data Store Read1' * Product: '/Divide' */ rtb_u8Vtg_FX_plus = (double) rtDW.ADC_Data_Model.VN7008AJ_FrontLINActuatorPowerDriverAB / 4095.0 * 5.0; /* MATLAB Function: '/Write' incorporates: * Constant: '/Constant2' * Constant: '/Constant3' * DataStoreRead: '/Data Store Read' * Product: '/Divide2' * Product: '/Divide3' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('VN7008AJ_FrontLINActuatorPowerDriverAB V = %f Iout = %f\n',U,I); */ printf("VN7008AJ_FrontLINActuatorPowerDriverAB V = %f Iout = %f\n", rtb_u8Vtg_FX_plus, rtb_u8Vtg_FX_plus / 2490.0 * 5890.0); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* Product: '/Divide1' incorporates: * Constant: '/Constant' * Constant: '/Constant1' * DataStoreRead: '/Data Store Read1' * Product: '/Divide' */ rtb_u8Vtg_FX_plus = (double) rtDW.ADC_Data_Model.VN7008AJ_RearLINActuatorPowerDriverC / 4095.0 * 5.0; /* MATLAB Function: '/Write' incorporates: * Constant: '/Constant2' * Constant: '/Constant3' * DataStoreRead: '/Data Store Read' * Product: '/Divide2' * Product: '/Divide3' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('VN7008AJ_RearLINActuatorPowerDriverC V = %f Iout = %f\n',U,I); */ printf("VN7008AJ_RearLINActuatorPowerDriverC V = %f Iout = %f\n", rtb_u8Vtg_FX_plus, rtb_u8Vtg_FX_plus / 2490.0 * 5890.0); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* MATLAB Function: '/Write' incorporates: * DataStoreRead: '/Data Store Read2' * DataStoreRead: '/Data Store Read3' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('ST_ReservePower = %u \n',data); */ printf("ST_ReservePower = %u \n", rtDW.ADC_Key_Data_Model.ST_ReservePower); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* MATLAB Function: '/Write1' incorporates: * DataStoreRead: '/Data Store Read2' * DataStoreRead: '/Data Store Read3' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('ST_BATTChiller = %u \n',data); */ printf("ST_BATTChiller = %u \n", rtDW.ADC_Key_Data_Model.ST_BATTChiller); fflush(stdout); } /* End of MATLAB Function: '/Write1' */ /* MATLAB Function: '/Write2' incorporates: * DataStoreRead: '/Data Store Read2' * DataStoreRead: '/Data Store Read3' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('EmergencyAirCleanSwitch = %u \n',data); */ printf("EmergencyAirCleanSwitch = %u \n", rtDW.ADC_Key_Data_Model.EmergencyAirCleanSwitch); fflush(stdout); } /* End of MATLAB Function: '/Write2' */ /* MATLAB Function: '/Write3' incorporates: * DataStoreRead: '/Data Store Read2' * DataStoreRead: '/Data Store Read3' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('FireExtinguishSwitch = %u \n',data); */ printf("FireExtinguishSwitch = %u \n", rtDW.ADC_Key_Data_Model.FireExtinguishSwitch); fflush(stdout); } /* End of MATLAB Function: '/Write3' */ /* MATLAB Function: '/Write4' incorporates: * DataStoreRead: '/Data Store Read2' * DataStoreRead: '/Data Store Read3' */ /* : if(LOGGER) */ if (rtDW.LOGGER_ACP != 0.0) { /* : fprintf('Ign_Wakeup = %u \n',data); */ printf("Ign_Wakeup = %u \n", rtDW.ADC_Key_Data_Model.Ign_Wakeup); fflush(stdout); } /* End of MATLAB Function: '/Write4' */ /* Chart: '/Zone_Climate_Logic_Auto_FL2' incorporates: * Constant: '/Constant' * DataStoreRead: '/Data Store Read' * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read2' * DataStoreRead: '/Data Store Read8' */ Zone_Climate_Logic_Auto_FL2(0.0, rtDW.CCU_FACE_RL, rtDW.CCU_FOOT_RL, rtDW.CCU_MODE_RL, rtDW.CCU_AC_REAR, &rtB.out_def_a, &rtB.out_face_p, &rtB.out_foot_e, &rtB.out_auto_c, &rtB.out_ac_h, &rtDW.sf_Zone_Climate_Logic_Auto_FL2); /* DataStoreWrite: '/Data Store Write1' */ rtDW.CCU_FACE_RL = rtB.out_face_p; /* DataStoreWrite: '/Data Store Write2' */ rtDW.CCU_FOOT_RL = rtB.out_foot_e; /* DataStoreWrite: '/Data Store Write3' */ rtDW.CCU_MODE_RL = rtB.out_auto_c; /* Chart: '/Zone_Climate_Logic_Auto_FL3' incorporates: * Constant: '/Constant1' * DataStoreRead: '/Data Store Read3' * DataStoreRead: '/Data Store Read4' * DataStoreRead: '/Data Store Read5' * DataStoreRead: '/Data Store Read9' */ Zone_Climate_Logic_Auto_FL2(0.0, rtDW.CCU_FACE_RR, rtDW.CCU_FOOT_RR, rtDW.CCU_MODE_RR, rtDW.CCU_AC_REAR, &rtB.out_def_m, &rtB.out_face_a, &rtB.out_foot_m, &rtB.out_auto_d, &rtB.out_ac_i, &rtDW.sf_Zone_Climate_Logic_Auto_FL3); /* DataStoreWrite: '/Data Store Write4' */ rtDW.CCU_FACE_RR = rtB.out_face_a; /* DataStoreWrite: '/Data Store Write5' */ rtDW.CCU_FOOT_RR = rtB.out_foot_m; /* DataStoreWrite: '/Data Store Write6' */ rtDW.CCU_MODE_RR = rtB.out_auto_d; /* DataTypeConversion: '/Data Type Conversion' incorporates: * DataStoreWrite: '/Data Store Write7' * Logic: '/Logical Operator1' */ rtDW.CCU_AC_REAR = (uint8_t)((rtB.out_ac_h != 0.0) || (rtB.out_ac_i != 0.0)); /* Chart: '/Zone_Climate_Logic_Auto_FL1' incorporates: * DataStoreRead: '/Data Store Read38' * DataStoreRead: '/Data Store Read39' * DataStoreRead: '/Data Store Read40' * DataStoreRead: '/Data Store Read41' * DataStoreRead: '/Data Store Read6' */ Zone_Climate_Logic_Auto_FL1(rtDW.CCU_DEF_FL, rtDW.CCU_FACE_FL, rtDW.CCU_FOOT_FL, rtDW.CCU_MODE_FL, rtDW.CCU_AC_FRONT, &rtB.out_def_i, &rtB.out_face_o, &rtB.out_foot_g, &rtB.out_auto_h, &rtB.out_ac_m, &rtDW.sf_Zone_Climate_Logic_Auto_FL1); /* Chart: '/Zone_Climate_Logic_Auto_FL4' incorporates: * DataStoreRead: '/Data Store Read42' * DataStoreRead: '/Data Store Read61' * DataStoreRead: '/Data Store Read62' * DataStoreRead: '/Data Store Read63' * DataStoreRead: '/Data Store Read7' */ Zone_Climate_Logic_Auto_FL1(rtDW.CCU_DEF_FR, rtDW.CCU_FACE_FR, rtDW.CCU_FOOT_FR, rtDW.CCU_MODE_FR, rtDW.CCU_AC_FRONT, &rtB.out_def, &rtB.out_face, &rtB.out_foot, &rtB.out_auto, &rtB.out_ac, &rtDW.sf_Zone_Climate_Logic_Auto_FL4); /* DataTypeConversion: '/Data Type Conversion1' incorporates: * DataStoreWrite: '/Data Store Write' * Logic: '/Logical Operator' */ rtDW.CCU_AC_FRONT = (uint8_t)((rtB.out_ac_m != 0.0) || (rtB.out_ac != 0.0)); /* DataStoreWrite: '/Data Store Write28' */ rtDW.CCU_FACE_FL = rtB.out_face_o; /* DataStoreWrite: '/Data Store Write29' */ rtDW.CCU_FOOT_FL = rtB.out_foot_g; /* DataStoreWrite: '/Data Store Write30' */ rtDW.CCU_MODE_FL = rtB.out_auto_h; /* DataStoreWrite: '/Data Store Write32' */ rtDW.CCU_FACE_FR = rtB.out_face; /* DataStoreWrite: '/Data Store Write33' */ rtDW.CCU_FOOT_FR = rtB.out_foot; /* DataStoreWrite: '/Data Store Write34' */ rtDW.CCU_MODE_FR = rtB.out_auto; /* DataStoreWrite: '/Data Store Write35' */ rtDW.CCU_DEF_FR = rtB.out_def; /* DataStoreWrite: '/Data Store Write37' */ rtDW.CCU_DEF_FL = rtB.out_def_i; /* Logic: '/Logical Operator' incorporates: * DataStoreRead: '/Data Store Read10' * DataStoreWrite: '/Data Store Write' */ rtDW.eCompChiller_Err = ((rtDW.HVC_ERR_STATUS_MSG_MODEL.HVC_CompComErr_Stat != 0) || (rtDW.HVC_ERR_STATUS_MSG_MODEL.HVC_CompTempSensErr_Stat != 0) || (rtDW.HVC_ERR_STATUS_MSG_MODEL.HVC_CompCurrSensErr_Stat != 0) || (rtDW.HVC_ERR_STATUS_MSG_MODEL.HVC_CompCurrShortCirc_Stat != 0) || (rtDW.HVC_ERR_STATUS_MSG_MODEL.HVC_CompInPowSupply_Stat != 0) || (rtDW.HVC_ERR_STATUS_MSG_MODEL.HVC_CompTorqueStallErr_Stat != 0) || (rtDW.HVC_ERR_STATUS_MSG_MODEL.HVC_CompVoltSensErr_Stat != 0)); /* Gain: '/Gain' incorporates: * DataStoreRead: '/Data Store Read10' * DataStoreWrite: '/Data Store Write' */ rtDW.eComp_InputC = (uint16_t) (rtDW.HVC_ERR_STATUS_MSG_MODEL.HVC_CompInputC_Val_ro << 7); /* Bias: '/Bias' incorporates: * DataStoreRead: '/Data Store Read10' * DataStoreWrite: '/Data Store Write' * DataTypeConversion: '/Data Type Conversion' */ rtDW.eComp_Temp = (int16_t) (rtDW.HVC_ERR_STATUS_MSG_MODEL.HVC_CompInvTemp_Val_ro - 50); /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' * DataStoreRead: '/Data Store Read11' */ rtb_Compare_p1p = (rtDW.TM_CP_model.CCPF_RecButton_Stat > 0); /* RelationalOperator: '/FixPt Relational Operator' incorporates: * UnitDelay: '/Delay Input1' * * Block description for '/Delay Input1': * * Store in Global RAM */ rtb_Compare_bu = ((int32_t)rtb_Compare_p1p > (int32_t)rtDW.DelayInput1_DSTATE); /* Chart: '/Full_Rec_Active' incorporates: * DataStoreWrite: '/Data Store Write9' */ if (rtDW.is_active_c836_HVAC_model == 0U) { rtDW.is_active_c836_HVAC_model = 1U; rtDW.is_c836_HVAC_model = IN_REC_OFF; /* : Full_Rec_Active = 0; */ rtDW.Full_Rec = 0U; } else if (rtDW.is_c836_HVAC_model == IN_REC_OFF) { rtDW.Full_Rec = 0U; /* : sf_internal_predicateOutput = Btn_Pulse==1; */ if (rtb_Compare_bu) { rtDW.is_c836_HVAC_model = IN_REC_ON; /* : Full_Rec_Active = 1; */ rtDW.Full_Rec = 1U; } } else { /* case IN_REC_ON: */ rtDW.Full_Rec = 1U; /* : sf_internal_predicateOutput = Btn_Pulse==1; */ if (rtb_Compare_bu) { rtDW.is_c836_HVAC_model = IN_REC_OFF; /* : Full_Rec_Active = 0; */ rtDW.Full_Rec = 0U; } } /* End of Chart: '/Full_Rec_Active' */ /* DataTypeConversion: '/Data Type Conversion1' incorporates: * Bias: '/Bias' * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write' * DataTypeConversion: '/Data Type Conversion' * Gain: '/Gain1' * Gain: '/Gain2' */ rtb_Bias5 = (int16_t)floor((0.01 * (double) rtDW.CCUCAN_BCM_Powertrain_model.BCM_AmbTempRaw_ro - 40.0) * 10.0); /* Outputs for Atomic SubSystem: '/Фильтрация температуры' */ /* Lookup_n-D: '/Get LVL for temp' incorporates: * DataStoreWrite: '/Data Store Write' * DataTypeConversion: '/Data Type Conversion1' */ rtb_FLU_tg_correct_g = rtConstP.pooled52[plook_u32s16_bincka(rtb_Bias5, rtConstP.GetLVLfortemp_bp01Data, 5U)]; /* If: '/If1' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write' */ if (rtDW.KEEP_RISING_UNTIL_LIMIT > 0.0) { /* Outputs for IfAction SubSystem: '/включен ускоренный режим' incorporates: * ActionPort: '/Action Port' */ u_hd(rtb_Bias5, rtb_FLU_tg_correct_g, &rtb_Merge_j, &rtDW.AMB_store, &rtDW.KEEP_RISING_UNTIL_LIMIT); /* End of Outputs for SubSystem: '/включен ускоренный режим' */ } else { /* Outputs for IfAction SubSystem: '/обычный режим' incorporates: * ActionPort: '/Action Port' */ u_a5(rtb_Bias5, rtb_FLU_tg_correct_g, &rtb_Merge_j, &rtDW.AMB_store, &rtDW.KEEP_RISING_UNTIL_LIMIT); /* End of Outputs for SubSystem: '/обычный режим' */ } /* End of If: '/If1' */ /* If: '/If1' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write' */ if (rtDW.KEEP_FALLING_UNTIL_LIMIT > 0.0) { /* Outputs for IfAction SubSystem: '/включен ускоренный режим' incorporates: * ActionPort: '/Action Port' */ u_de(rtb_Bias5, rtb_FLU_tg_correct_g, &rtb_Merge_hu, &rtDW.AMB_store, &rtDW.KEEP_FALLING_UNTIL_LIMIT); /* End of Outputs for SubSystem: '/включен ускоренный режим' */ } else { /* Outputs for IfAction SubSystem: '/обычный режим' incorporates: * ActionPort: '/Action Port' */ u_co(rtb_Bias5, rtb_FLU_tg_correct_g, &rtb_Merge_hu, &rtDW.AMB_store, &rtDW.KEEP_FALLING_UNTIL_LIMIT); /* End of Outputs for SubSystem: '/обычный режим' */ } /* End of If: '/If1' */ /* Sum: '/Subtract' incorporates: * DataStoreRead: '/Data Store Read15' * UnitDelay: '/Unit Delay' */ rtb_Subtract = rtDW.t_now - rtDW.UnitDelay_DSTATE; /* If: '/If' incorporates: * DataStoreRead: '/Data Store Read12' * DataStoreRead: '/Data Store Read' */ /* : f_g_ssAMBFILT_WATER = g_ssAMBFILT_WATER; */ if ((rtDW.VehicleSpeed > 45) && (rtDW.KEEP_UNTIL_SPEED_DROPS > 0)) { /* Outputs for IfAction SubSystem: '/Быстро из-за флага' incorporates: * ActionPort: '/Action Port' */ /* If: '/If1' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write' */ if (rtDW.KEEP_RISING_UNTIL_LIMIT > 0.0) { /* Outputs for IfAction SubSystem: '/включен ускоренный режим' incorporates: * ActionPort: '/Action Port' */ u_hd(rtb_Bias5, rtb_FLU_tg_correct_g, &rtb_Merge_g, &rtDW.AMB_store, &rtDW.KEEP_RISING_UNTIL_LIMIT); /* End of Outputs for SubSystem: '/включен ускоренный режим' */ } else { /* Outputs for IfAction SubSystem: '/обычный режим' incorporates: * ActionPort: '/Action Port' */ u_a5(rtb_Bias5, rtb_FLU_tg_correct_g, &rtb_Merge_g, &rtDW.AMB_store, &rtDW.KEEP_RISING_UNTIL_LIMIT); /* End of Outputs for SubSystem: '/обычный режим' */ } /* End of If: '/If1' */ /* If: '/If1' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write' */ if (rtDW.KEEP_FALLING_UNTIL_LIMIT > 0.0) { /* Outputs for IfAction SubSystem: '/включен ускоренный режим' incorporates: * ActionPort: '/Action Port' */ u_de(rtb_Bias5, rtb_FLU_tg_correct_g, &rtb_Merge_m2, &rtDW.AMB_store, &rtDW.KEEP_FALLING_UNTIL_LIMIT); /* End of Outputs for SubSystem: '/включен ускоренный режим' */ } else { /* Outputs for IfAction SubSystem: '/обычный режим' incorporates: * ActionPort: '/Action Port' */ u_co(rtb_Bias5, rtb_FLU_tg_correct_g, &rtb_Merge_m2, &rtDW.AMB_store, &rtDW.KEEP_FALLING_UNTIL_LIMIT); /* End of Outputs for SubSystem: '/обычный режим' */ } /* End of If: '/If1' */ /* Switch: '/Switch1' incorporates: * Abs: '/Abs' * Constant: '/epsilon' * DataStoreRead: '/Read Amb' * DataStoreWrite: '/Data Store Write' * RelationalOperator: '/AMBraw > AMB' * RelationalOperator: '/Relational Operator' * Sum: '/Add' * Switch: '/Switch' */ if (fabs((double)rtb_Bias5 - rtDW.AMB_store) <= 0.01) { /* SignalConversion generated from: '/AMB_new' */ rtb_u8Vtg_FX_plus = rtDW.AMB_store; } else { if (rtb_Bias5 > rtDW.AMB_store) { /* Switch: '/Switch' incorporates: * DataTypeConversion: '/Data Type Conversion' */ rtb_FLU_tg_correct_g = rtb_Merge_g; } else { /* Switch: '/Switch' incorporates: * DataTypeConversion: '/Data Type Conversion' * UnaryMinus: '/Unary Minus' */ rtb_FLU_tg_correct_g = (int16_t)-rtb_Merge_m2; } /* SignalConversion generated from: '/AMB_new' incorporates: * Constant: '/Constant' * Product: '/Divide' * Product: '/Product' * Sum: '/Add' * Switch: '/Switch' */ rtb_u8Vtg_FX_plus = (double)rtb_Subtract / 60000.0 * (double) rtb_FLU_tg_correct_g + rtDW.AMB_store; } /* End of Switch: '/Switch1' */ /* End of Outputs for SubSystem: '/Быстро из-за флага' */ } else if (rtDW.VehicleSpeed > 50) { /* Outputs for IfAction SubSystem: '/Быстро из-за скорости' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.KEEP_UNTIL_SPEED_DROPS = 1U; /* If: '/If1' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write' */ if (rtDW.KEEP_RISING_UNTIL_LIMIT > 0.0) { /* Outputs for IfAction SubSystem: '/включен ускоренный режим' incorporates: * ActionPort: '/Action Port' */ u_hd(rtb_Bias5, rtb_FLU_tg_correct_g, &rtb_Merge_g, &rtDW.AMB_store, &rtDW.KEEP_RISING_UNTIL_LIMIT); /* End of Outputs for SubSystem: '/включен ускоренный режим' */ } else { /* Outputs for IfAction SubSystem: '/обычный режим' incorporates: * ActionPort: '/Action Port' */ u_a5(rtb_Bias5, rtb_FLU_tg_correct_g, &rtb_Merge_g, &rtDW.AMB_store, &rtDW.KEEP_RISING_UNTIL_LIMIT); /* End of Outputs for SubSystem: '/обычный режим' */ } /* End of If: '/If1' */ /* If: '/If1' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write' */ if (rtDW.KEEP_FALLING_UNTIL_LIMIT > 0.0) { /* Outputs for IfAction SubSystem: '/включен ускоренный режим' incorporates: * ActionPort: '/Action Port' */ u_de(rtb_Bias5, rtb_FLU_tg_correct_g, &rtb_Merge_m2, &rtDW.AMB_store, &rtDW.KEEP_FALLING_UNTIL_LIMIT); /* End of Outputs for SubSystem: '/включен ускоренный режим' */ } else { /* Outputs for IfAction SubSystem: '/обычный режим' incorporates: * ActionPort: '/Action Port' */ u_co(rtb_Bias5, rtb_FLU_tg_correct_g, &rtb_Merge_m2, &rtDW.AMB_store, &rtDW.KEEP_FALLING_UNTIL_LIMIT); /* End of Outputs for SubSystem: '/обычный режим' */ } /* End of If: '/If1' */ /* Switch: '/Switch1' incorporates: * Abs: '/Abs' * Constant: '/epsilon' * DataStoreRead: '/Read Amb' * DataStoreWrite: '/Data Store Write' * RelationalOperator: '/AMBraw > AMB' * RelationalOperator: '/Relational Operator' * Sum: '/Add' * Switch: '/Switch' */ if (fabs((double)rtb_Bias5 - rtDW.AMB_store) <= 0.01) { /* SignalConversion generated from: '/AMB_new' */ rtb_u8Vtg_FX_plus = rtDW.AMB_store; } else { if (rtb_Bias5 > rtDW.AMB_store) { /* Switch: '/Switch' incorporates: * DataTypeConversion: '/Data Type Conversion' */ rtb_FLU_tg_correct_g = rtb_Merge_g; } else { /* Switch: '/Switch' incorporates: * DataTypeConversion: '/Data Type Conversion' * UnaryMinus: '/Unary Minus' */ rtb_FLU_tg_correct_g = (int16_t)-rtb_Merge_m2; } /* SignalConversion generated from: '/AMB_new' incorporates: * Constant: '/Constant' * Product: '/Divide' * Product: '/Product' * Sum: '/Add' * Switch: '/Switch' */ rtb_u8Vtg_FX_plus = (double)rtb_Subtract / 60000.0 * (double) rtb_FLU_tg_correct_g + rtDW.AMB_store; } /* End of Switch: '/Switch1' */ /* End of Outputs for SubSystem: '/Быстро из-за скорости' */ } else { /* Outputs for IfAction SubSystem: '/Медленно' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant1' */ rtDW.KEEP_UNTIL_SPEED_DROPS = 0U; /* MATLAB Function: '/границы' */ /* : rate_at_10 = 0.5; */ /* : rate_at_50 = double(g_aucAMBRATE_RISING(lvl + 1)) ; */ /* : f_lower_upper_bounds = [rate_at_10, rate_at_50]; */ rtb_f_lower_upper_bounds[0] = 0.5; i = rtb_FLU_tg_correct_g + 1; if (rtb_FLU_tg_correct_g + 1 > 32767) { i = 32767; } rtb_f_lower_upper_bounds[1] = g_aucAMBRATE_RISING[i - 1]; /* MATLAB Function: '/обычное понижение темп.' */ /* : fprintf("lvl = %d\n", lvl); */ printf("lvl = %d\n", rtb_FLU_tg_correct_g); fflush(stdout); /* Switch: '/Switch1' incorporates: * Abs: '/Abs' * Constant: '/Constant' * Constant: '/epsilon' * DataStoreRead: '/Read Amb' * DataStoreWrite: '/Data Store Write' * Product: '/Divide' * Product: '/Product' * RelationalOperator: '/AMBraw > AMB' * RelationalOperator: '/Relational Operator' * Sum: '/Add' * Sum: '/Add' * Switch: '/Switch' */ /* : f_g_aucAMBRATE_FALLING = g_aucAMBRATE_FALLING(lvl + 1); */ if (fabs((double)rtb_Bias5 - rtDW.AMB_store) <= 0.01) { rtb_u8Vtg_FX_plus = rtb_Bias5; } else { if (rtb_Bias5 > rtDW.AMB_store) { /* Switch: '/Скорость >10' incorporates: * Constant: '/Constant' * Switch: '/Switch' */ if (rtDW.VehicleSpeed > 10) { /* Lookup_n-D: '/1-D Lookup Table1' incorporates: * DataStoreRead: '/Data Store Read12' */ rtb_u8Vtg_FX_plus = look1_iu16td_binlc(rtDW.VehicleSpeed, rtConstP.uDLookupTable1_bp01Data, rtb_f_lower_upper_bounds, 1U); } else { rtb_u8Vtg_FX_plus = 0.5; } /* End of Switch: '/Скорость >10' */ } else { /* MATLAB Function: '/обычное понижение темп.' incorporates: * MATLAB Function: '/границы' */ i = rtb_FLU_tg_correct_g + 1; if (rtb_FLU_tg_correct_g + 1 > 32767) { i = 32767; } /* Switch: '/Switch' incorporates: * DataTypeConversion: '/Data Type Conversion' * MATLAB Function: '/обычное понижение темп.' * UnaryMinus: '/Unary Minus' */ rtb_u8Vtg_FX_plus = -(double)g_aucAMBRATE_FALLING[i - 1]; } rtb_u8Vtg_FX_plus = (double)rtb_Subtract / 60000.0 * rtb_u8Vtg_FX_plus + rtDW.AMB_store; } /* End of Switch: '/Switch1' */ /* End of Outputs for SubSystem: '/Медленно' */ } /* End of If: '/If' */ /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read11' * DataStoreRead: '/Data Store Read12' * MATLAB Function: '/Coolant temp threshold' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator' * Switch: '/Switch' */ if (rtDW.ECT <= g_ssAMBFILT_WATER) { /* Switch: '/Switch1' incorporates: * Abs: '/Abs' * Constant: '/epsilon' * DataStoreRead: '/Read Amb' * DataStoreWrite: '/Data Store Write' * RelationalOperator: '/Relational Operator' * Sum: '/Add' */ if (fabs((double)rtb_Bias5 - rtDW.AMB_store) > 0.01) { /* Switch: '/Switch' incorporates: * DataTypeConversion: '/Data Type Conversion' * DataTypeConversion: '/Data Type Conversion' * RelationalOperator: '/AMBraw > AMB' * UnaryMinus: '/Unary Minus' */ if (rtb_Bias5 > rtDW.AMB_store) { rtb_FLU_tg_correct_g = rtb_Merge_j; } else { rtb_FLU_tg_correct_g = (int16_t)-rtb_Merge_hu; } /* Switch: '/Switch1' incorporates: * Constant: '/Constant' * Product: '/Divide' * Product: '/Product' * Sum: '/Add' * Switch: '/Switch' */ rtDW.AMB_store += (double)rtb_Subtract / 60000.0 * (double) rtb_FLU_tg_correct_g; } /* End of Switch: '/Switch1' */ } else if (rtDW.VehicleSpeed != 0) { /* Switch: '/Switch1' incorporates: * DataStoreWrite: '/Write new AMB' * Switch: '/Switch' */ rtDW.AMB_store = rtb_u8Vtg_FX_plus; } /* End of Switch: '/Switch' */ /* Update for UnitDelay: '/Unit Delay' incorporates: * DataStoreRead: '/Data Store Read15' */ rtDW.UnitDelay_DSTATE = rtDW.t_now; /* End of Outputs for SubSystem: '/Фильтрация температуры' */ /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write' * DataStoreWrite: '/Data Store Write1' * DataStoreWrite: '/Write new AMB' * DataTypeConversion: '/Data Type Conversion' */ if (rtDW.BCM_T15_Stat > 0) { rtDW.AMB = (int16_t)floor(rtDW.AMB_store); } else { rtDW.AMB = rtb_Bias5; } /* End of Switch: '/Switch' */ /* If: '/If' incorporates: * RelationalOperator: '/Relational Operator1' * UnitDelay: '/Unit Delay' */ if (rtDW.UnitDelay_DSTATE_d5 == -9999) { /* Outputs for IfAction SubSystem: '/Инициализация температуры' incorporates: * ActionPort: '/Action Port' */ /* Switch: '/Switch1' incorporates: * DataStoreWrite: '/Data Store Write' * DataTypeConversion: '/Data Type Conversion' */ rtDW.AMB_store = rtb_Bias5; /* End of Outputs for SubSystem: '/Инициализация температуры' */ } /* End of If: '/If' */ /* Gain: '/Gain' incorporates: * DataStoreRead: '/Data Store Read4' * DataStoreWrite: '/Data Store Write' * DataTypeConversion: '/Data Type Conversion' */ rtDW.Sun_R = 4.01575 * (double) rtDW.CCUCAN_BCM_Climatic_model.SolarSensRightVal_ro; /* Gain: '/Gain' incorporates: * DataStoreRead: '/Data Store Read4' * DataStoreWrite: '/Data Store Write' * DataTypeConversion: '/Data Type Conversion' */ rtDW.Sun_L = 4.01575 * (double) rtDW.CCUCAN_BCM_Climatic_model.SolarSensLeftVal_ro; /* Bias: '/Bias' incorporates: * DataStoreRead: '/Data Store Read5' * DataStoreWrite: '/Data Store Write1' * DataTypeConversion: '/Data Type Conversion1' */ rtDW.ECT = (int16_t)(rtDW.CCUCAN_EMS_Veh_model.EMS_EngCoolTemp_Val_ro - 40); /* Gain: '/Gain' incorporates: * DataStoreRead: '/Data Store Read5' * DataStoreWrite: '/Data Store Write1' * DataTypeConversion: '/Data Type Conversion1' */ rtDW.Engine_speed = 0.25 * (double) rtDW.CCUCAN_EMS_Veh_model.EMS_nICEngineSpeed3_Val_ro; /* DataTypeConversion: '/Data Type Conversion1' incorporates: * DataStoreRead: '/Data Store Read6' * DataStoreWrite: '/Data Store Write2' * DataTypeConversion: '/Data Type Conversion' * Gain: '/Gain' */ rtDW.VehicleSpeed = (uint16_t)(0.01 * (double) rtDW.CCUCAN_ESC_04_model.ESC_VehicleSpeed_ro); /* DataStoreWrite: '/Data Store Write' incorporates: * DataStoreRead: '/Data Store Read7' */ rtDW.BCM_T15_Stat = rtDW.CCUCAN_BCM_VEH_STATE_model.BCM_T15_Stat; /* DataStoreWrite: '/Data Store Write7' incorporates: * DataStoreRead: '/Data Store Read8' */ rtDW.eCompChiller_Req = rtDW.CCUCAN_EMS_HVC_REQ_MSG_MODEL.EMS_eCompChiller_Req; /* DataStoreWrite: '/Data Store Write8' incorporates: * DataStoreRead: '/Data Store Read9' */ rtDW.SeatOccupied = rtDW.CCUCAN_OCURL_MSG_model.OCURL_SeatOccupied_Stat; /* Outputs for Enabled SubSystem: '/Subsystem1' incorporates: * EnablePort: '/Enable' */ /* DataStoreRead: '/Data Store Read1' */ if (rtDW.FIU_CCU1_MODEL.FIU_CCmodeFL_Req > 0) { /* Switch: '/Switch' incorporates: * DataStoreWrite: '/Data Store Write6' */ rtDW.CCU_MODE_FL = (uint8_t)(rtDW.FIU_CCU1_MODEL.FIU_CCmodeFL_Req > 1); } /* End of Outputs for SubSystem: '/Subsystem1' */ /* Outputs for Enabled SubSystem: '/Subsystem10' incorporates: * EnablePort: '/Enable' */ if (rtDW.FIU_CCU1_MODEL.FIU_CCmodeFR_Req > 0) { /* Switch: '/Switch' incorporates: * DataStoreWrite: '/Data Store Write10' */ rtDW.CCU_MODE_FR = (uint8_t)(rtDW.FIU_CCU1_MODEL.FIU_CCmodeFR_Req > 1); /* DataStoreWrite: '/Data Store Write1' incorporates: * Constant: '/true' */ rtDW.changed_FR_params = 1U; } /* End of Outputs for SubSystem: '/Subsystem10' */ /* Outputs for Enabled SubSystem: '/Subsystem11' incorporates: * EnablePort: '/Enable' */ if (rtDW.FIU_CCU1_MODEL.FIU_AirDirectionFR_Def_Req > 0) { /* Switch: '/Switch' incorporates: * DataStoreWrite: '/Data Store Write1' */ rtDW.CCU_DEF_FL = (uint8_t)(rtDW.FIU_CCU1_MODEL.FIU_AirDirectionFR_Def_Req <= 1); /* DataStoreWrite: '/Data Store Write11' incorporates: * DataStoreWrite: '/Data Store Write1' */ rtDW.CCU_DEF_FR = rtDW.CCU_DEF_FL; /* DataStoreWrite: '/Data Store Write2' incorporates: * Constant: '/true' */ rtDW.changed_FR_params = 1U; } /* End of Outputs for SubSystem: '/Subsystem11' */ /* Outputs for Enabled SubSystem: '/Subsystem12' incorporates: * EnablePort: '/Enable' */ if (rtDW.FIU_CCU1_MODEL.FIU_AirDirectionFR_Face_Req > 0) { /* Switch: '/Switch' incorporates: * DataStoreWrite: '/Data Store Write12' */ rtDW.CCU_FACE_FR = (uint8_t)(rtDW.FIU_CCU1_MODEL.FIU_AirDirectionFR_Face_Req <= 1); /* DataStoreWrite: '/Data Store Write1' incorporates: * Constant: '/true' */ rtDW.changed_FR_params = 1U; } /* End of Outputs for SubSystem: '/Subsystem12' */ /* Outputs for Enabled SubSystem: '/Subsystem13' incorporates: * EnablePort: '/Enable' */ if (rtDW.FIU_CCU1_MODEL.FIU_AirDirectionFR_Foot_Req > 0) { /* Switch: '/Switch' incorporates: * DataStoreWrite: '/Data Store Write13' */ rtDW.CCU_FOOT_FR = (uint8_t)(rtDW.FIU_CCU1_MODEL.FIU_AirDirectionFR_Foot_Req <= 1); /* DataStoreWrite: '/Data Store Write1' incorporates: * Constant: '/true' */ rtDW.changed_FR_params = 1U; } /* End of Outputs for SubSystem: '/Subsystem13' */ /* Outputs for Enabled SubSystem: '/Subsystem14' incorporates: * EnablePort: '/Enable' */ if (rtDW.FIU_CCU1_MODEL.FIU_BlowerSpeedFL_Req > 0) { /* Switch: '/Switch5' incorporates: * Constant: '/blower off' * DataStoreWrite: '/Data Store Write14' */ if (rtDW.FIU_CCU1_MODEL.FIU_BlowerSpeedFL_Req > 7) { rtDW.CCU_BLOWERS_FL = 0U; } else { rtDW.CCU_BLOWERS_FL = rtDW.FIU_CCU1_MODEL.FIU_BlowerSpeedFL_Req; } /* End of Switch: '/Switch5' */ } /* End of Outputs for SubSystem: '/Subsystem14' */ /* Outputs for Enabled SubSystem: '/Subsystem15' incorporates: * EnablePort: '/Enable' */ if (rtDW.FIU_CCU1_MODEL.FIU_BlowerSpeedFR_Req > 0) { /* Switch: '/Switch5' incorporates: * Constant: '/blower off' * DataStoreWrite: '/Data Store Write15' */ if (rtDW.FIU_CCU1_MODEL.FIU_BlowerSpeedFR_Req > 7) { rtDW.CCU_BLOWERS_FR = 0U; } else { rtDW.CCU_BLOWERS_FR = rtDW.FIU_CCU1_MODEL.FIU_BlowerSpeedFR_Req; } /* End of Switch: '/Switch5' */ /* DataStoreWrite: '/Data Store Write1' incorporates: * Constant: '/true' */ rtDW.changed_FR_params = 1U; } /* End of Outputs for SubSystem: '/Subsystem15' */ /* Outputs for Enabled SubSystem: '/Subsystem16' incorporates: * EnablePort: '/Enable' */ if (rtDW.FIU_CCU1_MODEL.FIU_CCautoModeFL_Req > 0) { /* DataStoreWrite: '/Data Store Write16' */ rtDW.CCU_AUTOMODE_FL = rtDW.FIU_CCU1_MODEL.FIU_CCautoModeFL_Req; } /* End of Outputs for SubSystem: '/Subsystem16' */ /* Outputs for Enabled SubSystem: '/Subsystem17' incorporates: * EnablePort: '/Enable' */ if (rtDW.FIU_CCU1_MODEL.FIU_CCautoModeFR_Req > 0) { /* DataStoreWrite: '/Data Store Write17' */ rtDW.CCU_AUTOMODE_FR = rtDW.FIU_CCU1_MODEL.FIU_CCautoModeFR_Req; /* DataStoreWrite: '/Data Store Write1' incorporates: * Constant: '/true' */ rtDW.changed_FR_params = 1U; } /* End of Outputs for SubSystem: '/Subsystem17' */ /* Outputs for Enabled SubSystem: '/Subsystem18' incorporates: * EnablePort: '/Enable' */ if (rtDW.FIU_CCU1_MODEL.FIU_Recirculation_Req > 0) { /* MultiPortSwitch: '/Multiport Switch' incorporates: * Constant: '/Constant' * Constant: '/Constant1' * Constant: '/Constant2' * DataStoreWrite: '/Data Store Write19' */ switch (rtDW.FIU_CCU1_MODEL.FIU_Recirculation_Req) { case 1: rtDW.CCU_RECIRC = 1U; break; case 2: rtDW.CCU_RECIRC = 0U; break; default: rtDW.CCU_RECIRC = 2U; break; } /* End of MultiPortSwitch: '/Multiport Switch' */ } /* End of Outputs for SubSystem: '/Subsystem18' */ /* Outputs for Enabled SubSystem: '/Subsystem21' incorporates: * EnablePort: '/Enable' */ if (rtDW.FIU_CCU1_MODEL.FIU_ACfrontOFF_Req > 0) { /* Switch: '/Switch' incorporates: * DataStoreWrite: '/Data Store Write22' */ rtDW.CCU_AC_FRONT = (uint8_t)(rtDW.FIU_CCU1_MODEL.FIU_ACfrontOFF_Req <= 1); } /* End of Outputs for SubSystem: '/Subsystem21' */ /* Outputs for Enabled SubSystem: '/Subsystem24' incorporates: * EnablePort: '/Enable' */ if (rtDW.FIU_CCU1_MODEL.FIU_FrontZoneSync_Req > 0) { /* If: '/If' */ if (rtDW.FIU_CCU1_MODEL.FIU_FrontZoneSync_Req == 1) { /* Outputs for IfAction SubSystem: '/sync front action' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write18' incorporates: * Constant: '/on' */ rtDW.enable_front_sync = 1U; /* End of Outputs for SubSystem: '/sync front action' */ } else if (rtDW.FIU_CCU1_MODEL.FIU_FrontZoneSync_Req == 2) { /* Outputs for IfAction SubSystem: '/full sync action' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.enable_full_sync = 1U; /* DataStoreWrite: '/Data Store Write18' incorporates: * Constant: '/on' */ rtDW.disable_rear_sync = 1U; /* End of Outputs for SubSystem: '/full sync action' */ } else if (rtDW.FIU_CCU1_MODEL.FIU_FrontZoneSync_Req == 3) { /* Outputs for IfAction SubSystem: '/sync off action' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write18' incorporates: * Constant: '/on' */ rtDW.disable_front_sync = 1U; /* End of Outputs for SubSystem: '/sync off action' */ } /* End of If: '/If' */ } /* End of Outputs for SubSystem: '/Subsystem24' */ /* Outputs for Enabled SubSystem: '/Subsystem5' incorporates: * EnablePort: '/Enable' */ if (rtDW.FIU_CCU1_MODEL.FIU_TargetTempFL_Val_ro > 0) { /* DataTypeConversion: '/Data Type Conversion1' incorporates: * Bias: '/Bias' * DataTypeConversion: '/Data Type Conversion' * Gain: '/Gain' * Gain: '/Gain1' */ rtDW.CCU_SET_FL = (uint16_t)((0.5 * (double) rtDW.FIU_CCU1_MODEL.FIU_TargetTempFL_Val_ro + 15.5) * 10.0); /* Saturate: '/Saturation' */ if (rtDW.CCU_SET_FL > 305) { /* DataTypeConversion: '/Data Type Conversion1' */ rtDW.CCU_SET_FL = 305U; } /* End of Saturate: '/Saturation' */ /* If: '/If' incorporates: * DataStoreWrite: '/Data Store Write1' */ if (rtDW.CCU_SET_FL < 160) { /* Outputs for IfAction SubSystem: '/LO mode' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/LOW' */ rtDW.LO_HI_MODE_FL = 1U; /* End of Outputs for SubSystem: '/LO mode' */ } else if (rtDW.CCU_SET_FL > 290) { /* Outputs for IfAction SubSystem: '/HI mode' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/HI' */ rtDW.LO_HI_MODE_FL = 2U; /* End of Outputs for SubSystem: '/HI mode' */ } else { /* Outputs for IfAction SubSystem: '/not LO or HI' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/not LO or HI' */ rtDW.LO_HI_MODE_FL = 0U; /* End of Outputs for SubSystem: '/not LO or HI' */ } /* End of If: '/If' */ } /* End of Outputs for SubSystem: '/Subsystem5' */ /* Outputs for Enabled SubSystem: '/Subsystem6' incorporates: * EnablePort: '/Enable' */ if (rtDW.FIU_CCU1_MODEL.FIU_TargetTempFR_Val_ro > 0) { /* DataTypeConversion: '/Data Type Conversion1' incorporates: * Bias: '/Bias' * DataTypeConversion: '/Data Type Conversion' * Gain: '/Gain' * Gain: '/Gain1' */ rtDW.CCU_SET_FR = (uint16_t)((0.5 * (double) rtDW.FIU_CCU1_MODEL.FIU_TargetTempFR_Val_ro + 15.5) * 10.0); /* Saturate: '/Saturation' */ if (rtDW.CCU_SET_FR > 305) { /* DataTypeConversion: '/Data Type Conversion1' */ rtDW.CCU_SET_FR = 305U; } /* End of Saturate: '/Saturation' */ /* DataStoreWrite: '/Data Store Write1' incorporates: * Constant: '/true' */ rtDW.changed_FR_params = 1U; /* If: '/If' incorporates: * DataStoreWrite: '/Data Store Write' */ if (rtDW.CCU_SET_FR < 160) { /* Outputs for IfAction SubSystem: '/LO mode' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/LOW' */ rtDW.LO_HI_MODE_FR = 1U; /* End of Outputs for SubSystem: '/LO mode' */ } else if (rtDW.CCU_SET_FR > 290) { /* Outputs for IfAction SubSystem: '/HI mode' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/HI' */ rtDW.LO_HI_MODE_FR = 2U; /* End of Outputs for SubSystem: '/HI mode' */ } else { /* Outputs for IfAction SubSystem: '/not LO or HI' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/not LO or HI' */ rtDW.LO_HI_MODE_FR = 0U; /* End of Outputs for SubSystem: '/not LO or HI' */ } /* End of If: '/If' */ } /* End of Outputs for SubSystem: '/Subsystem6' */ /* Outputs for Enabled SubSystem: '/Subsystem7' incorporates: * EnablePort: '/Enable' */ if (rtDW.FIU_CCU1_MODEL.FIU_AirDirectionFL_Def_Req > 0) { /* Switch: '/Switch' incorporates: * DataStoreWrite: '/Data Store Write1' */ rtDW.CCU_DEF_FR = (uint8_t)(rtDW.FIU_CCU1_MODEL.FIU_AirDirectionFL_Def_Req <= 1); /* DataStoreWrite: '/Data Store Write7' incorporates: * DataStoreWrite: '/Data Store Write1' */ rtDW.CCU_DEF_FL = rtDW.CCU_DEF_FR; } /* End of Outputs for SubSystem: '/Subsystem7' */ /* Outputs for Enabled SubSystem: '/Subsystem8' incorporates: * EnablePort: '/Enable' */ if (rtDW.FIU_CCU1_MODEL.FIU_AirDirectionFL_Face_Req > 0) { /* Switch: '/Switch' incorporates: * DataStoreWrite: '/Data Store Write8' */ rtDW.CCU_FACE_FL = (uint8_t)(rtDW.FIU_CCU1_MODEL.FIU_AirDirectionFL_Face_Req <= 1); } /* End of Outputs for SubSystem: '/Subsystem8' */ /* Outputs for Enabled SubSystem: '/Subsystem9' incorporates: * EnablePort: '/Enable' */ if (rtDW.FIU_CCU1_MODEL.FIU_AirDirectionFL_Foot_Req > 0) { /* Switch: '/Switch' incorporates: * DataStoreWrite: '/Data Store Write9' */ rtDW.CCU_FOOT_FL = (uint8_t)(rtDW.FIU_CCU1_MODEL.FIU_AirDirectionFL_Foot_Req <= 1); } /* End of DataStoreRead: '/Data Store Read1' */ /* End of Outputs for SubSystem: '/Subsystem9' */ /* Outputs for Enabled SubSystem: '/Subsystem2' incorporates: * EnablePort: '/Enable' */ /* DataStoreRead: '/Data Store Read2' */ if (rtDW.FIU_CCU2_MODEL.FIU_TargetTempRL_Val_ro > 0) { /* DataTypeConversion: '/Data Type Conversion1' incorporates: * Bias: '/Bias' * DataTypeConversion: '/Data Type Conversion' * Gain: '/Gain' * Gain: '/Gain1' */ rtDW.CCU_SET_RL = (uint16_t)((0.5 * (double) rtDW.FIU_CCU2_MODEL.FIU_TargetTempRL_Val_ro + 15.5) * 10.0); /* Saturate: '/Saturation' */ if (rtDW.CCU_SET_RL > 305) { /* DataTypeConversion: '/Data Type Conversion1' */ rtDW.CCU_SET_RL = 305U; } /* End of Saturate: '/Saturation' */ /* DataStoreWrite: '/Data Store Write2' incorporates: * Constant: '/true' */ rtDW.changed_RL_params = 1U; /* If: '/If' incorporates: * DataStoreWrite: '/Data Store Write1' */ if (rtDW.CCU_SET_RL < 160) { /* Outputs for IfAction SubSystem: '/LO mode' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/LOW' */ rtDW.LO_HI_MODE_RL = 1U; /* End of Outputs for SubSystem: '/LO mode' */ } else if (rtDW.CCU_SET_RL > 290) { /* Outputs for IfAction SubSystem: '/HI mode' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/HI' */ rtDW.LO_HI_MODE_RL = 2U; /* End of Outputs for SubSystem: '/HI mode' */ } else { /* Outputs for IfAction SubSystem: '/not LO or HI' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/not LO or HI' */ rtDW.LO_HI_MODE_RL = 0U; /* End of Outputs for SubSystem: '/not LO or HI' */ } /* End of If: '/If' */ } /* End of Outputs for SubSystem: '/Subsystem2' */ /* Outputs for Enabled SubSystem: '/Subsystem27' incorporates: * EnablePort: '/Enable' */ if (rtDW.FIU_CCU2_MODEL.FIU_CCmodeRL_Req > 0) { /* Switch: '/Switch' incorporates: * DataStoreWrite: '/Data Store Write1' */ rtDW.CCU_MODE_RL = (uint8_t)(rtDW.FIU_CCU2_MODEL.FIU_CCmodeRL_Req > 1); /* DataStoreWrite: '/Data Store Write2' incorporates: * Constant: '/true' */ rtDW.changed_RL_params = 1U; } /* End of Outputs for SubSystem: '/Subsystem27' */ /* Outputs for Enabled SubSystem: '/Subsystem28' incorporates: * EnablePort: '/Enable' */ if (rtDW.FIU_CCU2_MODEL.FIU_AirDirectionRL_Def_Req > 0) { /* DataStoreWrite: '/Data Store Write2' incorporates: * Constant: '/true' */ rtDW.changed_RL_params = 1U; } /* End of Outputs for SubSystem: '/Subsystem28' */ /* Outputs for Enabled SubSystem: '/Subsystem29' incorporates: * EnablePort: '/Enable' */ if (rtDW.FIU_CCU2_MODEL.FIU_AirDirectionRL_Face_Req > 0) { /* Switch: '/Switch' incorporates: * DataStoreWrite: '/Data Store Write1' */ rtDW.CCU_FACE_RL = (uint8_t)(rtDW.FIU_CCU2_MODEL.FIU_AirDirectionRL_Face_Req <= 1); /* DataStoreWrite: '/Data Store Write2' incorporates: * Constant: '/true' */ rtDW.changed_RL_params = 1U; } /* End of Outputs for SubSystem: '/Subsystem29' */ /* Outputs for Enabled SubSystem: '/Subsystem3' incorporates: * EnablePort: '/Enable' */ if (rtDW.FIU_CCU2_MODEL.FIU_TargetTempRR_Val_ro > 0) { /* DataTypeConversion: '/Data Type Conversion1' incorporates: * Bias: '/Bias' * DataTypeConversion: '/Data Type Conversion' * Gain: '/Gain' * Gain: '/Gain1' */ rtDW.CCU_SET_RR = (uint16_t)((0.5 * (double) rtDW.FIU_CCU2_MODEL.FIU_TargetTempRR_Val_ro + 15.5) * 10.0); /* Saturate: '/Saturation' */ if (rtDW.CCU_SET_RR > 305) { /* DataTypeConversion: '/Data Type Conversion1' */ rtDW.CCU_SET_RR = 305U; } /* End of Saturate: '/Saturation' */ /* DataStoreWrite: '/Data Store Write2' incorporates: * Constant: '/true' */ rtDW.changed_RR_params = 1U; /* If: '/If' incorporates: * DataStoreWrite: '/Data Store Write1' */ if (rtDW.CCU_SET_RR < 160) { /* Outputs for IfAction SubSystem: '/LO mode' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/LOW' */ rtDW.LO_HI_MODE_RR = 1U; /* End of Outputs for SubSystem: '/LO mode' */ } else if (rtDW.CCU_SET_RR > 290) { /* Outputs for IfAction SubSystem: '/HI mode' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/HI' */ rtDW.LO_HI_MODE_RR = 2U; /* End of Outputs for SubSystem: '/HI mode' */ } else { /* Outputs for IfAction SubSystem: '/not LO or HI' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/not LO or HI' */ rtDW.LO_HI_MODE_RR = 0U; /* End of Outputs for SubSystem: '/not LO or HI' */ } /* End of If: '/If' */ } /* End of Outputs for SubSystem: '/Subsystem3' */ /* Outputs for Enabled SubSystem: '/Subsystem30' incorporates: * EnablePort: '/Enable' */ if (rtDW.FIU_CCU2_MODEL.FIU_AirDirectionRL_Foot_Req > 0) { /* Switch: '/Switch' incorporates: * DataStoreWrite: '/Data Store Write1' */ rtDW.CCU_FOOT_RL = (uint8_t)(rtDW.FIU_CCU2_MODEL.FIU_AirDirectionRL_Foot_Req <= 1); /* DataStoreWrite: '/Data Store Write2' incorporates: * Constant: '/true' */ rtDW.changed_RL_params = 1U; } /* End of Outputs for SubSystem: '/Subsystem30' */ /* Outputs for Enabled SubSystem: '/Subsystem31' incorporates: * EnablePort: '/Enable' */ if (rtDW.FIU_CCU2_MODEL.FIU_CCmodeRR_Req > 0) { /* Switch: '/Switch' incorporates: * DataStoreWrite: '/Data Store Write1' */ rtDW.CCU_MODE_RR = (uint8_t)(rtDW.FIU_CCU2_MODEL.FIU_CCmodeRR_Req > 1); /* DataStoreWrite: '/Data Store Write2' incorporates: * Constant: '/true' */ rtDW.changed_RR_params = 1U; } /* End of Outputs for SubSystem: '/Subsystem31' */ /* Outputs for Enabled SubSystem: '/Subsystem32' incorporates: * EnablePort: '/Enable' */ if (rtDW.FIU_CCU2_MODEL.FIU_AirDirectionRR_Def_Req > 0) { /* DataStoreWrite: '/Data Store Write2' incorporates: * Constant: '/true' */ rtDW.changed_RR_params = 1U; } /* End of Outputs for SubSystem: '/Subsystem32' */ /* Outputs for Enabled SubSystem: '/Subsystem33' incorporates: * EnablePort: '/Enable' */ if (rtDW.FIU_CCU2_MODEL.FIU_AirDirectionRR_Face_Req > 0) { /* Switch: '/Switch' incorporates: * DataStoreWrite: '/Data Store Write1' */ rtDW.CCU_FACE_RR = (uint8_t)(rtDW.FIU_CCU2_MODEL.FIU_AirDirectionRR_Face_Req <= 1); /* DataStoreWrite: '/Data Store Write2' incorporates: * Constant: '/true' */ rtDW.changed_RR_params = 1U; } /* End of Outputs for SubSystem: '/Subsystem33' */ /* Outputs for Enabled SubSystem: '/Subsystem34' incorporates: * EnablePort: '/Enable' */ if (rtDW.FIU_CCU2_MODEL.FIU_AirDirectionRR_Foot_Req > 0) { /* Switch: '/Switch' incorporates: * DataStoreWrite: '/Data Store Write1' */ rtDW.CCU_FOOT_RR = (uint8_t)(rtDW.FIU_CCU2_MODEL.FIU_AirDirectionRR_Foot_Req <= 1); /* DataStoreWrite: '/Data Store Write2' incorporates: * Constant: '/true' */ rtDW.changed_RR_params = 1U; } /* End of Outputs for SubSystem: '/Subsystem34' */ /* Outputs for Enabled SubSystem: '/Subsystem35' incorporates: * EnablePort: '/Enable' */ if (rtDW.FIU_CCU2_MODEL.FIU_BlowerSpeedRL_Req > 0) { /* Switch: '/Switch5' incorporates: * Constant: '/blower off' * DataStoreWrite: '/Data Store Write1' */ if (rtDW.FIU_CCU2_MODEL.FIU_BlowerSpeedRL_Req > 7) { rtDW.CCU_BLOWERS_RL = 0U; } else { rtDW.CCU_BLOWERS_RL = rtDW.FIU_CCU2_MODEL.FIU_BlowerSpeedRL_Req; } /* End of Switch: '/Switch5' */ /* DataStoreWrite: '/Data Store Write2' incorporates: * Constant: '/true' */ rtDW.changed_RL_params = 1U; } /* End of Outputs for SubSystem: '/Subsystem35' */ /* Outputs for Enabled SubSystem: '/Subsystem36' incorporates: * EnablePort: '/Enable' */ if (rtDW.FIU_CCU2_MODEL.FIU_BlowerSpeedRR_Req > 0) { /* Switch: '/Switch5' incorporates: * Constant: '/blower off' * DataStoreWrite: '/Data Store Write1' */ if (rtDW.FIU_CCU2_MODEL.FIU_BlowerSpeedRR_Req > 7) { rtDW.CCU_BLOWERS_RR = 0U; } else { rtDW.CCU_BLOWERS_RR = rtDW.FIU_CCU2_MODEL.FIU_BlowerSpeedRR_Req; } /* End of Switch: '/Switch5' */ /* DataStoreWrite: '/Data Store Write2' incorporates: * Constant: '/true' */ rtDW.changed_RR_params = 1U; } /* End of Outputs for SubSystem: '/Subsystem36' */ /* Outputs for Enabled SubSystem: '/Subsystem37' incorporates: * EnablePort: '/Enable' */ if (rtDW.FIU_CCU2_MODEL.FIU_CCautoModeRL_Req > 0) { /* DataStoreWrite: '/Data Store Write1' */ rtDW.CCU_AUTOMODE_RL = rtDW.FIU_CCU2_MODEL.FIU_CCautoModeRL_Req; } /* End of Outputs for SubSystem: '/Subsystem37' */ /* Outputs for Enabled SubSystem: '/Subsystem38' incorporates: * EnablePort: '/Enable' */ if (rtDW.FIU_CCU2_MODEL.FIU_CCautoModeRR_Req > 0) { /* DataStoreWrite: '/Data Store Write1' */ rtDW.CCU_AUTOMODE_RR = rtDW.FIU_CCU2_MODEL.FIU_CCautoModeRR_Req; /* DataStoreWrite: '/Data Store Write2' incorporates: * Constant: '/true' */ rtDW.changed_RR_params = 1U; } /* End of Outputs for SubSystem: '/Subsystem38' */ /* Outputs for Enabled SubSystem: '/Subsystem41' incorporates: * EnablePort: '/Enable' */ if (rtDW.FIU_CCU2_MODEL.FIU_ACrearOFF_Req > 0) { /* Switch: '/Switch' incorporates: * DataStoreWrite: '/Data Store Write1' */ rtDW.CCU_AC_REAR = (uint8_t)(rtDW.FIU_CCU2_MODEL.FIU_ACrearOFF_Req <= 1); /* DataStoreWrite: '/Data Store Write2' incorporates: * Constant: '/true' */ rtDW.changed_RL_params = 1U; } /* End of Outputs for SubSystem: '/Subsystem41' */ /* Outputs for Enabled SubSystem: '/Subsystem44' incorporates: * EnablePort: '/Enable' */ if (rtDW.FIU_CCU2_MODEL.FIU_RearZoneSync_Req > 0) { /* If: '/If' */ if (rtDW.FIU_CCU2_MODEL.FIU_RearZoneSync_Req == 1) { /* Outputs for IfAction SubSystem: '/sync rear action' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write18' incorporates: * Constant: '/on' */ rtDW.enable_rear_sync = 1U; /* End of Outputs for SubSystem: '/sync rear action' */ } else if (rtDW.FIU_CCU2_MODEL.FIU_RearZoneSync_Req == 2) { /* Outputs for IfAction SubSystem: '/sync off rear action' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write18' incorporates: * Constant: '/on' */ rtDW.disable_rear_sync = 1U; /* End of Outputs for SubSystem: '/sync off rear action' */ } /* End of If: '/If' */ } /* End of DataStoreRead: '/Data Store Read2' */ /* End of Outputs for SubSystem: '/Subsystem44' */ /* BusCreator: '/Bus Creator' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read10' * DataStoreRead: '/Data Store Read11' * DataStoreRead: '/Data Store Read17' * DataStoreRead: '/Data Store Read18' * DataStoreRead: '/Data Store Read19' * DataStoreRead: '/Data Store Read2' * DataStoreRead: '/Data Store Read20' * DataStoreRead: '/Data Store Read21' * DataStoreRead: '/Data Store Read22' * DataStoreRead: '/Data Store Read23' * DataStoreRead: '/Data Store Read24' * DataStoreRead: '/Data Store Read3' * DataStoreRead: '/Data Store Read4' * DataStoreRead: '/Data Store Read5' * DataStoreRead: '/Data Store Read6' * DataStoreRead: '/Data Store Read7' * DataStoreRead: '/Data Store Read8' * DataStoreRead: '/Data Store Read9' * DataStoreWrite: '/Data Store Write' */ rtDW.CCU_STAT1_MODEL.CCU_ModeFL_Stat = rtDW.CCU_MODE_FL; rtDW.CCU_STAT1_MODEL.CCU_ModeFR_Stat = rtDW.CCU_MODE_FR; rtDW.CCU_STAT1_MODEL.CCU_ModeRL_Stat = rtDW.CCU_MODE_RL; rtDW.CCU_STAT1_MODEL.CCU_ModeRR_Stat = rtDW.CCU_MODE_RR; rtDW.CCU_STAT1_MODEL.CCU_AutoModeFL_Stat = rtDW.CCU_AUTOMODE_FL; rtDW.CCU_STAT1_MODEL.CCU_AutoModeFR_Stat = rtDW.CCU_AUTOMODE_FR; rtDW.CCU_STAT1_MODEL.CCU_AirDirectionRL_Face_Stat = rtDW.CCU_FACE_RL; rtDW.CCU_STAT1_MODEL.CCU_AirDirectionRL_Foot_Stat = rtDW.CCU_FOOT_RL; rtDW.CCU_STAT1_MODEL.CCU_AutoModeRL_Stat = rtDW.CCU_AUTOMODE_RL; rtDW.CCU_STAT1_MODEL.CCU_AutoModeRR_Stat = rtDW.CCU_AUTOMODE_RR; rtDW.CCU_STAT1_MODEL.CCU_AirDirectionRR_Face_Stat = rtDW.CCU_FACE_RR; rtDW.CCU_STAT1_MODEL.CCU_AirDirectionRR_Foot_Stat = rtDW.CCU_FOOT_RR; rtDW.CCU_STAT1_MODEL.CCU_AirDirectionFL_Def_Stat = rtDW.CCU_DEF_FL; rtDW.CCU_STAT1_MODEL.CCU_AirDirectionFL_Face_Stat = rtDW.CCU_FACE_FL; rtDW.CCU_STAT1_MODEL.CCU_AirDirectionFL_Foot_Stat = rtDW.CCU_FOOT_FL; rtDW.CCU_STAT1_MODEL.CCU_AirDirectionFR_Def_Stat = rtDW.CCU_DEF_FR; rtDW.CCU_STAT1_MODEL.CCU_AirDirectionFR_Face_Stat = rtDW.CCU_FACE_FR; rtDW.CCU_STAT1_MODEL.CCU_AirDirectionFR_Foot_Stat = rtDW.CCU_FOOT_FR; rtDW.CCU_STAT1_MODEL.CCU_Recirculation_Stat = rtDW.CCU_RECIRC; rtDW.CCU_STAT1_MODEL.CCU_BlowerSpeedFL_Stat = rtDW.CCU_BLOWERS_FL; /* Saturate: '/Saturation' incorporates: * DataStoreRead: '/Data Store Read13' */ if (rtDW.CCU_SET_FL > 310) { Gain = 310U; } else if (rtDW.CCU_SET_FL < 155) { Gain = 155U; } else { Gain = rtDW.CCU_SET_FL; } /* BusCreator: '/Bus Creator' incorporates: * Bias: '/Bias' * DataStoreRead: '/Data Store Read12' * DataStoreWrite: '/Data Store Write' * DataTypeConversion: '/Data Type Conversion' * Gain: '/Gain' * Gain: '/Gain1' * Saturate: '/Saturation' */ rtDW.CCU_STAT1_MODEL.CCU_TargetTempFL_Stat_ro = (uint8_t)((0.10000038146972656 * (double)Gain - 16.0) * 2.0); rtDW.CCU_STAT1_MODEL.CCU_BlowerSpeedFR_Stat = rtDW.CCU_BLOWERS_FR; /* Saturate: '/Saturation' incorporates: * DataStoreRead: '/Data Store Read14' */ if (rtDW.CCU_SET_FR > 310) { Gain = 310U; } else if (rtDW.CCU_SET_FR < 155) { Gain = 155U; } else { Gain = rtDW.CCU_SET_FR; } /* BusCreator: '/Bus Creator' incorporates: * Bias: '/Bias1' * DataStoreRead: '/Data Store Read26' * DataStoreWrite: '/Data Store Write' * DataTypeConversion: '/Data Type Conversion' * Gain: '/Gain' * Gain: '/Gain1' * Saturate: '/Saturation' */ rtDW.CCU_STAT1_MODEL.CCU_TargetTempFR_Stat_ro = (uint8_t)((0.10000038146972656 * (double)Gain - 16.0) * 2.0); rtDW.CCU_STAT1_MODEL.CCU_BlowerSpeedRL_Stat = rtDW.CCU_BLOWERS_RL; /* Saturate: '/Saturation' incorporates: * DataStoreRead: '/Data Store Read15' */ if (rtDW.CCU_SET_RR > 310) { Gain = 310U; } else if (rtDW.CCU_SET_RR < 155) { Gain = 155U; } else { Gain = rtDW.CCU_SET_RR; } /* BusCreator: '/Bus Creator' incorporates: * Bias: '/Bias' * DataStoreRead: '/Data Store Read25' * DataStoreWrite: '/Data Store Write' * DataTypeConversion: '/Data Type Conversion' * Gain: '/Gain' * Gain: '/Gain1' * Saturate: '/Saturation' */ rtDW.CCU_STAT1_MODEL.CCU_TargetTempRR_Stat_ro = (uint8_t)((0.10000038146972656 * (double)Gain - 16.0) * 2.0); rtDW.CCU_STAT1_MODEL.CCU_BlowerSpeedRR_Stat = rtDW.CCU_BLOWERS_RR; /* Saturate: '/Saturation' incorporates: * DataStoreRead: '/Data Store Read16' */ if (rtDW.CCU_SET_RL > 310) { Gain = 310U; } else if (rtDW.CCU_SET_RL < 155) { Gain = 155U; } else { Gain = rtDW.CCU_SET_RL; } /* BusCreator: '/Bus Creator' incorporates: * Bias: '/Bias' * DataStoreWrite: '/Data Store Write' * DataTypeConversion: '/Data Type Conversion' * Gain: '/Gain' * Gain: '/Gain1' * Saturate: '/Saturation' */ rtDW.CCU_STAT1_MODEL.CCU_TargetTempRL_Stat_ro = (uint8_t)((0.10000038146972656 * (double)Gain - 16.0) * 2.0); /* BusCreator: '/Bus Creator1' incorporates: * DataStoreRead: '/Data Store Read27' * DataStoreRead: '/Data Store Read28' * DataStoreRead: '/Data Store Read29' * DataStoreRead: '/Data Store Read34' * DataStoreRead: '/Data Store Read35' * DataStoreWrite: '/Data Store Write1' */ rtDW.CCU_STAT2_MODEL.CCU_AromaCartridgeSw_Stat = 0U; rtDW.CCU_STAT2_MODEL.CCU_FrontZoneSync_Stat = rtDW.CCU_FRONT_SYNC; rtDW.CCU_STAT2_MODEL.CCU_RearZoneSync_Stat = rtDW.CCU_REAR_SYNC; rtDW.CCU_STAT2_MODEL.CCU_AllZoneSync_Stat = rtDW.CCU_ALL_ZONE_SYNC; rtDW.CCU_STAT2_MODEL.CCU_ACfront_Stat = rtDW.CCU_AC_FRONT; rtDW.CCU_STAT2_MODEL.CCU_ACrear_Stat = rtDW.CCU_AC_REAR; rtDW.CCU_STAT2_MODEL.CCU_ACmaxF_Stat = 0U; rtDW.CCU_STAT2_MODEL.CCU_ACmaxR_Stat = 0U; rtDW.CCU_STAT2_MODEL.CCU_Defrost_Stat = 0U; rtDW.CCU_STAT2_MODEL.CCU_Ionization_Stat = 0U; rtDW.CCU_STAT2_MODEL.CCU_FootTempCorFL_Stat = 0U; rtDW.CCU_STAT2_MODEL.CCU_FootTempCorFR_Stat = 0U; rtDW.CCU_STAT2_MODEL.CCU_AromaIntens_Stat = 0U; rtDW.CCU_STAT2_MODEL.CCU_FootTempCorRL_Stat = 0U; rtDW.CCU_STAT2_MODEL.CCU_FootTempCorRR_Stat = 0U; rtDW.CCU_STAT2_MODEL.CCU_DeflectorSwDL_Stat = 0U; rtDW.CCU_STAT2_MODEL.CCU_DeflectorSwDR_Stat = 0U; rtDW.CCU_STAT2_MODEL.CCU_DeflectorSwFPL_Stat = 0U; rtDW.CCU_STAT2_MODEL.CCU_DeflectorSwFPR_Stat = 0U; rtDW.CCU_STAT2_MODEL.CCU_DeflectorSwFCL_Stat = 0U; rtDW.CCU_STAT2_MODEL.CCU_DeflectorSwFCR_Stat = 0U; rtDW.CCU_STAT2_MODEL.CCU_DeflectorSwRLB_Stat = 0U; rtDW.CCU_STAT2_MODEL.CCU_DeflectorSwRRB_Stat = 0U; /* BusCreator: '/Bus Creator2' incorporates: * DataStoreRead: '/Data Store Read30' * DataStoreRead: '/Data Store Read31' * DataStoreWrite: '/Data Store Write2' * DataTypeConversion: '/Data Type Conversion' * DataTypeConversion: '/Data Type Conversion' * DataTypeConversion: '/Data Type Conversion' * DataTypeConversion: '/Data Type Conversion' * DataTypeConversion: '/Data Type Conversion' * DataTypeConversion: '/Data Type Conversion' * DataTypeConversion: '/Data Type Conversion' * Logic: '/Logical Operator13' * Logic: '/Logical Operator4' * Logic: '/Logical Operator4' * Logic: '/Logical Operator4' */ CCU_Errors_Model.CCU_IncarTempErrF_Stat = (uint8_t)(rtb_LogicalOperator1_n || rtb_LogicalOperator3); CCU_Errors_Model.CCU_IncarTempErrR_Stat = (uint8_t)(rtb_LogicalOperator1_m2 || rtb_LogicalOperator3_p5); CCU_Errors_Model.CCU_DuctTempSenErrF_Stat = (uint8_t)(rtb_LogicalOperator3_nz || rtb_LogicalOperator4_fo || rtb_LogicalOperator6 || rtb_LogicalOperator8 || rtb_LogicalOperator10 || rtb_LogicalOperator11); CCU_Errors_Model.CCU_DuctTempSenErrR_Stat = (uint8_t)(rtb_Compare_n2 || rtb_Compare_jt || rtb_Compare_e || rtb_Compare_gs); CCU_Errors_Model.CCU_EvaTempSenErrF_Stat = rtb_LogicalOperator1_f1; CCU_Errors_Model.CCU_EvaTempSenErrR_Stat = rtb_LogicalOperator1_f; CCU_Errors_Model.CCU_DeflectorSwErrF_Stat = 0U; CCU_Errors_Model.CCU_DeflectorSwErrR_Stat = 0U; CCU_Errors_Model.CCU_PressSenErr_Stat = rtb_LogicalOperator1; CCU_Errors_Model.CCU_AmbienTemptSenErr_Stat = 0U; CCU_Errors_Model.CCU_SealingValveErr_Stat = 0U; CCU_Errors_Model.CCU_ETXVerr_Stat = 0U; CCU_Errors_Model.CCU_HVACfanOrTXVerrF_Stat = 0U; CCU_Errors_Model.CCU_HVACfanOrTXVerrR_Stat = 0U; CCU_Errors_Model.CCU_ActuatorErrF_Stat = rtDW.CCU_ActuatorErrF_Stat_private; CCU_Errors_Model.CCU_ActuatorErrR_Stat = rtDW.CCU_ActuatorErrR_Stat_private; CCU_Errors_Model.CCU_UltravioletErr_Stat = 0U; CCU_Errors_Model.CCU_VinRecordErr_Stat = 0U; CCU_Errors_Model.CCU_AirQualSenErr_Stat = 0U; CCU_Errors_Model.CCU_CommErr_Stat = 0U; CCU_Errors_Model.CCU_TWVerr_Stat = 0U; CCU_Errors_Model.CCU_IonizationErr_Stat = 0U; CCU_Errors_Model.CCU_AromaErr_Stat = 0U; /* Saturate: '/Saturation' incorporates: * MATLAB Function: '/MATLAB Function' */ if ((uint8_t)rpm_phys <= 170) { /* BusCreator: '/Bus Creator3' incorporates: * DataStoreWrite: '/Data Store Write3' */ rtDW.CCUCAN_HVC_REQ_MSG_MODEL.CCU_eCompSpeedReq_Val_ro = (uint8_t)rpm_phys; } else { /* BusCreator: '/Bus Creator3' incorporates: * DataStoreWrite: '/Data Store Write3' */ rtDW.CCUCAN_HVC_REQ_MSG_MODEL.CCU_eCompSpeedReq_Val_ro = 170U; } /* End of Saturate: '/Saturation' */ /* BusCreator: '/Bus Creator3' incorporates: * DataStoreWrite: '/Data Store Write1' * DataStoreWrite: '/Data Store Write13' * DataStoreWrite: '/Data Store Write3' * DataTypeConversion: '/Data Type Conversion' */ rtDW.CCUCAN_HVC_REQ_MSG_MODEL.CCU_eCompReq_Stat = Enable_Comp_PID; rtDW.CCUCAN_HVC_REQ_MSG_MODEL.CCU_LowTempValve_Req = rtB.Cmd_3Way; rtDW.CCUCAN_HVC_REQ_MSG_MODEL.CCU_HVC_Req_RC = 0U; rtDW.CCUCAN_HVC_REQ_MSG_MODEL.CCU_HVC_Req_CS = 0U; /* Switch: '/Switch1' incorporates: * Constant: '/Constant7' */ if (!Enable_Comp_PID) { Valve_2_way = 0U; } /* Saturate: '/Saturation5' incorporates: * Switch: '/Switch1' */ if (Valve_2_way <= 100) { /* BusCreator: '/Bus Creator4' incorporates: * DataStoreWrite: '/Data Store Write4' */ rtDW.CCU_Msg3_model.CCU_FAN_Req = Valve_2_way; } else { /* BusCreator: '/Bus Creator4' incorporates: * DataStoreWrite: '/Data Store Write4' */ rtDW.CCU_Msg3_model.CCU_FAN_Req = 100U; } /* End of Saturate: '/Saturation5' */ /* BusCreator: '/Bus Creator4' incorporates: * DataStoreWrite: '/Data Store Write4' */ rtDW.CCU_Msg3_model.CCU_RestMode_Stat = 0U; rtDW.CCU_Msg3_model.CCU_IncarTempSum_Val_ro = 0U; rtDW.CCU_Msg3_model.CCU_MSG3_RC = 0U; rtDW.CCU_Msg3_model.CCU_MSG3_CS = 0U; /* BusCreator: '/Bus Creator5' incorporates: * DataStoreRead: '/Data Store Read38' * DataStoreWrite: '/Data Store Write5' */ rtDW.CCU_Msg1_model.CCU_MirrorHeating_Req = 0U; rtDW.CCU_Msg1_model.CCU_RecirculationLed_Cmd = rtDW.Full_Rec; rtDW.CCU_Msg1_model.CCU_DefrostLed_Req = 0U; rtDW.CCU_Msg1_model.CCU_SideWindowHeating_Req = 0U; rtDW.CCU_Msg1_model.CCU_RearWindowHeating_Req = 0U; rtDW.CCU_Msg1_model.CCU_FrontWindowHeating_Req = 0U; rtDW.CCU_Msg1_model.CCU_EmergAirCleaning_Stat = 0U; rtDW.CCU_Msg1_model.CCU_FireExtinguishSys_Stat = 0U; rtDW.CCU_Msg1_model.CCU_FLAutoPsngrLed_Cmd = 0U; rtDW.CCU_Msg1_model.CCU_FRAutoPsngrLed_Cmd = 0U; rtDW.CCU_Msg1_model.CCU_RLAutoPsngrLed_Cmd = 0U; rtDW.CCU_Msg1_model.CCU_RRAutoPsngrLed_Cmd = 0U; rtDW.CCU_Msg1_model.CCU_AC_MaxLed_Cmd = 0U; rtDW.CCU_Msg1_model.CCU_MSG1_RC = 0U; rtDW.CCU_Msg1_model.CCU_MSG1_CS = 0U; /* DataTypeConversion: '/Data Type Conversion' */ for (i = 0; i < 9; i++) { /* Switch: '/Switch' incorporates: * Constant: '/Constant' * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read' * Gain: '/Gain' * Product: '/Divide' */ rtb_FLU_tg_correct_g = rtDW.MaxPositionCh0_private[i]; if (rtb_FLU_tg_correct_g != 0) { rtb_u8Vtg_FX_plus = (double)Actuator_Ch0_Status_Model.in_CPOS_ALL[i] / (double)rtb_FLU_tg_correct_g * 100.0; } else { rtb_u8Vtg_FX_plus = 0.0; } /* End of Switch: '/Switch' */ /* Saturate: '/Saturation' incorporates: * DataTypeConversion: '/Data Type Conversion' */ if (rtb_u8Vtg_FX_plus > 100.0) { rtb_DataTypeConversion_bh[i] = 100U; } else if (rtb_u8Vtg_FX_plus < 0.0) { rtb_DataTypeConversion_bh[i] = 0U; } else { rtb_DataTypeConversion_bh[i] = (uint8_t)rtb_u8Vtg_FX_plus; } /* End of Saturate: '/Saturation' */ } /* End of DataTypeConversion: '/Data Type Conversion' */ /* Switch: '/Switch' incorporates: * Constant: '/Constant1' * DataStoreRead: '/Data Store Read' * DataStoreRead: '/Data Store Read2' */ if (rtDW.stepSig_private > 0) { rtb_y_b2 = rtDW.stepSig_private; } else { rtb_y_b2 = 1; } /* End of Switch: '/Switch' */ /* SwitchCase: '/Switch Case' */ switch (rtb_y_b2) { case 1: /* Outputs for IfAction SubSystem: '/Stop Mode' incorporates: * ActionPort: '/Action Port' */ /* If: '/If1' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write1' * SignalConversion generated from: '/Bus Selector' */ if ((Actuator_Ch0_Status_Model.Busy == 0) && (Actuator_Ch0_Status_Model.Error_Connect == 0)) { /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: * ActionPort: '/Action Port' */ for (i = 0; i < 9; i++) { /* DataStoreWrite: '/Data Store Write1' */ rtDW.COM_private[i] = 1U; /* DataStoreWrite: '/Data Store Write' */ rtDW.MODE_private[i] = 2U; } /* Merge: '/Merge' incorporates: * Constant: '/Constant' * Sum: '/step inc' */ rtB.Merge_f1 = (int8_t)(rtb_y_b2 + 1); /* MATLAB Function: '/Write' incorporates: * DataStoreRead: '/Data Store Read3' */ /* : if(LOGGER == 2) */ if (rtDW.LOGGER_LIN == 2.0) { /* : fprintf('[LIN 1] Stop Mode\n'); */ printf("[LIN 1] Stop Mode\n"); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* End of Outputs for SubSystem: '/If Action Subsystem2' */ } else { /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: * ActionPort: '/Action Port' */ /* Merge: '/Merge' incorporates: * SignalConversion generated from: '/stepIn' */ rtB.Merge_f1 = rtb_y_b2; /* End of Outputs for SubSystem: '/If Action Subsystem3' */ } /* End of If: '/If1' */ /* End of Outputs for SubSystem: '/Stop Mode' */ break; case 2: /* Outputs for IfAction SubSystem: '/Initial CPOS Min' incorporates: * ActionPort: '/Action Port' */ /* If: '/If' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write1' * SignalConversion generated from: '/Bus Selector' */ if ((Actuator_Ch0_Status_Model.Busy == 0) && (Actuator_Ch0_Status_Model.Error_Connect == 0)) { /* Outputs for IfAction SubSystem: '/If Action Subsystem' incorporates: * ActionPort: '/Action Port' */ for (i = 0; i < 9; i++) { /* DataStoreWrite: '/Data Store Write' */ rtDW.POS_private[i] = 6000U; /* DataStoreWrite: '/Data Store Write1' */ rtDW.COM_private[i] = 2U; } /* Merge: '/Merge' incorporates: * Constant: '/Constant' * Merge: '/Merge' * Sum: '/step inc' */ rtB.Merge_f1 = (int8_t)(rtb_y_b2 + 1); /* MATLAB Function: '/Write' incorporates: * DataStoreRead: '/Data Store Read3' */ /* : if(LOGGER == 2) */ if (rtDW.LOGGER_LIN == 2.0) { /* : fprintf('[LIN 1] Initial CPOS Min\n'); */ printf("[LIN 1] Initial CPOS Min\n"); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* End of Outputs for SubSystem: '/If Action Subsystem' */ } else { /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: * ActionPort: '/Action Port' */ /* Merge: '/Merge' incorporates: * Merge: '/Merge' * SignalConversion generated from: '/stepIn1' */ rtB.Merge_f1 = rtb_y_b2; /* End of Outputs for SubSystem: '/If Action Subsystem3' */ } /* End of If: '/If' */ /* End of Outputs for SubSystem: '/Initial CPOS Min' */ break; case 3: /* Outputs for IfAction SubSystem: '/Normal Mode' incorporates: * ActionPort: '/Action Port' */ /* If: '/If1' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write1' * SignalConversion generated from: '/Bus Selector' */ if ((Actuator_Ch0_Status_Model.Busy == 0) && (Actuator_Ch0_Status_Model.Error_Connect == 0)) { /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: * ActionPort: '/Action Port' */ for (i = 0; i < 9; i++) { /* DataStoreWrite: '/Data Store Write' */ rtDW.MODE_private[i] = 0U; /* DataStoreWrite: '/Data Store Write1' */ rtDW.COM_private[i] = 1U; } /* Merge: '/Merge' incorporates: * Constant: '/Constant' * Sum: '/step inc' */ rtB.Merge_f1 = (int8_t)(rtb_y_b2 + 1); /* MATLAB Function: '/Write' incorporates: * DataStoreRead: '/Data Store Read3' */ /* : if(LOGGER == 2) */ if (rtDW.LOGGER_LIN == 2.0) { /* : fprintf('[LIN 1] Normal Mode\n'); */ printf("[LIN 1] Normal Mode\n"); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* End of Outputs for SubSystem: '/If Action Subsystem2' */ } else { /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: * ActionPort: '/Action Port' */ /* Merge: '/Merge' incorporates: * SignalConversion generated from: '/stepIn' */ rtB.Merge_f1 = rtb_y_b2; /* End of Outputs for SubSystem: '/If Action Subsystem3' */ } /* End of If: '/If1' */ /* End of Outputs for SubSystem: '/Normal Mode' */ break; case 4: /* Outputs for IfAction SubSystem: '/Move to position Min' incorporates: * ActionPort: '/Action Port' */ /* If: '/If1' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write1' * SignalConversion generated from: '/Bus Selector' */ if ((Actuator_Ch0_Status_Model.Busy == 0) && (Actuator_Ch0_Status_Model.Error_Connect == 0)) { /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: * ActionPort: '/Action Port' */ for (i = 0; i < 9; i++) { /* DataStoreWrite: '/Data Store Write4' incorporates: * Constant: '/Constant1' */ rtDW.Autos_private[i] = 1U; /* DataStoreWrite: '/Data Store Write2' incorporates: * Constant: '/Constant10' */ rtDW.Stall_private[i] = 1U; /* DataStoreWrite: '/Data Store Write3' */ rtDW.Lnoise_private[i] = 0U; /* DataStoreWrite: '/Data Store Write5' incorporates: * Constant: '/Constant2' */ rtDW.Speed_private[i] = 3U; /* DataStoreWrite: '/Data Store Write6' incorporates: * Constant: '/Constant3' */ rtDW.Coils_private[i] = 3U; /* DataStoreWrite: '/Data Store Write' */ rtDW.POS_private[i] = 0U; /* DataStoreWrite: '/Data Store Write1' incorporates: * Constant: '/Constant9' */ rtDW.COM_private[i] = 3U; } /* Merge: '/Merge' incorporates: * Constant: '/Constant' * Sum: '/step inc' */ rtB.Merge_f1 = (int8_t)(rtb_y_b2 + 1); /* MATLAB Function: '/Write' incorporates: * DataStoreRead: '/Data Store Read3' */ /* : if(LOGGER == 2) */ if (rtDW.LOGGER_LIN == 2.0) { /* : fprintf('[LIN 1] Move to position Min\n'); */ printf("[LIN 1] Move to position Min\n"); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* End of Outputs for SubSystem: '/If Action Subsystem2' */ } else { /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: * ActionPort: '/Action Port' */ /* Merge: '/Merge' incorporates: * SignalConversion generated from: '/stepIn' */ rtB.Merge_f1 = rtb_y_b2; /* End of Outputs for SubSystem: '/If Action Subsystem3' */ } /* End of If: '/If1' */ /* End of Outputs for SubSystem: '/Move to position Min' */ break; case 5: /* Outputs for IfAction SubSystem: '/Check Stall Min' incorporates: * ActionPort: '/Action Port' */ /* Logic: '/Logical Operator3' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read' * Logic: '/Logical Operator1' * Logic: '/Logical Operator2' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator1' */ for (i = 0; i < 9; i++) { rtb_LogicalOperator3_i5[i] = ((Actuator_Ch0_Status_Model.in_Act_Stall_Slave[i] == 1) || (Actuator_Ch0_Status_Model.in_CPOS_ALL[i] == 0) || (rtDW.ErrorCalibration_private[i] == 0)); } /* End of Logic: '/Logical Operator3' */ /* Logic: '/Logical Operator' incorporates: * Logic: '/Logical Operator3' */ rtb_LogicalOperator1_n = rtb_LogicalOperator3_i5[0]; for (i = 0; i < 8; i++) { rtb_LogicalOperator1_n = (rtb_LogicalOperator1_n && rtb_LogicalOperator3_i5[i + 1]); } /* If: '/If2' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write1' * DataTypeConversion: '/Data Type Conversion' * DataTypeConversion: '/Data Type Conversion1' * Logic: '/Logical Operator' * SignalConversion generated from: '/Bus Selector' */ if ((Actuator_Ch0_Status_Model.Busy == 0) && (Actuator_Ch0_Status_Model.Error_Connect == 0) && rtb_LogicalOperator1_n) { /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write1' */ for (i = 0; i < 9; i++) { /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read1' */ if (rtDW.ErrorCalibration_private[i] != 0) { rtDW.MinPositionCh0_private[i] = Actuator_Ch0_Status_Model.in_CPOS_ALL[i]; } /* End of Switch: '/Switch' */ } /* End of DataStoreWrite: '/Data Store Write1' */ /* Merge: '/Merge' incorporates: * Constant: '/Constant' * Sum: '/step inc' */ rtB.Merge_f1 = (int8_t)(rtb_y_b2 + 1); /* MATLAB Function: '/Write' incorporates: * DataStoreRead: '/Data Store Read3' */ /* : if(LOGGER == 2) */ if (rtDW.LOGGER_LIN == 2.0) { /* : fprintf('[LIN 1] Check Stall Min\n'); */ printf("[LIN 1] Check Stall Min\n"); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* End of Outputs for SubSystem: '/If Action Subsystem2' */ } else { /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: * ActionPort: '/Action Port' */ /* Merge: '/Merge' incorporates: * SignalConversion generated from: '/stepIn' */ rtB.Merge_f1 = rtb_y_b2; /* End of Outputs for SubSystem: '/If Action Subsystem3' */ } /* End of If: '/If2' */ /* End of Outputs for SubSystem: '/Check Stall Min' */ break; case 6: /* Outputs for IfAction SubSystem: '/Initial CPOS Max' incorporates: * ActionPort: '/Action Port' */ /* If: '/If1' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write1' * SignalConversion generated from: '/Bus Selector' */ if ((Actuator_Ch0_Status_Model.Busy == 0) && (Actuator_Ch0_Status_Model.Error_Connect == 0)) { /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: * ActionPort: '/Action Port' */ for (i = 0; i < 9; i++) { /* DataStoreWrite: '/Data Store Write1' */ rtDW.COM_private[i] = 2U; /* DataStoreWrite: '/Data Store Write' */ rtDW.POS_private[i] = 0U; } /* Merge: '/Merge' incorporates: * Constant: '/Constant' * Sum: '/step inc' */ rtB.Merge_f1 = (int8_t)(rtb_y_b2 + 1); /* MATLAB Function: '/Write' incorporates: * DataStoreRead: '/Data Store Read3' */ /* : if(LOGGER == 2) */ if (rtDW.LOGGER_LIN == 2.0) { /* : fprintf('[LIN 1] Initial CPOS Max\n'); */ printf("[LIN 1] Initial CPOS Max\n"); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* End of Outputs for SubSystem: '/If Action Subsystem2' */ } else { /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: * ActionPort: '/Action Port' */ /* Merge: '/Merge' incorporates: * SignalConversion generated from: '/stepIn' */ rtB.Merge_f1 = rtb_y_b2; /* End of Outputs for SubSystem: '/If Action Subsystem3' */ } /* End of If: '/If1' */ /* End of Outputs for SubSystem: '/Initial CPOS Max' */ break; case 7: /* Outputs for IfAction SubSystem: '/Move to position Max' incorporates: * ActionPort: '/Action Port' */ /* If: '/If1' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write1' * SignalConversion generated from: '/Bus Selector' */ if ((Actuator_Ch0_Status_Model.Busy == 0) && (Actuator_Ch0_Status_Model.Error_Connect == 0)) { /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: * ActionPort: '/Action Port' */ for (i = 0; i < 9; i++) { /* DataStoreWrite: '/Data Store Write4' incorporates: * Constant: '/Constant1' */ rtDW.Autos_private[i] = 1U; /* DataStoreWrite: '/Data Store Write2' incorporates: * Constant: '/Constant10' */ rtDW.Stall_private[i] = 1U; /* DataStoreWrite: '/Data Store Write3' */ rtDW.Lnoise_private[i] = 0U; /* DataStoreWrite: '/Data Store Write5' incorporates: * Constant: '/Constant2' */ rtDW.Speed_private[i] = 3U; /* DataStoreWrite: '/Data Store Write' */ rtDW.POS_private[i] = 6000U; /* DataStoreWrite: '/Data Store Write1' incorporates: * Constant: '/Constant9' */ rtDW.COM_private[i] = 3U; /* DataStoreWrite: '/Data Store Write6' */ rtDW.Coils_private[i] = 0U; } /* Merge: '/Merge' incorporates: * Constant: '/Constant' * Sum: '/step inc' */ rtB.Merge_f1 = (int8_t)(rtb_y_b2 + 1); /* MATLAB Function: '/Write' incorporates: * DataStoreRead: '/Data Store Read3' */ /* : if(LOGGER == 2) */ if (rtDW.LOGGER_LIN == 2.0) { /* : fprintf('[LIN 1] Move to position Max\n'); */ printf("[LIN 1] Move to position Max\n"); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* End of Outputs for SubSystem: '/If Action Subsystem2' */ } else { /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: * ActionPort: '/Action Port' */ /* Merge: '/Merge' incorporates: * SignalConversion generated from: '/stepIn' */ rtB.Merge_f1 = rtb_y_b2; /* End of Outputs for SubSystem: '/If Action Subsystem3' */ } /* End of If: '/If1' */ /* End of Outputs for SubSystem: '/Move to position Max' */ break; case 8: /* Outputs for IfAction SubSystem: '/Check Stall Max' incorporates: * ActionPort: '/Action Port' */ /* Logic: '/Logical Operator3' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read' * Logic: '/Logical Operator' * Logic: '/Logical Operator2' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator1' */ for (i = 0; i < 9; i++) { rtb_LogicalOperator3_i5[i] = ((Actuator_Ch0_Status_Model.in_Act_Stall_Slave[i] == 1) || (Actuator_Ch0_Status_Model.in_CPOS_ALL[i] == 6000) || (rtDW.ErrorCalibration_private[i] == 0)); } /* End of Logic: '/Logical Operator3' */ /* Logic: '/Logical Operator1' incorporates: * Logic: '/Logical Operator3' */ rtb_LogicalOperator1_n = rtb_LogicalOperator3_i5[0]; for (i = 0; i < 8; i++) { rtb_LogicalOperator1_n = (rtb_LogicalOperator1_n && rtb_LogicalOperator3_i5[i + 1]); } /* If: '/If2' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write1' * DataTypeConversion: '/Data Type Conversion' * DataTypeConversion: '/Data Type Conversion1' * Logic: '/Logical Operator1' * SignalConversion generated from: '/Bus Selector' */ if ((Actuator_Ch0_Status_Model.Busy == 0) && (Actuator_Ch0_Status_Model.Error_Connect == 0) && rtb_LogicalOperator1_n) { /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write1' */ for (i = 0; i < 9; i++) { /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read1' */ if (rtDW.ErrorCalibration_private[i] != 0) { rtDW.MaxPositionCh0_private[i] = Actuator_Ch0_Status_Model.in_CPOS_ALL[i]; } /* End of Switch: '/Switch' */ } /* End of DataStoreWrite: '/Data Store Write1' */ /* Merge: '/Merge' incorporates: * Constant: '/Constant' * Sum: '/step inc' */ rtB.Merge_f1 = (int8_t)(rtb_y_b2 + 1); /* MATLAB Function: '/Write' incorporates: * DataStoreRead: '/Data Store Read3' */ /* : if(LOGGER == 2) */ if (rtDW.LOGGER_LIN == 2.0) { /* : fprintf('[LIN 1] Check Stall MAX\n'); */ printf("[LIN 1] Check Stall MAX\n"); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* End of Outputs for SubSystem: '/If Action Subsystem2' */ } else { /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: * ActionPort: '/Action Port' */ /* Merge: '/Merge' incorporates: * SignalConversion generated from: '/stepIn' */ rtB.Merge_f1 = rtb_y_b2; /* End of Outputs for SubSystem: '/If Action Subsystem3' */ } /* End of If: '/If2' */ /* End of Outputs for SubSystem: '/Check Stall Max' */ break; case 9: /* Outputs for IfAction SubSystem: '/Homing' incorporates: * ActionPort: '/Action Port' */ /* Product: '/Divide1' incorporates: * Constant: '/ACT1' * DataStoreRead: '/MAX ACT1T ' */ for (i = 0; i < 9; i++) { rtb_Divide1_e[i] = (double)rtDW.MaxPositionCh0_private[i] / (double) rtConstP.ACT1_Value[i]; } /* End of Product: '/Divide1' */ /* SwitchCase: '/Switch Case' incorporates: * DataStoreRead: '/Data Store Read4' */ switch (rtDW.stepHoming_private) { case 0: /* Outputs for IfAction SubSystem: '/Switch Case Action Subsystem' incorporates: * ActionPort: '/Action Port' */ for (i = 0; i < 9; i++) { /* RelationalOperator: '/Compare' */ rtb_u8Vtg_FX_plus = rtb_Divide1_e[i]; /* Logic: '/Logical Operator' incorporates: * Constant: '/Constant' * Constant: '/Constant' * RelationalOperator: '/Compare' * RelationalOperator: '/Compare' */ rtb_LogicalOperator1 = ((rtb_u8Vtg_FX_plus >= 0.5) && (rtb_u8Vtg_FX_plus <= 1.9)); rtb_LogicalOperator3_i5[i] = rtb_LogicalOperator1; /* DataTypeConversion: '/Data Type Conversion' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write' * Logic: '/Logical Operator' * Logic: '/Logical Operator1' */ rtDW.ErrorCalibration_private[i] = (uint8_t)((!rtb_LogicalOperator1) && (rtDW.ErrorCalibration_private[i] != 0)); } /* MATLAB Function: '/MAX POSITION' incorporates: * DataStoreRead: '/Data Store Read5' * DataStoreRead: '/MIN ACT1T 1' * Logic: '/Logical Operator2' */ /* : if(LOGGER>0) */ if (rtDW.LOGGER_LIN > 0.0) { /* : fprintf("[LIN 1] Homing 0\n"); */ printf("[LIN 1] Homing 0\n"); fflush(stdout); /* : for i = 1:numel(MAX) */ for (i = 0; i < 9; i++) { /* : fprintf('[LIN 1] ACT%d MAX = %d KOEF = %f Callibration = %d \n', int16(i), int16(MAX(i)), KOEF(i), int16(ERRORS(i))); */ printf("[LIN 1] ACT%d MAX = %d KOEF = %f Callibration = %d \n", (int16_t)(i + 1), rtDW.MaxPositionCh0_private[i], rtb_Divide1_e[i], (int16_t)!rtb_LogicalOperator3_i5[i]); fflush(stdout); } } /* End of MATLAB Function: '/MAX POSITION' */ /* Logic: '/Logical Operator1' */ rtb_LogicalOperator1_n = rtb_LogicalOperator3_i5[0]; for (i = 0; i < 8; i++) { rtb_LogicalOperator1_n = (rtb_LogicalOperator1_n && rtb_LogicalOperator3_i5[i + 1]); } /* Switch: '/Switch' incorporates: * Logic: '/Logical Operator1' */ if (rtb_LogicalOperator1_n) { /* Merge: '/Merge' incorporates: * Constant: '/Constant1' */ rtB.Merge_ac = 4; } else { /* Merge: '/Merge' incorporates: * Constant: '/Constant' */ rtB.Merge_ac = 1; } /* End of Switch: '/Switch' */ /* End of Outputs for SubSystem: '/Switch Case Action Subsystem' */ break; case 1: /* Outputs for IfAction SubSystem: '/Switch Case Action Subsystem1' incorporates: * ActionPort: '/Action Port' */ /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' */ for (i = 0; i < 9; i++) { rtb_LogicalOperator3_i5[i] = (rtb_Divide1_e[i] > 1.5); } /* End of RelationalOperator: '/Compare' */ /* Logic: '/Logical Operator' */ rtb_LogicalOperator1_n = rtb_LogicalOperator3_i5[0]; for (i = 0; i < 8; i++) { rtb_LogicalOperator1_n = (rtb_LogicalOperator1_n || rtb_LogicalOperator3_i5[i + 1]); } /* DataTypeConversion: '/Data Type Conversion' incorporates: * DataStoreWrite: '/Data Store Write1' * Logic: '/Logical Operator' */ rtDW.CCU_ActuatorErrF_Stat_private = rtb_LogicalOperator1_n; for (i = 0; i < 9; i++) { /* DataTypeConversion: '/Data Type Conversion1' incorporates: * DataStoreWrite: '/Data Store Write2' */ rtb_LogicalOperator1 = rtb_LogicalOperator3_i5[i]; rtDW.COM_private[i] = rtb_LogicalOperator1; /* DataTypeConversion: '/Data Type Conversion2' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write3' * Logic: '/Logical Operator1' */ rtDW.ErrorActuator[i] = (uint8_t)(rtb_LogicalOperator1 || (rtDW.ErrorActuator[i] != 0)); /* DataStoreWrite: '/Data Store Write' */ rtDW.MODE_private[i] = 2U; } /* MATLAB Function: '/Write ERROR' incorporates: * DataStoreRead: '/Data Store Read6' */ /* : if(LOGGER>=0) */ if (rtDW.LOGGER_LIN >= 0.0) { /* : for i = 1:numel(ErrCallibration) */ for (i = 0; i < 9; i++) { /* : if ErrCallibration(i) == 1 */ if (rtb_LogicalOperator3_i5[i]) { /* : fprintf('[LIN 1] Failure with actuator #%d\n', int16(i)); */ printf("[LIN 1] Failure with actuator #%d\n", (int16_t)(i + 1)); fflush(stdout); } } } /* End of MATLAB Function: '/Write ERROR' */ for (i = 0; i < 9; i++) { /* Logic: '/Logical Operator1' */ rtb_LogicalOperator1 = rtb_LogicalOperator3_i5[i]; /* DataTypeConversion: '/Data Type Conversion' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write' * Logic: '/Logical Operator' * Logic: '/Logical Operator1' */ rtDW.ErrorCalibration_private[i] = (uint8_t)((!rtb_LogicalOperator1) && (rtDW.ErrorCalibration_private[i] != 0)); /* DataStoreWrite: '/Data Store Write' incorporates: * DataTypeConversion: '/Data Type Conversion' */ rtDW.dtc_state_error_model[i + 54] = rtb_LogicalOperator1; } /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.stepSig_private = 1; /* MATLAB Function: '/MAX POSITION' incorporates: * DataStoreRead: '/Data Store Read5' * DataStoreRead: '/MIN ACT1T 1' * DataStoreWrite: '/Data Store Write' */ /* : if(LOGGER>0) */ if (rtDW.LOGGER_LIN > 0.0) { /* : fprintf("[LIN 1] Homing 1. Start Callibration \n"); */ printf("[LIN 1] Homing 1. Start Callibration \n"); fflush(stdout); /* : for i = 1:numel(MAX) */ for (i = 0; i < 9; i++) { /* : if(ERRORS(i)==1) */ if (rtDW.ErrorCalibration_private[i] == 1) { /* : fprintf('[LIN 1] ACT%d MAX = %d KOEF = %f Callibration = %d \n', int16(i), int16(MAX(i)), KOEF(i), int16(ERRORS(i))); */ printf("[LIN 1] ACT%d MAX = %d KOEF = %f Callibration = %d \n", (int16_t)(i + 1), rtDW.MaxPositionCh0_private[i], rtb_Divide1_e[i], (int16_t)rtDW.ErrorCalibration_private[i]); fflush(stdout); } } } /* End of MATLAB Function: '/MAX POSITION' */ /* Logic: '/Logical Operator2' incorporates: * DataStoreWrite: '/Data Store Write' */ rtb_LogicalOperator1_n = (rtDW.ErrorCalibration_private[0] != 0); for (i = 0; i < 8; i++) { rtb_LogicalOperator1_n = (rtb_LogicalOperator1_n || (rtDW.ErrorCalibration_private[i + 1] != 0)); } /* Switch: '/Switch' incorporates: * Logic: '/Logical Operator2' */ if (rtb_LogicalOperator1_n) { /* Merge: '/Merge' incorporates: * Constant: '/Constant1' */ rtB.Merge_ac = 2; } else { /* Merge: '/Merge' incorporates: * Constant: '/Constant1' */ rtB.Merge_ac = 4; } /* End of Switch: '/Switch' */ /* End of Outputs for SubSystem: '/Switch Case Action Subsystem1' */ break; case 2: /* Outputs for IfAction SubSystem: '/Switch Case Action Subsystem2' incorporates: * ActionPort: '/Action Port' */ for (i = 0; i < 9; i++) { /* RelationalOperator: '/Compare' */ rtb_u8Vtg_FX_plus = rtb_Divide1_e[i]; /* Logic: '/Logical Operator3' incorporates: * Constant: '/Constant' * Constant: '/Constant' * DataStoreRead: '/Data Store Read' * Logic: '/Logical Operator1' * Logic: '/Logical Operator4' * RelationalOperator: '/Compare' * RelationalOperator: '/Compare' */ rtb_LogicalOperator1 = (((rtb_u8Vtg_FX_plus < 0.97) || (rtb_u8Vtg_FX_plus > 1.03)) && (rtDW.ErrorCalibration_private[i] != 0)); rtb_LogicalOperator3_i5[i] = rtb_LogicalOperator1; /* DataTypeConversion: '/Data Type Conversion' incorporates: * DataStoreWrite: '/Data Store Write1' */ rtDW.ErrorCalibration_private[i] = rtb_LogicalOperator1; } /* MATLAB Function: '/MAX POSITION' incorporates: * DataStoreRead: '/Data Store Read5' * DataStoreRead: '/MIN ACT1T 1' */ /* : if(LOGGER>0) */ if (rtDW.LOGGER_LIN > 0.0) { /* : fprintf("[LIN 1] Homing 3. Callibration \n"); */ printf("[LIN 1] Homing 3. Callibration \n"); fflush(stdout); /* : for i = 1:numel(MAX) */ for (i = 0; i < 9; i++) { /* : if(ERRORS(i)==1) */ if (rtb_LogicalOperator3_i5[i]) { /* : fprintf('[LIN 1] ACT%d MAX = %d KOEF = %f Callibration = %d \n', int16(i), int16(MAX(i)), KOEF(i), int16(ERRORS(i))); */ printf("[LIN 1] ACT%d MAX = %d KOEF = %f Callibration = %d \n", (int16_t)(i + 1), rtDW.MaxPositionCh0_private[i], rtb_Divide1_e[i], 1); fflush(stdout); } } } /* End of MATLAB Function: '/MAX POSITION' */ /* Logic: '/Logical Operator2' */ rtb_LogicalOperator1_n = rtb_LogicalOperator3_i5[0]; for (i = 0; i < 8; i++) { rtb_LogicalOperator1_n = (rtb_LogicalOperator1_n || rtb_LogicalOperator3_i5[i + 1]); } /* Switch: '/Switch' incorporates: * Logic: '/Logical Operator2' */ if (rtb_LogicalOperator1_n) { /* Merge: '/Merge' incorporates: * Constant: '/Constant3' */ rtB.Merge_ac = 3; } else { /* Merge: '/Merge' incorporates: * Constant: '/Constant1' */ rtB.Merge_ac = 4; } /* End of Switch: '/Switch' */ /* End of Outputs for SubSystem: '/Switch Case Action Subsystem2' */ break; case 3: /* Outputs for IfAction SubSystem: '/Switch Case Action Subsystem3' incorporates: * ActionPort: '/Action Port' */ /* MATLAB Function: '/MAX POSITION' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read5' */ /* : if(LOGGER>1) */ if (rtDW.LOGGER_LIN > 1.0) { /* : fprintf("[LIN 1] Homing 3. Start Time on step %d\n",int16(step)); */ rtb_u8Vtg_FX_plus = rt_roundd(rtDW.ErrorHomming_private); if (rtb_u8Vtg_FX_plus < 32768.0) { if (rtb_u8Vtg_FX_plus >= -32768.0) { rtb_FLU_tg_correct_g = (int16_t)rtb_u8Vtg_FX_plus; } else { rtb_FLU_tg_correct_g = INT16_MIN; } } else { rtb_FLU_tg_correct_g = INT16_MAX; } printf("[LIN 1] Homing 3. Start Time on step %d\n", rtb_FLU_tg_correct_g); fflush(stdout); } /* End of MATLAB Function: '/MAX POSITION' */ /* If: '/If' incorporates: * DataStoreRead: '/Data Store Read1' */ if (rtDW.ErrorHomming_private < 10.0) { /* Outputs for IfAction SubSystem: '/If Action Subsystem' incorporates: * ActionPort: '/Action Port' */ /* MATLAB Function: '/MATLAB Function' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreRead: '/Data Store Read1' */ MATLABFunction(rtDW.Start_timer_n, rtDW.t_now, &rtb_dt_an, &rtDW.sf_MATLABFunction_h); /* MATLAB Function: '/MAX POSITION' incorporates: * DataStoreRead: '/Data Store Read5' */ /* : if(LOGGER>1) */ if (rtDW.LOGGER_LIN > 1.0) { /* : fprintf("[LIN 1] Homing 3. Start TIme dt = %d \n",int32(data)); */ rtb_Subtract = rtb_dt_an; if (rtb_dt_an > 2147483647U) { rtb_Subtract = 2147483647U; } printf("[LIN 1] Homing 3. Start TIme dt = %d \n", (int32_t) rtb_Subtract); fflush(stdout); } /* End of MATLAB Function: '/MAX POSITION' */ /* If: '/If' */ if (rtb_dt_an > 30000U) { /* Outputs for IfAction SubSystem: '/If Action Subsystem' incorporates: * ActionPort: '/Action Port' */ /* Merge: '/Merge' */ IfActionSubsystem(&rtB.Merge_ac, &rtDW.ErrorHomming_private, &rtDW.Start_timer_n, &rtDW.stepSig_private); /* End of Outputs for SubSystem: '/If Action Subsystem' */ } else { /* Outputs for IfAction SubSystem: '/If Action Subsystem1' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write2' incorporates: * Constant: '/Constant3' */ rtDW.Start_timer_n = 1.0; /* DataTypeConversion: '/Data Type Conversion2' incorporates: * DataStoreRead: '/valves target in percent' */ for (i = 0; i < 9; i++) { rtb_DataTypeConversion_bq[i] = (uint8_t)rtb_out_dwb[i]; } /* End of DataTypeConversion: '/Data Type Conversion2' */ /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Concatenate: '/Vector Concatenate' */ rtDW.BUS_ADR_private[0] = rtb_DataTypeConversion_bq[8]; /* DataStoreRead: '/Data Store Read4' incorporates: * Concatenate: '/Vector Concatenate' */ rtDW.BUS_ADR_private[1] = rtb_Switch_m5; /* DataStoreRead: '/Data Store Read3' incorporates: * Concatenate: '/Vector Concatenate' */ rtDW.BUS_ADR_private[2] = rtb_u_gnq; /* DataStoreRead: '/Data Store Read' incorporates: * Concatenate: '/Vector Concatenate' */ rtDW.BUS_ADR_private[3] = rtDW.PID_TempFUL; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Concatenate: '/Vector Concatenate' */ rtDW.BUS_ADR_private[4] = rtb_DataTypeConversion_bq[1]; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Concatenate: '/Vector Concatenate' */ rtDW.BUS_ADR_private[5] = rtb_DataTypeConversion_bq[0]; /* DataStoreRead: '/Data Store Read6' incorporates: * Concatenate: '/Vector Concatenate' */ rtDW.BUS_ADR_private[6] = rtDW.PID_TempFLL; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Concatenate: '/Vector Concatenate' */ rtDW.BUS_ADR_private[7] = rtb_DataTypeConversion_bq[4]; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Concatenate: '/Vector Concatenate' */ rtDW.BUS_ADR_private[8] = rtb_DataTypeConversion_bq[5]; for (i = 0; i < 9; i++) { /* Product: '/Product' */ Valve_2_way = rtDW.BUS_ADR_private[i]; /* DataTypeConversion: '/Data Type Conversion1' incorporates: * Constant: '/Constant1' * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write' * Product: '/Divide1' * Product: '/Product' */ rtDW.POS_private[i] = (uint16_t)((double)(Valve_2_way * rtDW.MaxPositionCh0_private[i]) / 100.0); /* RelationalOperator: '/Relational Operator1' incorporates: * DataStoreWrite: '/Data Store Write2' */ rtb_LogicalOperator3_i5[i] = (rtb_DataTypeConversion_bh[i] == Valve_2_way); } /* Logic: '/Logical Operator' */ rtb_LogicalOperator1_n = rtb_LogicalOperator3_i5[0]; for (i = 0; i < 8; i++) { rtb_LogicalOperator1_n = (rtb_LogicalOperator1_n && rtb_LogicalOperator3_i5[i + 1]); } for (i = 0; i < 9; i++) { /* Switch: '/Switch' incorporates: * Constant: '/Constant4' * Constant: '/Constant9' * DataStoreWrite: '/Data Store Write1' * Logic: '/Logical Operator' */ if (rtb_LogicalOperator1_n) { rtDW.COM_private[i] = 0U; } else { rtDW.COM_private[i] = 3U; } /* End of Switch: '/Switch' */ /* DataTypeConversion: '/Data Type Conversion1' incorporates: * Concatenate: '/Vector Concatenate' * Constant: '/Constant5' * DataStoreWrite: '/Data Store Write2' * DataStoreWrite: '/Data Store Write7' * Product: '/Product' * RelationalOperator: '/Relational Operator' */ rtDW.BUS_ADR_private[i] = (uint8_t)((uint32_t) (rtb_DataTypeConversion_bh[i] != rtDW.BUS_ADR_private[i]) * rtConstP.pooled106[i]); /* DataStoreWrite: '/Data Store Write4' incorporates: * Constant: '/Constant1' */ rtDW.Autos_private[i] = 1U; /* DataStoreWrite: '/Data Store Write2' incorporates: * Constant: '/Constant10' */ rtDW.Stall_private[i] = 1U; /* DataStoreWrite: '/Data Store Write3' incorporates: * Constant: '/Constant11' */ rtDW.Lnoise_private[i] = 0U; /* DataStoreWrite: '/Data Store Write5' incorporates: * Constant: '/Constant2' */ rtDW.Speed_private[i] = 3U; /* DataStoreWrite: '/Data Store Write6' incorporates: * Constant: '/Constant3' */ rtDW.Coils_private[i] = 3U; } /* Merge: '/Merge' incorporates: * Constant: '/Constant1' * Merge: '/Merge' * SignalConversion generated from: '/Out1' */ rtB.Merge_ac = 3; /* End of Outputs for SubSystem: '/If Action Subsystem1' */ } /* End of If: '/If' */ /* End of Outputs for SubSystem: '/If Action Subsystem' */ } else { /* Outputs for IfAction SubSystem: '/If Action Subsystem1' incorporates: * ActionPort: '/Action Port' */ IfActionSubsystem1(&rtB.Merge_ac, &rtDW.CCU_ActuatorErrF_Stat_private, rtDW.COM_private, rtDW.ErrorActuator, rtDW.ErrorCalibration_private, &rtDW.LOGGER_LIN, rtDW.MODE_private, rtDW.dtc_state_error_model); /* End of Outputs for SubSystem: '/If Action Subsystem1' */ } /* End of If: '/If' */ /* End of Outputs for SubSystem: '/Switch Case Action Subsystem3' */ break; case 4: /* Outputs for IfAction SubSystem: '/Switch Case Action Subsystem4' incorporates: * ActionPort: '/Action Port' */ /* DataTypeConversion: '/Data Type Conversion2' incorporates: * DataStoreRead: '/valves target in percent' */ for (i = 0; i < 9; i++) { rtb_DataTypeConversion_bq[i] = (uint8_t)rtb_out_dwb[i]; } /* End of DataTypeConversion: '/Data Type Conversion2' */ /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Concatenate: '/Vector Concatenate' */ rtDW.BUS_ADR_private[0] = rtb_DataTypeConversion_bq[8]; /* DataStoreRead: '/Data Store Read4' incorporates: * Concatenate: '/Vector Concatenate' */ rtDW.BUS_ADR_private[1] = rtb_Switch_m5; /* DataStoreRead: '/Data Store Read3' incorporates: * Concatenate: '/Vector Concatenate' */ rtDW.BUS_ADR_private[2] = rtb_u_gnq; /* DataStoreRead: '/Data Store Read' incorporates: * Concatenate: '/Vector Concatenate' */ rtDW.BUS_ADR_private[3] = rtDW.PID_TempFUL; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Concatenate: '/Vector Concatenate' */ rtDW.BUS_ADR_private[4] = rtb_DataTypeConversion_bq[1]; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Concatenate: '/Vector Concatenate' */ rtDW.BUS_ADR_private[5] = rtb_DataTypeConversion_bq[0]; /* DataStoreRead: '/Data Store Read6' incorporates: * Concatenate: '/Vector Concatenate' */ rtDW.BUS_ADR_private[6] = rtDW.PID_TempFLL; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Concatenate: '/Vector Concatenate' */ rtDW.BUS_ADR_private[7] = rtb_DataTypeConversion_bq[4]; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Concatenate: '/Vector Concatenate' */ rtDW.BUS_ADR_private[8] = rtb_DataTypeConversion_bq[5]; for (i = 0; i < 9; i++) { /* Product: '/Product' */ Valve_2_way = rtDW.BUS_ADR_private[i]; /* DataTypeConversion: '/Data Type Conversion1' incorporates: * Constant: '/Constant1' * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write' * Product: '/Divide1' * Product: '/Product' */ rtDW.POS_private[i] = (uint16_t)((double)(Valve_2_way * rtDW.MaxPositionCh0_private[i]) / 100.0); /* RelationalOperator: '/Relational Operator1' incorporates: * DataStoreWrite: '/Data Store Write2' */ rtb_LogicalOperator3_i5[i] = (rtb_DataTypeConversion_bh[i] == Valve_2_way); } /* Logic: '/Logical Operator' */ rtb_LogicalOperator1_n = rtb_LogicalOperator3_i5[0]; for (i = 0; i < 8; i++) { rtb_LogicalOperator1_n = (rtb_LogicalOperator1_n && rtb_LogicalOperator3_i5[i + 1]); } for (i = 0; i < 9; i++) { /* Switch: '/Switch' incorporates: * Constant: '/Constant4' * Constant: '/Constant9' * DataStoreWrite: '/Data Store Write1' * Logic: '/Logical Operator' */ if (rtb_LogicalOperator1_n) { rtDW.COM_private[i] = 0U; } else { rtDW.COM_private[i] = 3U; } /* End of Switch: '/Switch' */ /* DataTypeConversion: '/Data Type Conversion1' incorporates: * Concatenate: '/Vector Concatenate' * Constant: '/Constant5' * DataStoreWrite: '/Data Store Write2' * DataStoreWrite: '/Data Store Write7' * Product: '/Product' * RelationalOperator: '/Relational Operator' */ rtDW.BUS_ADR_private[i] = (uint8_t)((uint32_t) (rtb_DataTypeConversion_bh[i] != rtDW.BUS_ADR_private[i]) * rtConstP.pooled106[i]); /* DataStoreWrite: '/Data Store Write4' incorporates: * Constant: '/Constant1' */ rtDW.Autos_private[i] = 1U; /* DataStoreWrite: '/Data Store Write2' incorporates: * Constant: '/Constant10' */ rtDW.Stall_private[i] = 1U; /* DataStoreWrite: '/Data Store Write3' incorporates: * Constant: '/Constant11' */ rtDW.Lnoise_private[i] = 0U; /* DataStoreWrite: '/Data Store Write5' incorporates: * Constant: '/Constant2' */ rtDW.Speed_private[i] = 3U; /* DataStoreWrite: '/Data Store Write6' incorporates: * Constant: '/Constant3' */ rtDW.Coils_private[i] = 3U; } /* Merge: '/Merge' incorporates: * Constant: '/Constant1' * SignalConversion generated from: '/step' */ rtB.Merge_ac = 4; /* End of Outputs for SubSystem: '/Switch Case Action Subsystem4' */ break; } /* End of SwitchCase: '/Switch Case' */ /* DataStoreWrite: '/Data Store Write2' */ rtDW.stepHoming_private = rtB.Merge_ac; /* Merge: '/Merge' incorporates: * DataStoreRead: '/Data Store Read7' */ rtB.Merge_f1 = rtDW.stepSig_private; /* End of Outputs for SubSystem: '/Homing' */ break; } /* End of SwitchCase: '/Switch Case' */ /* DataStoreWrite: '/Finish write stepSig' */ rtDW.stepSig_private = rtB.Merge_f1; for (i = 0; i < 9; i++) { /* BusCreator: '/Bus Creator' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read2' * DataStoreRead: '/Data Store Read3' * DataStoreRead: '/Data Store Read4' * DataStoreRead: '/Data Store Read5' * DataStoreRead: '/Data Store Read6' * DataStoreRead: '/Data Store Read7' * DataStoreRead: '/Data Store Read8' * DataStoreWrite: '/Data Store Write' */ Actuator_Ch0_Command_Model.POS[i] = rtDW.POS_private[i]; Actuator_Ch0_Command_Model.BUS_ADR[i] = rtDW.BUS_ADR_private[i]; Actuator_Ch0_Command_Model.MODE[i] = rtDW.MODE_private[i]; Actuator_Ch0_Command_Model.COM[i] = rtDW.COM_private[i]; Actuator_Ch0_Command_Model.Stall_SET[i] = rtDW.Stall_private[i]; Actuator_Ch0_Command_Model.Lnoise_SET[i] = rtDW.Lnoise_private[i]; Actuator_Ch0_Command_Model.Autos_SET[i] = rtDW.Autos_private[i]; Actuator_Ch0_Command_Model.Speed_SET[i] = rtDW.Speed_private[i]; Actuator_Ch0_Command_Model.Coils_Stop_SET[i] = rtDW.Coils_private[i]; /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' * DataStoreRead: '/Data Store Read2' */ rtb_LogicalOperator3_i5[i] = (rtDW.ErrorCalibration_private[i] == 0); } /* Logic: '/Logical Operator' */ rtb_LogicalOperator1_n = rtb_LogicalOperator3_i5[0]; for (i = 0; i < 8; i++) { rtb_LogicalOperator1_n = (rtb_LogicalOperator1_n || rtb_LogicalOperator3_i5[i + 1]); } for (i = 0; i < 9; i++) { /* Switch: '/Switch1' incorporates: * Concatenate: '/Vector Concatenate' * Constant: '/Constant' * Constant: '/Constant3' * DataStoreRead: '/Data Store Read2' * DataStoreWrite: '/Data Store Write7' * Logic: '/Logical Operator' * Product: '/Product' */ if (rtb_LogicalOperator1_n) { rtDW.BUS_ADR_private[i] = (uint8_t)((uint32_t) rtDW.ErrorCalibration_private[i] * rtConstP.pooled106[i]); } else { rtDW.BUS_ADR_private[i] = 0U; } /* End of Switch: '/Switch1' */ /* DataStoreWrite: '/Data Store Write' */ rtDW.COM_private[i] = 0U; } /* DataTypeConversion: '/Data Type Conversion' */ for (i = 0; i < 6; i++) { /* Switch: '/Switch' incorporates: * Constant: '/Constant' * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read' * Gain: '/Gain' * Product: '/Divide' */ rtb_FLU_tg_correct_g = rtDW.MaxPositionCh1_private[i]; if (rtb_FLU_tg_correct_g != 0) { rtb_u8Vtg_FX_plus = (double)Actuator_Ch1_Status_Model.in_CPOS_ALL[i] / (double)rtb_FLU_tg_correct_g * 100.0; } else { rtb_u8Vtg_FX_plus = 0.0; } /* End of Switch: '/Switch' */ /* Saturate: '/Saturation' */ if (rtb_u8Vtg_FX_plus > 100.0) { rtb_DataTypeConversion_bq[i] = 100U; } else if (rtb_u8Vtg_FX_plus < 0.0) { rtb_DataTypeConversion_bq[i] = 0U; } else { rtb_DataTypeConversion_bq[i] = (uint8_t)rtb_u8Vtg_FX_plus; } /* End of Saturate: '/Saturation' */ } /* End of DataTypeConversion: '/Data Type Conversion' */ /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant1' */ rtb_DataTypeConversion_bq[6] = 0U; rtb_DataTypeConversion_bq[7] = 0U; rtb_DataTypeConversion_bq[8] = 0U; /* DataStoreWrite: '/Data Store Write2' */ for (i = 0; i < 9; i++) { Actuator_pos_percent_Ch1[i] = rtb_DataTypeConversion_bq[i]; } /* Switch: '/Switch' incorporates: * Constant: '/Constant1' * DataStoreRead: '/Data Store Read' * DataStoreRead: '/Data Store Read2' */ if (rtDW.stepSig_private_h > 0) { rtb_y_b2 = rtDW.stepSig_private_h; } else { rtb_y_b2 = 1; } /* End of Switch: '/Switch' */ /* SwitchCase: '/Switch Case' */ switch (rtb_y_b2) { case 1: /* Outputs for IfAction SubSystem: '/Stop Mode' incorporates: * ActionPort: '/Action Port' */ /* If: '/If1' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write1' * SignalConversion generated from: '/Bus Selector' */ if ((Actuator_Ch1_Status_Model.Busy == 0) && (Actuator_Ch1_Status_Model.Error_Connect == 0)) { /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: * ActionPort: '/Action Port' */ for (i = 0; i < 9; i++) { /* DataStoreWrite: '/Data Store Write1' */ rtDW.COM_private_g[i] = 1U; /* DataStoreWrite: '/Data Store Write' */ rtDW.MODE_private_b[i] = 2U; } /* Merge: '/Merge' incorporates: * Constant: '/Constant' * Sum: '/step inc' */ rtB.Merge_e = (int8_t)(rtb_y_b2 + 1); /* MATLAB Function: '/Write' incorporates: * DataStoreRead: '/Data Store Read3' */ /* : if(LOGGER == 2) */ if (rtDW.LOGGER_LIN == 2.0) { /* : fprintf('[LIN 2] Stop Mode\n'); */ printf("[LIN 2] Stop Mode\n"); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* End of Outputs for SubSystem: '/If Action Subsystem2' */ } else { /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: * ActionPort: '/Action Port' */ /* Merge: '/Merge' incorporates: * SignalConversion generated from: '/stepIn' */ rtB.Merge_e = rtb_y_b2; /* End of Outputs for SubSystem: '/If Action Subsystem3' */ } /* End of If: '/If1' */ /* End of Outputs for SubSystem: '/Stop Mode' */ break; case 2: /* Outputs for IfAction SubSystem: '/Initial CPOS Min' incorporates: * ActionPort: '/Action Port' */ /* If: '/If' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write1' * SignalConversion generated from: '/Bus Selector' */ if ((Actuator_Ch1_Status_Model.Busy == 0) && (Actuator_Ch1_Status_Model.Error_Connect == 0)) { /* Outputs for IfAction SubSystem: '/If Action Subsystem' incorporates: * ActionPort: '/Action Port' */ for (i = 0; i < 9; i++) { /* DataStoreWrite: '/Data Store Write' */ rtDW.POS_private_m[i] = 6000U; /* DataStoreWrite: '/Data Store Write1' */ rtDW.COM_private_g[i] = 2U; } /* Merge: '/Merge' incorporates: * Constant: '/Constant' * Merge: '/Merge' * Sum: '/step inc' */ rtB.Merge_e = (int8_t)(rtb_y_b2 + 1); /* MATLAB Function: '/Write' incorporates: * DataStoreRead: '/Data Store Read3' */ /* : if(LOGGER == 2) */ if (rtDW.LOGGER_LIN == 2.0) { /* : fprintf('[LIN 2] Initial CPOS Min\n'); */ printf("[LIN 2] Initial CPOS Min\n"); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* End of Outputs for SubSystem: '/If Action Subsystem' */ } else { /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: * ActionPort: '/Action Port' */ /* Merge: '/Merge' incorporates: * Merge: '/Merge' * SignalConversion generated from: '/stepIn1' */ rtB.Merge_e = rtb_y_b2; /* End of Outputs for SubSystem: '/If Action Subsystem3' */ } /* End of If: '/If' */ /* End of Outputs for SubSystem: '/Initial CPOS Min' */ break; case 3: /* Outputs for IfAction SubSystem: '/Normal Mode' incorporates: * ActionPort: '/Action Port' */ /* If: '/If1' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write1' * SignalConversion generated from: '/Bus Selector' */ if ((Actuator_Ch1_Status_Model.Busy == 0) && (Actuator_Ch1_Status_Model.Error_Connect == 0)) { /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: * ActionPort: '/Action Port' */ for (i = 0; i < 9; i++) { /* DataStoreWrite: '/Data Store Write' */ rtDW.MODE_private_b[i] = 0U; /* DataStoreWrite: '/Data Store Write1' */ rtDW.COM_private_g[i] = 1U; } /* Merge: '/Merge' incorporates: * Constant: '/Constant' * Sum: '/step inc' */ rtB.Merge_e = (int8_t)(rtb_y_b2 + 1); /* MATLAB Function: '/Write' incorporates: * DataStoreRead: '/Data Store Read3' */ /* : if(LOGGER == 2) */ if (rtDW.LOGGER_LIN == 2.0) { /* : fprintf('LIN 2] Normal Mode\n'); */ printf("LIN 2] Normal Mode\n"); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* End of Outputs for SubSystem: '/If Action Subsystem2' */ } else { /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: * ActionPort: '/Action Port' */ /* Merge: '/Merge' incorporates: * SignalConversion generated from: '/stepIn' */ rtB.Merge_e = rtb_y_b2; /* End of Outputs for SubSystem: '/If Action Subsystem3' */ } /* End of If: '/If1' */ /* End of Outputs for SubSystem: '/Normal Mode' */ break; case 4: /* Outputs for IfAction SubSystem: '/Move to position Min' incorporates: * ActionPort: '/Action Port' */ /* If: '/If1' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write1' * SignalConversion generated from: '/Bus Selector' */ if ((Actuator_Ch1_Status_Model.Busy == 0) && (Actuator_Ch1_Status_Model.Error_Connect == 0)) { /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: * ActionPort: '/Action Port' */ for (i = 0; i < 9; i++) { /* DataStoreWrite: '/Data Store Write4' incorporates: * Constant: '/Constant1' */ rtDW.Autos_private_n[i] = 1U; /* DataStoreWrite: '/Data Store Write2' incorporates: * Constant: '/Constant10' */ rtDW.Stall_private_l[i] = 1U; /* DataStoreWrite: '/Data Store Write3' */ rtDW.Lnoise_private_n[i] = 0U; /* DataStoreWrite: '/Data Store Write5' incorporates: * Constant: '/Constant2' */ rtDW.Speed_private_j[i] = 3U; /* DataStoreWrite: '/Data Store Write6' incorporates: * Constant: '/Constant3' */ rtDW.Coils_private_c[i] = 3U; /* DataStoreWrite: '/Data Store Write' */ rtDW.POS_private_m[i] = 0U; /* DataStoreWrite: '/Data Store Write1' incorporates: * Constant: '/Constant9' */ rtDW.COM_private_g[i] = 3U; } /* Merge: '/Merge' incorporates: * Constant: '/Constant' * Sum: '/step inc' */ rtB.Merge_e = (int8_t)(rtb_y_b2 + 1); /* MATLAB Function: '/Write' incorporates: * DataStoreRead: '/Data Store Read3' */ /* : if(LOGGER == 2) */ if (rtDW.LOGGER_LIN == 2.0) { /* : fprintf('[LIN 2] Move to position Min\n'); */ printf("[LIN 2] Move to position Min\n"); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* End of Outputs for SubSystem: '/If Action Subsystem2' */ } else { /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: * ActionPort: '/Action Port' */ /* Merge: '/Merge' incorporates: * SignalConversion generated from: '/stepIn' */ rtB.Merge_e = rtb_y_b2; /* End of Outputs for SubSystem: '/If Action Subsystem3' */ } /* End of If: '/If1' */ /* End of Outputs for SubSystem: '/Move to position Min' */ break; case 5: /* Outputs for IfAction SubSystem: '/Check Stall Min' incorporates: * ActionPort: '/Action Port' */ /* Logic: '/Logical Operator3' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read' * Logic: '/Logical Operator1' * Logic: '/Logical Operator2' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator1' */ for (i = 0; i < 6; i++) { rtb_LogicalOperator3_n1[i] = ((Actuator_Ch1_Status_Model.in_Act_Stall_Slave[i] == 1) || (Actuator_Ch1_Status_Model.in_CPOS_ALL[i] == 0) || (rtDW.ErrorCalibration_private_p[i] == 0)); } /* End of Logic: '/Logical Operator3' */ /* Logic: '/Logical Operator' incorporates: * Logic: '/Logical Operator3' */ rtb_LogicalOperator1_n = rtb_LogicalOperator3_n1[0]; for (i = 0; i < 5; i++) { rtb_LogicalOperator1_n = (rtb_LogicalOperator1_n && rtb_LogicalOperator3_n1[i + 1]); } /* If: '/If2' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write1' * DataTypeConversion: '/Data Type Conversion' * DataTypeConversion: '/Data Type Conversion1' * Logic: '/Logical Operator' * SignalConversion generated from: '/Bus Selector' */ if ((Actuator_Ch1_Status_Model.Busy == 0) && (Actuator_Ch1_Status_Model.Error_Connect == 0) && rtb_LogicalOperator1_n) { /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write1' */ for (i = 0; i < 9; i++) { /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read1' */ if (rtDW.ErrorCalibration_private_p[i] != 0) { rtDW.MinPositionCh1_private[i] = Actuator_Ch1_Status_Model.in_CPOS_ALL[i]; } /* End of Switch: '/Switch' */ } /* End of DataStoreWrite: '/Data Store Write1' */ /* Merge: '/Merge' incorporates: * Constant: '/Constant' * Sum: '/step inc' */ rtB.Merge_e = (int8_t)(rtb_y_b2 + 1); /* MATLAB Function: '/Write' incorporates: * DataStoreRead: '/Data Store Read3' */ /* : if(LOGGER == 2) */ if (rtDW.LOGGER_LIN == 2.0) { /* : fprintf('[LIN 2] Check Stall Min\n'); */ printf("[LIN 2] Check Stall Min\n"); fflush(stdout); /* : for i = 1:numel(data) */ for (i = 0; i < 9; i++) { /* : fprintf('[LIN 2] MIN = %d ', int16(data(i))); */ printf("[LIN 2] MIN = %d ", Actuator_Ch1_Status_Model.in_CPOS_ALL[i]); fflush(stdout); } /* : fprintf('\n'); */ printf("\n"); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* End of Outputs for SubSystem: '/If Action Subsystem2' */ } else { /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: * ActionPort: '/Action Port' */ /* Merge: '/Merge' incorporates: * SignalConversion generated from: '/stepIn' */ rtB.Merge_e = rtb_y_b2; /* End of Outputs for SubSystem: '/If Action Subsystem3' */ } /* End of If: '/If2' */ /* End of Outputs for SubSystem: '/Check Stall Min' */ break; case 6: /* Outputs for IfAction SubSystem: '/Initial CPOS Max' incorporates: * ActionPort: '/Action Port' */ /* If: '/If1' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write1' * SignalConversion generated from: '/Bus Selector' */ if ((Actuator_Ch1_Status_Model.Busy == 0) && (Actuator_Ch1_Status_Model.Error_Connect == 0)) { /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: * ActionPort: '/Action Port' */ for (i = 0; i < 9; i++) { /* DataStoreWrite: '/Data Store Write1' */ rtDW.COM_private_g[i] = 2U; /* DataStoreWrite: '/Data Store Write' */ rtDW.POS_private_m[i] = 0U; } /* Merge: '/Merge' incorporates: * Constant: '/Constant' * Sum: '/step inc' */ rtB.Merge_e = (int8_t)(rtb_y_b2 + 1); /* MATLAB Function: '/Write' incorporates: * DataStoreRead: '/Data Store Read3' */ /* : if(LOGGER == 2) */ if (rtDW.LOGGER_LIN == 2.0) { /* : fprintf('[LIN 2] Initial CPOS Max\n'); */ printf("[LIN 2] Initial CPOS Max\n"); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* End of Outputs for SubSystem: '/If Action Subsystem2' */ } else { /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: * ActionPort: '/Action Port' */ /* Merge: '/Merge' incorporates: * SignalConversion generated from: '/stepIn' */ rtB.Merge_e = rtb_y_b2; /* End of Outputs for SubSystem: '/If Action Subsystem3' */ } /* End of If: '/If1' */ /* End of Outputs for SubSystem: '/Initial CPOS Max' */ break; case 7: /* Outputs for IfAction SubSystem: '/Move to position Max' incorporates: * ActionPort: '/Action Port' */ /* If: '/If1' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write1' * SignalConversion generated from: '/Bus Selector' */ if ((Actuator_Ch1_Status_Model.Busy == 0) && (Actuator_Ch1_Status_Model.Error_Connect == 0)) { /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: * ActionPort: '/Action Port' */ for (i = 0; i < 9; i++) { /* DataStoreWrite: '/Data Store Write4' incorporates: * Constant: '/Constant1' */ rtDW.Autos_private_n[i] = 1U; /* DataStoreWrite: '/Data Store Write2' incorporates: * Constant: '/Constant10' */ rtDW.Stall_private_l[i] = 1U; /* DataStoreWrite: '/Data Store Write3' */ rtDW.Lnoise_private_n[i] = 0U; /* DataStoreWrite: '/Data Store Write5' incorporates: * Constant: '/Constant2' */ rtDW.Speed_private_j[i] = 3U; /* DataStoreWrite: '/Data Store Write6' incorporates: * Constant: '/Constant3' */ rtDW.Coils_private_c[i] = 3U; /* DataStoreWrite: '/Data Store Write' */ rtDW.POS_private_m[i] = 6000U; /* DataStoreWrite: '/Data Store Write1' incorporates: * Constant: '/Constant9' */ rtDW.COM_private_g[i] = 3U; } /* Merge: '/Merge' incorporates: * Constant: '/Constant' * Sum: '/step inc' */ rtB.Merge_e = (int8_t)(rtb_y_b2 + 1); /* MATLAB Function: '/Write' incorporates: * DataStoreRead: '/Data Store Read3' */ /* : if(LOGGER == 2) */ if (rtDW.LOGGER_LIN == 2.0) { /* : fprintf('[LIN 2] Move to position Max\n'); */ printf("[LIN 2] Move to position Max\n"); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* End of Outputs for SubSystem: '/If Action Subsystem2' */ } else { /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: * ActionPort: '/Action Port' */ /* Merge: '/Merge' incorporates: * SignalConversion generated from: '/stepIn' */ rtB.Merge_e = rtb_y_b2; /* End of Outputs for SubSystem: '/If Action Subsystem3' */ } /* End of If: '/If1' */ /* End of Outputs for SubSystem: '/Move to position Max' */ break; case 8: /* Outputs for IfAction SubSystem: '/Check Stall Max' incorporates: * ActionPort: '/Action Port' */ /* Logic: '/Logical Operator3' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read' * Logic: '/Logical Operator' * Logic: '/Logical Operator2' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator1' */ for (i = 0; i < 6; i++) { rtb_LogicalOperator3_n1[i] = ((Actuator_Ch1_Status_Model.in_Act_Stall_Slave[i] == 1) || (Actuator_Ch1_Status_Model.in_CPOS_ALL[i] == 6000) || (rtDW.ErrorCalibration_private_p[i] == 0)); } /* End of Logic: '/Logical Operator3' */ /* Logic: '/Logical Operator1' incorporates: * Logic: '/Logical Operator3' */ rtb_LogicalOperator1_n = rtb_LogicalOperator3_n1[0]; for (i = 0; i < 5; i++) { rtb_LogicalOperator1_n = (rtb_LogicalOperator1_n && rtb_LogicalOperator3_n1[i + 1]); } /* If: '/If2' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write1' * DataTypeConversion: '/Data Type Conversion' * DataTypeConversion: '/Data Type Conversion1' * Logic: '/Logical Operator1' * SignalConversion generated from: '/Bus Selector' */ if ((Actuator_Ch1_Status_Model.Busy == 0) && (Actuator_Ch1_Status_Model.Error_Connect == 0) && rtb_LogicalOperator1_n) { /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write1' */ for (i = 0; i < 9; i++) { /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read1' */ if (rtDW.ErrorCalibration_private_p[i] != 0) { rtDW.MaxPositionCh1_private[i] = Actuator_Ch1_Status_Model.in_CPOS_ALL[i]; } else { rtDW.MaxPositionCh1_private[i] = 0; } /* End of Switch: '/Switch' */ } /* End of DataStoreWrite: '/Data Store Write1' */ /* Merge: '/Merge' incorporates: * Constant: '/Constant' * Sum: '/step inc' */ rtB.Merge_e = (int8_t)(rtb_y_b2 + 1); /* MATLAB Function: '/Write' incorporates: * DataStoreRead: '/Data Store Read3' */ /* : if(LOGGER == 2) */ if (rtDW.LOGGER_LIN == 2.0) { /* : fprintf('[LIN 2] Check Stall MAX\n'); */ printf("[LIN 2] Check Stall MAX\n"); fflush(stdout); /* : for i = 1:numel(data) */ for (i = 0; i < 9; i++) { /* : fprintf('[LIN 2] MAX = %d ', int16(data(i))); */ printf("[LIN 2] MAX = %d ", Actuator_Ch1_Status_Model.in_CPOS_ALL[i]); fflush(stdout); } /* : fprintf('\n'); */ printf("\n"); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* End of Outputs for SubSystem: '/If Action Subsystem2' */ } else { /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: * ActionPort: '/Action Port' */ /* Merge: '/Merge' incorporates: * SignalConversion generated from: '/stepIn' */ rtB.Merge_e = rtb_y_b2; /* End of Outputs for SubSystem: '/If Action Subsystem3' */ } /* End of If: '/If2' */ /* End of Outputs for SubSystem: '/Check Stall Max' */ break; case 9: /* Outputs for IfAction SubSystem: '/Homing' incorporates: * ActionPort: '/Action Port' */ /* Product: '/Divide1' incorporates: * Constant: '/ACT1' * DataStoreRead: '/MAX ACT1T ' */ for (i = 0; i < 6; i++) { rtb_Divide1_e[i] = (double)rtDW.MaxPositionCh1_private[i] / (double) rtConstP.ACT1_Value_c[i]; } /* End of Product: '/Divide1' */ /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant' */ rtb_Divide1_e[6] = 1.0; rtb_Divide1_e[7] = 1.0; rtb_Divide1_e[8] = 1.0; /* SwitchCase: '/Switch Case' incorporates: * DataStoreRead: '/Data Store Read4' */ switch (rtDW.stepHoming_private_f) { case 0: /* Outputs for IfAction SubSystem: '/Switch Case Action Subsystem' incorporates: * ActionPort: '/Action Port' */ for (i = 0; i < 9; i++) { /* RelationalOperator: '/Compare' */ rtb_u8Vtg_FX_plus = rtb_Divide1_e[i]; /* Logic: '/Logical Operator' incorporates: * Constant: '/Constant' * Constant: '/Constant' * RelationalOperator: '/Compare' * RelationalOperator: '/Compare' */ rtb_LogicalOperator1 = ((rtb_u8Vtg_FX_plus >= 0.9) && (rtb_u8Vtg_FX_plus <= 1.1)); rtb_LogicalOperator3_i5[i] = rtb_LogicalOperator1; /* DataTypeConversion: '/Data Type Conversion' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write' * Logic: '/Logical Operator' * Logic: '/Logical Operator1' */ rtDW.ErrorCalibration_private_p[i] = (uint8_t)((!rtb_LogicalOperator1) && (rtDW.ErrorCalibration_private_p[i] != 0)); } /* MATLAB Function: '/MAX POSITION' incorporates: * DataStoreRead: '/Data Store Read5' * DataStoreRead: '/MIN ACT1T 1' * Logic: '/Logical Operator2' */ /* : if(LOGGER>0) */ if (rtDW.LOGGER_LIN > 0.0) { /* : fprintf("[LIN 2] Homing 0\n"); */ printf("[LIN 2] Homing 0\n"); fflush(stdout); /* : for i = 1:numel(MAX) */ for (i = 0; i < 6; i++) { /* : fprintf('[LIN 2] ACT%d MAX = %d KOEF = %f Callibration = %d \n', int16(i), int16(MAX(i)), KOEF(i), int16(ERRORS(i))); */ printf("[LIN 2] ACT%d MAX = %d KOEF = %f Callibration = %d \n", (int16_t)(i + 1), rtDW.MaxPositionCh1_private[i], rtb_Divide1_e[i], (int16_t)!rtb_LogicalOperator3_i5[i]); fflush(stdout); } } /* End of MATLAB Function: '/MAX POSITION' */ /* Logic: '/Logical Operator1' */ rtb_LogicalOperator1_n = rtb_LogicalOperator3_i5[0]; for (i = 0; i < 8; i++) { rtb_LogicalOperator1_n = (rtb_LogicalOperator1_n && rtb_LogicalOperator3_i5[i + 1]); } /* Switch: '/Switch' incorporates: * Logic: '/Logical Operator1' */ if (rtb_LogicalOperator1_n) { /* Merge: '/Merge' incorporates: * Constant: '/Constant1' */ rtB.Merge_p = 4; } else { /* Merge: '/Merge' incorporates: * Constant: '/Constant' */ rtB.Merge_p = 1; } /* End of Switch: '/Switch' */ /* End of Outputs for SubSystem: '/Switch Case Action Subsystem' */ break; case 1: /* Outputs for IfAction SubSystem: '/Switch Case Action Subsystem1' incorporates: * ActionPort: '/Action Port' */ /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' */ for (i = 0; i < 9; i++) { rtb_LogicalOperator3_i5[i] = (rtb_Divide1_e[i] > 1.5); } /* End of RelationalOperator: '/Compare' */ /* Logic: '/Logical Operator' */ rtb_LogicalOperator1_n = rtb_LogicalOperator3_i5[0]; for (i = 0; i < 8; i++) { rtb_LogicalOperator1_n = (rtb_LogicalOperator1_n || rtb_LogicalOperator3_i5[i + 1]); } /* DataTypeConversion: '/Data Type Conversion' incorporates: * DataStoreWrite: '/Data Store Write1' * Logic: '/Logical Operator' */ rtDW.CCU_ActuatorErrF_Stat_private = rtb_LogicalOperator1_n; for (i = 0; i < 9; i++) { /* DataTypeConversion: '/Data Type Conversion1' incorporates: * DataStoreWrite: '/Data Store Write2' */ rtb_LogicalOperator1 = rtb_LogicalOperator3_i5[i]; rtDW.COM_private_g[i] = rtb_LogicalOperator1; /* DataTypeConversion: '/Data Type Conversion2' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write3' * Logic: '/Logical Operator1' */ rtDW.ErrorActuator_o[i] = (uint8_t)(rtb_LogicalOperator1 || (rtDW.ErrorActuator_o[i] != 0)); /* DataStoreWrite: '/Data Store Write' */ rtDW.MODE_private_b[i] = 2U; } /* MATLAB Function: '/Write ERROR' incorporates: * DataStoreRead: '/Data Store Read6' */ /* : if(LOGGER>=0) */ if (rtDW.LOGGER_LIN >= 0.0) { /* : for i = 1:numel(ErrCallibration) */ for (i = 0; i < 9; i++) { /* : if ErrCallibration(i) == 1 */ if (rtb_LogicalOperator3_i5[i]) { /* : fprintf('[LIN 2] Failure with actuator #%d\n', int16(i)); */ printf("[LIN 2] Failure with actuator #%d\n", (int16_t)(i + 1)); fflush(stdout); } } } /* End of MATLAB Function: '/Write ERROR' */ for (i = 0; i < 9; i++) { /* Logic: '/Logical Operator1' */ rtb_LogicalOperator1 = rtb_LogicalOperator3_i5[i]; /* DataTypeConversion: '/Data Type Conversion' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write' * Logic: '/Logical Operator' * Logic: '/Logical Operator1' */ rtDW.ErrorCalibration_private_p[i] = (uint8_t)((!rtb_LogicalOperator1) && (rtDW.ErrorCalibration_private_p[i] != 0)); /* DataStoreWrite: '/Data Store Write' incorporates: * DataTypeConversion: '/Data Type Conversion' */ rtDW.dtc_state_error_model[i + 54] = rtb_LogicalOperator1; } /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.stepSig_private_h = 1; /* MATLAB Function: '/MAX POSITION' incorporates: * DataStoreRead: '/Data Store Read5' * DataStoreRead: '/MIN ACT1T 1' * DataStoreWrite: '/Data Store Write' */ /* : if(LOGGER>0) */ if (rtDW.LOGGER_LIN > 0.0) { /* : fprintf("[LIN 2] Homing 1. Start Callibration \n"); */ printf("[LIN 2] Homing 1. Start Callibration \n"); fflush(stdout); /* : for i = 1:numel(MAX) */ for (i = 0; i < 6; i++) { /* : if(ERRORS(i)==1) */ if (rtDW.ErrorCalibration_private_p[i] == 1) { /* : fprintf('[LIN 2] ACT%d MAX = %d KOEF = %f Callibration = %d \n', int16(i), int16(MAX(i)), KOEF(i), int16(ERRORS(i))); */ printf("[LIN 2] ACT%d MAX = %d KOEF = %f Callibration = %d \n", (int16_t)(i + 1), rtDW.MaxPositionCh1_private[i], rtb_Divide1_e[i], (int16_t)rtDW.ErrorCalibration_private_p[i]); fflush(stdout); } } } /* End of MATLAB Function: '/MAX POSITION' */ /* Logic: '/Logical Operator2' incorporates: * DataStoreWrite: '/Data Store Write' */ rtb_LogicalOperator1_n = (rtDW.ErrorCalibration_private_p[0] != 0); for (i = 0; i < 8; i++) { rtb_LogicalOperator1_n = (rtb_LogicalOperator1_n || (rtDW.ErrorCalibration_private_p[i + 1] != 0)); } /* Switch: '/Switch' incorporates: * Logic: '/Logical Operator2' */ if (rtb_LogicalOperator1_n) { /* Merge: '/Merge' incorporates: * Constant: '/Constant1' */ rtB.Merge_p = 2; } else { /* Merge: '/Merge' incorporates: * Constant: '/Constant1' */ rtB.Merge_p = 4; } /* End of Switch: '/Switch' */ /* End of Outputs for SubSystem: '/Switch Case Action Subsystem1' */ break; case 2: /* Outputs for IfAction SubSystem: '/Switch Case Action Subsystem2' incorporates: * ActionPort: '/Action Port' */ for (i = 0; i < 9; i++) { /* RelationalOperator: '/Compare' */ rtb_u8Vtg_FX_plus = rtb_Divide1_e[i]; /* Logic: '/Logical Operator3' incorporates: * Constant: '/Constant' * Constant: '/Constant' * DataStoreRead: '/Data Store Read' * Logic: '/Logical Operator1' * Logic: '/Logical Operator4' * RelationalOperator: '/Compare' * RelationalOperator: '/Compare' */ rtb_LogicalOperator1 = (((rtb_u8Vtg_FX_plus < 0.97) || (rtb_u8Vtg_FX_plus > 1.03)) && (rtDW.ErrorCalibration_private_p[i] != 0)); rtb_LogicalOperator3_i5[i] = rtb_LogicalOperator1; /* DataTypeConversion: '/Data Type Conversion' incorporates: * DataStoreWrite: '/Data Store Write1' */ rtDW.ErrorCalibration_private_p[i] = rtb_LogicalOperator1; } /* MATLAB Function: '/MAX POSITION' incorporates: * DataStoreRead: '/Data Store Read5' * DataStoreRead: '/MIN ACT1T 1' */ /* : if(LOGGER>0) */ if (rtDW.LOGGER_LIN > 0.0) { /* : fprintf("[LIN 2] Homing 3. Callibration \n"); */ printf("[LIN 2] Homing 3. Callibration \n"); fflush(stdout); /* : for i = 1:numel(MAX) */ for (i = 0; i < 6; i++) { /* : if(ERRORS(i)==1) */ if (rtb_LogicalOperator3_i5[i]) { /* : fprintf('[LIN 2] ACT%d MAX = %d KOEF = %f Callibration = %d \n', int16(i), int16(MAX(i)), KOEF(i), int16(ERRORS(i))); */ printf("[LIN 2] ACT%d MAX = %d KOEF = %f Callibration = %d \n", (int16_t)(i + 1), rtDW.MaxPositionCh1_private[i], rtb_Divide1_e[i], 1); fflush(stdout); } } } /* End of MATLAB Function: '/MAX POSITION' */ /* Logic: '/Logical Operator2' */ rtb_LogicalOperator1_n = rtb_LogicalOperator3_i5[0]; for (i = 0; i < 8; i++) { rtb_LogicalOperator1_n = (rtb_LogicalOperator1_n || rtb_LogicalOperator3_i5[i + 1]); } /* Switch: '/Switch' incorporates: * Logic: '/Logical Operator2' */ if (rtb_LogicalOperator1_n) { /* Merge: '/Merge' incorporates: * Constant: '/Constant3' */ rtB.Merge_p = 3; } else { /* Merge: '/Merge' incorporates: * Constant: '/Constant1' */ rtB.Merge_p = 4; } /* End of Switch: '/Switch' */ /* End of Outputs for SubSystem: '/Switch Case Action Subsystem2' */ break; case 3: /* Outputs for IfAction SubSystem: '/Switch Case Action Subsystem3' incorporates: * ActionPort: '/Action Port' */ /* MATLAB Function: '/MAX POSITION' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read5' */ /* : if(LOGGER>1) */ if (rtDW.LOGGER_LIN > 1.0) { /* : fprintf("[LIN 2] Homing 3. Start Time on step %d\n",int16(step)); */ rtb_u8Vtg_FX_plus = rt_roundd(rtDW.ErrorHomming_private_h); if (rtb_u8Vtg_FX_plus < 32768.0) { if (rtb_u8Vtg_FX_plus >= -32768.0) { rtb_FLU_tg_correct_g = (int16_t)rtb_u8Vtg_FX_plus; } else { rtb_FLU_tg_correct_g = INT16_MIN; } } else { rtb_FLU_tg_correct_g = INT16_MAX; } printf("[LIN 2] Homing 3. Start Time on step %d\n", rtb_FLU_tg_correct_g); fflush(stdout); } /* End of MATLAB Function: '/MAX POSITION' */ /* If: '/If' incorporates: * DataStoreRead: '/Data Store Read1' */ if (rtDW.ErrorHomming_private_h < 10.0) { /* Outputs for IfAction SubSystem: '/If Action Subsystem' incorporates: * ActionPort: '/Action Port' */ /* MATLAB Function: '/MATLAB Function' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreRead: '/Data Store Read1' */ MATLABFunction(rtDW.Start_timer_j, rtDW.t_now, &rtb_dt_an, &rtDW.sf_MATLABFunction_hk); /* MATLAB Function: '/MAX POSITION' incorporates: * DataStoreRead: '/Data Store Read5' */ /* : if(LOGGER>1) */ if (rtDW.LOGGER_LIN > 1.0) { /* : fprintf("[LIN 2] Homing 3. Start TIme dt = %d \n",int32(data)); */ rtb_Subtract = rtb_dt_an; if (rtb_dt_an > 2147483647U) { rtb_Subtract = 2147483647U; } printf("[LIN 2] Homing 3. Start TIme dt = %d \n", (int32_t) rtb_Subtract); fflush(stdout); } /* End of MATLAB Function: '/MAX POSITION' */ /* If: '/If' */ if (rtb_dt_an > 30000U) { /* Outputs for IfAction SubSystem: '/If Action Subsystem' incorporates: * ActionPort: '/Action Port' */ /* Merge: '/Merge' */ IfActionSubsystem(&rtB.Merge_p, &rtDW.ErrorHomming_private_h, &rtDW.Start_timer_j, &rtDW.stepSig_private_h); /* End of Outputs for SubSystem: '/If Action Subsystem' */ } else { /* Outputs for IfAction SubSystem: '/If Action Subsystem1' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write2' incorporates: * Constant: '/Constant3' */ rtDW.Start_timer_j = 1.0; /* DataStoreRead: '/Data Store Read' incorporates: * Concatenate: '/LIN1' */ rtDW.BUS_ADR_private_j[0] = rtDW.PID_TempFUR; /* DataTypeConversion: '/Data Type Conversion2' incorporates: * DataStoreRead: '/valves target in percent' */ for (i = 0; i < 9; i++) { rtb_DataTypeConversion_fb[i] = (uint8_t)rtb_out_dwb[i]; } /* End of DataTypeConversion: '/Data Type Conversion2' */ /* SignalConversion generated from: '/LIN1' incorporates: * Concatenate: '/LIN1' */ rtDW.BUS_ADR_private_j[1] = rtb_DataTypeConversion_fb[2]; /* SignalConversion generated from: '/LIN1' incorporates: * Concatenate: '/LIN1' */ rtDW.BUS_ADR_private_j[2] = rtb_DataTypeConversion_fb[3]; /* DataStoreRead: '/Data Store Read2' incorporates: * Concatenate: '/LIN1' */ rtDW.BUS_ADR_private_j[3] = rtDW.PID_TempFRL; /* SignalConversion generated from: '/LIN1' incorporates: * Concatenate: '/LIN1' */ rtDW.BUS_ADR_private_j[4] = rtb_DataTypeConversion_fb[6]; /* SignalConversion generated from: '/LIN1' incorporates: * Concatenate: '/LIN1' */ rtDW.BUS_ADR_private_j[5] = rtb_DataTypeConversion_fb[7]; /* SignalConversion generated from: '/LIN1' incorporates: * Concatenate: '/LIN1' * DataStoreWrite: '/Data Store Write2' */ rtDW.BUS_ADR_private_j[6] = 0U; /* SignalConversion generated from: '/LIN1' incorporates: * Concatenate: '/LIN1' * DataStoreWrite: '/Data Store Write2' */ rtDW.BUS_ADR_private_j[7] = 0U; /* SignalConversion generated from: '/LIN1' incorporates: * Concatenate: '/LIN1' * DataStoreWrite: '/Data Store Write2' */ rtDW.BUS_ADR_private_j[8] = 0U; for (i = 0; i < 9; i++) { /* Product: '/Product' */ Valve_2_way = rtDW.BUS_ADR_private_j[i]; /* DataTypeConversion: '/Data Type Conversion1' incorporates: * Constant: '/Constant1' * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write' * Product: '/Divide1' * Product: '/Product' */ rtDW.POS_private_m[i] = (uint16_t)((double)(Valve_2_way * rtDW.MaxPositionCh1_private[i]) / 100.0); /* RelationalOperator: '/Relational Operator1' incorporates: * DataStoreWrite: '/Data Store Write2' */ rtb_LogicalOperator3_i5[i] = (rtb_DataTypeConversion_bq[i] == Valve_2_way); } /* Logic: '/Logical Operator' */ rtb_LogicalOperator1_n = rtb_LogicalOperator3_i5[0]; for (i = 0; i < 8; i++) { rtb_LogicalOperator1_n = (rtb_LogicalOperator1_n && rtb_LogicalOperator3_i5[i + 1]); } for (i = 0; i < 9; i++) { /* Switch: '/Switch' incorporates: * Constant: '/Constant4' * Constant: '/Constant9' * DataStoreWrite: '/Data Store Write1' * Logic: '/Logical Operator' */ if (rtb_LogicalOperator1_n) { rtDW.COM_private_g[i] = 0U; } else { rtDW.COM_private_g[i] = 3U; } /* End of Switch: '/Switch' */ /* DataTypeConversion: '/Data Type Conversion1' incorporates: * Concatenate: '/LIN1' * Constant: '/Constant5' * DataStoreWrite: '/Data Store Write2' * DataStoreWrite: '/Data Store Write7' * Product: '/Product' * RelationalOperator: '/Relational Operator' */ rtDW.BUS_ADR_private_j[i] = (uint8_t)((uint32_t) (rtb_DataTypeConversion_bq[i] != rtDW.BUS_ADR_private_j[i]) * rtConstP.pooled106[i]); /* DataStoreWrite: '/Data Store Write4' incorporates: * Constant: '/Constant1' */ rtDW.Autos_private_n[i] = 1U; /* DataStoreWrite: '/Data Store Write2' incorporates: * Constant: '/Constant10' */ rtDW.Stall_private_l[i] = 1U; /* DataStoreWrite: '/Data Store Write3' incorporates: * Constant: '/Constant11' */ rtDW.Lnoise_private_n[i] = 0U; /* DataStoreWrite: '/Data Store Write5' incorporates: * Constant: '/Constant2' */ rtDW.Speed_private_j[i] = 3U; /* DataStoreWrite: '/Data Store Write6' incorporates: * Constant: '/Constant3' */ rtDW.Coils_private_c[i] = 3U; } /* Merge: '/Merge' incorporates: * Constant: '/Constant1' * Merge: '/Merge' * SignalConversion generated from: '/Out1' */ rtB.Merge_p = 3; /* End of Outputs for SubSystem: '/If Action Subsystem1' */ } /* End of If: '/If' */ /* End of Outputs for SubSystem: '/If Action Subsystem' */ } else { /* Outputs for IfAction SubSystem: '/If Action Subsystem1' incorporates: * ActionPort: '/Action Port' */ IfActionSubsystem1(&rtB.Merge_p, &rtDW.CCU_ActuatorErrF_Stat_private, rtDW.COM_private_g, rtDW.ErrorActuator_o, rtDW.ErrorCalibration_private_p, &rtDW.LOGGER_LIN, rtDW.MODE_private_b, rtDW.dtc_state_error_model); /* End of Outputs for SubSystem: '/If Action Subsystem1' */ } /* End of If: '/If' */ /* End of Outputs for SubSystem: '/Switch Case Action Subsystem3' */ break; case 4: /* Outputs for IfAction SubSystem: '/Switch Case Action Subsystem4' incorporates: * ActionPort: '/Action Port' */ /* DataStoreRead: '/Data Store Read' incorporates: * Concatenate: '/LIN1' */ rtDW.BUS_ADR_private_j[0] = rtDW.PID_TempFUR; /* DataTypeConversion: '/Data Type Conversion2' incorporates: * DataStoreRead: '/valves target in percent' */ for (i = 0; i < 9; i++) { rtb_DataTypeConversion_fb[i] = (uint8_t)rtb_out_dwb[i]; } /* End of DataTypeConversion: '/Data Type Conversion2' */ /* SignalConversion generated from: '/LIN1' incorporates: * Concatenate: '/LIN1' */ rtDW.BUS_ADR_private_j[1] = rtb_DataTypeConversion_fb[2]; /* SignalConversion generated from: '/LIN1' incorporates: * Concatenate: '/LIN1' */ rtDW.BUS_ADR_private_j[2] = rtb_DataTypeConversion_fb[3]; /* DataStoreRead: '/Data Store Read2' incorporates: * Concatenate: '/LIN1' */ rtDW.BUS_ADR_private_j[3] = rtDW.PID_TempFRL; /* SignalConversion generated from: '/LIN1' incorporates: * Concatenate: '/LIN1' */ rtDW.BUS_ADR_private_j[4] = rtb_DataTypeConversion_fb[6]; /* SignalConversion generated from: '/LIN1' incorporates: * Concatenate: '/LIN1' */ rtDW.BUS_ADR_private_j[5] = rtb_DataTypeConversion_fb[7]; /* SignalConversion generated from: '/LIN1' incorporates: * Concatenate: '/LIN1' * DataStoreWrite: '/Data Store Write2' */ rtDW.BUS_ADR_private_j[6] = 0U; /* SignalConversion generated from: '/LIN1' incorporates: * Concatenate: '/LIN1' * DataStoreWrite: '/Data Store Write2' */ rtDW.BUS_ADR_private_j[7] = 0U; /* SignalConversion generated from: '/LIN1' incorporates: * Concatenate: '/LIN1' * DataStoreWrite: '/Data Store Write2' */ rtDW.BUS_ADR_private_j[8] = 0U; for (i = 0; i < 9; i++) { /* Product: '/Product' */ Valve_2_way = rtDW.BUS_ADR_private_j[i]; /* DataTypeConversion: '/Data Type Conversion1' incorporates: * Constant: '/Constant1' * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write' * Product: '/Divide1' * Product: '/Product' */ rtDW.POS_private_m[i] = (uint16_t)((double)(Valve_2_way * rtDW.MaxPositionCh1_private[i]) / 100.0); /* RelationalOperator: '/Relational Operator1' incorporates: * DataStoreWrite: '/Data Store Write2' */ rtb_LogicalOperator3_i5[i] = (rtb_DataTypeConversion_bq[i] == Valve_2_way); } /* Logic: '/Logical Operator' */ rtb_LogicalOperator1_n = rtb_LogicalOperator3_i5[0]; for (i = 0; i < 8; i++) { rtb_LogicalOperator1_n = (rtb_LogicalOperator1_n && rtb_LogicalOperator3_i5[i + 1]); } for (i = 0; i < 9; i++) { /* Switch: '/Switch' incorporates: * Constant: '/Constant4' * Constant: '/Constant9' * DataStoreWrite: '/Data Store Write1' * Logic: '/Logical Operator' */ if (rtb_LogicalOperator1_n) { rtDW.COM_private_g[i] = 0U; } else { rtDW.COM_private_g[i] = 3U; } /* End of Switch: '/Switch' */ /* DataTypeConversion: '/Data Type Conversion1' incorporates: * Concatenate: '/LIN1' * Constant: '/Constant5' * DataStoreWrite: '/Data Store Write2' * DataStoreWrite: '/Data Store Write7' * Product: '/Product' * RelationalOperator: '/Relational Operator' */ rtDW.BUS_ADR_private_j[i] = (uint8_t)((uint32_t) (rtb_DataTypeConversion_bq[i] != rtDW.BUS_ADR_private_j[i]) * rtConstP.pooled106[i]); /* DataStoreWrite: '/Data Store Write4' incorporates: * Constant: '/Constant1' */ rtDW.Autos_private_n[i] = 1U; /* DataStoreWrite: '/Data Store Write2' incorporates: * Constant: '/Constant10' */ rtDW.Stall_private_l[i] = 1U; /* DataStoreWrite: '/Data Store Write3' incorporates: * Constant: '/Constant11' */ rtDW.Lnoise_private_n[i] = 0U; /* DataStoreWrite: '/Data Store Write5' incorporates: * Constant: '/Constant2' */ rtDW.Speed_private_j[i] = 3U; /* DataStoreWrite: '/Data Store Write6' incorporates: * Constant: '/Constant3' */ rtDW.Coils_private_c[i] = 3U; } /* Merge: '/Merge' incorporates: * Constant: '/Constant1' * SignalConversion generated from: '/step' */ rtB.Merge_p = 4; /* MATLAB Function: '/MAX POSITION' incorporates: * DataStoreRead: '/Data Store Read5' */ /* : if(LOGGER>0) */ if (rtDW.LOGGER_LIN > 0.0) { /* : fprintf("[LIN 2] Homing. Callibration successful \n"); */ printf("[LIN 2] Homing. Callibration successful \n"); fflush(stdout); } /* End of MATLAB Function: '/MAX POSITION' */ /* End of Outputs for SubSystem: '/Switch Case Action Subsystem4' */ break; } /* End of SwitchCase: '/Switch Case' */ /* DataStoreWrite: '/Data Store Write2' */ rtDW.stepHoming_private_f = rtB.Merge_p; /* Merge: '/Merge' incorporates: * DataStoreRead: '/Data Store Read7' */ rtB.Merge_e = rtDW.stepSig_private_h; /* End of Outputs for SubSystem: '/Homing' */ break; } /* End of SwitchCase: '/Switch Case' */ /* DataStoreWrite: '/Finish write stepSig' */ rtDW.stepSig_private_h = rtB.Merge_e; /* BusCreator: '/Bus Creator' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read2' * DataStoreRead: '/Data Store Read3' * DataStoreRead: '/Data Store Read4' * DataStoreRead: '/Data Store Read5' * DataStoreRead: '/Data Store Read6' * DataStoreRead: '/Data Store Read7' * DataStoreRead: '/Data Store Read8' * DataStoreWrite: '/Data Store Write' */ for (i = 0; i < 9; i++) { Actuator_Ch1_Command_Model.POS[i] = rtDW.POS_private_m[i]; Actuator_Ch1_Command_Model.BUS_ADR[i] = rtDW.BUS_ADR_private_j[i]; Actuator_Ch1_Command_Model.MODE[i] = rtDW.MODE_private_b[i]; Actuator_Ch1_Command_Model.COM[i] = rtDW.COM_private_g[i]; Actuator_Ch1_Command_Model.Stall_SET[i] = rtDW.Stall_private_l[i]; Actuator_Ch1_Command_Model.Lnoise_SET[i] = rtDW.Lnoise_private_n[i]; Actuator_Ch1_Command_Model.Autos_SET[i] = rtDW.Autos_private_n[i]; Actuator_Ch1_Command_Model.Speed_SET[i] = rtDW.Speed_private_j[i]; Actuator_Ch1_Command_Model.Coils_Stop_SET[i] = rtDW.Coils_private_c[i]; } /* End of BusCreator: '/Bus Creator' */ /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' * DataStoreRead: '/Data Store Read2' */ for (i = 0; i < 6; i++) { rtb_Compare_le[i] = (rtDW.ErrorCalibration_private_p[i] == 0); } /* End of RelationalOperator: '/Compare' */ /* Logic: '/Logical Operator' */ rtb_LogicalOperator1_n = rtb_Compare_le[0]; for (i = 0; i < 5; i++) { rtb_LogicalOperator1_n = (rtb_LogicalOperator1_n || rtb_Compare_le[i + 1]); } /* Switch: '/Switch1' incorporates: * Constant: '/Constant' * Constant: '/Constant3' * DataStoreRead: '/Data Store Read2' * Logic: '/Logical Operator' * Product: '/Product' */ for (i = 0; i < 6; i++) { if (rtb_LogicalOperator1_n) { rtb_DataTypeConversion_bq[i] = (uint8_t)((uint32_t) rtDW.ErrorCalibration_private_p[i] * rtConstP.Constant3_Value[i]); } else { rtb_DataTypeConversion_bq[i] = 0U; } } /* End of Switch: '/Switch1' */ /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant1' */ rtb_DataTypeConversion_bq[6] = 0U; rtb_DataTypeConversion_bq[7] = 0U; rtb_DataTypeConversion_bq[8] = 0U; for (i = 0; i < 9; i++) { /* DataStoreWrite: '/Data Store Write7' incorporates: * Concatenate: '/LIN1' */ rtDW.BUS_ADR_private_j[i] = rtb_DataTypeConversion_bq[i]; /* DataStoreWrite: '/Data Store Write' */ rtDW.COM_private_g[i] = 0U; } /* DataTypeConversion: '/Data Type Conversion' */ for (i = 0; i < 8; i++) { /* Switch: '/Switch' incorporates: * Constant: '/Constant' * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read' * Gain: '/Gain' * Product: '/Divide' */ rtb_FLU_tg_correct_g = rtDW.MaxPositionCh2_private[i]; if (rtb_FLU_tg_correct_g != 0) { rtb_u8Vtg_FX_plus = (double)Actuator_Ch2_Status_Model.in_CPOS_ALL[i] / (double)rtb_FLU_tg_correct_g * 100.0; } else { rtb_u8Vtg_FX_plus = 0.0; } /* End of Switch: '/Switch' */ /* Saturate: '/Saturation' */ if (rtb_u8Vtg_FX_plus > 100.0) { rtb_DataTypeConversion_bq[i] = 100U; } else if (rtb_u8Vtg_FX_plus < 0.0) { rtb_DataTypeConversion_bq[i] = 0U; } else { rtb_DataTypeConversion_bq[i] = (uint8_t)rtb_u8Vtg_FX_plus; } /* End of Saturate: '/Saturation' */ } /* End of DataTypeConversion: '/Data Type Conversion' */ /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant1' */ rtb_DataTypeConversion_bq[8] = 0U; /* DataStoreWrite: '/Data Store Write2' */ for (i = 0; i < 9; i++) { rtb_DataTypeConversion_fb[i] = rtb_DataTypeConversion_bq[i]; } /* Switch: '/Switch' incorporates: * Constant: '/Constant1' * DataStoreRead: '/Data Store Read' * DataStoreRead: '/Data Store Read2' */ if (rtDW.stepSig_private_g > 0) { rtb_y_b2 = rtDW.stepSig_private_g; } else { rtb_y_b2 = 1; } /* End of Switch: '/Switch' */ /* SwitchCase: '/Switch Case' */ switch (rtb_y_b2) { case 1: /* Outputs for IfAction SubSystem: '/Stop Mode' incorporates: * ActionPort: '/Action Port' */ /* If: '/If1' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write1' * SignalConversion generated from: '/Bus Selector' */ if ((Actuator_Ch2_Status_Model.Busy == 0) && (Actuator_Ch2_Status_Model.Error_Connect == 0)) { /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: * ActionPort: '/Action Port' */ for (i = 0; i < 9; i++) { /* DataStoreWrite: '/Data Store Write1' */ rtDW.COM_private_k[i] = 1U; /* DataStoreWrite: '/Data Store Write' */ rtDW.MODE_private_c[i] = 2U; } /* Merge: '/Merge' incorporates: * Constant: '/Constant' * Sum: '/step inc' */ rtB.Merge_b4 = (int8_t)(rtb_y_b2 + 1); /* MATLAB Function: '/Write' incorporates: * DataStoreRead: '/Data Store Read3' */ /* : if(LOGGER == 2) */ if (rtDW.LOGGER_LIN == 2.0) { /* : fprintf('[LIN 3] Stop Mode\n'); */ printf("[LIN 3] Stop Mode\n"); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* End of Outputs for SubSystem: '/If Action Subsystem2' */ } else { /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: * ActionPort: '/Action Port' */ /* Merge: '/Merge' incorporates: * SignalConversion generated from: '/stepIn' */ rtB.Merge_b4 = rtb_y_b2; /* End of Outputs for SubSystem: '/If Action Subsystem3' */ } /* End of If: '/If1' */ /* End of Outputs for SubSystem: '/Stop Mode' */ break; case 2: /* Outputs for IfAction SubSystem: '/Initial CPOS Min' incorporates: * ActionPort: '/Action Port' */ /* If: '/If' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write1' * SignalConversion generated from: '/Bus Selector' */ if ((Actuator_Ch2_Status_Model.Busy == 0) && (Actuator_Ch2_Status_Model.Error_Connect == 0)) { /* Outputs for IfAction SubSystem: '/If Action Subsystem' incorporates: * ActionPort: '/Action Port' */ for (i = 0; i < 9; i++) { /* DataStoreWrite: '/Data Store Write' */ rtDW.POS_private_h[i] = 6000U; /* DataStoreWrite: '/Data Store Write1' */ rtDW.COM_private_k[i] = 2U; } /* Merge: '/Merge' incorporates: * Constant: '/Constant' * Merge: '/Merge' * Sum: '/step inc' */ rtB.Merge_b4 = (int8_t)(rtb_y_b2 + 1); /* MATLAB Function: '/Write' incorporates: * DataStoreRead: '/Data Store Read3' */ /* : if(LOGGER == 2) */ if (rtDW.LOGGER_LIN == 2.0) { /* : fprintf('[LIN 3] Initial CPOS Min\n'); */ printf("[LIN 3] Initial CPOS Min\n"); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* End of Outputs for SubSystem: '/If Action Subsystem' */ } else { /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: * ActionPort: '/Action Port' */ /* Merge: '/Merge' incorporates: * Merge: '/Merge' * SignalConversion generated from: '/stepIn1' */ rtB.Merge_b4 = rtb_y_b2; /* End of Outputs for SubSystem: '/If Action Subsystem3' */ } /* End of If: '/If' */ /* End of Outputs for SubSystem: '/Initial CPOS Min' */ break; case 3: /* Outputs for IfAction SubSystem: '/Normal Mode' incorporates: * ActionPort: '/Action Port' */ /* If: '/If1' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write1' * SignalConversion generated from: '/Bus Selector' */ if ((Actuator_Ch2_Status_Model.Busy == 0) && (Actuator_Ch2_Status_Model.Error_Connect == 0)) { /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: * ActionPort: '/Action Port' */ for (i = 0; i < 9; i++) { /* DataStoreWrite: '/Data Store Write' */ rtDW.MODE_private_c[i] = 0U; /* DataStoreWrite: '/Data Store Write1' */ rtDW.COM_private_k[i] = 1U; } /* Merge: '/Merge' incorporates: * Constant: '/Constant' * Sum: '/step inc' */ rtB.Merge_b4 = (int8_t)(rtb_y_b2 + 1); /* MATLAB Function: '/Write' incorporates: * DataStoreRead: '/Data Store Read3' */ /* : if(LOGGER == 2) */ if (rtDW.LOGGER_LIN == 2.0) { /* : fprintf('[LIN 3] Normal Mode\n'); */ printf("[LIN 3] Normal Mode\n"); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* End of Outputs for SubSystem: '/If Action Subsystem2' */ } else { /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: * ActionPort: '/Action Port' */ /* Merge: '/Merge' incorporates: * SignalConversion generated from: '/stepIn' */ rtB.Merge_b4 = rtb_y_b2; /* End of Outputs for SubSystem: '/If Action Subsystem3' */ } /* End of If: '/If1' */ /* End of Outputs for SubSystem: '/Normal Mode' */ break; case 4: /* Outputs for IfAction SubSystem: '/Move to position Min' incorporates: * ActionPort: '/Action Port' */ /* If: '/If1' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write1' * SignalConversion generated from: '/Bus Selector' */ if ((Actuator_Ch2_Status_Model.Busy == 0) && (Actuator_Ch2_Status_Model.Error_Connect == 0)) { /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: * ActionPort: '/Action Port' */ for (i = 0; i < 9; i++) { /* DataStoreWrite: '/Data Store Write4' incorporates: * Constant: '/Constant1' */ rtDW.Autos_private_g[i] = 1U; /* DataStoreWrite: '/Data Store Write2' incorporates: * Constant: '/Constant10' */ rtDW.Stall_private_f[i] = 1U; /* DataStoreWrite: '/Data Store Write3' */ rtDW.Lnoise_private_g[i] = 0U; /* DataStoreWrite: '/Data Store Write5' incorporates: * Constant: '/Constant2' */ rtDW.Speed_private_b[i] = 3U; /* DataStoreWrite: '/Data Store Write6' incorporates: * Constant: '/Constant3' */ rtDW.Coils_private_l[i] = 3U; /* DataStoreWrite: '/Data Store Write' */ rtDW.POS_private_h[i] = 0U; /* DataStoreWrite: '/Data Store Write1' incorporates: * Constant: '/Constant9' */ rtDW.COM_private_k[i] = 3U; } /* Merge: '/Merge' incorporates: * Constant: '/Constant' * Sum: '/step inc' */ rtB.Merge_b4 = (int8_t)(rtb_y_b2 + 1); /* MATLAB Function: '/Write' incorporates: * DataStoreRead: '/Data Store Read3' */ /* : if(LOGGER == 2) */ if (rtDW.LOGGER_LIN == 2.0) { /* : fprintf('[LIN 3] Move to position Min\n'); */ printf("[LIN 3] Move to position Min\n"); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* End of Outputs for SubSystem: '/If Action Subsystem2' */ } else { /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: * ActionPort: '/Action Port' */ /* Merge: '/Merge' incorporates: * SignalConversion generated from: '/stepIn' */ rtB.Merge_b4 = rtb_y_b2; /* End of Outputs for SubSystem: '/If Action Subsystem3' */ } /* End of If: '/If1' */ /* End of Outputs for SubSystem: '/Move to position Min' */ break; case 5: /* Outputs for IfAction SubSystem: '/Check Stall Min' incorporates: * ActionPort: '/Action Port' */ /* Logic: '/Logical Operator3' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read' * Logic: '/Logical Operator1' * Logic: '/Logical Operator2' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator1' */ for (i = 0; i < 8; i++) { rtb_Compare_le[i] = ((Actuator_Ch2_Status_Model.in_Act_Stall_Slave[i] == 1) || (Actuator_Ch2_Status_Model.in_CPOS_ALL[i] == 0) || (rtDW.ErrorCalibration_private_b[i] == 0)); } /* End of Logic: '/Logical Operator3' */ /* Logic: '/Logical Operator' incorporates: * Logic: '/Logical Operator3' */ rtb_LogicalOperator1_n = rtb_Compare_le[0]; for (i = 0; i < 7; i++) { rtb_LogicalOperator1_n = (rtb_LogicalOperator1_n && rtb_Compare_le[i + 1]); } /* If: '/If2' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write1' * DataTypeConversion: '/Data Type Conversion' * DataTypeConversion: '/Data Type Conversion1' * Logic: '/Logical Operator' * SignalConversion generated from: '/Bus Selector' */ if ((Actuator_Ch2_Status_Model.Busy == 0) && (Actuator_Ch2_Status_Model.Error_Connect == 0) && rtb_LogicalOperator1_n) { /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write1' */ for (i = 0; i < 9; i++) { /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read1' */ if (rtDW.ErrorCalibration_private_b[i] != 0) { rtDW.MinPositionCh2_private[i] = Actuator_Ch2_Status_Model.in_CPOS_ALL[i]; } /* End of Switch: '/Switch' */ } /* End of DataStoreWrite: '/Data Store Write1' */ /* Merge: '/Merge' incorporates: * Constant: '/Constant' * Sum: '/step inc' */ rtB.Merge_b4 = (int8_t)(rtb_y_b2 + 1); /* MATLAB Function: '/Write' incorporates: * DataStoreRead: '/Data Store Read3' */ /* : if(LOGGER == 2) */ if (rtDW.LOGGER_LIN == 2.0) { /* : fprintf('[LIN 3] Check Stall Min\n'); */ printf("[LIN 3] Check Stall Min\n"); fflush(stdout); /* : for i = 1:numel(data) */ for (i = 0; i < 9; i++) { /* : fprintf('[LIN 3] MIN = %d ', int16(data(i))); */ printf("[LIN 3] MIN = %d ", Actuator_Ch2_Status_Model.in_CPOS_ALL[i]); fflush(stdout); } /* : fprintf('\n'); */ printf("\n"); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* End of Outputs for SubSystem: '/If Action Subsystem2' */ } else { /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: * ActionPort: '/Action Port' */ /* Merge: '/Merge' incorporates: * SignalConversion generated from: '/stepIn' */ rtB.Merge_b4 = rtb_y_b2; /* End of Outputs for SubSystem: '/If Action Subsystem3' */ } /* End of If: '/If2' */ /* End of Outputs for SubSystem: '/Check Stall Min' */ break; case 6: /* Outputs for IfAction SubSystem: '/Initial CPOS Max' incorporates: * ActionPort: '/Action Port' */ /* If: '/If1' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write1' * SignalConversion generated from: '/Bus Selector' */ if ((Actuator_Ch2_Status_Model.Busy == 0) && (Actuator_Ch2_Status_Model.Error_Connect == 0)) { /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: * ActionPort: '/Action Port' */ for (i = 0; i < 9; i++) { /* DataStoreWrite: '/Data Store Write1' */ rtDW.COM_private_k[i] = 2U; /* DataStoreWrite: '/Data Store Write' */ rtDW.POS_private_h[i] = 0U; } /* Merge: '/Merge' incorporates: * Constant: '/Constant' * Sum: '/step inc' */ rtB.Merge_b4 = (int8_t)(rtb_y_b2 + 1); /* MATLAB Function: '/Write' incorporates: * DataStoreRead: '/Data Store Read3' */ /* : if(LOGGER == 2) */ if (rtDW.LOGGER_LIN == 2.0) { /* : fprintf('[LIN 3] Initial CPOS Max\n'); */ printf("[LIN 3] Initial CPOS Max\n"); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* End of Outputs for SubSystem: '/If Action Subsystem2' */ } else { /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: * ActionPort: '/Action Port' */ /* Merge: '/Merge' incorporates: * SignalConversion generated from: '/stepIn' */ rtB.Merge_b4 = rtb_y_b2; /* End of Outputs for SubSystem: '/If Action Subsystem3' */ } /* End of If: '/If1' */ /* End of Outputs for SubSystem: '/Initial CPOS Max' */ break; case 7: /* Outputs for IfAction SubSystem: '/Move to position Max' incorporates: * ActionPort: '/Action Port' */ /* If: '/If1' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write1' * SignalConversion generated from: '/Bus Selector' */ if ((Actuator_Ch2_Status_Model.Busy == 0) && (Actuator_Ch2_Status_Model.Error_Connect == 0)) { /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: * ActionPort: '/Action Port' */ for (i = 0; i < 9; i++) { /* DataStoreWrite: '/Data Store Write4' incorporates: * Constant: '/Constant1' */ rtDW.Autos_private_g[i] = 1U; /* DataStoreWrite: '/Data Store Write2' incorporates: * Constant: '/Constant10' */ rtDW.Stall_private_f[i] = 1U; /* DataStoreWrite: '/Data Store Write3' */ rtDW.Lnoise_private_g[i] = 0U; /* DataStoreWrite: '/Data Store Write5' incorporates: * Constant: '/Constant2' */ rtDW.Speed_private_b[i] = 3U; /* DataStoreWrite: '/Data Store Write6' incorporates: * Constant: '/Constant3' */ rtDW.Coils_private_l[i] = 3U; /* DataStoreWrite: '/Data Store Write' */ rtDW.POS_private_h[i] = 6000U; /* DataStoreWrite: '/Data Store Write1' incorporates: * Constant: '/Constant9' */ rtDW.COM_private_k[i] = 3U; } /* Merge: '/Merge' incorporates: * Constant: '/Constant' * Sum: '/step inc' */ rtB.Merge_b4 = (int8_t)(rtb_y_b2 + 1); /* MATLAB Function: '/Write' incorporates: * DataStoreRead: '/Data Store Read3' */ /* : if(LOGGER == 2) */ if (rtDW.LOGGER_LIN == 2.0) { /* : fprintf('[LIN 3] Move to position Max\n'); */ printf("[LIN 3] Move to position Max\n"); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* End of Outputs for SubSystem: '/If Action Subsystem2' */ } else { /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: * ActionPort: '/Action Port' */ /* Merge: '/Merge' incorporates: * SignalConversion generated from: '/stepIn' */ rtB.Merge_b4 = rtb_y_b2; /* End of Outputs for SubSystem: '/If Action Subsystem3' */ } /* End of If: '/If1' */ /* End of Outputs for SubSystem: '/Move to position Max' */ break; case 8: /* Outputs for IfAction SubSystem: '/Check Stall Max' incorporates: * ActionPort: '/Action Port' */ /* Logic: '/Logical Operator3' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read' * Logic: '/Logical Operator' * Logic: '/Logical Operator2' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator1' */ for (i = 0; i < 8; i++) { rtb_Compare_le[i] = ((Actuator_Ch2_Status_Model.in_Act_Stall_Slave[i] == 1) || (Actuator_Ch2_Status_Model.in_CPOS_ALL[i] == 6000) || (rtDW.ErrorCalibration_private_b[i] == 0)); } /* End of Logic: '/Logical Operator3' */ /* Logic: '/Logical Operator1' incorporates: * Logic: '/Logical Operator3' */ rtb_LogicalOperator1_n = rtb_Compare_le[0]; for (i = 0; i < 7; i++) { rtb_LogicalOperator1_n = (rtb_LogicalOperator1_n && rtb_Compare_le[i + 1]); } /* If: '/If2' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write1' * DataTypeConversion: '/Data Type Conversion' * DataTypeConversion: '/Data Type Conversion1' * Logic: '/Logical Operator1' * SignalConversion generated from: '/Bus Selector' */ if ((Actuator_Ch2_Status_Model.Busy == 0) && (Actuator_Ch2_Status_Model.Error_Connect == 0) && rtb_LogicalOperator1_n) { /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write1' */ for (i = 0; i < 9; i++) { /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read1' */ if (rtDW.ErrorCalibration_private_b[i] != 0) { rtDW.MaxPositionCh2_private[i] = Actuator_Ch2_Status_Model.in_CPOS_ALL[i]; } else { rtDW.MaxPositionCh2_private[i] = 0; } /* End of Switch: '/Switch' */ } /* End of DataStoreWrite: '/Data Store Write1' */ /* Merge: '/Merge' incorporates: * Constant: '/Constant' * Sum: '/step inc' */ rtB.Merge_b4 = (int8_t)(rtb_y_b2 + 1); /* MATLAB Function: '/Write' incorporates: * DataStoreRead: '/Data Store Read3' */ /* : if(LOGGER == 2) */ if (rtDW.LOGGER_LIN == 2.0) { /* : fprintf('[LIN 3] Check Stall MAX\n'); */ printf("[LIN 3] Check Stall MAX\n"); fflush(stdout); /* : for i = 1:numel(data) */ for (i = 0; i < 9; i++) { /* : fprintf('[LIN 3] MAX = %d ', int16(data(i))); */ printf("[LIN 3] MAX = %d ", Actuator_Ch2_Status_Model.in_CPOS_ALL[i]); fflush(stdout); } /* : fprintf('\n'); */ printf("\n"); fflush(stdout); } /* End of MATLAB Function: '/Write' */ /* End of Outputs for SubSystem: '/If Action Subsystem2' */ } else { /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: * ActionPort: '/Action Port' */ /* Merge: '/Merge' incorporates: * SignalConversion generated from: '/stepIn' */ rtB.Merge_b4 = rtb_y_b2; /* End of Outputs for SubSystem: '/If Action Subsystem3' */ } /* End of If: '/If2' */ /* End of Outputs for SubSystem: '/Check Stall Max' */ break; case 9: /* Outputs for IfAction SubSystem: '/Homing' incorporates: * ActionPort: '/Action Port' */ /* Product: '/Divide1' incorporates: * Constant: '/ACT1' * DataStoreRead: '/MAX ACT1T ' */ for (i = 0; i < 8; i++) { rtb_Divide1_e[i] = (double)rtDW.MaxPositionCh2_private[i] / (double) rtConstP.ACT1_Value_m[i]; } /* End of Product: '/Divide1' */ /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant' */ rtb_Divide1_e[8] = 1.0; /* SwitchCase: '/Switch Case' incorporates: * DataStoreRead: '/Data Store Read4' */ switch (rtDW.stepHoming_private_a) { case 0: /* Outputs for IfAction SubSystem: '/Switch Case Action Subsystem' incorporates: * ActionPort: '/Action Port' */ for (i = 0; i < 9; i++) { /* RelationalOperator: '/Compare' */ rtb_u8Vtg_FX_plus = rtb_Divide1_e[i]; /* Logic: '/Logical Operator' incorporates: * Constant: '/Constant' * Constant: '/Constant' * RelationalOperator: '/Compare' * RelationalOperator: '/Compare' */ rtb_LogicalOperator1 = ((rtb_u8Vtg_FX_plus >= 0.9) && (rtb_u8Vtg_FX_plus <= 1.1)); rtb_LogicalOperator3_i5[i] = rtb_LogicalOperator1; /* DataTypeConversion: '/Data Type Conversion' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write' * Logic: '/Logical Operator' * Logic: '/Logical Operator1' */ rtDW.ErrorCalibration_private_b[i] = (uint8_t)((!rtb_LogicalOperator1) && (rtDW.ErrorCalibration_private_b[i] != 0)); } /* MATLAB Function: '/MAX POSITION' incorporates: * DataStoreRead: '/Data Store Read5' * DataStoreRead: '/MIN ACT1T 1' * Logic: '/Logical Operator2' */ /* : if(LOGGER>0) */ if (rtDW.LOGGER_LIN > 0.0) { /* : fprintf("[LIN 3] Homing 0\n"); */ printf("[LIN 3] Homing 0\n"); fflush(stdout); /* : for i = 1:numel(MAX) */ for (i = 0; i < 6; i++) { /* : fprintf('[LIN 3] ACT%d MAX = %d KOEF = %f Callibration = %d \n', int16(i), int16(MAX(i)), KOEF(i), int16(ERRORS(i))); */ printf("[LIN 3] ACT%d MAX = %d KOEF = %f Callibration = %d \n", (int16_t)(i + 1), rtDW.MaxPositionCh2_private[i], rtb_Divide1_e[i], (int16_t)!rtb_LogicalOperator3_i5[i]); fflush(stdout); } } /* End of MATLAB Function: '/MAX POSITION' */ /* Logic: '/Logical Operator1' */ rtb_LogicalOperator1_n = rtb_LogicalOperator3_i5[0]; for (i = 0; i < 8; i++) { rtb_LogicalOperator1_n = (rtb_LogicalOperator1_n && rtb_LogicalOperator3_i5[i + 1]); } /* Switch: '/Switch' incorporates: * Logic: '/Logical Operator1' */ if (rtb_LogicalOperator1_n) { /* Merge: '/Merge' incorporates: * Constant: '/Constant1' */ rtB.Merge_h = 4; } else { /* Merge: '/Merge' incorporates: * Constant: '/Constant' */ rtB.Merge_h = 1; } /* End of Switch: '/Switch' */ /* End of Outputs for SubSystem: '/Switch Case Action Subsystem' */ break; case 1: /* Outputs for IfAction SubSystem: '/Switch Case Action Subsystem1' incorporates: * ActionPort: '/Action Port' */ /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' */ for (i = 0; i < 9; i++) { rtb_LogicalOperator3_i5[i] = (rtb_Divide1_e[i] > 1.5); } /* End of RelationalOperator: '/Compare' */ /* Logic: '/Logical Operator' */ rtb_LogicalOperator1_n = rtb_LogicalOperator3_i5[0]; for (i = 0; i < 8; i++) { rtb_LogicalOperator1_n = (rtb_LogicalOperator1_n || rtb_LogicalOperator3_i5[i + 1]); } /* DataTypeConversion: '/Data Type Conversion' incorporates: * DataStoreWrite: '/Data Store Write1' * Logic: '/Logical Operator' */ rtDW.CCU_ActuatorErrF_Stat_private = rtb_LogicalOperator1_n; for (i = 0; i < 9; i++) { /* DataTypeConversion: '/Data Type Conversion1' incorporates: * DataStoreWrite: '/Data Store Write2' */ rtb_LogicalOperator1 = rtb_LogicalOperator3_i5[i]; rtDW.COM_private_k[i] = rtb_LogicalOperator1; /* DataTypeConversion: '/Data Type Conversion2' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write3' * Logic: '/Logical Operator1' */ rtDW.ErrorActuator_a[i] = (uint8_t)(rtb_LogicalOperator1 || (rtDW.ErrorActuator_a[i] != 0)); /* DataStoreWrite: '/Data Store Write' */ rtDW.MODE_private_c[i] = 2U; } /* MATLAB Function: '/Write ERROR' incorporates: * DataStoreRead: '/Data Store Read6' */ /* : if(LOGGER>=0) */ if (rtDW.LOGGER_LIN >= 0.0) { /* : for i = 1:numel(ErrCallibration) */ for (i = 0; i < 9; i++) { /* : if ErrCallibration(i) == 1 */ if (rtb_LogicalOperator3_i5[i]) { /* : fprintf('[LIN 3] Failure with actuator #%d\n', int16(i)); */ printf("[LIN 3] Failure with actuator #%d\n", (int16_t)(i + 1)); fflush(stdout); } } } /* End of MATLAB Function: '/Write ERROR' */ for (i = 0; i < 9; i++) { /* Logic: '/Logical Operator1' */ rtb_LogicalOperator1 = rtb_LogicalOperator3_i5[i]; /* DataTypeConversion: '/Data Type Conversion' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write' * Logic: '/Logical Operator' * Logic: '/Logical Operator1' */ rtDW.ErrorCalibration_private_b[i] = (uint8_t)((!rtb_LogicalOperator1) && (rtDW.ErrorCalibration_private_b[i] != 0)); /* DataStoreWrite: '/Data Store Write' incorporates: * DataTypeConversion: '/Data Type Conversion' */ rtDW.dtc_state_error_model[i + 54] = rtb_LogicalOperator1; } /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.stepSig_private_g = 1; /* MATLAB Function: '/MAX POSITION' incorporates: * DataStoreRead: '/Data Store Read5' * DataStoreRead: '/MIN ACT1T 1' * DataStoreWrite: '/Data Store Write' */ /* : if(LOGGER>0) */ if (rtDW.LOGGER_LIN > 0.0) { /* : fprintf("[LIN 3] Homing 1. Start Callibration \n"); */ printf("[LIN 3] Homing 1. Start Callibration \n"); fflush(stdout); /* : for i = 1:numel(MAX) */ for (i = 0; i < 6; i++) { /* : if(ERRORS(i)==1) */ if (rtDW.ErrorCalibration_private_b[i] == 1) { /* : fprintf('[LIN 3] ACT%d MAX = %d KOEF = %f Callibration = %d \n', int16(i), int16(MAX(i)), KOEF(i), int16(ERRORS(i))); */ printf("[LIN 3] ACT%d MAX = %d KOEF = %f Callibration = %d \n", (int16_t)(i + 1), rtDW.MaxPositionCh2_private[i], rtb_Divide1_e[i], (int16_t)rtDW.ErrorCalibration_private_b[i]); fflush(stdout); } } } /* End of MATLAB Function: '/MAX POSITION' */ /* Logic: '/Logical Operator2' incorporates: * DataStoreWrite: '/Data Store Write' */ rtb_LogicalOperator1_n = (rtDW.ErrorCalibration_private_b[0] != 0); for (i = 0; i < 8; i++) { rtb_LogicalOperator1_n = (rtb_LogicalOperator1_n || (rtDW.ErrorCalibration_private_b[i + 1] != 0)); } /* Switch: '/Switch' incorporates: * Logic: '/Logical Operator2' */ if (rtb_LogicalOperator1_n) { /* Merge: '/Merge' incorporates: * Constant: '/Constant1' */ rtB.Merge_h = 2; } else { /* Merge: '/Merge' incorporates: * Constant: '/Constant1' */ rtB.Merge_h = 4; } /* End of Switch: '/Switch' */ /* End of Outputs for SubSystem: '/Switch Case Action Subsystem1' */ break; case 2: /* Outputs for IfAction SubSystem: '/Switch Case Action Subsystem2' incorporates: * ActionPort: '/Action Port' */ for (i = 0; i < 9; i++) { /* RelationalOperator: '/Compare' */ rtb_u8Vtg_FX_plus = rtb_Divide1_e[i]; /* Logic: '/Logical Operator3' incorporates: * Constant: '/Constant' * Constant: '/Constant' * DataStoreRead: '/Data Store Read' * Logic: '/Logical Operator1' * Logic: '/Logical Operator4' * RelationalOperator: '/Compare' * RelationalOperator: '/Compare' */ rtb_LogicalOperator1 = (((rtb_u8Vtg_FX_plus < 0.97) || (rtb_u8Vtg_FX_plus > 1.03)) && (rtDW.ErrorCalibration_private_b[i] != 0)); rtb_LogicalOperator3_i5[i] = rtb_LogicalOperator1; /* DataTypeConversion: '/Data Type Conversion' incorporates: * DataStoreWrite: '/Data Store Write1' */ rtDW.ErrorCalibration_private_b[i] = rtb_LogicalOperator1; } /* MATLAB Function: '/MAX POSITION' incorporates: * DataStoreRead: '/Data Store Read5' * DataStoreRead: '/MIN ACT1T 1' */ /* : if(LOGGER>0) */ if (rtDW.LOGGER_LIN > 0.0) { /* : fprintf("[LIN 3] Homing 3. Callibration \n"); */ printf("[LIN 3] Homing 3. Callibration \n"); fflush(stdout); /* : for i = 1:numel(MAX) */ for (i = 0; i < 6; i++) { /* : if(ERRORS(i)==1) */ if (rtb_LogicalOperator3_i5[i]) { /* : fprintf('[LIN 3] ACT%d MAX = %d KOEF = %f Callibration = %d \n', int16(i), int16(MAX(i)), KOEF(i), int16(ERRORS(i))); */ printf("[LIN 3] ACT%d MAX = %d KOEF = %f Callibration = %d \n", (int16_t)(i + 1), rtDW.MaxPositionCh2_private[i], rtb_Divide1_e[i], 1); fflush(stdout); } } } /* End of MATLAB Function: '/MAX POSITION' */ /* Logic: '/Logical Operator2' */ rtb_LogicalOperator1_n = rtb_LogicalOperator3_i5[0]; for (i = 0; i < 8; i++) { rtb_LogicalOperator1_n = (rtb_LogicalOperator1_n || rtb_LogicalOperator3_i5[i + 1]); } /* Switch: '/Switch' incorporates: * Logic: '/Logical Operator2' */ if (rtb_LogicalOperator1_n) { /* Merge: '/Merge' incorporates: * Constant: '/Constant3' */ rtB.Merge_h = 3; } else { /* Merge: '/Merge' incorporates: * Constant: '/Constant1' */ rtB.Merge_h = 4; } /* End of Switch: '/Switch' */ /* End of Outputs for SubSystem: '/Switch Case Action Subsystem2' */ break; case 3: /* Outputs for IfAction SubSystem: '/Switch Case Action Subsystem3' incorporates: * ActionPort: '/Action Port' */ /* MATLAB Function: '/MAX POSITION' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read5' */ /* : if(LOGGER>1) */ if (rtDW.LOGGER_LIN > 1.0) { /* : fprintf("[LIN 3] Homing 3. Start Time on step %d\n",int16(step)); */ rtb_u8Vtg_FX_plus = rt_roundd(rtDW.ErrorHomming_private_m); if (rtb_u8Vtg_FX_plus < 32768.0) { if (rtb_u8Vtg_FX_plus >= -32768.0) { rtb_FLU_tg_correct_g = (int16_t)rtb_u8Vtg_FX_plus; } else { rtb_FLU_tg_correct_g = INT16_MIN; } } else { rtb_FLU_tg_correct_g = INT16_MAX; } printf("[LIN 3] Homing 3. Start Time on step %d\n", rtb_FLU_tg_correct_g); fflush(stdout); } /* End of MATLAB Function: '/MAX POSITION' */ /* If: '/If' incorporates: * DataStoreRead: '/Data Store Read1' */ if (rtDW.ErrorHomming_private_m < 10.0) { /* Outputs for IfAction SubSystem: '/If Action Subsystem' incorporates: * ActionPort: '/Action Port' */ /* MATLAB Function: '/MATLAB Function' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreRead: '/Data Store Read1' */ MATLABFunction(rtDW.Start_timer, rtDW.t_now, &rtb_dt_an, &rtDW.sf_MATLABFunction_g); /* MATLAB Function: '/MAX POSITION' incorporates: * DataStoreRead: '/Data Store Read5' */ /* : if(LOGGER>1) */ if (rtDW.LOGGER_LIN > 1.0) { /* : fprintf("[LIN 3] Homing 3. Start TIme dt = %d \n",int32(data)); */ rtb_Subtract = rtb_dt_an; if (rtb_dt_an > 2147483647U) { rtb_Subtract = 2147483647U; } printf("[LIN 3] Homing 3. Start TIme dt = %d \n", (int32_t) rtb_Subtract); fflush(stdout); } /* End of MATLAB Function: '/MAX POSITION' */ /* If: '/If' */ if (rtb_dt_an > 30000U) { /* Outputs for IfAction SubSystem: '/If Action Subsystem' incorporates: * ActionPort: '/Action Port' */ /* Merge: '/Merge' */ IfActionSubsystem(&rtB.Merge_h, &rtDW.ErrorHomming_private_m, &rtDW.Start_timer, &rtDW.stepSig_private_g); /* End of Outputs for SubSystem: '/If Action Subsystem' */ } else { /* Outputs for IfAction SubSystem: '/If Action Subsystem1' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write2' incorporates: * Constant: '/Constant3' */ rtDW.Start_timer = 1.0; /* DataStoreRead: '/Data Store Read2' incorporates: * Concatenate: '/Vector Concatenate' */ rtDW.BUS_ADR_private_a[0] = rtDW.PID_TempRR; /* DataStoreRead: '/Data Store Read' incorporates: * Concatenate: '/Vector Concatenate' */ rtDW.BUS_ADR_private_a[1] = rtDW.PID_TempRL; /* DataTypeConversion: '/Data Type Conversion2' incorporates: * DataStoreRead: '/valves target in percent' */ for (i = 0; i < 6; i++) { rtb_DataTypeConversion2_ie[i] = (uint8_t)rtb_Gain1_nj[i]; } /* End of DataTypeConversion: '/Data Type Conversion2' */ /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Concatenate: '/Vector Concatenate' */ rtDW.BUS_ADR_private_a[2] = rtb_DataTypeConversion2_ie[0]; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Concatenate: '/Vector Concatenate' */ rtDW.BUS_ADR_private_a[3] = rtb_DataTypeConversion2_ie[4]; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Concatenate: '/Vector Concatenate' */ rtDW.BUS_ADR_private_a[4] = rtb_DataTypeConversion2_ie[1]; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Concatenate: '/Vector Concatenate' */ rtDW.BUS_ADR_private_a[5] = rtb_DataTypeConversion2_ie[2]; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Concatenate: '/Vector Concatenate' */ rtDW.BUS_ADR_private_a[6] = rtb_DataTypeConversion2_ie[5]; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Concatenate: '/Vector Concatenate' */ rtDW.BUS_ADR_private_a[7] = rtb_DataTypeConversion2_ie[3]; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Concatenate: '/Vector Concatenate' * Constant: '/Constant1' * SignalConversion generated from: '/Vector Concatenate' */ rtDW.BUS_ADR_private_a[8] = 0U; for (i = 0; i < 9; i++) { /* Product: '/Product' */ Valve_2_way = rtDW.BUS_ADR_private_a[i]; /* DataTypeConversion: '/Data Type Conversion1' incorporates: * Constant: '/Constant1' * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write' * Product: '/Divide1' * Product: '/Product' */ rtDW.POS_private_h[i] = (uint16_t)((double)(Valve_2_way * rtDW.MaxPositionCh2_private[i]) / 100.0); /* RelationalOperator: '/Relational Operator1' incorporates: * DataStoreWrite: '/Data Store Write2' */ rtb_LogicalOperator3_i5[i] = (rtb_DataTypeConversion_bq[i] == Valve_2_way); } /* Logic: '/Logical Operator' */ rtb_LogicalOperator1_n = rtb_LogicalOperator3_i5[0]; for (i = 0; i < 8; i++) { rtb_LogicalOperator1_n = (rtb_LogicalOperator1_n && rtb_LogicalOperator3_i5[i + 1]); } for (i = 0; i < 9; i++) { /* Switch: '/Switch' incorporates: * Constant: '/Constant4' * Constant: '/Constant9' * DataStoreWrite: '/Data Store Write1' * Logic: '/Logical Operator' */ if (rtb_LogicalOperator1_n) { rtDW.COM_private_k[i] = 0U; } else { rtDW.COM_private_k[i] = 3U; } /* End of Switch: '/Switch' */ /* DataTypeConversion: '/Data Type Conversion1' incorporates: * Concatenate: '/Vector Concatenate' * Constant: '/Constant5' * DataStoreWrite: '/Data Store Write2' * DataStoreWrite: '/Data Store Write7' * Product: '/Product' * RelationalOperator: '/Relational Operator' */ rtDW.BUS_ADR_private_a[i] = (uint8_t)((uint32_t) (rtb_DataTypeConversion_bq[i] != rtDW.BUS_ADR_private_a[i]) * rtConstP.pooled106[i]); /* DataStoreWrite: '/Data Store Write4' incorporates: * Constant: '/Constant1' */ rtDW.Autos_private_g[i] = 1U; /* DataStoreWrite: '/Data Store Write2' incorporates: * Constant: '/Constant10' */ rtDW.Stall_private_f[i] = 1U; /* DataStoreWrite: '/Data Store Write3' incorporates: * Constant: '/Constant11' */ rtDW.Lnoise_private_g[i] = 0U; /* DataStoreWrite: '/Data Store Write5' incorporates: * Constant: '/Constant2' */ rtDW.Speed_private_b[i] = 3U; /* DataStoreWrite: '/Data Store Write6' incorporates: * Constant: '/Constant3' */ rtDW.Coils_private_l[i] = 3U; } /* Merge: '/Merge' incorporates: * Constant: '/Constant1' * Merge: '/Merge' * SignalConversion generated from: '/Out1' */ rtB.Merge_h = 3; /* End of Outputs for SubSystem: '/If Action Subsystem1' */ } /* End of If: '/If' */ /* End of Outputs for SubSystem: '/If Action Subsystem' */ } else { /* Outputs for IfAction SubSystem: '/If Action Subsystem1' incorporates: * ActionPort: '/Action Port' */ IfActionSubsystem1(&rtB.Merge_h, &rtDW.CCU_ActuatorErrF_Stat_private, rtDW.COM_private_k, rtDW.ErrorActuator_a, rtDW.ErrorCalibration_private_b, &rtDW.LOGGER_LIN, rtDW.MODE_private_c, rtDW.dtc_state_error_model); /* End of Outputs for SubSystem: '/If Action Subsystem1' */ } /* End of If: '/If' */ /* End of Outputs for SubSystem: '/Switch Case Action Subsystem3' */ break; case 4: /* Outputs for IfAction SubSystem: '/Switch Case Action Subsystem4' incorporates: * ActionPort: '/Action Port' */ /* DataStoreRead: '/Data Store Read2' incorporates: * Concatenate: '/Vector Concatenate' */ rtDW.BUS_ADR_private_a[0] = rtDW.PID_TempRR; /* DataStoreRead: '/Data Store Read' incorporates: * Concatenate: '/Vector Concatenate' */ rtDW.BUS_ADR_private_a[1] = rtDW.PID_TempRL; /* DataTypeConversion: '/Data Type Conversion2' incorporates: * DataStoreRead: '/valves target in percent' */ for (i = 0; i < 6; i++) { rtb_DataTypeConversion2_ie[i] = (uint8_t)rtb_Gain1_nj[i]; } /* End of DataTypeConversion: '/Data Type Conversion2' */ /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Concatenate: '/Vector Concatenate' */ rtDW.BUS_ADR_private_a[2] = rtb_DataTypeConversion2_ie[0]; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Concatenate: '/Vector Concatenate' */ rtDW.BUS_ADR_private_a[3] = rtb_DataTypeConversion2_ie[4]; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Concatenate: '/Vector Concatenate' */ rtDW.BUS_ADR_private_a[4] = rtb_DataTypeConversion2_ie[1]; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Concatenate: '/Vector Concatenate' */ rtDW.BUS_ADR_private_a[5] = rtb_DataTypeConversion2_ie[2]; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Concatenate: '/Vector Concatenate' */ rtDW.BUS_ADR_private_a[6] = rtb_DataTypeConversion2_ie[5]; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Concatenate: '/Vector Concatenate' */ rtDW.BUS_ADR_private_a[7] = rtb_DataTypeConversion2_ie[3]; /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Concatenate: '/Vector Concatenate' * Constant: '/Constant1' * SignalConversion generated from: '/Vector Concatenate' */ rtDW.BUS_ADR_private_a[8] = 0U; for (i = 0; i < 9; i++) { /* Product: '/Product' */ Valve_2_way = rtDW.BUS_ADR_private_a[i]; /* DataTypeConversion: '/Data Type Conversion1' incorporates: * Constant: '/Constant1' * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write' * Product: '/Divide1' * Product: '/Product' */ rtDW.POS_private_h[i] = (uint16_t)((double)(Valve_2_way * rtDW.MaxPositionCh2_private[i]) / 100.0); /* RelationalOperator: '/Relational Operator1' incorporates: * DataStoreWrite: '/Data Store Write2' */ rtb_LogicalOperator3_i5[i] = (rtb_DataTypeConversion_bq[i] == Valve_2_way); } /* Logic: '/Logical Operator' */ rtb_LogicalOperator1_n = rtb_LogicalOperator3_i5[0]; for (i = 0; i < 8; i++) { rtb_LogicalOperator1_n = (rtb_LogicalOperator1_n && rtb_LogicalOperator3_i5[i + 1]); } for (i = 0; i < 9; i++) { /* Switch: '/Switch' incorporates: * Constant: '/Constant4' * Constant: '/Constant9' * DataStoreWrite: '/Data Store Write1' * Logic: '/Logical Operator' */ if (rtb_LogicalOperator1_n) { rtDW.COM_private_k[i] = 0U; } else { rtDW.COM_private_k[i] = 3U; } /* End of Switch: '/Switch' */ /* DataTypeConversion: '/Data Type Conversion1' incorporates: * Concatenate: '/Vector Concatenate' * Constant: '/Constant5' * DataStoreWrite: '/Data Store Write2' * DataStoreWrite: '/Data Store Write7' * Product: '/Product' * RelationalOperator: '/Relational Operator' */ rtDW.BUS_ADR_private_a[i] = (uint8_t)((uint32_t) (rtb_DataTypeConversion_bq[i] != rtDW.BUS_ADR_private_a[i]) * rtConstP.pooled106[i]); /* DataStoreWrite: '/Data Store Write4' incorporates: * Constant: '/Constant1' */ rtDW.Autos_private_g[i] = 1U; /* DataStoreWrite: '/Data Store Write2' incorporates: * Constant: '/Constant10' */ rtDW.Stall_private_f[i] = 1U; /* DataStoreWrite: '/Data Store Write3' incorporates: * Constant: '/Constant11' */ rtDW.Lnoise_private_g[i] = 0U; /* DataStoreWrite: '/Data Store Write5' incorporates: * Constant: '/Constant2' */ rtDW.Speed_private_b[i] = 3U; /* DataStoreWrite: '/Data Store Write6' incorporates: * Constant: '/Constant3' */ rtDW.Coils_private_l[i] = 3U; } /* Merge: '/Merge' incorporates: * Constant: '/Constant1' * SignalConversion generated from: '/step' */ rtB.Merge_h = 4; /* MATLAB Function: '/MAX POSITION' incorporates: * DataStoreRead: '/Data Store Read5' */ /* : if(LOGGER>0) */ if (rtDW.LOGGER_LIN > 0.0) { /* : fprintf("[LIN 3] Homing. Callibration successful \n"); */ printf("[LIN 3] Homing. Callibration successful \n"); fflush(stdout); } /* End of MATLAB Function: '/MAX POSITION' */ /* End of Outputs for SubSystem: '/Switch Case Action Subsystem4' */ break; } /* End of SwitchCase: '/Switch Case' */ /* DataStoreWrite: '/Data Store Write2' */ rtDW.stepHoming_private_a = rtB.Merge_h; /* Merge: '/Merge' incorporates: * DataStoreRead: '/Data Store Read7' */ rtB.Merge_b4 = rtDW.stepSig_private_g; /* End of Outputs for SubSystem: '/Homing' */ break; } /* End of SwitchCase: '/Switch Case' */ /* Outport: '/CCU_Errors_model' incorporates: * DataStoreRead: '/Data Store Read10' */ rtY.CCU_Errors_model = CCU_Errors_Model; /* DataStoreWrite: '/Finish write stepSig' */ rtDW.stepSig_private_g = rtB.Merge_b4; /* BusCreator: '/Bus Creator' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read2' * DataStoreRead: '/Data Store Read3' * DataStoreRead: '/Data Store Read4' * DataStoreRead: '/Data Store Read5' * DataStoreRead: '/Data Store Read6' * DataStoreRead: '/Data Store Read7' * DataStoreRead: '/Data Store Read8' * DataStoreWrite: '/Data Store Write' */ for (i = 0; i < 9; i++) { Actuator_Ch2_Command_Model.POS[i] = rtDW.POS_private_h[i]; Actuator_Ch2_Command_Model.BUS_ADR[i] = rtDW.BUS_ADR_private_a[i]; Actuator_Ch2_Command_Model.MODE[i] = rtDW.MODE_private_c[i]; Actuator_Ch2_Command_Model.COM[i] = rtDW.COM_private_k[i]; Actuator_Ch2_Command_Model.Stall_SET[i] = rtDW.Stall_private_f[i]; Actuator_Ch2_Command_Model.Lnoise_SET[i] = rtDW.Lnoise_private_g[i]; Actuator_Ch2_Command_Model.Autos_SET[i] = rtDW.Autos_private_g[i]; Actuator_Ch2_Command_Model.Speed_SET[i] = rtDW.Speed_private_b[i]; Actuator_Ch2_Command_Model.Coils_Stop_SET[i] = rtDW.Coils_private_l[i]; } /* End of BusCreator: '/Bus Creator' */ /* RelationalOperator: '/Compare' incorporates: * Constant: '/Constant' * DataStoreRead: '/Data Store Read2' */ for (i = 0; i < 8; i++) { rtb_Compare_le[i] = (rtDW.ErrorCalibration_private_b[i] == 0); } /* End of RelationalOperator: '/Compare' */ /* Logic: '/Logical Operator' */ rtb_LogicalOperator1_n = rtb_Compare_le[0]; for (i = 0; i < 7; i++) { rtb_LogicalOperator1_n = (rtb_LogicalOperator1_n || rtb_Compare_le[i + 1]); } /* Switch: '/Switch1' incorporates: * Constant: '/Constant' * Constant: '/Constant3' * DataStoreRead: '/Data Store Read2' * Logic: '/Logical Operator' * Product: '/Product' */ for (i = 0; i < 8; i++) { if (rtb_LogicalOperator1_n) { rtb_DataTypeConversion_bq[i] = (uint8_t)((uint32_t) rtDW.ErrorCalibration_private_b[i] * rtConstP.Constant3_Value_d[i]); } else { rtb_DataTypeConversion_bq[i] = 0U; } } /* End of Switch: '/Switch1' */ /* SignalConversion generated from: '/Vector Concatenate' incorporates: * Constant: '/Constant1' */ rtb_DataTypeConversion_bq[8] = 0U; for (i = 0; i < 9; i++) { /* DataStoreWrite: '/Data Store Write7' incorporates: * Concatenate: '/Vector Concatenate' */ rtDW.BUS_ADR_private_a[i] = rtb_DataTypeConversion_bq[i]; /* DataStoreWrite: '/Data Store Write' */ rtDW.COM_private_k[i] = 0U; } /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.LOGGER_LIN = 1.0; /* Gain: '/Gain' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreRead: '/Data Store Read2' * Sum: '/Subtract' */ rtb_Gain_pl = (int16_t)(rtb_FLU_tg_correct - rtb_y_fe) * 26214; /* Sum: '/Sum' incorporates: * DiscreteIntegrator: '/Integrator' * Gain: '/Proportional Gain' * Gain: '/Gain' * Sum: '/SumI2' */ rtb_SumI2_e = (int64_t)((int32_t)(((int64_t)rtb_Gain_pl << 30) >> 49) + (int32_t)(rtDW.Integrator_DSTATE >> 32)) << 32; /* Saturate: '/Saturation' incorporates: * DataStoreWrite: '/Data Store Write' * Sum: '/SumI2' */ if (rtb_SumI2_e >= 429496729600LL) { rtDW.PID_TempFUL = 100U; } else if (rtb_SumI2_e <= 0LL) { rtDW.PID_TempFUL = 0U; } else { rtDW.PID_TempFUL = (uint8_t)(rtb_SumI2_e >> 32); } /* End of Saturate: '/Saturation' */ /* Gain: '/Gain1' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read3' * Sum: '/Subtract1' */ rpm_phys = (int16_t)(rtb_Selector_p - rtb_y_bf) * 26214; /* Sum: '/Sum' incorporates: * DiscreteIntegrator: '/Integrator' * Gain: '/Proportional Gain' * Gain: '/Gain1' * Sum: '/SumI2' */ rtb_SumI2_je = (int64_t)((int32_t)(((int64_t)rpm_phys << 30) >> 49) + (int32_t) (rtDW.Integrator_DSTATE_k >> 32)) << 32; /* Saturate: '/Saturation' incorporates: * DataStoreWrite: '/Data Store Write1' * Sum: '/SumI2' */ if (rtb_SumI2_je >= 429496729600LL) { rtDW.PID_TempFUR = 100U; } else if (rtb_SumI2_je <= 0LL) { rtDW.PID_TempFUR = 0U; } else { rtDW.PID_TempFUR = (uint8_t)(rtb_SumI2_je >> 32); } /* End of Saturate: '/Saturation' */ /* Gain: '/Gain4' incorporates: * DataStoreRead: '/Data Store Read10' * DataStoreRead: '/Data Store Read6' * Sum: '/Subtract4' */ rtb_Gain4 = (int16_t)(rtb_FLU_tg_correct_de - rtb_y_ar) * 26214; /* Sum: '/Sum' incorporates: * DiscreteIntegrator: '/Integrator' * Gain: '/Proportional Gain' * Gain: '/Gain4' * Sum: '/SumI2' */ rtb_SumI2_b = (int64_t)((int32_t)(((int64_t)rtb_Gain4 << 30) >> 49) + (int32_t) (rtDW.Integrator_DSTATE_h >> 32)) << 32; /* Saturate: '/Saturation' incorporates: * DataStoreWrite: '/Data Store Write4' * Sum: '/SumI2' */ if (rtb_SumI2_b >= 429496729600LL) { rtDW.PID_TempFLL = 100U; } else if (rtb_SumI2_b <= 0LL) { rtDW.PID_TempFLL = 0U; } else { rtDW.PID_TempFLL = (uint8_t)(rtb_SumI2_b >> 32); } /* End of Saturate: '/Saturation' */ /* Gain: '/Gain5' incorporates: * DataStoreRead: '/Data Store Read11' * DataStoreRead: '/Data Store Read9' * Sum: '/Subtract5' */ rtb_Gain5 = (int16_t)(rtb_FLU_tg_correct_b - rtb_y_h5) * 26214; /* Sum: '/Sum' incorporates: * DiscreteIntegrator: '/Integrator' * Gain: '/Proportional Gain' * Gain: '/Gain5' * Sum: '/SumI2' */ rtb_SumI2_c = (int64_t)((int32_t)(((int64_t)rtb_Gain5 << 30) >> 49) + (int32_t) (rtDW.Integrator_DSTATE_i >> 32)) << 32; /* Saturate: '/Saturation' incorporates: * DataStoreWrite: '/Data Store Write5' * Sum: '/SumI2' */ if (rtb_SumI2_c >= 429496729600LL) { rtDW.PID_TempFRL = 100U; } else if (rtb_SumI2_c <= 0LL) { rtDW.PID_TempFRL = 0U; } else { rtDW.PID_TempFRL = (uint8_t)(rtb_SumI2_c >> 32); } /* End of Saturate: '/Saturation' */ /* Gain: '/Gain2' incorporates: * DataStoreRead: '/Data Store Read5' * Sum: '/Subtract2' */ rtb_Gain2 = 26214 * (int16_t)-rtb_MultiportSwitch_ae; /* Sum: '/Sum' incorporates: * DiscreteIntegrator: '/Integrator' * Gain: '/Proportional Gain' * Gain: '/Gain2' * Sum: '/SumI2' */ rtb_SumI2_o = (int64_t)((int32_t)(((int64_t)rtb_Gain2 << 30) >> 49) + (int32_t) (rtDW.Integrator_DSTATE_n >> 32)) << 32; /* Saturate: '/Saturation' incorporates: * DataStoreWrite: '/Data Store Write2' * Sum: '/SumI2' */ if (rtb_SumI2_o >= 429496729600LL) { rtDW.PID_TempRL = 100U; } else if (rtb_SumI2_o <= 0LL) { rtDW.PID_TempRL = 0U; } else { rtDW.PID_TempRL = (uint8_t)(rtb_SumI2_o >> 32); } /* End of Saturate: '/Saturation' */ /* Gain: '/Gain3' incorporates: * DataStoreRead: '/Data Store Read7' * DataStoreRead: '/Data Store Read8' * Sum: '/Subtract3' */ rtb_Gain3 = (int16_t)(rtDW.Duct_RR_Tg - rtb_Bias1_h) * 26214; /* Sum: '/Sum' incorporates: * DiscreteIntegrator: '/Integrator' * Gain: '/Integral Gain' * Gain: '/Proportional Gain' * Gain: '/Gain3' */ rtb_IntegralGain = (int64_t)((int32_t)(((int64_t)rtb_Gain3 << 30) >> 49) + (int32_t)(rtDW.Integrator_DSTATE_a >> 32)) << 32; /* Saturate: '/Saturation' incorporates: * DataStoreWrite: '/Data Store Write3' * Gain: '/Integral Gain' */ if (rtb_IntegralGain >= 429496729600LL) { rtDW.PID_TempRR = 100U; } else if (rtb_IntegralGain <= 0LL) { rtDW.PID_TempRR = 0U; } else { rtDW.PID_TempRR = (uint8_t)(rtb_IntegralGain >> 32); } /* End of Saturate: '/Saturation' */ /* Product: '/Divide' incorporates: * Constant: '/Constant' * DataStoreRead: '/Data Store Read6' * DataStoreRead: '/Data Store Read7' * Sum: '/Add' */ Blower_AF_FL = floor(Blower_AF_FL + Blower_AF_FR) / 4.0; /* Switch: '/Switch' */ if (Blower_AF_FL > 0.0) { /* Saturate: '/Saturation2' */ if (Blower_AF_FL > 80.0) { /* DataTypeConversion: '/Data Type Conversion1' incorporates: * DataStoreWrite: '/Data Store Write2' */ rtDW.PWM_front = 80U; } else if (Blower_AF_FL < 15.0) { /* DataTypeConversion: '/Data Type Conversion1' incorporates: * DataStoreWrite: '/Data Store Write2' */ rtDW.PWM_front = 15U; } else { /* DataTypeConversion: '/Data Type Conversion1' incorporates: * DataStoreWrite: '/Data Store Write2' */ rtDW.PWM_front = (uint8_t)Blower_AF_FL; } /* End of Saturate: '/Saturation2' */ } else { /* DataTypeConversion: '/Data Type Conversion1' incorporates: * Constant: '/Constant1' * DataStoreWrite: '/Data Store Write2' */ rtDW.PWM_front = 0U; } /* End of Switch: '/Switch' */ /* Product: '/Divide1' incorporates: * Constant: '/Constant2' * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read3' * Sum: '/Add1' */ Blower_AF_FL = (double)(Blower_AF_RL + rtb_Saturation9) / 4.0; /* Switch: '/Switch1' */ if (Blower_AF_FL > 0.0) { /* Saturate: '/Saturation1' */ if (Blower_AF_FL > 80.0) { /* DataTypeConversion: '/Data Type Conversion2' incorporates: * DataStoreWrite: '/Data Store Write3' */ rtDW.PWM_rear = 80U; } else if (Blower_AF_FL < 15.0) { /* DataTypeConversion: '/Data Type Conversion2' incorporates: * DataStoreWrite: '/Data Store Write3' */ rtDW.PWM_rear = 15U; } else { /* DataTypeConversion: '/Data Type Conversion2' incorporates: * DataStoreWrite: '/Data Store Write3' */ rtDW.PWM_rear = (uint8_t)Blower_AF_FL; } /* End of Saturate: '/Saturation1' */ } else { /* DataTypeConversion: '/Data Type Conversion2' incorporates: * Constant: '/Constant3' * DataStoreWrite: '/Data Store Write3' */ rtDW.PWM_rear = 0U; } /* End of Switch: '/Switch1' */ /* BusCreator: '/Bus Creator' incorporates: * DataStoreWrite: '/Data Store Write' * DataStoreWrite: '/Data Store Write2' * DataStoreWrite: '/Data Store Write3' */ PWM_Get.pwmPercentFront = rtDW.PWM_front; PWM_Get.pwmPercentRear = rtDW.PWM_rear; PWM_Get.pwmPercentFrontReserved = 0U; PWM_Get.pwmPercentRearReserved = 0U; /* BusCreator: '/Bus Creator1' incorporates: * DataStoreRead: '/Data Store Read51' * DataStoreRead: '/Data Store Read52' * DataStoreRead: '/Data Store Read53' * DataStoreRead: '/Data Store Read54' * DataStoreRead: '/Data Store Read56' * DataStoreRead: '/Data Store Read57' * DataStoreRead: '/Data Store Read58' * DataStoreRead: '/Data Store Read59' * DataStoreRead: '/Data Store Read60' * DataStoreRead: '/Data Store Read61' * DataStoreRead: '/Data Store Read62' * DataStoreRead: '/Data Store Read63' * DataStoreRead: '/Data Store Read64' * DataStoreRead: '/Data Store Read65' * DataStoreRead: '/Data Store Read66' * DataStoreRead: '/Data Store Read67' * DataStoreWrite: '/Data Store Write27' * DataStoreWrite: '/Data Store Write8' * DataTypeConversion: '/Data Type Conversion1' * DataTypeConversion: '/Data Type Conversion2' * DataTypeConversion: '/Data Type Conversion3' * DataTypeConversion: '/Data Type Conversion4' * Logic: '/Logical Operator2' * Logic: '/Logical Operator3' * Logic: '/Logical Operator4' * Logic: '/Logical Operator5' */ /* : if(LOGGER) */ rtDW.PowerEnable_Model.SW5V_EN = rtDW.SW5V_EN; rtDW.PowerEnable_Model.PBATT_CK_EN = rtDW.PBATT_CK_EN; rtDW.PowerEnable_Model.Incar_Motor_Front_EN = rtDW.Incar_Motor_Front_EN; rtDW.PowerEnable_Model.Incar_Motor_Rear_EN = rtDW.Incar_Motor_Rear_EN; rtDW.PowerEnable_Model.TwoWayValve_EN = (uint8_t)(rtB.Cmd_2Way == 0); rtDW.PowerEnable_Model.ReservePower_EN = rtDW.ReservePower_EN; rtDW.PowerEnable_Model.PtcRelayDriver1_EN = rtDW.PtcRelayDriver1_EN; rtDW.PowerEnable_Model.PtcRelayDriver2_EN = rtDW.PtcRelayDriver2_EN; rtDW.PowerEnable_Model.ShutOffFront_EN = (uint8_t)(rtb_timer_out == 0); rtDW.PowerEnable_Model.ShutOffRear_EN = (uint8_t)(ShutOffRear_EN == 0); rtDW.PowerEnable_Model.EN_ReservePower = rtDW.EN_ReservePower; rtDW.PowerEnable_Model.LIN_ActPower_AB = rtDW.LIN_ActPower_AB; rtDW.PowerEnable_Model.LIN_ActPower_C = rtDW.LIN_ActPower_C; rtDW.PowerEnable_Model.ShutOffTXV1_EN = rtDW.ShutOffTXV1_EN; rtDW.PowerEnable_Model.ShutOffTXV2_EN = rtDW.ShutOffTXV2_EN; rtDW.PowerEnable_Model.EN_BATTChiller = (uint8_t)(EN_BATTChiller == 0); rtDW.PowerEnable_Model.EN_PowerReserve = rtDW.EN_PowerReserve; /* Outport: '/PWM_Get' incorporates: * DataStoreRead: '/Data Store Read7' */ rtY.PWM_Get_f = PWM_Get; /* SwitchCase: '/Incar Motors' incorporates: * Constant: '/Constant' * Constant: '/Constant' * Constant: '/Constant' * DataStoreRead: '/Data Store Read' * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read2' * Logic: '/Logical Operator' * Logic: '/Logical Operator1' * RelationalOperator: '/Compare' * RelationalOperator: '/Compare' * RelationalOperator: '/Compare' */ if ((rtDW.BCM_T15_Stat != 0) && ((rtDW.CCU_BLOWERS_RL != 0) || (rtDW.CCU_BLOWERS_RR != 0))) { /* Outputs for IfAction SubSystem: '/Subsystem2' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write2' incorporates: * Constant: '/Constant' */ rtDW.Incar_Motor_Front_EN = 1U; /* DataStoreWrite: '/Data Store Write3' incorporates: * Constant: '/Constant' */ rtDW.Incar_Motor_Rear_EN = 1U; /* End of Outputs for SubSystem: '/Subsystem2' */ } else { /* Outputs for IfAction SubSystem: '/Subsystem' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write2' incorporates: * Constant: '/Constant' */ rtDW.Incar_Motor_Front_EN = 0U; /* DataStoreWrite: '/Data Store Write3' incorporates: * Constant: '/Constant' */ rtDW.Incar_Motor_Rear_EN = 0U; /* End of Outputs for SubSystem: '/Subsystem' */ } /* End of SwitchCase: '/Incar Motors' */ /* BusCreator: '/Bus Creator' incorporates: * DataStoreRead: '/Data Store Read2' * DataStoreWrite: '/Data Store Write' * DataTypeConversion: '/Data Type Conversion2' */ rtDW.dbgCAN_dbg_Sen_0_model.dbg_Sen_BattVolt_ro = 0U; rtDW.dbgCAN_dbg_Sen_0_model.dbg_Sen_Pressure_ro = (uint16_t)rtDW.Pressure; /* DataTypeConversion: '/Data Type Conversion' incorporates: * DataStoreRead: '/Data Store Read' */ rtb_Divide1_l5 = fabs(rtDW.Sun_L); if (rtb_Divide1_l5 < 4.503599627370496E+15) { if (rtb_Divide1_l5 >= 0.5) { /* BusCreator: '/Bus Creator' incorporates: * DataStoreWrite: '/Data Store Write' */ rtDW.dbgCAN_dbg_Sen_0_model.dbg_Sen_Sun_L = (uint16_t)floor(rtDW.Sun_L + 0.5); } else { /* BusCreator: '/Bus Creator' incorporates: * DataStoreWrite: '/Data Store Write' */ rtDW.dbgCAN_dbg_Sen_0_model.dbg_Sen_Sun_L = 0U; } } else { /* BusCreator: '/Bus Creator' incorporates: * DataStoreWrite: '/Data Store Write' */ rtDW.dbgCAN_dbg_Sen_0_model.dbg_Sen_Sun_L = (uint16_t)rtDW.Sun_L; } /* End of DataTypeConversion: '/Data Type Conversion' */ /* DataTypeConversion: '/Data Type Conversion1' incorporates: * DataStoreRead: '/Data Store Read1' */ rtb_Divide1_l5 = fabs(rtDW.Sun_R); if (rtb_Divide1_l5 < 4.503599627370496E+15) { if (rtb_Divide1_l5 >= 0.5) { /* BusCreator: '/Bus Creator' incorporates: * DataStoreWrite: '/Data Store Write' */ rtDW.dbgCAN_dbg_Sen_0_model.dbg_Sen_Sun_R = (uint16_t)floor(rtDW.Sun_R + 0.5); } else { /* BusCreator: '/Bus Creator' incorporates: * DataStoreWrite: '/Data Store Write' */ rtDW.dbgCAN_dbg_Sen_0_model.dbg_Sen_Sun_R = 0U; } } else { /* BusCreator: '/Bus Creator' incorporates: * DataStoreWrite: '/Data Store Write' */ rtDW.dbgCAN_dbg_Sen_0_model.dbg_Sen_Sun_R = (uint16_t)rtDW.Sun_R; } /* End of DataTypeConversion: '/Data Type Conversion1' */ /* BusCreator: '/Bus Creator1' incorporates: * Constant: '/Constant10' * Constant: '/Constant6' * Constant: '/Constant7' * Constant: '/Constant8' * Constant: '/Constant9' * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read10' * DataStoreRead: '/Data Store Read11' * DataStoreRead: '/Data Store Read13' * DataStoreRead: '/Data Store Read15' * DataStoreRead: '/Data Store Read17' * DataStoreRead: '/Data Store Read19' * DataStoreRead: '/Data Store Read2' * DataStoreRead: '/Data Store Read3' * DataStoreRead: '/Data Store Read4' * DataStoreRead: '/Data Store Read5' * DataStoreRead: '/Data Store Read6' * DataStoreRead: '/Data Store Read7' * DataStoreRead: '/Data Store Read8' * DataStoreRead: '/Data Store Read9' * DataStoreWrite: '/Data Store Write4' * DataStoreWrite: '/Data Store Write1' */ rtDW.dbgCAN_dbg_Sen_Duct_model.dbg_Sen_Duct_MultMsg_Idx = 0U; rtDW.dbgCAN_dbg_Sen_Duct_model.dbg_Sen_Duct_FL_Fb_Select = 0U; rtDW.dbgCAN_dbg_Sen_Duct_model.dbg_Sen_Duct_RR_Fb_Select = 0U; rtDW.dbgCAN_dbg_Sen_Duct_model.dbg_Sen_Duct_RL_Fb_Select = 0U; rtDW.dbgCAN_dbg_Sen_Duct_model.dbg_Sen_Duct_FR_Fb_Select = 0U; rtDW.dbgCAN_dbg_Sen_Duct_model.dbg_Sen_Duct_RL_Tgt_ro = 0; rtDW.dbgCAN_dbg_Sen_Duct_model.dbg_Sen_Duct_FR_Upper_Tgt_ro = rtb_Selector_p; rtDW.dbgCAN_dbg_Sen_Duct_model.dbg_Sen_Duct_RR_Tgt_ro = rtDW.Duct_RR_Tg; rtDW.dbgCAN_dbg_Sen_Duct_model.dbg_Sen_Duct_FL_Upper_Tgt_ro = rtb_FLU_tg_correct; rtDW.dbgCAN_dbg_Sen_Duct_model.dbg_Sen_Duct_RR_Fb_ro = rtb_Bias1_h; rtDW.dbgCAN_dbg_Sen_Duct_model.dbg_Sen_Duct_RL_Fb_ro = rtb_MultiportSwitch_ae; rtDW.dbgCAN_dbg_Sen_Duct_model.dbg_Sen_Duct_FR_Upper_Fb_ro = rtb_y_bf; rtDW.dbgCAN_dbg_Sen_Duct_model.dbg_Sen_Duct_FL_Upper_Fb_ro = rtb_y_fe; rtDW.dbgCAN_dbg_Sen_Duct_model.dbg_Sen_Duct_FR_Side_Fb_ro = rtb_y_ck; rtDW.dbgCAN_dbg_Sen_Duct_model.dbg_Sen_Duct_FL_Side_Fb_ro = rtb_y_lg; rtDW.dbgCAN_dbg_Sen_Duct_model.dbg_Sen_Duct_RL_Side_Fb_ro = Duct3_R; rtDW.dbgCAN_dbg_Sen_Duct_model.dbg_Sen_Duct_RR_Side_Fb_ro = Duct4_R; rtDW.dbgCAN_dbg_Sen_Duct_model.dbg_Sen_Duct_FR_Lower_Tgt_ro = rtb_FLU_tg_correct_b; rtDW.dbgCAN_dbg_Sen_Duct_model.dbg_Sen_Duct_FL_Lower_Tgt_ro = rtb_FLU_tg_correct_de; rtDW.dbgCAN_dbg_Sen_Duct_model.dbg_Sen_Duct_FR_Lower_Fb_ro = rtb_y_h5; rtDW.dbgCAN_dbg_Sen_Duct_model.dbg_Sen_Duct_FL_Lower_Fb_ro = rtb_y_ar; /* BusCreator: '/Bus Creator' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read53' * DataStoreRead: '/Data Store Read54' * DataStoreRead: '/Data Store Read6' * DataStoreWrite: '/Data Store Write27' * DataStoreWrite: '/Data Store Write' * DataTypeConversion: '/Data Type Conversion4' * Logic: '/Logical Operator5' */ rtDW.dbgCAN_CCU_IO_model.dbg_IO_Txv_F = rtb_timer_out; rtDW.dbgCAN_CCU_IO_model.dbg_IO_Txv_R = ShutOffRear_EN; rtDW.dbgCAN_CCU_IO_model.dbg_IO_Txv_Ch = EN_BATTChiller; rtDW.dbgCAN_CCU_IO_model.dbg_IO_2WayValve = (uint8_t)(rtB.Cmd_2Way == 0); rtDW.dbgCAN_CCU_IO_model.dbg_IO_IncarMotor_F = rtDW.Incar_Motor_Front_EN; rtDW.dbgCAN_CCU_IO_model.dbg_IO_IncarMotor_R = rtDW.Incar_Motor_Rear_EN; /* Saturate: '/Saturation' incorporates: * DataStoreRead: '/Data Store Read2' */ if (rtDW.CCU_SET_FL > 310) { Gain = 310U; } else if (rtDW.CCU_SET_FL < 155) { Gain = 155U; } else { Gain = rtDW.CCU_SET_FL; } /* BusCreator: '/Bus Creator' incorporates: * Bias: '/Bias' * DataStoreWrite: '/Data Store Write' * DataTypeConversion: '/Data Type Conversion' * Gain: '/Gain' * Gain: '/Gain1' * Saturate: '/Saturation' */ rtDW.dbgCAN_CCU_IO_model.dbg_SetTemp_FL_ro = (uint8_t)((0.10000038146972656 * (double)Gain - 16.0) * 2.0); /* Saturate: '/Saturation' incorporates: * DataStoreRead: '/Data Store Read3' */ if (rtDW.CCU_SET_FR > 310) { Gain = 310U; } else if (rtDW.CCU_SET_FR < 155) { Gain = 155U; } else { Gain = rtDW.CCU_SET_FR; } /* BusCreator: '/Bus Creator' incorporates: * Bias: '/Bias' * DataStoreWrite: '/Data Store Write' * DataTypeConversion: '/Data Type Conversion' * Gain: '/Gain' * Gain: '/Gain1' * Saturate: '/Saturation' */ rtDW.dbgCAN_CCU_IO_model.dbg_SetTemp_FR_ro = (uint8_t)((0.10000038146972656 * (double)Gain - 16.0) * 2.0); /* Saturate: '/Saturation' incorporates: * DataStoreRead: '/Data Store Read4' */ if (rtDW.CCU_SET_RL > 310) { Gain = 310U; } else if (rtDW.CCU_SET_RL < 155) { Gain = 155U; } else { Gain = rtDW.CCU_SET_RL; } /* BusCreator: '/Bus Creator' incorporates: * Bias: '/Bias' * DataStoreWrite: '/Data Store Write' * DataTypeConversion: '/Data Type Conversion' * Gain: '/Gain' * Gain: '/Gain1' * Saturate: '/Saturation' */ rtDW.dbgCAN_CCU_IO_model.dbg_SetTemp_RL_ro = (uint8_t)((0.10000038146972656 * (double)Gain - 16.0) * 2.0); /* Saturate: '/Saturation' incorporates: * DataStoreRead: '/Data Store Read5' */ if (rtDW.CCU_SET_RR > 310) { Gain = 310U; } else if (rtDW.CCU_SET_RR < 155) { Gain = 155U; } else { Gain = rtDW.CCU_SET_RR; } /* BusCreator: '/Bus Creator' incorporates: * Bias: '/Bias' * DataStoreWrite: '/Data Store Write' * DataTypeConversion: '/Data Type Conversion' * Gain: '/Gain' * Gain: '/Gain1' * Saturate: '/Saturation' */ rtDW.dbgCAN_CCU_IO_model.dbg_SetTemp_RR_ro = (uint8_t)((0.10000038146972656 * (double)Gain - 16.0) * 2.0); rtDW.dbgCAN_CCU_IO_model.dbg_IO_Input_Emergency = 0U; rtDW.dbgCAN_CCU_IO_model.dbg_IO_Input_FireExtinguisher = 0U; rtDW.dbgCAN_CCU_IO_model.dbg_IO_Install_Sealing_Valve = 0U; /* BusCreator: '/Bus Creator' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read2' * DataStoreRead: '/Data Store Read3' * DataStoreRead: '/Data Store Read4' * DataStoreRead: '/Data Store Read55' * DataStoreRead: '/Data Store Read7' * DataStoreWrite: '/Data Store Write' * DataStoreWrite: '/Data Store Write' * DataTypeConversion: '/Data Type Conversion2' */ rtDW.dbg_Logic_Ac_model.Logic_Ac_Req_Front = rtDW.CCU_AC_FRONT; rtDW.dbg_Logic_Ac_model.Logic_Ac_Txv_Front = rtb_timer_out; rtDW.dbg_Logic_Ac_model.Logic_Ac_Txv_Rear = ShutOffRear_EN; rtDW.dbg_Logic_Ac_model.Logic_Ac_Req_Rear = rtDW.CCU_AC_REAR; rtDW.dbg_Logic_Ac_model.Logic_Ac_Req_Chiller = rtDW.eCompChiller_Req; rtDW.dbg_Logic_Ac_model.Logic_Ac_Txv_Chiller = EN_BATTChiller; rtDW.dbg_Logic_Ac_model.Logic_Ac_EvaCtrl = rtB.Eva_Ctrl; rtDW.dbg_Logic_Ac_model.Logic_Ac_Comp_EmrStop_Reason = eComp_stop; rtDW.dbg_Logic_Ac_model.Logic_Ac_Txv_Closed_bySen = 0U; rtDW.dbg_Logic_Ac_model.Logic_Ac_WinterSts_Front = 0U; rtDW.dbg_Logic_Ac_model.Logic_Ac_WinterSts_Rear = 0U; /* BusCreator: '/Bus Creator' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreRead: '/Data Store Read2' * DataStoreWrite: '/Data Store Write' * DataStoreWrite: '/Data Store Write3' */ rtDW.dbgCAN_Logic_Rec_model.Logic_Rec_Idx = rtDW.Full_Rec; rtDW.dbgCAN_Logic_Rec_model.Logic_Rec_Partial_Spd_Sts = rtb_Switch_gs; rtDW.dbgCAN_Logic_Rec_model.Logic_Rec_Partial_Winter = 0U; rtDW.dbgCAN_Logic_Rec_model.Logic_Rec_Partial_Summer = rtb_Saturation4_l; rtDW.dbgCAN_Logic_Rec_model.Logic_Rec_FreshAirPurge_Sts = 0U; /* BusCreator: '/Bus Creator' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreRead: '/Data Store Read2' * DataStoreWrite: '/Data Store Write' */ rtDW.dbgCAN_Logic_State_model.Logic_Operation_Mode = 0U; rtDW.dbgCAN_Logic_State_model.Logic_Amb_Level = rtDW.LEVEL; rtDW.dbgCAN_Logic_State_model.Logic_AutoDemist_Electric = 0U; rtDW.dbgCAN_Logic_State_model.Logic_AutoDemist_Garage = 0U; rtDW.dbgCAN_Logic_State_model.Logic_AutoDemist_Lv_Summer = 0U; rtDW.dbgCAN_Logic_State_model.Logic_RemoteStart = 0U; rtDW.dbgCAN_Logic_State_model.Logic_Rest_Mode = 0U; rtDW.dbgCAN_Logic_State_model.Logic_LoHi_Front = rtDW.CAN_LoHi_Front; rtDW.dbgCAN_Logic_State_model.Logic_2WayValve_Status = 0U; rtDW.dbgCAN_Logic_State_model.Logic_Full_Auto_FL = 0U; rtDW.dbgCAN_Logic_State_model.Logic_Full_Auto_FR = 0U; rtDW.dbgCAN_Logic_State_model.Logic_Full_Auto_RL = 0U; rtDW.dbgCAN_Logic_State_model.Logic_Full_Auto_RR = 0U; rtDW.dbgCAN_Logic_State_model.Logic_Full_MaxAc = 0U; rtDW.dbgCAN_Logic_State_model.Logic_Full_MaxDef = 0U; /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read3' */ if (rtDW.step_start_controle_front > 0) { /* BusCreator: '/Bus Creator' incorporates: * DataStoreWrite: '/Data Store Write' */ rtDW.dbgCAN_Logic_State_model.Logic_Start_Ctrl_Front = (uint8_t) rtDW.step_start_controle_front; } else { /* BusCreator: '/Bus Creator' incorporates: * Constant: '/Constant' * DataStoreWrite: '/Data Store Write' */ rtDW.dbgCAN_Logic_State_model.Logic_Start_Ctrl_Front = 0U; } /* End of Switch: '/Switch' */ /* Switch: '/Switch1' incorporates: * DataStoreRead: '/Data Store Read4' */ if (rtDW.step_start_controle_rear > 0) { /* BusCreator: '/Bus Creator' incorporates: * DataStoreWrite: '/Data Store Write' */ rtDW.dbgCAN_Logic_State_model.Logic_Start_Ctrl_Rear = (uint8_t) rtDW.step_start_controle_rear; } else { /* BusCreator: '/Bus Creator' incorporates: * Constant: '/Constant' * DataStoreWrite: '/Data Store Write' */ rtDW.dbgCAN_Logic_State_model.Logic_Start_Ctrl_Rear = 0U; } /* End of Switch: '/Switch1' */ /* BusCreator: '/Bus Creator' incorporates: * DataStoreWrite: '/Data Store Write' */ rtDW.dbgCAN_Logic_State_model.Logic_Valve_Use_DiffBlr_R2 = 0U; rtDW.dbgCAN_Logic_State_model.Logic_Duct_WaitCorrection_FRL = 0U; rtDW.dbgCAN_Logic_State_model.Logic_Duct_WaitCorrection_FLL = 0U; rtDW.dbgCAN_Logic_State_model.Logic_AutoDemist_Lv_Winter = 0U; rtDW.dbgCAN_Logic_State_model.Logic_AF_WaitCorrection_FL = 0U; rtDW.dbgCAN_Logic_State_model.Logic_AF_WaitCorrection_FR = 0U; /* BusCreator: '/Bus Creator1' incorporates: * DataStoreRead: '/Data Store Read4' * DataStoreWrite: '/Data Store Write2' * DataStoreWrite: '/Data Store Write1' */ rtDW.dbgCAN_dbg_Act0_model.dbg_Act00_Def = rtb_DataTypeConversion_bh[0]; rtDW.dbgCAN_dbg_Act0_model.dbg_Act01_Vent_SFL = rtb_DataTypeConversion_bh[5]; rtDW.dbgCAN_dbg_Act0_model.dbg_Act02_Vent_CFL = rtb_DataTypeConversion_bh[4]; rtDW.dbgCAN_dbg_Act0_model.dbg_Act03_Foot_1FL = rtb_DataTypeConversion_bh[7]; rtDW.dbgCAN_dbg_Act0_model.dbg_Act04_Foot_2FL = rtb_DataTypeConversion_bh[8]; rtDW.dbgCAN_dbg_Act0_model.dbg_Act05_Vent_CFR = Actuator_pos_percent_Ch1[1]; rtDW.dbgCAN_dbg_Act0_model.dbg_Act06_Vent_SFR = Actuator_pos_percent_Ch1[2]; rtDW.dbgCAN_dbg_Act0_model.dbg_Act07_Foot_1FR = Actuator_pos_percent_Ch1[4]; /* BusCreator: '/Bus Creator3' incorporates: * DataStoreRead: '/Data Store Read4' * DataStoreRead: '/Data Store Read5' * DataStoreWrite: '/Data Store Write2' * DataStoreWrite: '/Data Store Write2' */ rtDW.dbgCAN_dbg_Act2_model.dbg_Act16_TempL_FL = rtb_DataTypeConversion_bh[6]; rtDW.dbgCAN_dbg_Act2_model.dbg_Act17_TempU_FR = Actuator_pos_percent_Ch1[0]; rtDW.dbgCAN_dbg_Act2_model.dbg_Act18_TempL_FR = Actuator_pos_percent_Ch1[3]; rtDW.dbgCAN_dbg_Act2_model.dbg_Act19_Temp_RL = rtb_DataTypeConversion_fb[1]; rtDW.dbgCAN_dbg_Act2_model.dbg_Act20_Temp_RR = rtb_DataTypeConversion_fb[0]; rtDW.dbgCAN_dbg_Act2_model.dbg_Act21_Rec = rtb_DataTypeConversion_bh[1]; rtDW.dbgCAN_dbg_Act2_model.dbg_Act22_OSA = rtb_DataTypeConversion_bh[2]; rtDW.dbgCAN_dbg_Act2_model.dbg_Act23_SealingValve = rtb_DataTypeConversion_fb [8]; /* BusCreator: '/Bus Creator2' incorporates: * DataStoreRead: '/Data Store Read4' * DataStoreRead: '/Data Store Read5' * DataStoreWrite: '/Data Store Write2' * DataStoreWrite: '/Data Store Write3' */ rtDW.dbgCAN_dbg_Act1_model.dbg_Act08_Foot_2FR = Actuator_pos_percent_Ch1[5]; rtDW.dbgCAN_dbg_Act1_model.dbg_Act09_Vent_SRL = rtb_DataTypeConversion_fb[2]; rtDW.dbgCAN_dbg_Act1_model.dbg_Act10_Vent_CRL = rtb_DataTypeConversion_fb[4]; rtDW.dbgCAN_dbg_Act1_model.dbg_Act11_Foot_RL = rtb_DataTypeConversion_fb[3]; rtDW.dbgCAN_dbg_Act1_model.dbg_Act12_Vent_CRR = rtb_DataTypeConversion_fb[5]; rtDW.dbgCAN_dbg_Act1_model.dbg_Act13_Vent_SRR = rtb_DataTypeConversion_fb[7]; rtDW.dbgCAN_dbg_Act1_model.dbg_Act14_Foot_RR = rtb_DataTypeConversion_fb[6]; rtDW.dbgCAN_dbg_Act1_model.dbg_Act15_TempU_FL = rtb_DataTypeConversion_bh[3]; /* BusCreator: '/Bus Creator' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreRead: '/Data Store Read1' * DataStoreWrite: '/Data Store Write' */ rtDW.dbgCAN_dbg_Sen_Amb_model.dbg_Sen_Amb_ro = rtDW.AMB; rtDW.dbgCAN_dbg_Sen_Amb_model.dbg_Sen_Amb_Raw_ro = rtb_Bias5; rtDW.dbgCAN_dbg_Sen_Amb_model.dbg_Amb_Tg_ro = 0; /* BusCreator: '/Bus Creator' incorporates: * DataStoreWrite: '/Data Store Write' * SignalConversion generated from: '/Vector Concatenate' * SignalConversion generated from: '/Vector Concatenate' * */ rtDW.dbg_Auto_AF_model.dbg_Auto_AF_MultMsg_Idx = 0U; rtDW.dbg_Auto_AF_model.dbg_Auto_AF_Correct_FL = 0; rtDW.dbg_Auto_AF_model.dbg_Auto_AF_Correct_FR = 0; rtDW.dbg_Auto_AF_model.dbg_Auto_AF_Correct_RL = 0; rtDW.dbg_Auto_AF_model.dbg_Auto_AF_Correct_RR = 0; rtDW.dbg_Auto_AF_model.dbg_Auto_AF_Vtg_RL = 0; rtDW.dbg_Auto_AF_model.dbg_Auto_AF_Vtg_FL = rtb_Bias_ct; rtDW.dbg_Auto_AF_model.dbg_Auto_AF_Vtg_FR = rtb_MultiportSwitch1_h; rtDW.dbg_Auto_AF_model.dbg_Auto_AF_Vtg_RR = 0; rtDW.dbg_Auto_AF_model.dbg_Auto_AF_Incar_RL = 0; rtDW.dbg_Auto_AF_model.dbg_Auto_AF_Incar_FR = rtb_u5FLU_tg_incar_l; rtDW.dbg_Auto_AF_model.dbg_Auto_AF_Incar_RR = 0; rtDW.dbg_Auto_AF_model.dbg_Auto_AF_Incar_FL = rtb_Bias4; rtDW.dbg_Auto_AF_model.dbg_Auto_AF_Amb_RL = 0; rtDW.dbg_Auto_AF_model.dbg_Auto_AF_Amb_FR = rtb_u6FLU_tg_amb_hq; rtDW.dbg_Auto_AF_model.dbg_Auto_AF_Sun_RR = 0; rtDW.dbg_Auto_AF_model.dbg_Auto_AF_Amb_FL = rtb_Bias2; rtDW.dbg_Auto_AF_model.dbg_Auto_AF_Sun_FR = rtb_u6FLU_tg_amb; rtDW.dbg_Auto_AF_model.dbg_Auto_AF_Sun_RL = 0; rtDW.dbg_Auto_AF_model.dbg_Auto_AF_Amb_RR = 0; rtDW.dbg_Auto_AF_model.dbg_Auto_AF_Sun_FL = rtb_Bias3; /* BusCreator: '/Bus Creator' incorporates: * Bias: '/Bias1' * Bias: '/Bias2' * Bias: '/Bias3' * Bias: '/Bias4' * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read11' * DataStoreRead: '/Data Store Read2' * DataStoreRead: '/Data Store Read3' * DataStoreRead: '/Data Store Read4' * DataStoreRead: '/Data Store Read5' * DataStoreRead: '/Data Store Read7' * DataStoreRead: '/Data Store Read8' * DataStoreRead: '/Data Store Read9' * DataStoreWrite: '/Data Store Write4' * DataStoreWrite: '/Data Store Write' * DataStoreWrite: '/Data Store Write' * DataStoreWrite: '/Data Store Write' * SignalConversion generated from: '/Vector Concatenate' * */ rtDW.dbg_Auto_Duct_model.dbg_Auto_Duct_MultMsg_Idx = 0U; rtDW.dbg_Auto_Duct_model.dbg_Auto_Duct_Tgt_FL_Upper_ro = rtb_FLU_tg_correct; rtDW.dbg_Auto_Duct_model.dbg_Auto_Duct_Tg_Incar_FL_Upper_ro = (int16_t) (rtb_MultiportSwitch_o - 200); rtDW.dbg_Auto_Duct_model.dbg_Auto_Duct_Tgt_RR_ro = rtDW.Duct_RR_Tg; rtDW.dbg_Auto_Duct_model.dbg_Auto_Duct_Tgt_RL_ro = 0; rtDW.dbg_Auto_Duct_model.dbg_Auto_Duct_Tgt_FR_Upper_ro = rtb_Selector_p; rtDW.dbg_Auto_Duct_model.dbg_Auto_Duct_Tgt_FR_Lower_ro = rtb_FLU_tg_correct_b; rtDW.dbg_Auto_Duct_model.dbg_Auto_Duct_Tgt_FL_Lower_ro = rtb_FLU_tg_correct_de; rtDW.dbg_Auto_Duct_model.dbg_Auto_Duct_Tg_Incar_FR_Upper_ro = (int16_t) (rtb_VectorConcatenate_lo[4] - 200); rtDW.dbg_Auto_Duct_model.dbg_Auto_Duct_Tg_FL_Upper_ro = g_assEVA_TG_AMB_R_h; rtDW.dbg_Auto_Duct_model.dbg_Auto_Duct_Tg_FL_Lower_ro = Duct_FRU_Tg_DBG[0]; rtDW.dbg_Auto_Duct_model.dbg_Auto_Duct_Tg_FR_Lower_ro = Duct_FRL_Tg_DBG[0]; rtDW.dbg_Auto_Duct_model.dbg_Auto_Duct_Tg_FR_Upper_ro = rtb_VectorConcatenate_lo[0]; rtDW.dbg_Auto_Duct_model.dbg_Auto_Duct_Tg_RL_ro = rtDW.Duct_RL_Tg_DBG[0]; rtDW.dbg_Auto_Duct_model.dbg_Auto_Duct_Tg_RR_ro = rtDW.Duct_RR_Tg_DBG[0]; rtDW.dbg_Auto_Duct_model.dbg_Auto_Duct_Tg_Incar_FL_Lower_ro = (int16_t) (Duct_FRU_Tg_DBG[4] - 200); rtDW.dbg_Auto_Duct_model.dbg_Auto_Duct_Incar_FL_Lower_ro = Duct_FRU_Tg_DBG[1]; rtDW.dbg_Auto_Duct_model.dbg_Auto_Duct_Incar_RR_ro = rtDW.Duct_RR_Tg_DBG[1]; rtDW.dbg_Auto_Duct_model.dbg_Auto_Duct_Incar_RL_ro = rtDW.Duct_RL_Tg_DBG[1]; rtDW.dbg_Auto_Duct_model.dbg_Auto_Duct_Incar_FR_Upper_ro = rtb_VectorConcatenate_lo[1]; rtDW.dbg_Auto_Duct_model.dbg_Auto_Duct_Incar_FR_Lower_ro = Duct_FRL_Tg_DBG[1]; rtDW.dbg_Auto_Duct_model.dbg_Auto_Duct_Incar_FL_Upper_ro = rtb_u5FLU_tg_incar; rtDW.dbg_Auto_Duct_model.dbg_Auto_Duct_Tg_Incar_FR_Lower_ro = (int16_t) (Duct_FRL_Tg_DBG[4] - 200); rtDW.dbg_Auto_Duct_model.dbg_Auto_Duct_Amb_RL_ro = rtDW.Duct_RL_Tg_DBG[2]; rtDW.dbg_Auto_Duct_model.dbg_Auto_Duct_Amb_FR_Upper_ro = rtb_VectorConcatenate_lo[2]; rtDW.dbg_Auto_Duct_model.dbg_Auto_Duct_Amb_FR_Lower_ro = Duct_FRL_Tg_DBG[2]; rtDW.dbg_Auto_Duct_model.dbg_Auto_Duct_Amb_RR_ro = rtDW.Duct_RR_Tg_DBG[2]; rtDW.dbg_Auto_Duct_model.dbg_Auto_Duct_Amb_FL_Lower_ro = Duct_FRU_Tg_DBG[2]; rtDW.dbg_Auto_Duct_model.dbg_Auto_Duct_Amb_FL_Upper_ro = rtb_VectorConcatenate_jn[2]; rtDW.dbg_Auto_Duct_model.dbg_Auto_Duct_Tg_Incar_RL_ro = (int16_t) (rtDW.Duct_RL_Tg_DBG[4] - 200); rtDW.dbg_Auto_Duct_model.dbg_Auto_Duct_Sun_FL_Lower_ro = Duct_FRU_Tg_DBG[3]; rtDW.dbg_Auto_Duct_model.dbg_Auto_Duct_Sun_FR_Lower_ro = Duct_FRL_Tg_DBG[3]; rtDW.dbg_Auto_Duct_model.dbg_Auto_Duct_Sun_FR_Upper_ro = rtb_VectorConcatenate_lo[3]; rtDW.dbg_Auto_Duct_model.dbg_Auto_Duct_Sun_RL_ro = rtDW.Duct_RL_Tg_DBG[3]; rtDW.dbg_Auto_Duct_model.dbg_Auto_Duct_Sun_FL_Upper_ro = rtb_VectorConcatenate_jn[3]; rtDW.dbg_Auto_Duct_model.dbg_Auto_Duct_Sun_RR_ro = rtDW.Duct_RR_Tg_DBG[3]; rtDW.dbg_Auto_Duct_model.dbg_Auto_Duct_Tg_Incar_RR_ro = (int16_t) (rtDW.Duct_RR_Tg_DBG[4] - 200); /* BusCreator: '/Bus Creator' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read10' * DataStoreRead: '/Data Store Read11' * DataStoreRead: '/Data Store Read4' * DataStoreRead: '/Data Store Read5' * DataStoreRead: '/Data Store Read6' * DataStoreRead: '/Data Store Read7' * DataStoreRead: '/Data Store Read8' * DataStoreRead: '/Data Store Read9' * DataStoreWrite: '/Data Store Write' */ rtDW.dbgCAN_dbg_Logic_Blower_model.Logic_Blower_Step_FL = rtDW.CCU_BLOWERS_FL; rtDW.dbgCAN_dbg_Logic_Blower_model.Logic_Blower_Step_FR = rtDW.CCU_BLOWERS_FR; rtDW.dbgCAN_dbg_Logic_Blower_model.Logic_Blower_Step_RL = rtDW.CCU_BLOWERS_RL; rtDW.dbgCAN_dbg_Logic_Blower_model.Logic_Blower_Step_RR = rtDW.CCU_BLOWERS_RR; rtDW.dbgCAN_dbg_Logic_Blower_model.Logic_Blower_Pwm_Front = rtDW.PWM_front; rtDW.dbgCAN_dbg_Logic_Blower_model.Logic_Blower_Pwm_Rear = rtDW.PWM_rear; rtDW.dbgCAN_dbg_Logic_Blower_model.Logic_Blower_AF_FL = Comp_Max_RPM_Allowed; rtDW.dbgCAN_dbg_Logic_Blower_model.Logic_Blower_AF_FR = rtb_Switch3_ed; rtDW.dbgCAN_dbg_Logic_Blower_model.Logic_Blower_AF_RL = Blower_AF_RL; rtDW.dbgCAN_dbg_Logic_Blower_model.Logic_Blower_AF_RR = rtb_Saturation9; /* BusCreator: '/Bus Creator' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read2' * DataStoreWrite: '/Data Store Write' */ rtDW.dbgCAN_dbg_Sen_Eva_model.dbg_Sen_Eva_F = g_assEVA_TG_AMB_F_n; rtDW.dbgCAN_dbg_Sen_Eva_model.dbg_Sen_Eva_R = 0; rtDW.dbgCAN_dbg_Sen_Eva_model.dbg_Sen_Eva_Target = rtDW.Eva_F; rtDW.dbgCAN_dbg_Sen_Eva_model.dbg_Sen_Eva_Diff_FrontRear = rtDW.Eva_R; /* Outport: '/dtc_state_error_model' incorporates: * DataStoreRead: '/Data Store Read1' */ memcpy(&rtY.dtc_state_error_model[0], &rtDW.dtc_state_error_model[0], 127U * sizeof(uint8_t)); /* Outport: '/dbgCAN_dbg_Act0_model' incorporates: * DataStoreRead: '/Data Store Read3' */ rtY.dbgCAN_dbg_Act0_model = rtDW.dbgCAN_dbg_Act0_model; /* Outport: '/dbgCAN_dbg_Act1_model' incorporates: * DataStoreRead: '/Data Store Read4' */ rtY.dbgCAN_dbg_Act1_model = rtDW.dbgCAN_dbg_Act1_model; /* Outport: '/dbgCAN_dbg_Act2_model' incorporates: * DataStoreRead: '/Data Store Read5' */ rtY.dbgCAN_dbg_Act2_model = rtDW.dbgCAN_dbg_Act2_model; /* Outport: '/CCU_Stat1_model' incorporates: * DataStoreRead: '/Data Store Read6' */ rtY.CCU_Stat1_model = rtDW.CCU_STAT1_MODEL; /* Outport: '/dbgCAN_dbg_Sen_Duct_model' incorporates: * DataStoreRead: '/Data Store Read8' */ rtY.dbgCAN_dbg_Sen_Duct_model = rtDW.dbgCAN_dbg_Sen_Duct_model; /* Outport: '/dbgCAN_dbg_Sen_Eva_model' incorporates: * DataStoreRead: '/Data Store Read9' */ rtY.dbgCAN_dbg_Sen_Eva_model = rtDW.dbgCAN_dbg_Sen_Eva_model; /* Outport: '/dbgCAN_dbg_Logic_Blower_model' incorporates: * DataStoreRead: '/Data Store Read13' */ rtY.dbgCAN_dbg_Logic_Blower_model = rtDW.dbgCAN_dbg_Logic_Blower_model; /* Outport: '/dbgCAN_dbg_Sen_Amb_model' incorporates: * DataStoreRead: '/Data Store Read29' */ rtY.dbgCAN_dbg_Sen_Amb_model = rtDW.dbgCAN_dbg_Sen_Amb_model; /* Outport: '/CCU_Stat2_model' incorporates: * DataStoreRead: '/Data Store Read43' */ rtY.CCU_Stat2_model = rtDW.CCU_STAT2_MODEL; /* Outport: '/dbgCAN_dbg_Sen_Incar_model' incorporates: * DataStoreRead: '/Data Store Read48' */ rtY.dbgCAN_dbg_Sen_Incar_model = rtDW.dbgCAN_dbg_Sen_Incar_model; /* Outport: '/dbgCAN_dbg_Sen_0_model' incorporates: * DataStoreRead: '/Data Store Read49' */ rtY.dbgCAN_dbg_Sen_0_model = rtDW.dbgCAN_dbg_Sen_0_model; /* Outport: '/PowerEnable_Model' incorporates: * DataStoreRead: '/Data Store Read46' */ rtY.PowerEnable_Model = rtDW.PowerEnable_Model; /* Outport: '/dbg_Logic_Ac_model' incorporates: * DataStoreRead: '/Data Store Read56' */ rtY.dbg_Logic_Ac_model = rtDW.dbg_Logic_Ac_model; /* Outport: '/CCUCAN_HVC_REQ_MSG_MODEL' incorporates: * DataStoreRead: '/Data Store Read57' */ rtY.CCUCAN_HVC_REQ_MSG_MODEL = rtDW.CCUCAN_HVC_REQ_MSG_MODEL; /* Outport: '/dbgCAN_CCU_IO_model' incorporates: * DataStoreRead: '/Data Store Read60' */ rtY.dbgCAN_CCU_IO_model = rtDW.dbgCAN_CCU_IO_model; /* Outport: '/CCU_Msg3_model' incorporates: * DataStoreRead: '/Data Store Read30' */ rtY.CCU_Msg3_model = rtDW.CCU_Msg3_model; /* Outport: '/dbgCAN_Logic_Rec_model' incorporates: * DataStoreRead: '/Data Store Read38' */ rtY.dbgCAN_Logic_Rec_model = rtDW.dbgCAN_Logic_Rec_model; /* Outport: '/dbgCAN_Logic_State_model' incorporates: * DataStoreRead: '/Data Store Read39' */ rtY.dbgCAN_Logic_State_model = rtDW.dbgCAN_Logic_State_model; /* Outport: '/CCU_Msg1_model' incorporates: * DataStoreRead: '/Data Store Read14' */ rtY.CCU_Msg1_model = rtDW.CCU_Msg1_model; /* Outport: '/dbgCAN_Auto_Duct_model' incorporates: * DataStoreRead: '/Data Store Read62' */ rtY.dbgCAN_Auto_Duct_model = rtDW.dbg_Auto_Duct_model; /* Outport: '/dbgCAN_Auto_AF_model' incorporates: * DataStoreRead: '/Data Store Read63' */ rtY.dbgCAN_Auto_AF_model = rtDW.dbg_Auto_AF_model; /* If: '/если SC front не завершен' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreRead: '/Data Store Read1' * DataTypeConversion: '/Data Type Conversion' */ if ((rtDW.start_control_finished_front == 0) && (rtDW.SKIPPED_FIRST_SIMULATION_STEP == 0.0)) { /* Outputs for IfAction SubSystem: '/If Action Subsystem' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write' incorporates: * Constant: '/Constant' */ rtDW.SKIPPED_FIRST_SIMULATION_STEP = 1.0; /* End of Outputs for SubSystem: '/If Action Subsystem' */ } else if (rtDW.start_control_finished_front == 0) { /* Outputs for IfAction SubSystem: '/Start Control Front' incorporates: * ActionPort: '/Action Port' */ /* SwitchCase: '/Switch Case' incorporates: * DataStoreRead: '/Data Store Read' */ switch (rtDW.step_start_controle_front) { case -1: /* Outputs for IfAction SubSystem: '/Step -1 F (Entry Condition)' incorporates: * ActionPort: '/Action Port' */ /* SwitchCase: '/Switch Case' incorporates: * DataStoreRead: '/Data Store Read1' */ switch (rtDW.LEVEL) { case 0: /* Outputs for IfAction SubSystem: '/Level 0' incorporates: * ActionPort: '/Action Port' */ /* MATLAB Function: '/g_assSTART_ENTER_INCAR' incorporates: * DataStoreRead: '/Data Store Read3' */ g_assSTART_ENTER_INCAR_f(rtDW.LEVEL, &g_assEVA_TG_AMB_F_n); /* MATLAB Function: '/g_ausSTART_ENTER_SETTEMP' incorporates: * DataStoreRead: '/Data Store Read4' */ /* : out = g_ausSTART_ENTER_SETTEMP(LVL+1); */ i = (int32_t)(rtDW.LEVEL + 1U); if (rtDW.LEVEL + 1U > 255U) { i = 255; } /* Switch: '/Switch' incorporates: * Constant: '/not LO or HI' * DataStoreRead: '/Data Store Read' * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read2' * DataStoreRead: '/Data Store Read5' * Logic: '/AND' * MATLAB Function: '/g_ausSTART_ENTER_SETTEMP' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator1' * RelationalOperator: '/Relational Operator2' * RelationalOperator: '/Relational Operator3' */ if ((rtDW.Incar_FL > g_assEVA_TG_AMB_F_n) && (rtDW.CCU_MODE_FL == 1) && (rtDW.CCU_SET_FL < g_ausSTART_ENTER_SETTEMP[i - 1]) && (rtDW.LO_HI_MODE_FL == 0)) { /* Merge: '/Merge' incorporates: * Constant: '/Constant1' */ rtB.Merge_fb = 1; } else { /* Merge: '/Merge' incorporates: * Constant: '/Constant' */ rtB.Merge_fb = -1; } /* End of Switch: '/Switch' */ /* End of Outputs for SubSystem: '/Level 0' */ break; case 1: /* Outputs for IfAction SubSystem: '/Level 1' incorporates: * ActionPort: '/Action Port' */ /* MATLAB Function: '/g_assSTART_ENTER_INCAR' incorporates: * DataStoreRead: '/Data Store Read3' */ g_assSTART_ENTER_INCAR_f(rtDW.LEVEL, &g_assEVA_TG_AMB_F_n); /* MATLAB Function: '/g_ausSTART_ENTER_SETTEMP' incorporates: * DataStoreRead: '/Data Store Read4' */ /* : out = int16(g_ausSTART_ENTER_SETTEMP(LVL+1)); */ i = (int32_t)(rtDW.LEVEL + 1U); if (rtDW.LEVEL + 1U > 255U) { i = 255; } Gain = g_ausSTART_ENTER_SETTEMP[i - 1]; if (Gain > 32767) { Gain = 32767U; } /* Switch: '/Switch' incorporates: * Constant: '/not LO or HI' * DataStoreRead: '/Data Store Read' * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read2' * DataStoreRead: '/Data Store Read5' * Logic: '/AND' * MATLAB Function: '/g_ausSTART_ENTER_SETTEMP' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator1' * RelationalOperator: '/Relational Operator2' * RelationalOperator: '/Relational Operator3' */ if ((rtDW.Incar_FL > g_assEVA_TG_AMB_F_n) && (rtDW.CCU_MODE_FL == 1) && (rtDW.CCU_SET_FL < Gain) && (rtDW.LO_HI_MODE_FL == 0)) { /* Merge: '/Merge' incorporates: * Constant: '/Constant1' */ rtB.Merge_fb = 1; } else { /* Merge: '/Merge' incorporates: * Constant: '/Constant' */ rtB.Merge_fb = -1; } /* End of Switch: '/Switch' */ /* End of Outputs for SubSystem: '/Level 1' */ break; case 2: /* Outputs for IfAction SubSystem: '/Level 2' incorporates: * ActionPort: '/Action Port' */ Level2(&rtB.Merge_fb); /* End of Outputs for SubSystem: '/Level 2' */ break; case 3: /* Outputs for IfAction SubSystem: '/Level 3' incorporates: * ActionPort: '/Action Port' */ /* MATLAB Function: '/g_assSTART_ENTER_COOLANT ' incorporates: * DataStoreRead: '/Data Store Read3' */ g_assSTART_ENTER_COOLANT_j(rtDW.LEVEL, &g_assEVA_TG_AMB_F_n); /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreRead: '/mode driver' * Logic: '/AND' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator2' */ if ((rtDW.ECT < g_assEVA_TG_AMB_F_n) && (rtDW.CCU_MODE_FL == 1)) { /* Merge: '/Merge' incorporates: * Constant: '/Constant1' */ rtB.Merge_fb = 0; } else { /* Merge: '/Merge' incorporates: * Constant: '/Constant' */ rtB.Merge_fb = -1; } /* End of Switch: '/Switch' */ /* End of Outputs for SubSystem: '/Level 3' */ break; case 4: /* Outputs for IfAction SubSystem: '/Level 4' incorporates: * ActionPort: '/Action Port' */ Level4(&rtB.Merge_fb, &rtDW.CCU_MODE_FL, &rtDW.ECT, &rtDW.LEVEL, &rtDW.LO_HI_MODE_FL); /* End of Outputs for SubSystem: '/Level 4' */ break; case 5: /* Outputs for IfAction SubSystem: '/Level 5' incorporates: * ActionPort: '/Action Port' */ Level4(&rtB.Merge_fb, &rtDW.CCU_MODE_FL, &rtDW.ECT, &rtDW.LEVEL, &rtDW.LO_HI_MODE_FL); /* End of Outputs for SubSystem: '/Level 5' */ break; } /* End of SwitchCase: '/Switch Case' */ /* End of Outputs for SubSystem: '/Step -1 F (Entry Condition)' */ break; case 0: /* Outputs for IfAction SubSystem: '/Step 0 F' incorporates: * ActionPort: '/Action Port' */ /* SwitchCase: '/Switch Case' incorporates: * DataStoreRead: '/Data Store Read1' */ switch (rtDW.LEVEL) { case 0: /* Outputs for IfAction SubSystem: '/Level 0' incorporates: * ActionPort: '/Action Port' */ Level0(&rtB.Merge_fb); /* End of Outputs for SubSystem: '/Level 0' */ break; case 1: /* Outputs for IfAction SubSystem: '/Level 1' incorporates: * ActionPort: '/Action Port' */ Level0(&rtB.Merge_fb); /* End of Outputs for SubSystem: '/Level 1' */ break; case 2: /* Outputs for IfAction SubSystem: '/Level 2' incorporates: * ActionPort: '/Action Port' */ Level0(&rtB.Merge_fb); /* End of Outputs for SubSystem: '/Level 2' */ break; case 3: /* Outputs for IfAction SubSystem: '/Level 3' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write6' incorporates: * Constant: '/Constant3' */ rtDW.Blower_FL = 20U; /* DataStoreWrite: '/Data Store Write11' incorporates: * Constant: '/Constant5' */ rtDW.Dtg_FUL = 60U; /* DataStoreWrite: '/Data Store Write13' incorporates: * Constant: '/Constant7' */ rtDW.Dtg_FLL = 80U; /* DataStoreWrite: '/Data Store Write' incorporates: * DataStoreRead: '/Data Store Read1' * MATLAB Function: '/incar filter up' */ incarfilterup(rtDW.LEVEL, &EN_BATTChiller); /* DataStoreWrite: '/Data Store Write1' incorporates: * DataStoreRead: '/Data Store Read2' * MATLAB Function: '/incar filter down' */ incarfilterdown(rtDW.LEVEL, &rtb_timer_out); /* DataStoreWrite: '/Data Store Write3' incorporates: * Constant: '/Mode - def' */ rtDW.Mode_FL = 80U; /* DataStoreWrite: '/Data Store Write7' incorporates: * Constant: '/Recirc logic Partial REC' */ Blower_AF_FL = 1.0; /* DataStoreWrite: '/Data Store Write8' incorporates: * Constant: '/Valve open' */ ShutOffRear_EN = 1U; /* DataStoreWrite: '/Data Store Write9' incorporates: * Constant: '/Valve open' */ Valve_2_way = 1U; /* MATLAB Function: '/g_assSTART_COOLANT_STEP0_TO_1 ' incorporates: * DataStoreRead: '/Data Store Read3' */ /* : out = int16(g_assSTART_COOLANT_STEP0_TO_1(LVL + 1 - 2)); */ i = (int32_t)(rtDW.LEVEL + 1U); if (rtDW.LEVEL + 1U > 255U) { i = 255; } rtb_Subtract = (uint32_t)i - 2U; if ((uint32_t)i - 2U > (uint32_t)i) { rtb_Subtract = 0U; } /* Merge: '/Merge' incorporates: * DataStoreRead: '/Engine coolant temp' * MATLAB Function: '/g_assSTART_COOLANT_STEP0_TO_1 ' * RelationalOperator: '/Relational Operator' * Switch: '/Switch' */ rtB.Merge_fb = (int8_t)(rtDW.ECT > g_assSTART_COOLANT_STEP0_TO_1 [(int32_t)rtb_Subtract - 1]); /* End of Outputs for SubSystem: '/Level 3' */ break; case 4: /* Outputs for IfAction SubSystem: '/Level 4' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write6' incorporates: * Constant: '/Constant3' */ rtDW.Blower_FL = 20U; /* DataStoreWrite: '/Data Store Write11' incorporates: * Constant: '/Constant5' */ rtDW.Dtg_FUL = 60U; /* DataStoreWrite: '/Data Store Write13' incorporates: * Constant: '/Constant7' */ rtDW.Dtg_FLL = 80U; /* DataStoreWrite: '/Data Store Write' incorporates: * DataStoreRead: '/Data Store Read1' * MATLAB Function: '/incar filter up' */ incarfilterup(rtDW.LEVEL, &EN_BATTChiller); /* DataStoreWrite: '/Data Store Write1' incorporates: * DataStoreRead: '/Data Store Read2' * MATLAB Function: '/incar filter down' */ incarfilterdown(rtDW.LEVEL, &rtb_timer_out); /* DataStoreWrite: '/Data Store Write3' incorporates: * Constant: '/Mode - def' */ rtDW.Mode_FL = 80U; /* DataStoreWrite: '/Data Store Write7' incorporates: * Constant: '/Recirc logic Partial REC' */ Blower_AF_FL = 1.0; /* DataStoreWrite: '/Data Store Write8' incorporates: * Constant: '/Valve open' */ ShutOffRear_EN = 1U; /* DataStoreWrite: '/Data Store Write9' incorporates: * Constant: '/Valve open' */ Valve_2_way = 1U; /* MATLAB Function: '/g_assSTART_COOLANT_STEP0_TO_1 ' incorporates: * DataStoreRead: '/Data Store Read3' */ g_assSTART_COOLANT_STEP0_TO_1_a(rtDW.LEVEL, &g_assEVA_TG_AMB_F_n); /* Merge: '/Merge' incorporates: * DataStoreRead: '/Engine coolant temp' * RelationalOperator: '/Relational Operator' * Switch: '/Switch' */ rtB.Merge_fb = (int8_t)(rtDW.ECT > g_assEVA_TG_AMB_F_n); /* End of Outputs for SubSystem: '/Level 4' */ break; case 5: /* Outputs for IfAction SubSystem: '/Level 5' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write6' incorporates: * Constant: '/Constant3' */ rtDW.Blower_FL = 20U; /* DataStoreWrite: '/Data Store Write11' incorporates: * Constant: '/Constant5' */ rtDW.Dtg_FUL = 80U; /* DataStoreWrite: '/Data Store Write13' incorporates: * Constant: '/Constant7' */ rtDW.Dtg_FLL = 80U; /* DataStoreWrite: '/Data Store Write' incorporates: * DataStoreRead: '/Data Store Read1' * MATLAB Function: '/incar filter up' */ incarfilterup(rtDW.LEVEL, &EN_BATTChiller); /* DataStoreWrite: '/Data Store Write1' incorporates: * DataStoreRead: '/Data Store Read2' * MATLAB Function: '/incar filter down' */ incarfilterdown(rtDW.LEVEL, &rtb_timer_out); /* DataStoreWrite: '/Data Store Write3' incorporates: * Constant: '/Mode - def' */ rtDW.Mode_FL = 80U; /* DataStoreWrite: '/Data Store Write7' incorporates: * Constant: '/Recirc logic Partial REC' */ Blower_AF_FL = 1.0; /* DataStoreWrite: '/Data Store Write8' incorporates: * Constant: '/Valve open' */ ShutOffRear_EN = 1U; /* DataStoreWrite: '/Data Store Write9' incorporates: * Constant: '/Valve open' */ Valve_2_way = 1U; /* MATLAB Function: '/g_assSTART_COOLANT_STEP0_TO_1 ' incorporates: * DataStoreRead: '/Data Store Read3' */ g_assSTART_COOLANT_STEP0_TO_1_a(rtDW.LEVEL, &g_assEVA_TG_AMB_F_n); /* Merge: '/Merge' incorporates: * DataStoreRead: '/Engine coolant temp' * RelationalOperator: '/Relational Operator' * Switch: '/Switch' */ rtB.Merge_fb = (int8_t)(rtDW.ECT > g_assEVA_TG_AMB_F_n); /* End of Outputs for SubSystem: '/Level 5' */ break; } /* End of SwitchCase: '/Switch Case' */ /* End of Outputs for SubSystem: '/Step 0 F' */ break; case 1: /* Outputs for IfAction SubSystem: '/Step 1 F' incorporates: * ActionPort: '/Action Port' */ /* SwitchCase: '/Switch Case' incorporates: * DataStoreRead: '/Data Store Read1' */ switch (rtDW.LEVEL) { case 0: /* Outputs for IfAction SubSystem: '/Level 0' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write8' incorporates: * DataStoreRead: '/Data Store Read10' * MATLAB Function: '/3 way valve status' */ uwayvalvestatus(rtDW.LEVEL, &ShutOffRear_EN); /* DataStoreWrite: '/Data Store Write' incorporates: * DataStoreRead: '/Data Store Read1' * MATLAB Function: '/incar filter up' */ incarfilterup(rtDW.LEVEL, &EN_BATTChiller); /* DataStoreWrite: '/Data Store Write1' incorporates: * DataStoreRead: '/Data Store Read2' * MATLAB Function: '/incar filter down' */ incarfilterdown(rtDW.LEVEL, &rtb_timer_out); /* DataStoreWrite: '/Data Store Write3' incorporates: * DataStoreRead: '/Data Store Read5' * MATLAB Function: '/mode FR step 1' */ modeFRstep1(rtDW.LEVEL, &rtDW.Mode_FL); /* DataStoreWrite: '/Data Store Write11' incorporates: * DataStoreRead: '/Data Store Read6' * MATLAB Function: '/window heating' */ windowheating(rtDW.LEVEL, &rtDW.Dtg_FUL); /* DataStoreWrite: '/Data Store Write6' incorporates: * DataStoreRead: '/Data Store Read7' * MATLAB Function: '/blower FR' */ blowerFR(rtDW.LEVEL, &rtDW.Blower_FL); /* DataStoreWrite: '/Data Store Write11' incorporates: * DataStoreRead: '/Data Store Read8' * MATLAB Function: '/Dtg_FrontUpper_X' */ Dtg_FrontUpper_X(rtDW.LEVEL, &rtDW.Dtg_FUL); /* DataStoreWrite: '/Data Store Write13' incorporates: * DataStoreRead: '/Data Store Read9' * MATLAB Function: '/Dtg_FrontLower_X' */ Dtg_FrontLower_X(rtDW.LEVEL, &rtDW.Dtg_FLL); /* DataStoreWrite: '/Data Store Write7' incorporates: * Constant: '/Recirc logic Partial REC' */ Blower_AF_FL = 1.0; /* RelationalOperator: '/Equal' incorporates: * DataStoreRead: '/current step' */ eComp_stop = (rtDW.step_start_controle_front == 1); /* MATLAB Function: '/Incar temp goto from step 1 to step 2 ' incorporates: * DataStoreRead: '/Data Store Read3' */ Incartempgotofromstep1tostep2(rtDW.LEVEL, &g_assEVA_TG_AMB_F_n); /* MATLAB Function: '/Time goto from step 1 to step 2 ' incorporates: * DataStoreRead: '/Data Store Read4' */ /* : out = int16(g_ausSTART_TIME_STEP1_TO_2(LVL + 1)); */ i = (int32_t)(rtDW.LEVEL + 1U); if (rtDW.LEVEL + 1U > 255U) { i = 255; } Gain = g_ausSTART_TIME_STEP1_TO_2[i - 1]; if (Gain > 32767) { Gain = 32767U; } /* Switch: '/Switch' incorporates: * DataStoreRead: '/incar temp' * DataStoreRead: '/Data Store Read4' * Gain: '/из сек в мс' * Logic: '/Logical Operator' * MATLAB Function: '/Time goto from step 1 to step 2 ' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator1' * Sum: '/Subtract' * UnitDelay: '/t_start_delay_private ' */ if ((rtDW.Incar_FL < g_assEVA_TG_AMB_F_n) || (rtDW.t_now - rtDW.t_start_delay_private_DSTATE_ch > (uint16_t)(1000 * Gain))) { /* Merge: '/Merge' incorporates: * Constant: '/go to next step' * SignalConversion generated from: '/step' */ rtB.Merge_fb = 2; } else { /* Merge: '/Merge' incorporates: * Constant: '/stay at step 1' * SignalConversion generated from: '/step' */ rtB.Merge_fb = 1; } /* End of Switch: '/Switch' */ /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read4' * Logic: '/Logical Operator3' * Logic: '/Logical Operator4' * UnitDelay: '/Cond_prev_private ' * UnitDelay: '/t_start_delay_private ' */ if (eComp_stop && (!rtDW.Cond_prev_private_DSTATE_an)) { rtDW.t_start_delay_private_DSTATE_ch = rtDW.t_now; } /* End of Switch: '/Switch' */ /* Update for UnitDelay: '/Cond_prev_private ' */ rtDW.Cond_prev_private_DSTATE_an = eComp_stop; /* End of Outputs for SubSystem: '/Level 0' */ break; case 1: /* Outputs for IfAction SubSystem: '/Level 1' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write8' incorporates: * DataStoreRead: '/Data Store Read10' * MATLAB Function: '/3 way valve status' */ uwayvalvestatus(rtDW.LEVEL, &ShutOffRear_EN); /* DataStoreWrite: '/Data Store Write' incorporates: * DataStoreRead: '/Data Store Read1' * MATLAB Function: '/incar filter up' */ incarfilterup(rtDW.LEVEL, &EN_BATTChiller); /* DataStoreWrite: '/Data Store Write1' incorporates: * DataStoreRead: '/Data Store Read2' * MATLAB Function: '/incar filter down' */ incarfilterdown(rtDW.LEVEL, &rtb_timer_out); /* DataStoreWrite: '/Data Store Write3' incorporates: * DataStoreRead: '/Data Store Read5' * MATLAB Function: '/mode FR step 1' */ modeFRstep1(rtDW.LEVEL, &rtDW.Mode_FL); /* DataStoreWrite: '/Data Store Write11' incorporates: * DataStoreRead: '/Data Store Read6' * MATLAB Function: '/window heating' */ windowheating(rtDW.LEVEL, &rtDW.Dtg_FUL); /* DataStoreWrite: '/Data Store Write6' incorporates: * DataStoreRead: '/Data Store Read7' * MATLAB Function: '/blower FR' */ blowerFR(rtDW.LEVEL, &rtDW.Blower_FL); /* DataStoreWrite: '/Data Store Write11' incorporates: * DataStoreRead: '/Data Store Read8' * MATLAB Function: '/Dtg_FrontUpper_X' */ Dtg_FrontUpper_X(rtDW.LEVEL, &rtDW.Dtg_FUL); /* DataStoreWrite: '/Data Store Write13' incorporates: * DataStoreRead: '/Data Store Read9' * MATLAB Function: '/Dtg_FrontLower_X' */ Dtg_FrontLower_X(rtDW.LEVEL, &rtDW.Dtg_FLL); /* DataStoreWrite: '/Data Store Write7' incorporates: * Constant: '/Recirc logic Partial REC' */ Blower_AF_FL = 1.0; /* RelationalOperator: '/Equal' incorporates: * DataStoreRead: '/current step' */ eComp_stop = (rtDW.step_start_controle_front == 1); /* MATLAB Function: '/Incar temp goto from step 1 to step 2 ' incorporates: * DataStoreRead: '/Data Store Read3' */ Incartempgotofromstep1tostep2(rtDW.LEVEL, &g_assEVA_TG_AMB_F_n); /* MATLAB Function: '/Time goto from step 1 to step 2 ' incorporates: * DataStoreRead: '/Data Store Read4' */ Timegotofromstep1tostep2(rtDW.LEVEL, &g_assEVA_TG_AMB_R_h); /* RelationalOperator: '/Relational Operator1' incorporates: * DataStoreRead: '/Data Store Read4' * Gain: '/из сек в мс' * Sum: '/Subtract' * UnitDelay: '/t_start_delay_private ' */ rtb_LogicalOperator1 = (rtDW.t_now - rtDW.t_start_delay_private_DSTATE_jr > (uint32_t)(1000 * g_assEVA_TG_AMB_R_h)); /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read4' * Logic: '/Logical Operator3' * Logic: '/Logical Operator4' * UnitDelay: '/Cond_prev_private ' * UnitDelay: '/t_start_delay_private ' */ if (eComp_stop && (!rtDW.Cond_prev_private_DSTATE_ht)) { rtDW.t_start_delay_private_DSTATE_jr = rtDW.t_now; } /* End of Switch: '/Switch' */ /* Switch: '/Switch' incorporates: * DataStoreRead: '/incar temp' * Logic: '/Logical Operator' * RelationalOperator: '/Relational Operator' */ if ((rtDW.Incar_FL < g_assEVA_TG_AMB_F_n) || rtb_LogicalOperator1) { /* Merge: '/Merge' incorporates: * Constant: '/go to next step' */ rtB.Merge_fb = 2; } else { /* Merge: '/Merge' incorporates: * Constant: '/stay at step 1' */ rtB.Merge_fb = 1; } /* End of Switch: '/Switch' */ /* Update for UnitDelay: '/Cond_prev_private ' */ rtDW.Cond_prev_private_DSTATE_ht = eComp_stop; /* End of Outputs for SubSystem: '/Level 1' */ break; case 2: /* Outputs for IfAction SubSystem: '/Level 2' incorporates: * ActionPort: '/Action Port' */ /* Merge: '/Merge' incorporates: * Constant: '/Constant' * SignalConversion generated from: '/step' */ rtB.Merge_fb = 2; /* End of Outputs for SubSystem: '/Level 2' */ break; case 3: /* Outputs for IfAction SubSystem: '/Level 3' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write8' incorporates: * DataStoreRead: '/Data Store Read11' * MATLAB Function: '/3 way valve status' */ uwayvalvestatus(rtDW.LEVEL, &ShutOffRear_EN); /* DataStoreWrite: '/Data Store Write' incorporates: * DataStoreRead: '/Data Store Read1' * MATLAB Function: '/incar filter up' */ incarfilterup(rtDW.LEVEL, &EN_BATTChiller); /* DataStoreWrite: '/Data Store Write1' incorporates: * DataStoreRead: '/Data Store Read2' * MATLAB Function: '/incar filter down' */ incarfilterdown(rtDW.LEVEL, &rtb_timer_out); /* DataStoreWrite: '/Data Store Write3' incorporates: * DataStoreRead: '/Data Store Read5' * MATLAB Function: '/mode FR step 1' */ modeFRstep1(rtDW.LEVEL, &rtDW.Mode_FL); /* DataStoreWrite: '/Data Store Write11' incorporates: * DataStoreRead: '/Data Store Read6' * MATLAB Function: '/window heating' */ windowheating(rtDW.LEVEL, &rtDW.Dtg_FUL); /* MATLAB Function: '/blower min max' incorporates: * DataStoreRead: '/Data Store Read7' */ blowerminmax(rtDW.LEVEL, rtb_out_g4); /* MATLAB Function: '/ECT min max' incorporates: * DataStoreRead: '/Data Store Read7' */ ECTminmax(rtDW.LEVEL, rtb_out_mt); /* Lookup_n-D: '/blower для текущего ECT' incorporates: * DataStoreRead: '/engine coolant temp' */ g_assEVA_TG_AMB_F_n = look1_is16lu64n32tu16Ds32Is16_binlcs(rtDW.ECT, rtb_out_mt, rtb_out_g4, 1U); /* DataStoreWrite: '/Data Store Write6' incorporates: * DataTypeConversion: '/Data Type Conversion' */ rtDW.Blower_FL = (uint16_t)g_assEVA_TG_AMB_F_n; /* DataStoreWrite: '/Data Store Write11' incorporates: * DataStoreRead: '/Data Store Read8' * MATLAB Function: '/Dtg_FrontUpper_X' */ Dtg_FrontUpper_X(rtDW.LEVEL, &rtDW.Dtg_FUL); /* DataStoreWrite: '/Data Store Write13' incorporates: * DataStoreRead: '/Data Store Read9' * MATLAB Function: '/Dtg_FrontLower_X' */ Dtg_FrontLower_X(rtDW.LEVEL, &rtDW.Dtg_FLL); /* DataStoreWrite: '/Data Store Write7' incorporates: * Constant: '/Recirc logic Partial REC' */ Blower_AF_FL = 1.0; /* RelationalOperator: '/Equal' incorporates: * DataStoreRead: '/current step' */ eComp_stop = (rtDW.step_start_controle_front == 1); /* MATLAB Function: '/Incar temp goto from step 1 to step 2 ' incorporates: * DataStoreRead: '/Data Store Read3' */ Incartempgotofromstep1tostep2(rtDW.LEVEL, &g_assEVA_TG_AMB_R_h); /* MATLAB Function: '/Time goto from step 1 to step 2 ' incorporates: * DataStoreRead: '/Data Store Read4' */ Timegotofromstep1tostep2(rtDW.LEVEL, &g_assEVA_TG_AMB_F_n); /* RelationalOperator: '/Relational Operator1' incorporates: * DataStoreRead: '/Data Store Read4' * Gain: '/из сек в мс' * Sum: '/Subtract' * UnitDelay: '/t_start_delay_private ' */ rtb_LogicalOperator1 = (rtDW.t_now - rtDW.t_start_delay_private_DSTATE_d > (uint32_t)(1000 * g_assEVA_TG_AMB_F_n)); /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read4' * Logic: '/Logical Operator3' * Logic: '/Logical Operator4' * UnitDelay: '/Cond_prev_private ' * UnitDelay: '/t_start_delay_private ' */ /* : out = int16(g_assSTART_COOLANT_TO_STEP2(LVL + 1 - 3)); */ if (eComp_stop && (!rtDW.Cond_prev_private_DSTATE_fs)) { rtDW.t_start_delay_private_DSTATE_d = rtDW.t_now; } /* End of Switch: '/Switch' */ /* MATLAB Function: '/g_assSTART_COOLANT_TO_STEP2 ' incorporates: * DataStoreRead: '/Data Store Read10' */ i = (int32_t)(rtDW.LEVEL + 1U); if (rtDW.LEVEL + 1U > 255U) { i = 255; } /* MW:begin MISRA2012:D4.1 CERT-C:INT30-C 'Justifying MISRA CPP rule violation' */ rtb_Subtract = (uint32_t)i - 3U; /* MW:end MISRA2012:D4.1 CERT-C:INT30-C */ if ((uint32_t)i - 3U > (uint32_t)i) { rtb_Subtract = 0U; } /* Switch: '/Switch' incorporates: * DataStoreRead: '/engine coolant temp' * DataStoreRead: '/incar temp' * Logic: '/Logical Operator' * MATLAB Function: '/g_assSTART_COOLANT_TO_STEP2 ' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator2' */ if ((rtDW.Incar_FL < g_assEVA_TG_AMB_R_h) || rtb_LogicalOperator1 || (rtDW.ECT > g_assSTART_COOLANT_TO_STEP2[(int32_t)rtb_Subtract - 1])) { /* Merge: '/Merge' incorporates: * Constant: '/go to next step 2' */ rtB.Merge_fb = 2; } else { /* Merge: '/Merge' incorporates: * Constant: '/stay at step 1' */ rtB.Merge_fb = 1; } /* End of Switch: '/Switch' */ /* Update for UnitDelay: '/Cond_prev_private ' */ rtDW.Cond_prev_private_DSTATE_fs = eComp_stop; /* End of Outputs for SubSystem: '/Level 3' */ break; case 4: /* Outputs for IfAction SubSystem: '/Level 4' incorporates: * ActionPort: '/Action Port' */ Level4_h(&rtB.Merge_fb, &rtDW.Blower_FL, &Gain, &rtDW.Dtg_FLL, &Valve_2_way, &rtDW.Dtg_FUL, &Comp_Max_RPM_Allowed, &rtDW.ECT, &rtb_Switch3_ed, &rtDW.Incar_FL, &rtb_timer_out, &EN_BATTChiller, &rtDW.LEVEL, &rtDW.Mode_FL, &Blower_AF_RL, &Blower_AF_FL, &ShutOffRear_EN, &rtDW.step_start_controle_front, &rtDW.t_now, &rtDW.Level4_hv); /* End of Outputs for SubSystem: '/Level 4' */ break; case 5: /* Outputs for IfAction SubSystem: '/Level 5' incorporates: * ActionPort: '/Action Port' */ Level4_h(&rtB.Merge_fb, &rtDW.Blower_FL, &Gain, &rtDW.Dtg_FLL, &Valve_2_way, &rtDW.Dtg_FUL, &Comp_Max_RPM_Allowed, &rtDW.ECT, &rtb_Switch3_ed, &rtDW.Incar_FL, &rtb_timer_out, &EN_BATTChiller, &rtDW.LEVEL, &rtDW.Mode_FL, &Blower_AF_RL, &Blower_AF_FL, &ShutOffRear_EN, &rtDW.step_start_controle_front, &rtDW.t_now, &rtDW.Level5_b); /* End of Outputs for SubSystem: '/Level 5' */ break; } /* End of SwitchCase: '/Switch Case' */ /* End of Outputs for SubSystem: '/Step 1 F' */ break; case 2: /* Outputs for IfAction SubSystem: '/Step 2 F' incorporates: * ActionPort: '/Action Port' */ /* SwitchCase: '/Switch Case' incorporates: * DataStoreRead: '/Data Store Read1' */ switch (rtDW.LEVEL) { case 0: /* Outputs for IfAction SubSystem: '/Level 0' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write8' incorporates: * DataStoreRead: '/Data Store Read10' * MATLAB Function: '/3 way valve status' */ uwayvalvestatus_j(rtDW.LEVEL, &ShutOffRear_EN); /* MATLAB Function: '/step' incorporates: * DataStoreRead: '/Data Store Read9' */ Dtg_FrontLower_X(rtDW.LEVEL, &EN_BATTChiller); /* MATLAB Function: '/time for step' incorporates: * DataStoreRead: '/Data Store Read9' */ timeforstep(rtDW.LEVEL, &rtb_timer_out); /* Switch: '/Switch' incorporates: * Constant: '/epsilon' * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator' * Sum: '/Add' * Switch: '/Switch' */ if ((uint8_t)(rtDW.Dtg_FLL - rtDW.Dtg_logic_FLL) <= 0.01) { /* DataStoreWrite: '/Data Store Write13' */ rtDW.Dtg_FLL = rtDW.Dtg_logic_FLL; } else { if (rtDW.Dtg_FLL <= rtDW.Dtg_logic_FLL) { /* Switch: '/Switch' incorporates: * Constant: '/Constant' */ i = 1; } else { /* Switch: '/Switch' incorporates: * Constant: '/Constant1' */ i = -1; } /* DataStoreWrite: '/Data Store Write13' incorporates: * Constant: '/Constant' * DataStoreRead: '/текущее время в мс' * Product: '/Product1' * Product: '/change rate (dtg//sec)' * Product: '/скорость в мс' * Product: '/шаг изменения' * Sum: '/Add' * Sum: '/Subtract' * Switch: '/Switch' * UnitDelay: '/Unit Delay' */ rtDW.Dtg_FLL = (uint8_t)((double)EN_BATTChiller / (double) rtb_timer_out / 1000.0 * (double)(rtDW.t_now - rtDW.UnitDelay_DSTATE_hx) * (double)i + (double)rtDW.Dtg_FLL); } /* End of Switch: '/Switch' */ /* MATLAB Function: '/step' incorporates: * DataStoreRead: '/Data Store Read8' */ Dtg_FrontUpper_X(rtDW.LEVEL, &EN_BATTChiller); /* MATLAB Function: '/time for step' incorporates: * DataStoreRead: '/Data Store Read8' */ timeforstep_c(rtDW.LEVEL, &rtb_timer_out); /* Switch: '/Switch' incorporates: * Constant: '/epsilon' * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator' * Sum: '/Add' * Switch: '/Switch' */ if ((uint8_t)(rtDW.Dtg_FUL - rtDW.Dtg_logic_FUL) <= 0.01) { /* DataStoreWrite: '/Data Store Write11' */ rtDW.Dtg_FUL = rtDW.Dtg_logic_FUL; } else { if (rtDW.Dtg_FUL <= rtDW.Dtg_logic_FUL) { /* Switch: '/Switch' incorporates: * Constant: '/Constant' */ i = 1; } else { /* Switch: '/Switch' incorporates: * Constant: '/Constant1' */ i = -1; } /* DataStoreWrite: '/Data Store Write11' incorporates: * Constant: '/Constant' * DataStoreRead: '/текущее время в мс' * Product: '/Product1' * Product: '/change rate (dtg//sec)' * Product: '/скорость в мс' * Product: '/шаг изменения' * Sum: '/Add' * Sum: '/Subtract' * Switch: '/Switch' * UnitDelay: '/Unit Delay' */ rtDW.Dtg_FUL = (uint8_t)((double)EN_BATTChiller / (double) rtb_timer_out / 1000.0 * (double)(rtDW.t_now - rtDW.UnitDelay_DSTATE_fi) * (double)i + (double)rtDW.Dtg_FUL); } /* End of Switch: '/Switch' */ /* DataStoreWrite: '/Data Store Write' incorporates: * DataStoreRead: '/Data Store Read1' * MATLAB Function: '/incar filter up' */ incarfilterup(rtDW.LEVEL, &EN_BATTChiller); /* DataStoreWrite: '/Data Store Write1' incorporates: * DataStoreRead: '/Data Store Read2' * MATLAB Function: '/incar filter down' */ incarfilterdown(rtDW.LEVEL, &rtb_timer_out); /* Sum: '/Add' incorporates: * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' */ EN_BATTChiller = (uint8_t)(rtDW.Mode_FL - rtDW.Mode_logic_FL); /* RelationalOperator: '/Relational Operator' incorporates: * Constant: '/epsilon' */ eComp_stop = (EN_BATTChiller <= 0.01); /* MATLAB Function: '/step' incorporates: * DataStoreRead: '/Data Store Read5' */ step_h(rtDW.LEVEL, &rtb_timer_out); /* MATLAB Function: '/time for step' incorporates: * DataStoreRead: '/Data Store Read5' */ timeforstep_p(rtDW.LEVEL, &EN_BATTChiller); /* Switch: '/Switch' incorporates: * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' * RelationalOperator: '/Relational Operator' * Switch: '/Switch' */ if (eComp_stop) { /* DataStoreWrite: '/Data Store Write3' incorporates: * DataStoreRead: '/значение auto (в соответствии с логикой)' */ rtDW.Mode_FL = rtDW.Mode_logic_FL; } else { if (rtDW.Mode_FL <= rtDW.Mode_logic_FL) { /* Switch: '/Switch' incorporates: * Constant: '/Constant' */ i = 1; } else { /* Switch: '/Switch' incorporates: * Constant: '/Constant1' */ i = -1; } /* DataStoreWrite: '/Data Store Write3' incorporates: * Constant: '/Constant' * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/текущее время в мс' * Product: '/Product1' * Product: '/change rate (step//sec)' * Product: '/скорость в мс' * Product: '/шаг изменения' * Sum: '/Add' * Sum: '/Subtract' * Switch: '/Switch' * UnitDelay: '/Unit Delay' */ rtDW.Mode_FL = (uint8_t)((double)rtb_timer_out / (double) EN_BATTChiller / 1000.0 * (double)(rtDW.t_now - rtDW.UnitDelay_DSTATE_m) * (double)i + (double)rtDW.Mode_FL); } /* End of Switch: '/Switch' */ /* Sum: '/Add' incorporates: * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' */ /* : out = g_aucSTART_ELEC_WINDOW(LVL + 1 + 6); */ Gain = (uint16_t)(rtDW.Blower_FL - rtDW.Blower_logic_FL); /* RelationalOperator: '/Relational Operator' incorporates: * Constant: '/epsilon' */ eComp_stop = (Gain <= 0.01); /* MATLAB Function: '/blower step' incorporates: * DataStoreRead: '/Data Store Read7' */ blowerstep(rtDW.LEVEL, &Gain1); /* MATLAB Function: '/blower time for step' incorporates: * DataStoreRead: '/Data Store Read7' */ blowertimeforstep(rtDW.LEVEL, &Gain); /* Switch: '/Switch' incorporates: * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' * RelationalOperator: '/Relational Operator' * Switch: '/Switch' */ if (eComp_stop) { /* DataStoreWrite: '/Data Store Write6' incorporates: * DataStoreRead: '/значение auto (в соответствии с логикой)' */ rtDW.Blower_FL = rtDW.Blower_logic_FL; } else { if (rtDW.Blower_FL <= rtDW.Blower_logic_FL) { /* Switch: '/Switch' incorporates: * Constant: '/Constant' */ i = 1; } else { /* Switch: '/Switch' incorporates: * Constant: '/Constant1' */ i = -1; } /* DataStoreWrite: '/Data Store Write6' incorporates: * Constant: '/Constant' * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/текущее время в мс' * Product: '/Product1' * Product: '/change rate (AF//sec)' * Product: '/скорость в мс' * Product: '/шаг изменения' * Sum: '/Add' * Sum: '/Subtract' * Switch: '/Switch' * UnitDelay: '/Unit Delay' */ rtDW.Blower_FL = (uint16_t)((double)Gain1 / (double)Gain / 1000.0 * (double)(rtDW.t_now - rtDW.UnitDelay_DSTATE_p5) * (double)i + (double)rtDW.Blower_FL); } /* End of Switch: '/Switch' */ /* DataStoreWrite: '/Data Store Write7' incorporates: * Constant: '/Recirc logic Partial REC' */ Blower_AF_FL = 1.0; /* RelationalOperator: '/Equal' incorporates: * DataStoreRead: '/current step' */ eComp_stop = (rtDW.step_start_controle_front == 2); /* Sum: '/Subtract' incorporates: * DataStoreRead: '/Data Store Read4' * UnitDelay: '/t_start_delay_private ' */ rtb_Subtract = rtDW.t_now - rtDW.t_start_delay_private_DSTATE_jt; /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read4' * Logic: '/Logical Operator3' * Logic: '/Logical Operator4' * UnitDelay: '/Cond_prev_private ' * UnitDelay: '/t_start_delay_private ' */ if (eComp_stop && (!rtDW.Cond_prev_private_DSTATE_lu)) { rtDW.t_start_delay_private_DSTATE_jt = rtDW.t_now; } /* End of Switch: '/Switch' */ /* MATLAB Function: '/Time goto from step 2 to step 3 ' incorporates: * DataStoreRead: '/Data Store Read4' */ Timegotofromstep2tostep3(rtDW.LEVEL, &g_assEVA_TG_AMB_F_n); /* Switch: '/Switch' incorporates: * Gain: '/из сек в мс' * RelationalOperator: '/Relational Operator1' */ if (rtb_Subtract > (uint32_t)(1000 * g_assEVA_TG_AMB_F_n)) { /* Merge: '/Merge' incorporates: * Constant: '/go to next step' */ rtB.Merge_fb = 3; } else { /* Merge: '/Merge' incorporates: * Constant: '/stay at step' */ rtB.Merge_fb = 2; } /* End of Switch: '/Switch' */ /* Update for UnitDelay: '/Unit Delay' incorporates: * DataStoreRead: '/текущее время в мс' */ rtDW.UnitDelay_DSTATE_hx = rtDW.t_now; /* Update for UnitDelay: '/Unit Delay' incorporates: * DataStoreRead: '/текущее время в мс' */ rtDW.UnitDelay_DSTATE_fi = rtDW.t_now; /* Update for UnitDelay: '/Unit Delay' incorporates: * DataStoreRead: '/текущее время в мс' */ rtDW.UnitDelay_DSTATE_m = rtDW.t_now; /* Update for UnitDelay: '/Unit Delay' incorporates: * DataStoreRead: '/текущее время в мс' */ rtDW.UnitDelay_DSTATE_p5 = rtDW.t_now; /* Update for UnitDelay: '/Cond_prev_private ' */ rtDW.Cond_prev_private_DSTATE_lu = eComp_stop; /* End of Outputs for SubSystem: '/Level 0' */ break; case 1: /* Outputs for IfAction SubSystem: '/Level 1' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write8' incorporates: * DataStoreRead: '/Data Store Read10' * MATLAB Function: '/3 way valve status' */ uwayvalvestatus_j(rtDW.LEVEL, &ShutOffRear_EN); /* MATLAB Function: '/step' incorporates: * DataStoreRead: '/Data Store Read9' */ Dtg_FrontLower_X(rtDW.LEVEL, &EN_BATTChiller); /* MATLAB Function: '/time for step' incorporates: * DataStoreRead: '/Data Store Read9' */ timeforstep(rtDW.LEVEL, &rtb_timer_out); /* Switch: '/Switch' incorporates: * Constant: '/epsilon' * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator' * Sum: '/Add' * Switch: '/Switch' */ if ((uint8_t)(rtDW.Dtg_FLL - rtDW.Dtg_logic_FLL) <= 0.01) { /* DataStoreWrite: '/Data Store Write13' */ rtDW.Dtg_FLL = rtDW.Dtg_logic_FLL; } else { if (rtDW.Dtg_FLL <= rtDW.Dtg_logic_FLL) { /* Switch: '/Switch' incorporates: * Constant: '/Constant' */ i = 1; } else { /* Switch: '/Switch' incorporates: * Constant: '/Constant1' */ i = -1; } /* DataStoreWrite: '/Data Store Write13' incorporates: * Constant: '/Constant' * DataStoreRead: '/текущее время в мс' * Product: '/Product1' * Product: '/change rate (dtg//sec)' * Product: '/скорость в мс' * Product: '/шаг изменения' * Sum: '/Add' * Sum: '/Subtract' * Switch: '/Switch' * UnitDelay: '/Unit Delay' */ rtDW.Dtg_FLL = (uint8_t)((double)EN_BATTChiller / (double) rtb_timer_out / 1000.0 * (double)(rtDW.t_now - rtDW.UnitDelay_DSTATE_an) * (double)i + (double)rtDW.Dtg_FLL); } /* End of Switch: '/Switch' */ /* MATLAB Function: '/step' incorporates: * DataStoreRead: '/Data Store Read8' */ Dtg_FrontUpper_X(rtDW.LEVEL, &EN_BATTChiller); /* MATLAB Function: '/time for step' incorporates: * DataStoreRead: '/Data Store Read8' */ timeforstep_c(rtDW.LEVEL, &rtb_timer_out); /* Switch: '/Switch' incorporates: * Constant: '/epsilon' * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator' * Sum: '/Add' * Switch: '/Switch' */ if ((uint8_t)(rtDW.Dtg_FUL - rtDW.Dtg_logic_FUL) <= 0.01) { /* DataStoreWrite: '/Data Store Write11' */ rtDW.Dtg_FUL = rtDW.Dtg_logic_FUL; } else { if (rtDW.Dtg_FUL <= rtDW.Dtg_logic_FUL) { /* Switch: '/Switch' incorporates: * Constant: '/Constant' */ i = 1; } else { /* Switch: '/Switch' incorporates: * Constant: '/Constant1' */ i = -1; } /* DataStoreWrite: '/Data Store Write11' incorporates: * Constant: '/Constant' * DataStoreRead: '/текущее время в мс' * Product: '/Product1' * Product: '/change rate (dtg//sec)' * Product: '/скорость в мс' * Product: '/шаг изменения' * Sum: '/Add' * Sum: '/Subtract' * Switch: '/Switch' * UnitDelay: '/Unit Delay' */ rtDW.Dtg_FUL = (uint8_t)((double)EN_BATTChiller / (double) rtb_timer_out / 1000.0 * (double)(rtDW.t_now - rtDW.UnitDelay_DSTATE_a1) * (double)i + (double)rtDW.Dtg_FUL); } /* End of Switch: '/Switch' */ /* DataStoreWrite: '/Data Store Write' incorporates: * DataStoreRead: '/Data Store Read1' * MATLAB Function: '/incar filter up' */ incarfilterup(rtDW.LEVEL, &EN_BATTChiller); /* DataStoreWrite: '/Data Store Write1' incorporates: * DataStoreRead: '/Data Store Read2' * MATLAB Function: '/incar filter down' */ incarfilterdown(rtDW.LEVEL, &rtb_timer_out); /* Sum: '/Add' incorporates: * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' */ EN_BATTChiller = (uint8_t)(rtDW.Mode_FL - rtDW.Mode_logic_FL); /* MATLAB Function: '/step' incorporates: * DataStoreRead: '/Data Store Read5' */ step_h(rtDW.LEVEL, &rtb_timer_out); /* MATLAB Function: '/time for step' incorporates: * DataStoreRead: '/Data Store Read5' */ timeforstep_p(rtDW.LEVEL, &ShutOffRear_EN); /* Switch: '/Switch' incorporates: * Constant: '/epsilon' * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator' * Switch: '/Switch' */ if (EN_BATTChiller <= 0.01) { /* DataStoreWrite: '/Data Store Write3' incorporates: * DataStoreRead: '/значение auto (в соответствии с логикой)' */ rtDW.Mode_FL = rtDW.Mode_logic_FL; } else { if (rtDW.Mode_FL <= rtDW.Mode_logic_FL) { /* Switch: '/Switch' incorporates: * Constant: '/Constant' */ i = 1; } else { /* Switch: '/Switch' incorporates: * Constant: '/Constant1' */ i = -1; } /* DataStoreWrite: '/Data Store Write3' incorporates: * Constant: '/Constant' * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/текущее время в мс' * Product: '/Product1' * Product: '/change rate (step//sec)' * Product: '/скорость в мс' * Product: '/шаг изменения' * Sum: '/Add' * Sum: '/Subtract' * Switch: '/Switch' * UnitDelay: '/Unit Delay' */ rtDW.Mode_FL = (uint8_t)((double)rtb_timer_out / (double) ShutOffRear_EN / 1000.0 * (double)(rtDW.t_now - rtDW.UnitDelay_DSTATE_ne) * (double)i + (double)rtDW.Mode_FL); } /* End of Switch: '/Switch' */ /* MATLAB Function: '/window heating' incorporates: * DataStoreRead: '/Data Store Read6' */ windowheating_e(rtDW.LEVEL, &EN_BATTChiller); /* Sum: '/Add' incorporates: * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' */ Gain = (uint16_t)(rtDW.Blower_FL - rtDW.Blower_logic_FL); /* RelationalOperator: '/Relational Operator' incorporates: * Constant: '/epsilon' */ eComp_stop = (Gain <= 0.01); /* MATLAB Function: '/blower step' incorporates: * DataStoreRead: '/Data Store Read7' */ blowerstep(rtDW.LEVEL, &Gain1); /* MATLAB Function: '/blower time for step' incorporates: * DataStoreRead: '/Data Store Read7' */ blowertimeforstep(rtDW.LEVEL, &Gain); /* Switch: '/Switch' incorporates: * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' * RelationalOperator: '/Relational Operator' * Switch: '/Switch' */ if (eComp_stop) { /* DataStoreWrite: '/Data Store Write6' incorporates: * DataStoreRead: '/значение auto (в соответствии с логикой)' */ rtDW.Blower_FL = rtDW.Blower_logic_FL; } else { if (rtDW.Blower_FL <= rtDW.Blower_logic_FL) { /* Switch: '/Switch' incorporates: * Constant: '/Constant' */ i = 1; } else { /* Switch: '/Switch' incorporates: * Constant: '/Constant1' */ i = -1; } /* DataStoreWrite: '/Data Store Write6' incorporates: * Constant: '/Constant' * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/текущее время в мс' * Product: '/Product1' * Product: '/change rate (step//sec)' * Product: '/скорость в мс' * Product: '/шаг изменения' * Sum: '/Add' * Sum: '/Subtract' * Switch: '/Switch' * UnitDelay: '/Unit Delay' */ rtDW.Blower_FL = (uint16_t)((double)Gain1 / (double)Gain / 1000.0 * (double)(rtDW.t_now - rtDW.UnitDelay_DSTATE_p) * (double)i + (double) rtDW.Blower_FL); } /* End of Switch: '/Switch' */ /* DataStoreWrite: '/Data Store Write7' incorporates: * Constant: '/Recirc logic Partial REC' */ Blower_AF_FL = 1.0; /* RelationalOperator: '/Equal' incorporates: * DataStoreRead: '/current step' */ eComp_stop = (rtDW.step_start_controle_front == 2); /* Sum: '/Subtract' incorporates: * DataStoreRead: '/Data Store Read4' * UnitDelay: '/t_start_delay_private ' */ rtb_Subtract = rtDW.t_now - rtDW.t_start_delay_private_DSTATE_n; /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read4' * Logic: '/Logical Operator3' * Logic: '/Logical Operator4' * UnitDelay: '/Cond_prev_private ' * UnitDelay: '/t_start_delay_private ' */ if (eComp_stop && (!rtDW.Cond_prev_private_DSTATE_o)) { rtDW.t_start_delay_private_DSTATE_n = rtDW.t_now; } /* End of Switch: '/Switch' */ /* MATLAB Function: '/Time goto from step 2 to step 3 ' incorporates: * DataStoreRead: '/Data Store Read4' */ Timegotofromstep2tostep3(rtDW.LEVEL, &g_assEVA_TG_AMB_F_n); /* Switch: '/Switch' incorporates: * Gain: '/из сек в мс' * RelationalOperator: '/Relational Operator1' */ if (rtb_Subtract > (uint32_t)(1000 * g_assEVA_TG_AMB_F_n)) { /* Merge: '/Merge' incorporates: * Constant: '/go to next step' */ rtB.Merge_fb = 3; } else { /* Merge: '/Merge' incorporates: * Constant: '/stay at step' */ rtB.Merge_fb = 2; } /* End of Switch: '/Switch' */ /* Update for UnitDelay: '/Unit Delay' incorporates: * DataStoreRead: '/текущее время в мс' */ rtDW.UnitDelay_DSTATE_an = rtDW.t_now; /* Update for UnitDelay: '/Unit Delay' incorporates: * DataStoreRead: '/текущее время в мс' */ rtDW.UnitDelay_DSTATE_a1 = rtDW.t_now; /* Update for UnitDelay: '/Unit Delay' incorporates: * DataStoreRead: '/текущее время в мс' */ rtDW.UnitDelay_DSTATE_ne = rtDW.t_now; /* Update for UnitDelay: '/Unit Delay' incorporates: * DataStoreRead: '/текущее время в мс' */ rtDW.UnitDelay_DSTATE_p = rtDW.t_now; /* Update for UnitDelay: '/Cond_prev_private ' */ rtDW.Cond_prev_private_DSTATE_o = eComp_stop; /* End of Outputs for SubSystem: '/Level 1' */ break; case 2: /* Outputs for IfAction SubSystem: '/Level 2' incorporates: * ActionPort: '/Action Port' */ Level2(&rtB.Merge_fb); /* End of Outputs for SubSystem: '/Level 2' */ break; case 3: /* Outputs for IfAction SubSystem: '/Level 3' incorporates: * ActionPort: '/Action Port' */ Level3(&rtB.Merge_fb, &rtb_Saturation9, &rtDW.Blower_FL, &Gain, &rtDW.Blower_logic_FL, &rtDW.Dtg_FLL, &Valve_2_way, &rtDW.Dtg_FUL, &Comp_Max_RPM_Allowed, &rtDW.Dtg_logic_FLL, &rtDW.Dtg_logic_FUL, &rtb_Switch3_ed, &rtDW.HI_logic_on, &rtb_timer_out, &EN_BATTChiller, &rtDW.LEVEL, &rtDW.Mode_FL, &Blower_AF_RL, &rtDW.Mode_logic_FL, &Blower_AF_FL, &ShutOffRear_EN, &rtDW.step_start_controle_front, &rtDW.t_now, &rtDW.Level3_f); /* End of Outputs for SubSystem: '/Level 3' */ break; case 4: /* Outputs for IfAction SubSystem: '/Level 4' incorporates: * ActionPort: '/Action Port' */ Level3(&rtB.Merge_fb, &rtb_Saturation9, &rtDW.Blower_FL, &Gain, &rtDW.Blower_logic_FL, &rtDW.Dtg_FLL, &Valve_2_way, &rtDW.Dtg_FUL, &Comp_Max_RPM_Allowed, &rtDW.Dtg_logic_FLL, &rtDW.Dtg_logic_FUL, &rtb_Switch3_ed, &rtDW.HI_logic_on, &rtb_timer_out, &EN_BATTChiller, &rtDW.LEVEL, &rtDW.Mode_FL, &Blower_AF_RL, &rtDW.Mode_logic_FL, &Blower_AF_FL, &ShutOffRear_EN, &rtDW.step_start_controle_front, &rtDW.t_now, &rtDW.Level4_k); /* End of Outputs for SubSystem: '/Level 4' */ break; case 5: /* Outputs for IfAction SubSystem: '/Level 5' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write8' incorporates: * DataStoreRead: '/Data Store Read10' * MATLAB Function: '/3 way valve status' */ uwayvalvestatus_j(rtDW.LEVEL, &ShutOffRear_EN); /* MATLAB Function: '/step' incorporates: * DataStoreRead: '/Data Store Read9' */ Dtg_FrontLower_X(rtDW.LEVEL, &EN_BATTChiller); /* MATLAB Function: '/time for step' incorporates: * DataStoreRead: '/Data Store Read9' */ timeforstep(rtDW.LEVEL, &rtb_timer_out); /* Switch: '/Switch' incorporates: * Constant: '/epsilon' * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator' * Sum: '/Add' * Switch: '/Switch' */ if ((uint8_t)(rtDW.Dtg_FLL - rtDW.Dtg_logic_FLL) <= 0.01) { /* DataStoreWrite: '/Data Store Write13' */ rtDW.Dtg_FLL = rtDW.Dtg_logic_FLL; } else { if (rtDW.Dtg_FLL <= rtDW.Dtg_logic_FLL) { /* Switch: '/Switch' incorporates: * Constant: '/Constant' */ i = 1; } else { /* Switch: '/Switch' incorporates: * Constant: '/Constant1' */ i = -1; } /* DataStoreWrite: '/Data Store Write13' incorporates: * Constant: '/Constant' * DataStoreRead: '/текущее время в мс' * Product: '/Product1' * Product: '/change rate (dtg//sec)' * Product: '/скорость в мс' * Product: '/шаг изменения' * Sum: '/Add' * Sum: '/Subtract' * Switch: '/Switch' * UnitDelay: '/Unit Delay' */ rtDW.Dtg_FLL = (uint8_t)((double)EN_BATTChiller / (double) rtb_timer_out / 1000.0 * (double)(rtDW.t_now - rtDW.UnitDelay_DSTATE_fs) * (double)i + (double)rtDW.Dtg_FLL); } /* End of Switch: '/Switch' */ /* MATLAB Function: '/step' incorporates: * DataStoreRead: '/Data Store Read8' */ Dtg_FrontUpper_X(rtDW.LEVEL, &EN_BATTChiller); /* MATLAB Function: '/time for step' incorporates: * DataStoreRead: '/Data Store Read8' */ timeforstep_c(rtDW.LEVEL, &rtb_timer_out); /* Switch: '/Switch' incorporates: * Constant: '/epsilon' * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator' * Sum: '/Add' * Switch: '/Switch' */ if ((uint8_t)(rtDW.Dtg_FUL - rtDW.Dtg_logic_FUL) <= 0.01) { /* DataStoreWrite: '/Data Store Write11' */ rtDW.Dtg_FUL = rtDW.Dtg_logic_FUL; } else { if (rtDW.Dtg_FUL <= rtDW.Dtg_logic_FUL) { /* Switch: '/Switch' incorporates: * Constant: '/Constant' */ i = 1; } else { /* Switch: '/Switch' incorporates: * Constant: '/Constant1' */ i = -1; } /* DataStoreWrite: '/Data Store Write11' incorporates: * Constant: '/Constant' * DataStoreRead: '/текущее время в мс' * Product: '/Product1' * Product: '/change rate (dtg//sec)' * Product: '/скорость в мс' * Product: '/шаг изменения' * Sum: '/Add' * Sum: '/Subtract' * Switch: '/Switch' * UnitDelay: '/Unit Delay' */ rtDW.Dtg_FUL = (uint8_t)((double)EN_BATTChiller / (double) rtb_timer_out / 1000.0 * (double)(rtDW.t_now - rtDW.UnitDelay_DSTATE_ha) * (double)i + (double)rtDW.Dtg_FUL); } /* End of Switch: '/Switch' */ /* DataStoreWrite: '/Data Store Write' incorporates: * DataStoreRead: '/Data Store Read1' * MATLAB Function: '/incar filter up' */ incarfilterup(rtDW.LEVEL, &EN_BATTChiller); /* DataStoreWrite: '/Data Store Write1' incorporates: * DataStoreRead: '/Data Store Read2' * MATLAB Function: '/incar filter down' */ incarfilterdown(rtDW.LEVEL, &rtb_timer_out); /* MATLAB Function: '/autodemist (autodefog)' incorporates: * DataStoreRead: '/Data Store Read3' */ autodemistautodefog(rtDW.LEVEL, &EN_BATTChiller); /* Sum: '/Add' incorporates: * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' */ rtb_timer_out = (uint8_t)(rtDW.Mode_FL - rtDW.Mode_logic_FL); /* MATLAB Function: '/step' incorporates: * DataStoreRead: '/Data Store Read5' */ step_h(rtDW.LEVEL, &EN_BATTChiller); /* MATLAB Function: '/time for step' incorporates: * DataStoreRead: '/Data Store Read5' */ timeforstep_p(rtDW.LEVEL, &ShutOffRear_EN); /* Switch: '/Switch' incorporates: * Constant: '/epsilon' * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator' * Switch: '/Switch' */ if (rtb_timer_out <= 0.01) { /* DataStoreWrite: '/Data Store Write3' incorporates: * DataStoreRead: '/значение auto (в соответствии с логикой)' */ rtDW.Mode_FL = rtDW.Mode_logic_FL; } else { if (rtDW.Mode_FL <= rtDW.Mode_logic_FL) { /* Switch: '/Switch' incorporates: * Constant: '/Constant' */ i = 1; } else { /* Switch: '/Switch' incorporates: * Constant: '/Constant1' */ i = -1; } /* DataStoreWrite: '/Data Store Write3' incorporates: * Constant: '/Constant' * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/текущее время в мс' * Product: '/Product1' * Product: '/change rate (step//sec)' * Product: '/скорость в мс' * Product: '/шаг изменения' * Sum: '/Add' * Sum: '/Subtract' * Switch: '/Switch' * UnitDelay: '/Unit Delay' */ rtDW.Mode_FL = (uint8_t)((double)EN_BATTChiller / (double) ShutOffRear_EN / 1000.0 * (double)(rtDW.t_now - rtDW.UnitDelay_DSTATE_e) * (double)i + (double)rtDW.Mode_FL); } /* End of Switch: '/Switch' */ /* MATLAB Function: '/window heating' incorporates: * DataStoreRead: '/Data Store Read6' */ windowheating_e(rtDW.LEVEL, &rtb_timer_out); /* Sum: '/Add' incorporates: * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' */ Gain = (uint16_t)(rtDW.Blower_FL - rtDW.Blower_logic_FL); /* RelationalOperator: '/Relational Operator' incorporates: * Constant: '/epsilon' */ eComp_stop = (Gain <= 0.01); /* MATLAB Function: '/blower step' incorporates: * DataStoreRead: '/Data Store Read7' */ blowerstep(rtDW.LEVEL, &Gain1); /* MATLAB Function: '/blower time for step' incorporates: * DataStoreRead: '/Data Store Read7' */ blowertimeforstep(rtDW.LEVEL, &Gain); /* Switch: '/Switch' incorporates: * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' * RelationalOperator: '/Relational Operator' * Switch: '/Switch' */ if (eComp_stop) { /* DataStoreWrite: '/Data Store Write6' incorporates: * DataStoreRead: '/значение auto (в соответствии с логикой)' */ rtDW.Blower_FL = rtDW.Blower_logic_FL; } else { if (rtDW.Blower_FL <= rtDW.Blower_logic_FL) { /* Switch: '/Switch' incorporates: * Constant: '/Constant' */ i = 1; } else { /* Switch: '/Switch' incorporates: * Constant: '/Constant1' */ i = -1; } /* DataStoreWrite: '/Data Store Write6' incorporates: * Constant: '/Constant' * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/текущее время в мс' * Product: '/Product1' * Product: '/change rate (step//sec)' * Product: '/скорость в мс' * Product: '/шаг изменения' * Sum: '/Add' * Sum: '/Subtract' * Switch: '/Switch' * UnitDelay: '/Unit Delay' */ rtDW.Blower_FL = (uint16_t)((double)Gain1 / (double)Gain / 1000.0 * (double)(rtDW.t_now - rtDW.UnitDelay_DSTATE_k) * (double)i + (double) rtDW.Blower_FL); } /* End of Switch: '/Switch' */ /* DataStoreWrite: '/Data Store Write7' incorporates: * Constant: '/Recirc logic Partial REC' */ Blower_AF_FL = 1.0; /* RelationalOperator: '/Equal' incorporates: * DataStoreRead: '/current step' */ eComp_stop = (rtDW.step_start_controle_front == 2); /* MATLAB Function: '/Time goto from step 2 to step 3 ' incorporates: * DataStoreRead: '/Data Store Read4' */ Timegotofromstep2tostep3(rtDW.LEVEL, &g_assEVA_TG_AMB_F_n); /* RelationalOperator: '/Relational Operator1' incorporates: * DataStoreRead: '/Data Store Read4' * Gain: '/из сек в мс' * Sum: '/Subtract' * UnitDelay: '/t_start_delay_private ' */ rtb_LogicalOperator1 = (rtDW.t_now - rtDW.t_start_delay_private_DSTATE_it > (uint32_t)(1000 * g_assEVA_TG_AMB_F_n)); /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read4' * Logic: '/Logical Operator3' * Logic: '/Logical Operator4' * UnitDelay: '/Cond_prev_private ' * UnitDelay: '/t_start_delay_private ' */ if (eComp_stop && (!rtDW.Cond_prev_private_DSTATE_n)) { rtDW.t_start_delay_private_DSTATE_it = rtDW.t_now; } /* End of Switch: '/Switch' */ /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read' * Logic: '/Logical Operator' */ if (rtb_LogicalOperator1 || rtDW.HI_logic_on) { /* Merge: '/Merge' incorporates: * Constant: '/go to next step' */ rtB.Merge_fb = 3; } else { /* Merge: '/Merge' incorporates: * Constant: '/stay at step' */ rtB.Merge_fb = 2; } /* End of Switch: '/Switch' */ /* Update for UnitDelay: '/Unit Delay' incorporates: * DataStoreRead: '/текущее время в мс' */ rtDW.UnitDelay_DSTATE_fs = rtDW.t_now; /* Update for UnitDelay: '/Unit Delay' incorporates: * DataStoreRead: '/текущее время в мс' */ rtDW.UnitDelay_DSTATE_ha = rtDW.t_now; /* Update for UnitDelay: '/Unit Delay' incorporates: * DataStoreRead: '/текущее время в мс' */ rtDW.UnitDelay_DSTATE_e = rtDW.t_now; /* Update for UnitDelay: '/Unit Delay' incorporates: * DataStoreRead: '/текущее время в мс' */ rtDW.UnitDelay_DSTATE_k = rtDW.t_now; /* Update for UnitDelay: '/Cond_prev_private ' */ rtDW.Cond_prev_private_DSTATE_n = eComp_stop; /* End of Outputs for SubSystem: '/Level 5' */ break; } /* End of SwitchCase: '/Switch Case' */ /* End of Outputs for SubSystem: '/Step 2 F' */ break; case 3: /* Outputs for IfAction SubSystem: '/Step 3 F' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write10' incorporates: * Constant: '/True' */ rtDW.start_control_finished_front = 1; /* Merge: '/Merge' incorporates: * Constant: '/Constant1' * SignalConversion generated from: '/step' */ rtB.Merge_fb = 3; /* End of Outputs for SubSystem: '/Step 3 F' */ break; } /* End of SwitchCase: '/Switch Case' */ /* DataStoreWrite: '/Data Store Write' */ rtDW.step_start_controle_front = rtB.Merge_fb; /* End of Outputs for SubSystem: '/Start Control Front' */ } /* End of If: '/если SC front не завершен' */ /* If: '/если SC rear не завершен1' incorporates: * DataStoreRead: '/Data Store Read3' */ if (rtDW.start_control_finished_rear == 0.0) { /* Outputs for IfAction SubSystem: '/Start Control Rear' incorporates: * ActionPort: '/Action Port' */ /* SwitchCase: '/Switch Case' incorporates: * DataStoreRead: '/Data Store Read' */ switch (rtDW.step_start_controle_rear) { case -1: /* Outputs for IfAction SubSystem: '/Step -1 R (Entry Condition)' incorporates: * ActionPort: '/Action Port' */ /* SwitchCase: '/Switch Case' incorporates: * DataStoreRead: '/Data Store Read1' */ switch (rtDW.LEVEL) { case 0: /* Outputs for IfAction SubSystem: '/Level 0' incorporates: * ActionPort: '/Action Port' */ /* MATLAB Function: '/g_ausSTART_ENTER_SETTEMP' incorporates: * DataStoreRead: '/Data Store Read4' */ /* : out = int16(g_assSTART_ENTER_INCAR(LVL + 1 + 6)); */ g_ausSTART_ENTER_SETTEMP_m(rtDW.LEVEL, &g_assEVA_TG_AMB_F_n); /* MATLAB Function: '/g_assSTART_ENTER_INCAR' incorporates: * DataStoreRead: '/Data Store Read3' */ i = (int32_t)(rtDW.LEVEL + 1U); if (rtDW.LEVEL + 1U > 255U) { i = 255; } i_0 = (int32_t)((uint32_t)i + 6U); if ((uint32_t)i + 6U > 255U) { i_0 = 255; } /* Switch: '/Switch' incorporates: * Constant: '/not LO or HI' * DataStoreRead: '/Data Store Read' * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read2' * DataStoreRead: '/Data Store Read5' * Logic: '/AND' * MATLAB Function: '/g_assSTART_ENTER_INCAR' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator1' * RelationalOperator: '/Relational Operator2' * RelationalOperator: '/Relational Operator3' */ if ((rtDW.Incar_RR > g_assSTART_ENTER_INCAR[i_0 - 1]) && (rtDW.CCU_MODE_RR == 1) && (rtDW.CCU_SET_RR < g_assEVA_TG_AMB_F_n) && (rtDW.LO_HI_MODE_RR == 0)) { /* Merge: '/Merge' incorporates: * Constant: '/Constant1' */ rtB.Merge_c = 1; } else { /* Merge: '/Merge' incorporates: * Constant: '/Constant' */ rtB.Merge_c = -1; } /* End of Switch: '/Switch' */ /* End of Outputs for SubSystem: '/Level 0' */ break; case 1: /* Outputs for IfAction SubSystem: '/Level 1' incorporates: * ActionPort: '/Action Port' */ /* MATLAB Function: '/g_assSTART_ENTER_INCAR' incorporates: * DataStoreRead: '/Data Store Read3' */ g_assSTART_ENTER_INCAR_c(rtDW.LEVEL, &g_assEVA_TG_AMB_F_n); /* MATLAB Function: '/g_ausSTART_ENTER_SETTEMP' incorporates: * DataStoreRead: '/Data Store Read4' */ g_ausSTART_ENTER_SETTEMP_m(rtDW.LEVEL, &g_assEVA_TG_AMB_R_h); /* Switch: '/Switch' incorporates: * Constant: '/not LO or HI' * DataStoreRead: '/Data Store Read' * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read2' * DataStoreRead: '/Data Store Read5' * Logic: '/AND' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator1' * RelationalOperator: '/Relational Operator2' * RelationalOperator: '/Relational Operator3' */ if ((rtDW.Incar_RR > g_assEVA_TG_AMB_F_n) && (rtDW.CCU_MODE_RR == 1) && (rtDW.CCU_SET_RR < g_assEVA_TG_AMB_R_h) && (rtDW.LO_HI_MODE_FL == 0)) { /* Merge: '/Merge' incorporates: * Constant: '/Constant1' */ rtB.Merge_c = 1; } else { /* Merge: '/Merge' incorporates: * Constant: '/Constant' */ rtB.Merge_c = -1; } /* End of Switch: '/Switch' */ /* End of Outputs for SubSystem: '/Level 1' */ break; case 2: /* Outputs for IfAction SubSystem: '/Level 2' incorporates: * ActionPort: '/Action Port' */ /* MATLAB Function: '/g_assSTART_ENTER_INCAR' incorporates: * DataStoreRead: '/Data Store Read3' */ g_assSTART_ENTER_INCAR_c(rtDW.LEVEL, &g_assEVA_TG_AMB_F_n); /* MATLAB Function: '/g_ausSTART_ENTER_SETTEMP' incorporates: * DataStoreRead: '/Data Store Read4' */ g_ausSTART_ENTER_SETTEMP_m(rtDW.LEVEL, &g_assEVA_TG_AMB_R_h); /* Switch: '/Switch' incorporates: * Constant: '/LOW' * DataStoreRead: '/Data Store Read' * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read2' * DataStoreRead: '/Data Store Read5' * Logic: '/AND' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator1' * RelationalOperator: '/Relational Operator2' * RelationalOperator: '/Relational Operator3' */ if ((rtDW.Incar_RR < g_assEVA_TG_AMB_F_n) && (rtDW.CCU_MODE_RR == 1) && (rtDW.CCU_SET_RR > g_assEVA_TG_AMB_R_h) && (rtDW.LO_HI_MODE_FL != 1)) { /* Merge: '/Merge' incorporates: * Constant: '/Constant1' */ rtB.Merge_c = 0; } else { /* Merge: '/Merge' incorporates: * Constant: '/Constant' */ rtB.Merge_c = -1; } /* End of Switch: '/Switch' */ /* End of Outputs for SubSystem: '/Level 2' */ break; case 3: /* Outputs for IfAction SubSystem: '/Level 3' incorporates: * ActionPort: '/Action Port' */ /* MATLAB Function: '/g_assSTART_ENTER_INCAR' incorporates: * DataStoreRead: '/Data Store Read4' */ g_assSTART_ENTER_INCAR_c(rtDW.LEVEL, &g_assEVA_TG_AMB_F_n); /* MATLAB Function: '/g_assSTART_ENTER_COOLANT ' incorporates: * DataStoreRead: '/Data Store Read3' */ g_assSTART_ENTER_COOLANT_c(rtDW.LEVEL, &g_assEVA_TG_AMB_R_h); /* MATLAB Function: '/g_ausSTART_ENTER_SETTEMP' incorporates: * DataStoreRead: '/Data Store Read6' */ /* : out = int16(g_ausSTART_ENTER_SETTEMP(LVL+1+6)); */ i = (int32_t)(rtDW.LEVEL + 1U); if (rtDW.LEVEL + 1U > 255U) { i = 255; } i_0 = (int32_t)((uint32_t)i + 6U); if ((uint32_t)i + 6U > 255U) { i_0 = 255; } Gain = g_ausSTART_ENTER_SETTEMP[i_0 - 1]; if (Gain > 32767) { Gain = 32767U; } /* Switch: '/Switch' incorporates: * Constant: '/LOW' * DataStoreRead: '/Data Store Read' * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read2' * DataStoreRead: '/Data Store Read5' * DataStoreRead: '/Data Store Read7' * Logic: '/AND' * Logic: '/AND1' * MATLAB Function: '/g_ausSTART_ENTER_SETTEMP' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator1' * RelationalOperator: '/Relational Operator2' * RelationalOperator: '/Relational Operator3' * RelationalOperator: '/Relational Operator4' */ if (((rtDW.Incar_RR < g_assEVA_TG_AMB_F_n) || (rtDW.ECT < g_assEVA_TG_AMB_R_h)) && (rtDW.CCU_MODE_RR == 1) && (rtDW.CCU_SET_RR > Gain) && (rtDW.LO_HI_MODE_FL != 1)) { /* Merge: '/Merge' incorporates: * Constant: '/Constant1' */ rtB.Merge_c = 0; } else { /* Merge: '/Merge' incorporates: * Constant: '/Constant' */ rtB.Merge_c = -1; } /* End of Switch: '/Switch' */ /* End of Outputs for SubSystem: '/Level 3' */ break; case 4: /* Outputs for IfAction SubSystem: '/Level 4' incorporates: * ActionPort: '/Action Port' */ Level4_l(&rtB.Merge_c, &rtDW.CCU_MODE_RR, &rtDW.ECT, &rtDW.Incar_RR, &rtDW.LEVEL, &rtDW.LO_HI_MODE_FL); /* End of Outputs for SubSystem: '/Level 4' */ break; case 5: /* Outputs for IfAction SubSystem: '/Level 5' incorporates: * ActionPort: '/Action Port' */ Level4_l(&rtB.Merge_c, &rtDW.CCU_MODE_RR, &rtDW.ECT, &rtDW.Incar_RR, &rtDW.LEVEL, &rtDW.LO_HI_MODE_FL); /* End of Outputs for SubSystem: '/Level 5' */ break; } /* End of SwitchCase: '/Switch Case' */ /* End of Outputs for SubSystem: '/Step -1 R (Entry Condition)' */ break; case 0: /* Outputs for IfAction SubSystem: '/Step 0 R' incorporates: * ActionPort: '/Action Port' */ /* SwitchCase: '/Switch Case' incorporates: * DataStoreRead: '/Data Store Read1' */ switch (rtDW.LEVEL) { case 0: /* Outputs for IfAction SubSystem: '/Level 0' incorporates: * ActionPort: '/Action Port' */ Level0(&rtB.Merge_c); /* End of Outputs for SubSystem: '/Level 0' */ break; case 1: /* Outputs for IfAction SubSystem: '/Level 1' incorporates: * ActionPort: '/Action Port' */ Level0(&rtB.Merge_c); /* End of Outputs for SubSystem: '/Level 1' */ break; case 2: /* Outputs for IfAction SubSystem: '/Level 2' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write5' incorporates: * Constant: '/Constant2' */ rtDW.Blower_RR = 10U; /* DataStoreWrite: '/Data Store Write10' incorporates: * Constant: '/Constant4' */ rtDW.Dtg_RR = 65U; /* MATLAB Function: '/incar filter up' incorporates: * DataStoreRead: '/Data Store Read1' */ incarfilterup_b(rtDW.LEVEL, &EN_BATTChiller); /* MATLAB Function: '/incar filter down' incorporates: * DataStoreRead: '/Data Store Read2' */ incarfilterdown_c(rtDW.LEVEL, &EN_BATTChiller); /* DataStoreWrite: '/Data Store Write2' incorporates: * Constant: '/Mode - foot' */ rtDW.Mode_RR = 60U; /* MATLAB Function: '/g_assSTART_COOLANT_STEP0_TO_1 ' incorporates: * DataStoreRead: '/Data Store Read3' */ /* : out = int16(g_assSTART_COOLANT_STEP0_TO_1(LVL + 3)); */ i = (int32_t)(rtDW.LEVEL + 3U); if (rtDW.LEVEL + 3U > 255U) { i = 255; } /* Merge: '/Merge' incorporates: * DataStoreRead: '/Engine coolant temp' * MATLAB Function: '/g_assSTART_COOLANT_STEP0_TO_1 ' * RelationalOperator: '/Relational Operator' * Switch: '/Switch' */ rtB.Merge_c = (int8_t)(rtDW.ECT > g_assSTART_COOLANT_STEP0_TO_1[i - 1]); /* End of Outputs for SubSystem: '/Level 2' */ break; case 3: /* Outputs for IfAction SubSystem: '/Level 3' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write5' incorporates: * Constant: '/Constant2' */ rtDW.Blower_RR = 10U; /* DataStoreWrite: '/Data Store Write10' incorporates: * Constant: '/Constant4' */ rtDW.Dtg_RR = 65U; /* MATLAB Function: '/incar filter up' incorporates: * DataStoreRead: '/Data Store Read1' */ incarfilterup_b(rtDW.LEVEL, &EN_BATTChiller); /* MATLAB Function: '/incar filter down' incorporates: * DataStoreRead: '/Data Store Read2' */ incarfilterdown_c(rtDW.LEVEL, &EN_BATTChiller); /* DataStoreWrite: '/Data Store Write2' incorporates: * Constant: '/Mode - foot' */ rtDW.Mode_RR = 60U; /* MATLAB Function: '/g_assSTART_COOLANT_STEP0_TO_1 ' incorporates: * DataStoreRead: '/Data Store Read3' */ g_assSTART_COOLANT_STEP0_TO_1_k(rtDW.LEVEL, &g_assEVA_TG_AMB_F_n); /* Merge: '/Merge' incorporates: * DataStoreRead: '/Engine coolant temp' * RelationalOperator: '/Relational Operator' * Switch: '/Switch' */ rtB.Merge_c = (int8_t)(rtDW.ECT > g_assEVA_TG_AMB_F_n); /* End of Outputs for SubSystem: '/Level 3' */ break; case 4: /* Outputs for IfAction SubSystem: '/Level 4' incorporates: * ActionPort: '/Action Port' */ Level4_c(&rtB.Merge_c, &Gain, &rtDW.Blower_RR, &Comp_Max_RPM_Allowed, &rtDW.Dtg_RR, &rtDW.ECT, &rtb_timer_out, &EN_BATTChiller, &rtDW.LEVEL, &rtb_Switch3_ed, &rtDW.Mode_RR, &Valve_2_way, &ShutOffRear_EN); /* End of Outputs for SubSystem: '/Level 4' */ break; case 5: /* Outputs for IfAction SubSystem: '/Level 5' incorporates: * ActionPort: '/Action Port' */ Level4_c(&rtB.Merge_c, &Gain, &rtDW.Blower_RR, &Comp_Max_RPM_Allowed, &rtDW.Dtg_RR, &rtDW.ECT, &rtb_timer_out, &EN_BATTChiller, &rtDW.LEVEL, &rtb_Switch3_ed, &rtDW.Mode_RR, &Valve_2_way, &ShutOffRear_EN); /* End of Outputs for SubSystem: '/Level 5' */ break; } /* End of SwitchCase: '/Switch Case' */ /* End of Outputs for SubSystem: '/Step 0 R' */ break; case 1: /* Outputs for IfAction SubSystem: '/Step 1 R' incorporates: * ActionPort: '/Action Port' */ /* SwitchCase: '/Switch Case' incorporates: * DataStoreRead: '/Data Store Read1' */ switch (rtDW.LEVEL) { case 0: /* Outputs for IfAction SubSystem: '/Level 0' incorporates: * ActionPort: '/Action Port' */ Level0_o(&rtB.Merge_c, &Gain, &rtDW.Blower_RR, &Comp_Max_RPM_Allowed, &rtDW.Dtg_RR, &rtDW.Incar_RR, &rtb_timer_out, &EN_BATTChiller, &rtDW.LEVEL, &rtb_Switch3_ed, &rtDW.Mode_RR, &Blower_AF_FL, &Valve_2_way, &rtDW.step_start_controle_rear, &rtDW.t_now, &rtDW.Level0_o3); /* End of Outputs for SubSystem: '/Level 0' */ break; case 1: /* Outputs for IfAction SubSystem: '/Level 1' incorporates: * ActionPort: '/Action Port' */ Level0_o(&rtB.Merge_c, &Gain, &rtDW.Blower_RR, &Comp_Max_RPM_Allowed, &rtDW.Dtg_RR, &rtDW.Incar_RR, &rtb_timer_out, &EN_BATTChiller, &rtDW.LEVEL, &rtb_Switch3_ed, &rtDW.Mode_RR, &Blower_AF_FL, &Valve_2_way, &rtDW.step_start_controle_rear, &rtDW.t_now, &rtDW.Level1_f); /* End of Outputs for SubSystem: '/Level 1' */ break; case 2: /* Outputs for IfAction SubSystem: '/Level 2' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write2' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read2' * DataStoreRead: '/Data Store Read5' * DataStoreRead: '/Data Store Read6' * MATLAB Function: '/2 way valve' * MATLAB Function: '/incar filter down' * MATLAB Function: '/incar filter up' * MATLAB Function: '/mode rear step 1' */ uwayvalve(rtDW.LEVEL, &rtDW.Mode_RR); incarfilterup_b(rtDW.LEVEL, &rtDW.Mode_RR); incarfilterdown_c(rtDW.LEVEL, &rtDW.Mode_RR); moderearstep1(rtDW.LEVEL, &rtDW.Mode_RR); /* MATLAB Function: '/blower start finish' incorporates: * DataStoreRead: '/Data Store Read7' */ blowerstartfinish(rtDW.LEVEL, rtb_out_g4); /* MATLAB Function: '/ECT min max' */ /* : min = int16(g_assSTART_COOLANT_STEP0_TO_1(5)); */ /* : max = int16(g_assSTART_COOLANT_TO_STEP2(2)); */ /* : out = [min, max]; */ rtb_out_mt[0] = g_assSTART_COOLANT_STEP0_TO_1[4]; rtb_out_mt[1] = g_assSTART_COOLANT_TO_STEP2[1]; /* Lookup_n-D: '/blower для текущего ECT' incorporates: * DataStoreRead: '/engine coolant temp' */ g_assEVA_TG_AMB_F_n = look1_is16lu64n32tu16Ds32Is16_binlcs(rtDW.ECT, rtb_out_mt, rtb_out_g4, 1U); /* DataTypeConversion: '/Data Type Conversion1' incorporates: * DataStoreWrite: '/Data Store Write5' */ rtDW.Blower_RR = (uint16_t)g_assEVA_TG_AMB_F_n; /* DataStoreWrite: '/Data Store Write10' incorporates: * DataStoreRead: '/Data Store Read8' * MATLAB Function: '/Dtg_rear' */ Dtg_rear(rtDW.LEVEL, &rtDW.Dtg_RR); /* RelationalOperator: '/Equal' incorporates: * DataStoreRead: '/current step' */ eComp_stop = (rtDW.step_start_controle_rear == 1); /* MATLAB Function: '/Incar temp goto from step 1 to step 2 ' incorporates: * DataStoreRead: '/Data Store Read3' */ Incartempgotofromstep1tostep2_n(rtDW.LEVEL, &g_assEVA_TG_AMB_R_h); /* Sum: '/Subtract' incorporates: * DataStoreRead: '/Data Store Read4' * UnitDelay: '/t_start_delay_private ' */ rtb_Subtract = rtDW.t_now - rtDW.t_start_delay_private_DSTATE_e; /* MATLAB Function: '/Time goto from step 1 to step 2 ' incorporates: * DataStoreRead: '/Data Store Read4' */ Timegotofromstep1tostep2_p(rtDW.LEVEL, &g_assEVA_TG_AMB_F_n); /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read4' * Logic: '/Logical Operator3' * Logic: '/Logical Operator4' * UnitDelay: '/Cond_prev_private ' * UnitDelay: '/t_start_delay_private ' */ /* : out = int16(g_assSTART_COOLANT_TO_STEP2(2)); */ if (eComp_stop && (!rtDW.Cond_prev_private_DSTATE_ld)) { rtDW.t_start_delay_private_DSTATE_e = rtDW.t_now; } /* End of Switch: '/Switch' */ /* Switch: '/Switch' incorporates: * DataStoreRead: '/engine coolant temp' * DataStoreRead: '/incar temp' * Gain: '/из сек в мс' * Logic: '/Logical Operator' * MATLAB Function: '/g_assSTART_COOLANT_TO_STEP2 ' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator1' * RelationalOperator: '/Relational Operator2' */ if ((rtDW.Incar_RR > g_assEVA_TG_AMB_R_h) || (rtb_Subtract > (uint16_t) (1000 * g_assEVA_TG_AMB_F_n)) || (rtDW.ECT > g_assSTART_COOLANT_TO_STEP2[1])) { /* Merge: '/Merge' incorporates: * Constant: '/go to next step' */ rtB.Merge_c = 2; } else { /* Merge: '/Merge' incorporates: * Constant: '/stay at step 1' */ rtB.Merge_c = 1; } /* End of Switch: '/Switch' */ /* Update for UnitDelay: '/Cond_prev_private ' */ rtDW.Cond_prev_private_DSTATE_ld = eComp_stop; /* End of Outputs for SubSystem: '/Level 2' */ break; case 3: /* Outputs for IfAction SubSystem: '/Level 3' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write2' incorporates: * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read2' * DataStoreRead: '/Data Store Read5' * DataStoreRead: '/Data Store Read6' * MATLAB Function: '/2 way valve' * MATLAB Function: '/incar filter down' * MATLAB Function: '/incar filter up' * MATLAB Function: '/mode rear step 1' */ uwayvalve(rtDW.LEVEL, &rtDW.Mode_RR); incarfilterup_b(rtDW.LEVEL, &rtDW.Mode_RR); incarfilterdown_c(rtDW.LEVEL, &rtDW.Mode_RR); moderearstep1(rtDW.LEVEL, &rtDW.Mode_RR); /* MATLAB Function: '/blower start finish' incorporates: * DataStoreRead: '/Data Store Read7' */ blowerstartfinish(rtDW.LEVEL, rtb_out_g4); /* MATLAB Function: '/ECT min max' incorporates: * DataStoreRead: '/Data Store Read7' */ ECTminmax_b(rtDW.LEVEL, rtb_out_mt); /* Lookup_n-D: '/blower для текущего ECT' incorporates: * DataStoreRead: '/engine coolant temp' */ g_assEVA_TG_AMB_F_n = look1_is16lu64n32tu16Ds32Is16_binlcs(rtDW.ECT, rtb_out_mt, rtb_out_g4, 1U); /* DataTypeConversion: '/Data Type Conversion1' incorporates: * DataStoreWrite: '/Data Store Write5' */ rtDW.Blower_RR = (uint16_t)g_assEVA_TG_AMB_F_n; /* DataStoreWrite: '/Data Store Write10' incorporates: * DataStoreRead: '/Data Store Read8' * MATLAB Function: '/Dtg_rear' */ Dtg_rear(rtDW.LEVEL, &rtDW.Dtg_RR); /* RelationalOperator: '/Equal' incorporates: * DataStoreRead: '/current step' */ eComp_stop = (rtDW.step_start_controle_rear == 1); /* MATLAB Function: '/Incar temp goto from step 1 to step 2 ' incorporates: * DataStoreRead: '/Data Store Read3' */ Incartempgotofromstep1tostep2_n(rtDW.LEVEL, &g_assEVA_TG_AMB_R_h); /* Sum: '/Subtract' incorporates: * DataStoreRead: '/Data Store Read4' * UnitDelay: '/t_start_delay_private ' */ rtb_Subtract = rtDW.t_now - rtDW.t_start_delay_private_DSTATE_l; /* MATLAB Function: '/Time goto from step 1 to step 2 ' incorporates: * DataStoreRead: '/Data Store Read4' */ Timegotofromstep1tostep2_p(rtDW.LEVEL, &g_assEVA_TG_AMB_F_n); /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read4' * Logic: '/Logical Operator3' * Logic: '/Logical Operator4' * UnitDelay: '/Cond_prev_private ' * UnitDelay: '/t_start_delay_private ' */ /* : out = int16(g_assSTART_COOLANT_TO_STEP2(3)); */ if (eComp_stop && (!rtDW.Cond_prev_private_DSTATE_pk)) { rtDW.t_start_delay_private_DSTATE_l = rtDW.t_now; } /* End of Switch: '/Switch' */ /* Switch: '/Switch' incorporates: * DataStoreRead: '/engine coolant temp' * DataStoreRead: '/incar temp' * Gain: '/из сек в мс' * Logic: '/Logical Operator' * MATLAB Function: '/g_assSTART_COOLANT_TO_STEP2 ' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator1' * RelationalOperator: '/Relational Operator2' */ if ((rtDW.Incar_RR > g_assEVA_TG_AMB_R_h) || (rtb_Subtract > (uint16_t) (1000 * g_assEVA_TG_AMB_F_n)) || (rtDW.ECT > g_assSTART_COOLANT_TO_STEP2[2])) { /* Merge: '/Merge' incorporates: * Constant: '/go to next step' */ rtB.Merge_c = 2; } else { /* Merge: '/Merge' incorporates: * Constant: '/stay at step 1' */ rtB.Merge_c = 1; } /* End of Switch: '/Switch' */ /* Update for UnitDelay: '/Cond_prev_private ' */ rtDW.Cond_prev_private_DSTATE_pk = eComp_stop; /* End of Outputs for SubSystem: '/Level 3' */ break; case 4: /* Outputs for IfAction SubSystem: '/Level 4' incorporates: * ActionPort: '/Action Port' */ Level4_n(&rtB.Merge_c, &Gain, &rtDW.Blower_RR, &Comp_Max_RPM_Allowed, &rtDW.Dtg_RR, &rtDW.ECT, &rtDW.Incar_RR, &rtb_timer_out, &EN_BATTChiller, &rtDW.LEVEL, &rtb_Switch3_ed, &rtDW.Mode_RR, &Blower_AF_FL, &Valve_2_way, &rtDW.step_start_controle_rear, &rtDW.t_now, &rtDW.Level4_ns); /* End of Outputs for SubSystem: '/Level 4' */ break; case 5: /* Outputs for IfAction SubSystem: '/Level 5' incorporates: * ActionPort: '/Action Port' */ Level4_n(&rtB.Merge_c, &Gain, &rtDW.Blower_RR, &Comp_Max_RPM_Allowed, &rtDW.Dtg_RR, &rtDW.ECT, &rtDW.Incar_RR, &rtb_timer_out, &EN_BATTChiller, &rtDW.LEVEL, &rtb_Switch3_ed, &rtDW.Mode_RR, &Blower_AF_FL, &Valve_2_way, &rtDW.step_start_controle_rear, &rtDW.t_now, &rtDW.Level5_f); /* End of Outputs for SubSystem: '/Level 5' */ break; } /* End of SwitchCase: '/Switch Case' */ /* End of Outputs for SubSystem: '/Step 1 R' */ break; case 2: /* Outputs for IfAction SubSystem: '/Step 2 R' incorporates: * ActionPort: '/Action Port' */ /* SwitchCase: '/Switch Case' incorporates: * DataStoreRead: '/Data Store Read1' */ switch (rtDW.LEVEL) { case 0: /* Outputs for IfAction SubSystem: '/Level 0' incorporates: * ActionPort: '/Action Port' */ /* MATLAB Function: '/2 way valve' incorporates: * DataStoreRead: '/Data Store Read6' */ uwayvalve(rtDW.LEVEL, &EN_BATTChiller); /* MATLAB Function: '/step' incorporates: * DataStoreRead: '/Data Store Read8' */ Dtg_rear(rtDW.LEVEL, &EN_BATTChiller); /* MATLAB Function: '/time for step' incorporates: * DataStoreRead: '/Data Store Read8' */ timeforstep_h(rtDW.LEVEL, &rtb_timer_out); /* Switch: '/Switch' incorporates: * Constant: '/Constant' * Constant: '/epsilon' * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' * DataStoreRead: '/текущее время в мс' * DataStoreWrite: '/Data Store Write10' * Product: '/Product1' * Product: '/change rate (dtg//sec)' * Product: '/скорость в мс' * Product: '/шаг изменения' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator' * Sum: '/Add' * Sum: '/Add' * Sum: '/Subtract' * Switch: '/Switch' * UnitDelay: '/Unit Delay' */ if ((uint8_t)(rtDW.Dtg_RR - rtDW.Dtg_logic_RR) <= 0.01) { rtDW.Dtg_RR = rtDW.Dtg_logic_RR; } else { if (rtDW.Dtg_RR <= rtDW.Dtg_logic_RR) { /* Switch: '/Switch' incorporates: * Constant: '/Constant' */ i = 1; } else { /* Switch: '/Switch' incorporates: * Constant: '/Constant1' */ i = -1; } rtDW.Dtg_RR = (uint8_t)((double)EN_BATTChiller / (double)rtb_timer_out / 1000.0 * (double)(rtDW.t_now - rtDW.UnitDelay_DSTATE_i) * (double) i + (double)rtDW.Dtg_RR); } /* End of Switch: '/Switch' */ /* MATLAB Function: '/incar filter up' incorporates: * DataStoreRead: '/Data Store Read1' */ incarfilterup_b(rtDW.LEVEL, &EN_BATTChiller); /* MATLAB Function: '/incar filter down' incorporates: * DataStoreRead: '/Data Store Read2' */ incarfilterdown_c(rtDW.LEVEL, &EN_BATTChiller); /* Sum: '/Add' incorporates: * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' */ rtb_timer_out = (uint8_t)(rtDW.Mode_RR - rtDW.Mode_logic_RR); /* RelationalOperator: '/Relational Operator' incorporates: * Constant: '/epsilon' */ eComp_stop = (rtb_timer_out <= 0.01); /* MATLAB Function: '/step' incorporates: * DataStoreRead: '/Data Store Read5' */ step_i3(rtDW.LEVEL, &EN_BATTChiller); /* MATLAB Function: '/time for step' incorporates: * DataStoreRead: '/Data Store Read5' */ timeforstep_m(rtDW.LEVEL, &rtb_timer_out); /* Switch: '/Switch' incorporates: * Constant: '/Constant' * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' * DataStoreRead: '/текущее время в мс' * DataStoreWrite: '/Data Store Write2' * Product: '/Product1' * Product: '/change rate (step//sec)' * Product: '/скорость в мс' * Product: '/шаг изменения' * RelationalOperator: '/Relational Operator' * Sum: '/Add' * Sum: '/Subtract' * Switch: '/Switch' * UnitDelay: '/Unit Delay' */ if (eComp_stop) { rtDW.Mode_RR = rtDW.Mode_logic_RR; } else { if (rtDW.Mode_RR <= rtDW.Mode_logic_RR) { /* Switch: '/Switch' incorporates: * Constant: '/Constant' */ i = 1; } else { /* Switch: '/Switch' incorporates: * Constant: '/Constant1' */ i = -1; } rtDW.Mode_RR = (uint8_t)((double)EN_BATTChiller / (double) rtb_timer_out / 1000.0 * (double)(rtDW.t_now - rtDW.UnitDelay_DSTATE_o) * (double)i + (double)rtDW.Mode_RR); } /* End of Switch: '/Switch' */ /* MATLAB Function: '/blower step' incorporates: * DataStoreRead: '/Data Store Read7' */ blowerstep_e(rtDW.LEVEL, &Gain); /* MATLAB Function: '/blower time for step' incorporates: * DataStoreRead: '/Data Store Read7' */ blowertimeforstep_o(rtDW.LEVEL, &Gain1); /* Switch: '/Switch' incorporates: * Constant: '/Constant' * Constant: '/epsilon' * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' * DataStoreRead: '/текущее время в мс' * DataStoreWrite: '/Data Store Write5' * Product: '/Product1' * Product: '/change rate (step//sec)' * Product: '/скорость в мс' * Product: '/шаг изменения' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator' * Sum: '/Add' * Sum: '/Add' * Sum: '/Subtract' * Switch: '/Switch' * UnitDelay: '/Unit Delay' */ if ((uint16_t)(rtDW.Blower_RR - rtDW.Blower_logic_RR) <= 0.01) { rtDW.Blower_RR = rtDW.Blower_logic_RR; } else { if (rtDW.Blower_RR <= rtDW.Blower_logic_RR) { /* Switch: '/Switch' incorporates: * Constant: '/Constant' */ i = 1; } else { /* Switch: '/Switch' incorporates: * Constant: '/Constant1' */ i = -1; } rtDW.Blower_RR = (uint16_t)((double)Gain / (double)Gain1 / 1000.0 * (double)(rtDW.t_now - rtDW.UnitDelay_DSTATE_ge) * (double)i + (double)rtDW.Blower_RR); } /* End of Switch: '/Switch' */ /* RelationalOperator: '/Equal' incorporates: * DataStoreRead: '/current step' */ eComp_stop = (rtDW.step_start_controle_rear == 2); /* Sum: '/Subtract' incorporates: * DataStoreRead: '/Data Store Read4' * UnitDelay: '/t_start_delay_private ' */ rtb_Subtract = rtDW.t_now - rtDW.t_start_delay_private_DSTATE_hn; /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read4' * Logic: '/Logical Operator3' * Logic: '/Logical Operator4' * UnitDelay: '/Cond_prev_private ' * UnitDelay: '/t_start_delay_private ' */ if (eComp_stop && (!rtDW.Cond_prev_private_DSTATE_b)) { rtDW.t_start_delay_private_DSTATE_hn = rtDW.t_now; } /* End of Switch: '/Switch' */ /* MATLAB Function: '/Time goto from step 1 to step 2 ' incorporates: * DataStoreRead: '/Data Store Read4' */ Timegotofromstep1tostep2_p(rtDW.LEVEL, &g_assEVA_TG_AMB_F_n); /* Switch: '/Switch' incorporates: * Gain: '/из сек в мс' * RelationalOperator: '/Relational Operator1' */ if (rtb_Subtract > (uint16_t)(1000 * g_assEVA_TG_AMB_F_n)) { /* Merge: '/Merge' incorporates: * Constant: '/go to next step' */ rtB.Merge_c = 3; } else { /* Merge: '/Merge' incorporates: * Constant: '/stay at step' */ rtB.Merge_c = 2; } /* End of Switch: '/Switch' */ /* Update for UnitDelay: '/Unit Delay' incorporates: * DataStoreRead: '/текущее время в мс' */ rtDW.UnitDelay_DSTATE_i = rtDW.t_now; /* Update for UnitDelay: '/Unit Delay' incorporates: * DataStoreRead: '/текущее время в мс' */ rtDW.UnitDelay_DSTATE_o = rtDW.t_now; /* Update for UnitDelay: '/Unit Delay' incorporates: * DataStoreRead: '/текущее время в мс' */ rtDW.UnitDelay_DSTATE_ge = rtDW.t_now; /* Update for UnitDelay: '/Cond_prev_private ' */ rtDW.Cond_prev_private_DSTATE_b = eComp_stop; /* End of Outputs for SubSystem: '/Level 0' */ break; case 1: /* Outputs for IfAction SubSystem: '/Level 1' incorporates: * ActionPort: '/Action Port' */ /* MATLAB Function: '/2 way valve' incorporates: * DataStoreRead: '/Data Store Read6' */ uwayvalve(rtDW.LEVEL, &EN_BATTChiller); /* MATLAB Function: '/step' incorporates: * DataStoreRead: '/Data Store Read8' */ Dtg_rear(rtDW.LEVEL, &EN_BATTChiller); /* MATLAB Function: '/time for step' incorporates: * DataStoreRead: '/Data Store Read8' */ timeforstep_h(rtDW.LEVEL, &rtb_timer_out); /* Switch: '/Switch' incorporates: * Constant: '/Constant' * Constant: '/epsilon' * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' * DataStoreRead: '/текущее время в мс' * DataStoreWrite: '/Data Store Write10' * Product: '/Product1' * Product: '/change rate (dtg//sec)' * Product: '/скорость в мс' * Product: '/шаг изменения' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator' * Sum: '/Add' * Sum: '/Add' * Sum: '/Subtract' * Switch: '/Switch' * UnitDelay: '/Unit Delay' */ if ((uint8_t)(rtDW.Dtg_RR - rtDW.Dtg_logic_RR) <= 0.01) { rtDW.Dtg_RR = rtDW.Dtg_logic_RR; } else { if (rtDW.Dtg_RR <= rtDW.Dtg_logic_RR) { /* Switch: '/Switch' incorporates: * Constant: '/Constant' */ i = 1; } else { /* Switch: '/Switch' incorporates: * Constant: '/Constant1' */ i = -1; } rtDW.Dtg_RR = (uint8_t)((double)EN_BATTChiller / (double)rtb_timer_out / 1000.0 * (double)(rtDW.t_now - rtDW.UnitDelay_DSTATE_a4) * (double) i + (double)rtDW.Dtg_RR); } /* End of Switch: '/Switch' */ /* MATLAB Function: '/incar filter up' incorporates: * DataStoreRead: '/Data Store Read1' */ incarfilterup_b(rtDW.LEVEL, &EN_BATTChiller); /* MATLAB Function: '/incar filter down' incorporates: * DataStoreRead: '/Data Store Read2' */ incarfilterdown_c(rtDW.LEVEL, &EN_BATTChiller); /* Sum: '/Add' incorporates: * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' */ rtb_timer_out = (uint8_t)(rtDW.Mode_RR - rtDW.Mode_logic_RR); /* RelationalOperator: '/Relational Operator' incorporates: * Constant: '/epsilon' */ eComp_stop = (rtb_timer_out <= 0.01); /* MATLAB Function: '/step' incorporates: * DataStoreRead: '/Data Store Read5' */ step_i3(rtDW.LEVEL, &EN_BATTChiller); /* MATLAB Function: '/time for step' incorporates: * DataStoreRead: '/Data Store Read5' */ timeforstep_m(rtDW.LEVEL, &rtb_timer_out); /* Switch: '/Switch' incorporates: * Constant: '/Constant' * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' * DataStoreRead: '/текущее время в мс' * DataStoreWrite: '/Data Store Write2' * Product: '/Product1' * Product: '/change rate (step//sec)' * Product: '/скорость в мс' * Product: '/шаг изменения' * RelationalOperator: '/Relational Operator' * Sum: '/Add' * Sum: '/Subtract' * Switch: '/Switch' * UnitDelay: '/Unit Delay' */ if (eComp_stop) { rtDW.Mode_RR = rtDW.Mode_logic_RR; } else { if (rtDW.Mode_RR <= rtDW.Mode_logic_RR) { /* Switch: '/Switch' incorporates: * Constant: '/Constant' */ i = 1; } else { /* Switch: '/Switch' incorporates: * Constant: '/Constant1' */ i = -1; } rtDW.Mode_RR = (uint8_t)((double)EN_BATTChiller / (double) rtb_timer_out / 1000.0 * (double)(rtDW.t_now - rtDW.UnitDelay_DSTATE_d) * (double)i + (double)rtDW.Mode_RR); } /* End of Switch: '/Switch' */ /* MATLAB Function: '/blower step' incorporates: * DataStoreRead: '/Data Store Read7' */ blowerstep_e(rtDW.LEVEL, &Gain); /* MATLAB Function: '/blower time for step' incorporates: * DataStoreRead: '/Data Store Read7' */ blowertimeforstep_o(rtDW.LEVEL, &Gain1); /* Switch: '/Switch' incorporates: * Constant: '/Constant' * Constant: '/epsilon' * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' * DataStoreRead: '/текущее время в мс' * DataStoreWrite: '/Data Store Write5' * Product: '/Product1' * Product: '/change rate (step//sec)' * Product: '/скорость в мс' * Product: '/шаг изменения' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator' * Sum: '/Add' * Sum: '/Add' * Sum: '/Subtract' * Switch: '/Switch' * UnitDelay: '/Unit Delay' */ if ((uint16_t)(rtDW.Blower_RR - rtDW.Blower_logic_RR) <= 0.01) { rtDW.Blower_RR = rtDW.Blower_logic_RR; } else { if (rtDW.Blower_RR <= rtDW.Blower_logic_RR) { /* Switch: '/Switch' incorporates: * Constant: '/Constant' */ i = 1; } else { /* Switch: '/Switch' incorporates: * Constant: '/Constant1' */ i = -1; } rtDW.Blower_RR = (uint16_t)((double)Gain / (double)Gain1 / 1000.0 * (double)(rtDW.t_now - rtDW.UnitDelay_DSTATE_l) * (double)i + (double) rtDW.Blower_RR); } /* End of Switch: '/Switch' */ /* RelationalOperator: '/Equal' incorporates: * DataStoreRead: '/current step' */ eComp_stop = (rtDW.step_start_controle_rear == 2); /* Sum: '/Subtract' incorporates: * DataStoreRead: '/Data Store Read4' * UnitDelay: '/t_start_delay_private ' */ rtb_Subtract = rtDW.t_now - rtDW.t_start_delay_private_DSTATE_pa; /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read4' * Logic: '/Logical Operator3' * Logic: '/Logical Operator4' * UnitDelay: '/Cond_prev_private ' * UnitDelay: '/t_start_delay_private ' */ if (eComp_stop && (!rtDW.Cond_prev_private_DSTATE_l2)) { rtDW.t_start_delay_private_DSTATE_pa = rtDW.t_now; } /* End of Switch: '/Switch' */ /* MATLAB Function: '/Time goto from step 1 to step 2 ' incorporates: * DataStoreRead: '/Data Store Read4' */ Timegotofromstep1tostep2_p(rtDW.LEVEL, &g_assEVA_TG_AMB_F_n); /* Switch: '/Switch' incorporates: * Gain: '/из сек в мс' * RelationalOperator: '/Relational Operator1' */ if (rtb_Subtract > (uint16_t)(1000 * g_assEVA_TG_AMB_F_n)) { /* Merge: '/Merge' incorporates: * Constant: '/go to next step' */ rtB.Merge_c = 3; } else { /* Merge: '/Merge' incorporates: * Constant: '/stay at step' */ rtB.Merge_c = 2; } /* End of Switch: '/Switch' */ /* Update for UnitDelay: '/Unit Delay' incorporates: * DataStoreRead: '/текущее время в мс' */ rtDW.UnitDelay_DSTATE_a4 = rtDW.t_now; /* Update for UnitDelay: '/Unit Delay' incorporates: * DataStoreRead: '/текущее время в мс' */ rtDW.UnitDelay_DSTATE_d = rtDW.t_now; /* Update for UnitDelay: '/Unit Delay' incorporates: * DataStoreRead: '/текущее время в мс' */ rtDW.UnitDelay_DSTATE_l = rtDW.t_now; /* Update for UnitDelay: '/Cond_prev_private ' */ rtDW.Cond_prev_private_DSTATE_l2 = eComp_stop; /* End of Outputs for SubSystem: '/Level 1' */ break; case 2: /* Outputs for IfAction SubSystem: '/Level 2' incorporates: * ActionPort: '/Action Port' */ /* MATLAB Function: '/2 way valve' incorporates: * DataStoreRead: '/Data Store Read6' */ uwayvalve(rtDW.LEVEL, &EN_BATTChiller); /* MATLAB Function: '/step' incorporates: * DataStoreRead: '/Data Store Read8' */ Dtg_rear(rtDW.LEVEL, &EN_BATTChiller); /* MATLAB Function: '/time for step' incorporates: * DataStoreRead: '/Data Store Read8' */ timeforstep_h(rtDW.LEVEL, &rtb_timer_out); /* Switch: '/Switch' incorporates: * Constant: '/Constant' * Constant: '/epsilon' * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' * DataStoreRead: '/текущее время в мс' * DataStoreWrite: '/Data Store Write10' * Product: '/Product1' * Product: '/change rate (dtg//sec)' * Product: '/скорость в мс' * Product: '/шаг изменения' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator' * Sum: '/Add' * Sum: '/Add' * Sum: '/Subtract' * Switch: '/Switch' * UnitDelay: '/Unit Delay' */ if ((uint8_t)(rtDW.Dtg_RR - rtDW.Dtg_logic_RR) <= 0.01) { rtDW.Dtg_RR = rtDW.Dtg_logic_RR; } else { if (rtDW.Dtg_RR <= rtDW.Dtg_logic_RR) { /* Switch: '/Switch' incorporates: * Constant: '/Constant' */ i = 1; } else { /* Switch: '/Switch' incorporates: * Constant: '/Constant1' */ i = -1; } rtDW.Dtg_RR = (uint8_t)((double)EN_BATTChiller / (double)rtb_timer_out / 1000.0 * (double)(rtDW.t_now - rtDW.UnitDelay_DSTATE_g) * (double) i + (double)rtDW.Dtg_RR); } /* End of Switch: '/Switch' */ /* MATLAB Function: '/incar filter up' incorporates: * DataStoreRead: '/Data Store Read1' */ incarfilterup_b(rtDW.LEVEL, &EN_BATTChiller); /* MATLAB Function: '/incar filter down' incorporates: * DataStoreRead: '/Data Store Read2' */ incarfilterdown_c(rtDW.LEVEL, &EN_BATTChiller); /* Sum: '/Add' incorporates: * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' */ rtb_timer_out = (uint8_t)(rtDW.Mode_RR - rtDW.Mode_logic_RR); /* RelationalOperator: '/Relational Operator' incorporates: * Constant: '/epsilon' */ eComp_stop = (rtb_timer_out <= 0.01); /* MATLAB Function: '/step' incorporates: * DataStoreRead: '/Data Store Read5' */ step_i3(rtDW.LEVEL, &EN_BATTChiller); /* MATLAB Function: '/time for step' incorporates: * DataStoreRead: '/Data Store Read5' */ timeforstep_m(rtDW.LEVEL, &rtb_timer_out); /* Switch: '/Switch' incorporates: * Constant: '/Constant' * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' * DataStoreRead: '/текущее время в мс' * DataStoreWrite: '/Data Store Write2' * Product: '/Product1' * Product: '/change rate (step//sec)' * Product: '/скорость в мс' * Product: '/шаг изменения' * RelationalOperator: '/Relational Operator' * Sum: '/Add' * Sum: '/Subtract' * Switch: '/Switch' * UnitDelay: '/Unit Delay' */ if (eComp_stop) { rtDW.Mode_RR = rtDW.Mode_logic_RR; } else { if (rtDW.Mode_RR <= rtDW.Mode_logic_RR) { /* Switch: '/Switch' incorporates: * Constant: '/Constant' */ i = 1; } else { /* Switch: '/Switch' incorporates: * Constant: '/Constant1' */ i = -1; } rtDW.Mode_RR = (uint8_t)((double)EN_BATTChiller / (double) rtb_timer_out / 1000.0 * (double)(rtDW.t_now - rtDW.UnitDelay_DSTATE_h) * (double)i + (double)rtDW.Mode_RR); } /* End of Switch: '/Switch' */ /* MATLAB Function: '/blower step' incorporates: * DataStoreRead: '/Data Store Read7' */ blowerstep_e(rtDW.LEVEL, &Gain); /* MATLAB Function: '/blower time for step' incorporates: * DataStoreRead: '/Data Store Read7' */ blowertimeforstep_o(rtDW.LEVEL, &Gain1); /* Switch: '/Switch' incorporates: * Constant: '/Constant' * Constant: '/epsilon' * DataStoreRead: '/Текущее значение blower ' * DataStoreRead: '/значение auto (в соответствии с логикой)' * DataStoreRead: '/текущее время в мс' * DataStoreWrite: '/Data Store Write5' * Product: '/Product1' * Product: '/change rate (step//sec)' * Product: '/скорость в мс' * Product: '/шаг изменения' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator' * Sum: '/Add' * Sum: '/Add' * Sum: '/Subtract' * Switch: '/Switch' * UnitDelay: '/Unit Delay' */ if ((uint16_t)(rtDW.Blower_RR - rtDW.Blower_logic_RR) <= 0.01) { rtDW.Blower_RR = rtDW.Blower_logic_RR; } else { if (rtDW.Blower_RR <= rtDW.Blower_logic_RR) { /* Switch: '/Switch' incorporates: * Constant: '/Constant' */ i = 1; } else { /* Switch: '/Switch' incorporates: * Constant: '/Constant1' */ i = -1; } rtDW.Blower_RR = (uint16_t)((double)Gain / (double)Gain1 / 1000.0 * (double)(rtDW.t_now - rtDW.UnitDelay_DSTATE_f) * (double)i + (double) rtDW.Blower_RR); } /* End of Switch: '/Switch' */ /* RelationalOperator: '/Equal' incorporates: * DataStoreRead: '/current step' */ eComp_stop = (rtDW.step_start_controle_rear == 2); /* Sum: '/Subtract' incorporates: * DataStoreRead: '/Data Store Read4' * UnitDelay: '/t_start_delay_private ' */ rtb_Subtract = rtDW.t_now - rtDW.t_start_delay_private_DSTATE_kh; /* MATLAB Function: '/Time goto from step 1 to step 2 ' incorporates: * DataStoreRead: '/Data Store Read4' */ Timegotofromstep1tostep2_p(rtDW.LEVEL, &g_assEVA_TG_AMB_F_n); /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read4' * Logic: '/Logical Operator3' * Logic: '/Logical Operator4' * UnitDelay: '/Cond_prev_private ' * UnitDelay: '/t_start_delay_private ' */ if (eComp_stop && (!rtDW.Cond_prev_private_DSTATE_eo)) { rtDW.t_start_delay_private_DSTATE_kh = rtDW.t_now; } /* End of Switch: '/Switch' */ /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read' * Gain: '/из сек в мс' * Logic: '/Logical Operator' * RelationalOperator: '/Relational Operator1' */ if ((rtb_Subtract > (uint16_t)(1000 * g_assEVA_TG_AMB_F_n)) || rtDW.HI_logic_on) { /* Merge: '/Merge' incorporates: * Constant: '/go to next step' */ rtB.Merge_c = 3; } else { /* Merge: '/Merge' incorporates: * Constant: '/stay at step' */ rtB.Merge_c = 2; } /* End of Switch: '/Switch' */ /* Update for UnitDelay: '/Unit Delay' incorporates: * DataStoreRead: '/текущее время в мс' */ rtDW.UnitDelay_DSTATE_g = rtDW.t_now; /* Update for UnitDelay: '/Unit Delay' incorporates: * DataStoreRead: '/текущее время в мс' */ rtDW.UnitDelay_DSTATE_h = rtDW.t_now; /* Update for UnitDelay: '/Unit Delay' incorporates: * DataStoreRead: '/текущее время в мс' */ rtDW.UnitDelay_DSTATE_f = rtDW.t_now; /* Update for UnitDelay: '/Cond_prev_private ' */ rtDW.Cond_prev_private_DSTATE_eo = eComp_stop; /* End of Outputs for SubSystem: '/Level 2' */ break; case 3: /* Outputs for IfAction SubSystem: '/Level 3' incorporates: * ActionPort: '/Action Port' */ Level3_j(&rtB.Merge_c, &Gain, &rtDW.Blower_RR, &rtDW.Blower_logic_RR, &Comp_Max_RPM_Allowed, &rtDW.Dtg_RR, &rtDW.Dtg_logic_RR, &rtDW.HI_logic_on, &rtb_timer_out, &EN_BATTChiller, &rtDW.LEVEL, &rtb_Switch3_ed, &rtDW.Mode_RR, &rtDW.Mode_logic_RR, &Blower_AF_FL, &Valve_2_way, &rtDW.step_start_controle_rear, &rtDW.t_now, &rtDW.Level3_jn); /* End of Outputs for SubSystem: '/Level 3' */ break; case 4: /* Outputs for IfAction SubSystem: '/Level 4' incorporates: * ActionPort: '/Action Port' */ Level3_j(&rtB.Merge_c, &Gain, &rtDW.Blower_RR, &rtDW.Blower_logic_RR, &Comp_Max_RPM_Allowed, &rtDW.Dtg_RR, &rtDW.Dtg_logic_RR, &rtDW.HI_logic_on, &rtb_timer_out, &EN_BATTChiller, &rtDW.LEVEL, &rtb_Switch3_ed, &rtDW.Mode_RR, &rtDW.Mode_logic_RR, &Blower_AF_FL, &Valve_2_way, &rtDW.step_start_controle_rear, &rtDW.t_now, &rtDW.Level4_d); /* End of Outputs for SubSystem: '/Level 4' */ break; case 5: /* Outputs for IfAction SubSystem: '/Level 5' incorporates: * ActionPort: '/Action Port' */ Level3_j(&rtB.Merge_c, &Gain, &rtDW.Blower_RR, &rtDW.Blower_logic_RR, &Comp_Max_RPM_Allowed, &rtDW.Dtg_RR, &rtDW.Dtg_logic_RR, &rtDW.HI_logic_on, &rtb_timer_out, &EN_BATTChiller, &rtDW.LEVEL, &rtb_Switch3_ed, &rtDW.Mode_RR, &rtDW.Mode_logic_RR, &Blower_AF_FL, &Valve_2_way, &rtDW.step_start_controle_rear, &rtDW.t_now, &rtDW.Level5_cf); /* End of Outputs for SubSystem: '/Level 5' */ break; } /* End of SwitchCase: '/Switch Case' */ /* End of Outputs for SubSystem: '/Step 2 R' */ break; case 3: /* Outputs for IfAction SubSystem: '/Step 3 R' incorporates: * ActionPort: '/Action Port' */ /* DataStoreWrite: '/Data Store Write10' incorporates: * Constant: '/True' */ rtDW.start_control_finished_front = 1; /* Merge: '/Merge' incorporates: * Constant: '/Constant1' * SignalConversion generated from: '/step' */ rtB.Merge_c = 4; /* End of Outputs for SubSystem: '/Step 3 R' */ break; } /* End of SwitchCase: '/Switch Case' */ /* DataStoreWrite: '/Data Store Write' */ rtDW.step_start_controle_rear = rtB.Merge_c; /* End of Outputs for SubSystem: '/Start Control Rear' */ } /* End of If: '/если SC rear не завершен1' */ /* If: '/If' incorporates: * DataStoreRead: '/Data Store Read1' */ if (rtDW.CCU_ALL_ZONE_SYNC > 0) { /* Outputs for IfAction SubSystem: '/all zone sync' incorporates: * ActionPort: '/Action Port' */ /* DataTypeConversion: '/Data Type Conversion1' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write' */ rtDW.CCU_SET_FR = rtDW.CCU_SET_FL; /* DataTypeConversion: '/Data Type Conversion1' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write1' */ rtDW.CCU_SET_RL = rtDW.CCU_SET_FL; /* DataTypeConversion: '/Data Type Conversion1' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write2' */ rtDW.CCU_SET_RR = rtDW.CCU_SET_FL; /* DataStoreWrite: '/Data Store Write3' incorporates: * DataStoreRead: '/Data Store Read1' */ rtDW.CCU_BLOWERS_FR = rtDW.CCU_BLOWERS_FL; /* DataStoreWrite: '/Data Store Write4' incorporates: * DataStoreRead: '/Data Store Read1' */ rtDW.CCU_BLOWERS_RL = rtDW.CCU_BLOWERS_FL; /* DataStoreWrite: '/Data Store Write5' incorporates: * DataStoreRead: '/Data Store Read1' */ rtDW.CCU_BLOWERS_RR = rtDW.CCU_BLOWERS_FL; /* DataStoreWrite: '/Data Store Write6' incorporates: * DataStoreRead: '/Data Store Read2' */ rtDW.CCU_DEF_FR = rtDW.CCU_DEF_FL; /* DataStoreWrite: '/Data Store Write10' incorporates: * DataStoreRead: '/Data Store Read3' */ rtDW.CCU_FACE_RL = rtDW.CCU_FACE_FL; /* DataStoreWrite: '/Data Store Write11' incorporates: * DataStoreRead: '/Data Store Read3' */ rtDW.CCU_FACE_RR = rtDW.CCU_FACE_FL; /* DataStoreWrite: '/Data Store Write9' incorporates: * DataStoreRead: '/Data Store Read3' */ rtDW.CCU_FACE_FR = rtDW.CCU_FACE_FL; /* DataStoreWrite: '/Data Store Write12' incorporates: * DataStoreRead: '/Data Store Read4' */ rtDW.CCU_FOOT_FR = rtDW.CCU_FOOT_FL; /* DataStoreWrite: '/Data Store Write13' incorporates: * DataStoreRead: '/Data Store Read4' */ rtDW.CCU_FOOT_RL = rtDW.CCU_FOOT_FL; /* DataStoreWrite: '/Data Store Write14' incorporates: * DataStoreRead: '/Data Store Read4' */ rtDW.CCU_FOOT_RR = rtDW.CCU_FOOT_FL; /* DataStoreWrite: '/Data Store Write15' incorporates: * DataStoreRead: '/Data Store Read5' */ rtDW.CCU_MODE_RR = rtDW.CCU_MODE_FL; /* DataStoreWrite: '/Data Store Write7' incorporates: * DataStoreRead: '/Data Store Read5' */ rtDW.CCU_MODE_FR = rtDW.CCU_MODE_FL; /* DataStoreWrite: '/Data Store Write8' incorporates: * DataStoreRead: '/Data Store Read5' */ rtDW.CCU_MODE_RL = rtDW.CCU_MODE_FL; /* DataStoreWrite: '/Data Store Write16' incorporates: * DataStoreRead: '/Data Store Read6' */ rtDW.CCU_AUTOMODE_FR = rtDW.CCU_AUTOMODE_FL; /* DataStoreWrite: '/Data Store Write17' incorporates: * DataStoreRead: '/Data Store Read6' */ rtDW.CCU_AUTOMODE_RL = rtDW.CCU_AUTOMODE_FL; /* DataStoreWrite: '/Data Store Write18' incorporates: * DataStoreRead: '/Data Store Read6' */ rtDW.CCU_AUTOMODE_RR = rtDW.CCU_AUTOMODE_FL; /* DataStoreWrite: '/Data Store Write19' incorporates: * DataStoreRead: '/Data Store Read7' */ rtDW.CCU_AC_REAR = rtDW.CCU_AC_FRONT; /* End of Outputs for SubSystem: '/all zone sync' */ } /* End of If: '/If' */ /* If: '/If1' incorporates: * DataStoreRead: '/Data Store Read2' */ if (rtDW.CCU_FRONT_SYNC > 0) { /* Outputs for IfAction SubSystem: '/front sync' incorporates: * ActionPort: '/Action Port' */ /* DataTypeConversion: '/Data Type Conversion1' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write' */ rtDW.CCU_SET_FR = rtDW.CCU_SET_FL; /* DataStoreWrite: '/Data Store Write3' incorporates: * DataStoreRead: '/Data Store Read1' */ rtDW.CCU_BLOWERS_FR = rtDW.CCU_BLOWERS_FL; /* DataStoreWrite: '/Data Store Write6' incorporates: * DataStoreRead: '/Data Store Read2' */ rtDW.CCU_DEF_FR = rtDW.CCU_DEF_FL; /* DataStoreWrite: '/Data Store Write9' incorporates: * DataStoreRead: '/Data Store Read3' */ rtDW.CCU_FACE_FR = rtDW.CCU_FACE_FL; /* DataStoreWrite: '/Data Store Write12' incorporates: * DataStoreRead: '/Data Store Read4' */ rtDW.CCU_FOOT_FR = rtDW.CCU_FOOT_FL; /* DataStoreWrite: '/Data Store Write7' incorporates: * DataStoreRead: '/Data Store Read5' */ rtDW.CCU_MODE_FR = rtDW.CCU_MODE_FL; /* DataStoreWrite: '/Data Store Write16' incorporates: * DataStoreRead: '/Data Store Read6' */ rtDW.CCU_AUTOMODE_FR = rtDW.CCU_AUTOMODE_FL; /* End of Outputs for SubSystem: '/front sync' */ } /* End of If: '/If1' */ /* If: '/If2' incorporates: * DataStoreRead: '/Data Store Read3' */ if (rtDW.CCU_REAR_SYNC > 0) { /* Outputs for IfAction SubSystem: '/rear sync' incorporates: * ActionPort: '/Action Port' */ /* DataTypeConversion: '/Data Type Conversion1' incorporates: * DataStoreRead: '/Data Store Read' * DataStoreWrite: '/Data Store Write2' */ rtDW.CCU_SET_RL = rtDW.CCU_SET_RR; /* DataStoreWrite: '/Data Store Write4' incorporates: * DataStoreRead: '/Data Store Read1' */ rtDW.CCU_BLOWERS_RL = rtDW.CCU_BLOWERS_RR; /* DataStoreWrite: '/Data Store Write17' incorporates: * DataStoreRead: '/Data Store Read2' */ rtDW.CCU_AUTOMODE_RL = rtDW.CCU_AUTOMODE_RR; /* DataStoreWrite: '/Data Store Write10' incorporates: * DataStoreRead: '/Data Store Read3' */ rtDW.CCU_FACE_RL = rtDW.CCU_FACE_RR; /* DataStoreWrite: '/Data Store Write13' incorporates: * DataStoreRead: '/Data Store Read4' */ rtDW.CCU_FOOT_RL = rtDW.CCU_FOOT_RR; /* DataStoreWrite: '/Data Store Write15' incorporates: * DataStoreRead: '/Data Store Read5' */ rtDW.CCU_MODE_RL = rtDW.CCU_MODE_RR; /* End of Outputs for SubSystem: '/rear sync' */ } /* End of If: '/If2' */ /* Update for DiscreteIntegrator: '/Integrator' incorporates: * Switch: '/Switch' */ if ((rtDW.Integrator_DSTATE_l < 0) && (rtb_Switch_fs < INT32_MIN - rtDW.Integrator_DSTATE_l)) { rtDW.Integrator_DSTATE_l = INT32_MIN; } else if ((rtDW.Integrator_DSTATE_l > 0) && (rtb_Switch_fs > INT32_MAX - rtDW.Integrator_DSTATE_l)) { rtDW.Integrator_DSTATE_l = INT32_MAX; } else { rtDW.Integrator_DSTATE_l += rtb_Switch_fs; } rtDW.Integrator_PrevResetState = (int8_t)Enable_Comp_PID; /* End of Update for DiscreteIntegrator: '/Integrator' */ /* Update for UnitDelay: '/Unit Delay' incorporates: * DataStoreWrite: '/Data Store Write4' */ rtDW.UnitDelay_DSTATE_lk = 0; /* Update for UnitDelay: '/Unit Delay1' incorporates: * DataStoreRead: '/Data Store Read7' */ rtDW.UnitDelay1_DSTATE = rtDW.Duct_RR_Tg; /* Update for UnitDelay: '/Cond_prev_private ' */ rtDW.Cond_prev_private_DSTATE = rtb_FailCond_fn; /* Update for UnitDelay: '/Cond_prev_private ' */ rtDW.Cond_prev_private_DSTATE_p = rtb_FailCond_gk; /* Update for UnitDelay: '/Cond_prev_private ' */ rtDW.Cond_prev_private_DSTATE_a = rtb_FailCond; /* Update for UnitDelay: '/Cond_prev_private ' */ rtDW.Cond_prev_private_DSTATE_h = rtb_Compare_ah; /* Update for UnitDelay: '/Cond_prev_private ' */ rtDW.Cond_prev_private_DSTATE_c = rtb_Compare; /* Update for UnitDelay: '/Cond_prev_private ' */ rtDW.Cond_prev_private_DSTATE_m = rtb_Compare_eu; /* Update for UnitDelay: '/Cond_prev_private ' */ rtDW.Cond_prev_private_DSTATE_j = rtb_Compare_e3; /* Update for UnitDelay: '/Cond_prev_private ' */ rtDW.Cond_prev_private_DSTATE_f = rtb_Compare_fr; /* Update for UnitDelay: '/Cond_prev_private ' */ rtDW.Cond_prev_private_DSTATE_cn = rtb_Compare_b; /* Update for UnitDelay: '/Cond_prev_private ' */ rtDW.Cond_prev_private_DSTATE_l = rtb_Compare_au; /* Update for UnitDelay: '/Cond_prev_private ' */ rtDW.Cond_prev_private_DSTATE_ja = rtb_Compare_gl; /* Update for UnitDelay: '/Cond_prev_private ' */ rtDW.Cond_prev_private_DSTATE_g = rtb_Compare_m; /* Update for UnitDelay: '/Cond_prev_private ' */ rtDW.Cond_prev_private_DSTATE_cd = rtb_Compare_i; /* Update for UnitDelay: '/Cond_prev_private ' */ rtDW.Cond_prev_private_DSTATE_e = rtb_LogicalOperator5; /* Update for UnitDelay: '/Cond_prev_private ' */ rtDW.Cond_prev_private_DSTATE_mv = rtb_FailCond_lt; /* Update for UnitDelay: '/Cond_prev_private ' */ rtDW.Cond_prev_private_DSTATE_jl = rtb_Compare_dq; /* Update for UnitDelay: '/Cond_prev_private ' */ rtDW.Cond_prev_private_DSTATE_ei = rtb_FailCond_h; /* Update for UnitDelay: '/Unit Delay' incorporates: * DataStoreWrite: '/Data Store Write1' */ rtDW.UnitDelay_DSTATE_da = rtDW.Incar_FL; /* Update for UnitDelay: '/Unit Delay1' incorporates: * DataStoreWrite: '/Data Store Write3' */ rtDW.UnitDelay1_DSTATE_k = rtDW.Incar_FR; /* Update for UnitDelay: '/Unit Delay' incorporates: * DataStoreWrite: '/Data Store Write4' */ rtDW.UnitDelay_DSTATE_my = rtDW.Incar_RL; /* Update for UnitDelay: '/Unit Delay' incorporates: * DataStoreWrite: '/Data Store Write5' */ rtDW.UnitDelay_DSTATE_lt = rtDW.Incar_RR; /* Update for UnitDelay: '/Delay Input1' * * Block description for '/Delay Input1': * * Store in Global RAM */ rtDW.DelayInput1_DSTATE = rtb_Compare_p1p; /* Update for UnitDelay: '/Unit Delay' incorporates: * DataStoreWrite: '/Data Store Write' */ rtDW.UnitDelay_DSTATE_d5 = rtb_Bias5; /* Update for DiscreteIntegrator: '/Integrator' incorporates: * DataStoreWrite: '/Data Store Write' * Gain: '/Integral Gain' * Gain: '/Gain' * Sum: '/SumI2' * Sum: '/SumI4' * Sum: '/SumI2' */ rtDW.Integrator_DSTATE += (int64_t)((rtDW.PID_TempFUL - (int32_t)(rtb_SumI2_e >> 32)) + (int32_t)((1717986918LL * rtb_Gain_pl) >> 52)) << 32; /* Update for DiscreteIntegrator: '/Integrator' incorporates: * DataStoreWrite: '/Data Store Write1' * Gain: '/Integral Gain' * Gain: '/Gain1' * Sum: '/SumI2' * Sum: '/SumI4' * Sum: '/SumI2' */ rtDW.Integrator_DSTATE_k += (int64_t)((rtDW.PID_TempFUR - (int32_t) (rtb_SumI2_je >> 32)) + (int32_t)((1717986918LL * rpm_phys) >> 52)) << 32; /* Update for DiscreteIntegrator: '/Integrator' incorporates: * DataStoreWrite: '/Data Store Write4' * Gain: '/Integral Gain' * Gain: '/Gain4' * Sum: '/SumI2' * Sum: '/SumI4' * Sum: '/SumI2' */ rtDW.Integrator_DSTATE_h += (int64_t)((rtDW.PID_TempFLL - (int32_t) (rtb_SumI2_b >> 32)) + (int32_t)((1717986918LL * rtb_Gain4) >> 52)) << 32; /* Update for DiscreteIntegrator: '/Integrator' incorporates: * DataStoreWrite: '/Data Store Write5' * Gain: '/Integral Gain' * Gain: '/Gain5' * Sum: '/SumI2' * Sum: '/SumI2' * Sum: '/SumI4' */ rtDW.Integrator_DSTATE_i += (int64_t)((rtDW.PID_TempFRL - (int32_t) (rtb_SumI2_c >> 32)) + (int32_t)((1717986918LL * rtb_Gain5) >> 52)) << 32; /* Update for DiscreteIntegrator: '/Integrator' incorporates: * DataStoreWrite: '/Data Store Write2' * Gain: '/Integral Gain' * Gain: '/Gain2' * Sum: '/SumI2' * Sum: '/SumI4' * Sum: '/SumI2' */ rtDW.Integrator_DSTATE_n += (int64_t)((rtDW.PID_TempRL - (int32_t)(rtb_SumI2_o >> 32)) + (int32_t)((1717986918LL * rtb_Gain2) >> 52)) << 32; /* Update for DiscreteIntegrator: '/Integrator' incorporates: * DataStoreWrite: '/Data Store Write3' * Gain: '/Integral Gain' * Gain: '/Gain3' * Sum: '/SumI2' * Sum: '/SumI4' */ rtDW.Integrator_DSTATE_a += (int64_t)((rtDW.PID_TempRR - (int32_t) (rtb_IntegralGain >> 32)) + (int32_t)((1717986918LL * rtb_Gain3) >> 52)) << 32; } /* Model initialize function */ void HVAC_model_initialize(void) { /* Registration code */ /* initialize error status */ rtmSetErrorStatus(rtM, (NULL)); /* block I/O */ (void) memset(((void *) &rtB), 0, sizeof(B)); /* states (dwork) */ (void) memset((void *)&rtDW, 0, sizeof(DW)); /* exported global states */ Actuator_Ch0_Command_Model = HVAC_model_rtZActuatorCmdBus; Actuator_Ch1_Command_Model = HVAC_model_rtZActuatorCmdBus; Actuator_Ch2_Command_Model = HVAC_model_rtZActuatorCmdBus; Actuator_Ch0_Status_Model = HVAC_model_rtZActuatorCmdBusInput; Actuator_Ch1_Status_Model = HVAC_model_rtZActuatorCmdBusInput; Actuator_Ch2_Status_Model = HVAC_model_rtZActuatorCmdBusInput; Status_Sensor_Model = HVAC_model_rtZCmdBusStatus; CCU_Errors_Model = HVAC_model_rtZCmdBusError; PWM_Get = HVAC_model_rtZCmdBusPWMGet; { int32_t i; /* Start for DataStoreMemory: '/Data Store Memory' */ rtDW.Temp_FL_store = -9999; /* Start for DataStoreMemory: '/Data Store Memory10' */ rtDW.Temp_RR_store = -9999; /* Start for DataStoreMemory: '/Data Store Memory4' */ rtDW.Temp_FR_store = -9999; /* Start for DataStoreMemory: '/Data Store Memory6' */ rtDW.Temp_RL_store = -9999; /* Start for Switch: '/Switch1' incorporates: * DataStoreMemory: '/Data Store Memory' */ rtDW.AMB_store = -9999.0; for (i = 0; i < 9; i++) { /* Start for DataStoreMemory: '/Data Store Memory1' */ rtDW.ErrorCalibration_private[i] = 1U; /* Start for DataStoreMemory: '/Data Store Memory13' */ rtDW.MaxPositionCh0_private[i] = rtConstP.DataStoreMemory13_InitialValue[i]; /* Start for DataStoreMemory: '/Data Store Memory1' */ rtDW.ErrorCalibration_private_p[i] = 1U; /* Start for DataStoreMemory: '/Data Store Memory13' */ rtDW.MaxPositionCh1_private[i] = rtConstP.DataStoreMemory13_InitialValue_i[i]; /* Start for DataStoreMemory: '/Data Store Memory1' */ rtDW.ErrorCalibration_private_b[i] = 1U; /* Start for DataStoreMemory: '/Data Store Memory13' */ rtDW.MaxPositionCh2_private[i] = rtConstP.DataStoreMemory13_InitialValue_l[i]; } /* Start for DataStoreMemory: '/Data Store Memory110' */ rtDW.CCU_FACE_RL = 1U; /* Start for DataStoreMemory: '/Data Store Memory113' */ rtDW.CCU_AUTOMODE_RL = 3U; /* Start for DataStoreMemory: '/Data Store Memory116' */ rtDW.CCU_FACE_RR = 1U; /* Start for DataStoreMemory: '/Data Store Memory119' */ rtDW.CCU_AUTOMODE_RR = 3U; /* Start for DataTypeConversion: '/Data Type Conversion1' incorporates: * DataStoreMemory: '/Data Store Memory14' */ rtDW.CCU_SET_FR = 230U; /* Start for DataTypeConversion: '/Data Type Conversion1' incorporates: * DataStoreMemory: '/Data Store Memory15' */ rtDW.CCU_SET_FL = 230U; /* Start for DataTypeConversion: '/Data Type Conversion1' incorporates: * DataStoreMemory: '/Data Store Memory16' */ rtDW.CCU_SET_RR = 230U; /* Start for DataStoreMemory: '/Data Store Memory160' */ rtDW.SW5V_EN = 1U; /* Start for DataStoreMemory: '/Data Store Memory161' */ rtDW.PBATT_CK_EN = 1U; /* Start for DataStoreMemory: '/Data Store Memory165' */ rtDW.ReservePower_EN = 1U; /* Start for DataStoreMemory: '/Data Store Memory166' */ rtDW.PtcRelayDriver1_EN = 1U; /* Start for DataStoreMemory: '/Data Store Memory167' */ rtDW.PtcRelayDriver2_EN = 1U; /* Start for DataTypeConversion: '/Data Type Conversion1' incorporates: * DataStoreMemory: '/Data Store Memory17' */ rtDW.CCU_SET_RL = 230U; /* Start for DataStoreMemory: '/Data Store Memory170' */ rtDW.EN_ReservePower = 1U; /* Start for DataStoreMemory: '/Data Store Memory171' */ rtDW.LIN_ActPower_AB = 1U; /* Start for DataStoreMemory: '/Data Store Memory172' */ rtDW.LIN_ActPower_C = 1U; /* Start for DataStoreMemory: '/Data Store Memory173' */ rtDW.ShutOffTXV1_EN = 1U; /* Start for DataStoreMemory: '/Data Store Memory174' */ rtDW.ShutOffTXV2_EN = 1U; /* Start for DataStoreMemory: '/Data Store Memory176' */ rtDW.EN_PowerReserve = 1U; /* Start for DataStoreMemory: '/Data Store Memory231' */ rtDW.step_start_controle_front = -1; /* Start for DataStoreMemory: '/Data Store Memory232' */ rtDW.step_start_controle_rear = -1; /* Start for DataStoreMemory: '/Data Store Memory42' */ rtDW.ADC_Data_Model = rtConstP.DataStoreMemory42_InitialValue; /* Start for DataStoreMemory: '/Data Store Memory5' */ rtDW.t_now = 10U; /* Start for DataStoreMemory: '/Data Store Memory85' */ rtDW.CCU_FACE_FL = 1U; /* Start for DataStoreMemory: '/Data Store Memory86' */ rtDW.CCU_FOOT_FL = 1U; /* Start for DataStoreMemory: '/Data Store Memory89' */ rtDW.CCU_FACE_FR = 1U; /* Start for DataStoreMemory: '/Data Store Memory90' */ rtDW.CCU_FOOT_FR = 1U; /* Start for DataStoreMemory: '/Data Store Memory93' */ rtDW.CCU_AUTOMODE_FR = 3U; /* Start for DataStoreMemory: '/Data Store Memory94' */ rtDW.CCU_AUTOMODE_FL = 3U; /* InitializeConditions for DiscreteIntegrator: '/Integrator' */ rtDW.Integrator_PrevResetState = 0; /* InitializeConditions for RateLimiter: '/Rate Limiter' */ rtDW.PrevY = 0U; /* InitializeConditions for UnitDelay: '/Unit Delay' */ rtDW.UnitDelay_DSTATE_lk = -9999; /* InitializeConditions for UnitDelay: '/Unit Delay1' */ rtDW.UnitDelay1_DSTATE = -9999; /* InitializeConditions for UnitDelay: '/Unit Delay' */ rtDW.UnitDelay_DSTATE_da = -9999; /* InitializeConditions for UnitDelay: '/Unit Delay1' */ rtDW.UnitDelay1_DSTATE_k = -9999; /* InitializeConditions for UnitDelay: '/Unit Delay' */ rtDW.UnitDelay_DSTATE_my = -9999; /* InitializeConditions for UnitDelay: '/Unit Delay' */ rtDW.UnitDelay_DSTATE_lt = -9999; /* InitializeConditions for UnitDelay: '/Unit Delay' */ rtDW.UnitDelay_DSTATE_d5 = -9999; /* SystemInitialize for Chart: '/A//C Control' */ rtB.FRONT_eTXV = false; rtB.REAR_eTXV = false; rtB.Chiller_eTXV = false; rtDW.Pressure_Condition_table_OK = false; rtDW.Chiller_Start_request = false; rtDW.Pressure_Hi_Fault = false; rtB.Comp_Feedback_Temp = 0; rtB.Comp_Target_Temp = 0; rtB.Chiller_Only_Flag = 0.0; rtDW.FRONT_Start_request = false; rtDW.REAR_Start_request = false; rtB.Eva_Ctrl = 0U; rtDW.is_active_c621_HVAC_model = 0U; rtDW.is_PRESSURE_MONITOR = IN_NO_ACTIVE_CHILD_o; rtDW.is_FRONT_CONTOUR = IN_NO_ACTIVE_CHILD_o; rtDW.is_REAR_CONTOUR = IN_NO_ACTIVE_CHILD_o; rtDW.is_CHILLER_CONTOUR = IN_NO_ACTIVE_CHILD_o; rtDW.is_E_COMP_MANAGER = IN_NO_ACTIVE_CHILD_o; rtDW.is_COMP_PROTECTION = IN_NO_ACTIVE_CHILD_o; /* SystemInitialize for MATLAB Function: '/MATLAB Function1' */ rtDW.t_start_not_empty = false; rtDW.is_running = 0U; /* SystemInitialize for Chart: '/13,1,3,15 Valve control' */ rtDW.t_start_1 = 0U; rtB.Cmd_3Way = 0U; rtDW.t_start_2 = 0U; rtDW.t_start_3 = 0U; rtDW.t_start_4 = 0U; rtDW.Cmd_RearTemp_3W = 0.0; rtB.Cmd_2Way = 0U; rtDW.Cmd_RearTemp_2W = 0.0; rtDW.is_active_c775_HVAC_model = 0U; rtDW.is_ThreeWay_Logic = IN_NO_ACTIVE_CHILD_o; rtDW.is_TwoWay_Logic = IN_NO_ACTIVE_CHILD_o; /* SystemInitialize for Chart: '/Synchronization stateflow chart' */ rtDW.is_active_c618_HVAC_model = 0U; rtDW.is_c618_HVAC_model = IN_NO_ACTIVE_CHILD_o; /* SystemInitialize for Merge: '/Merge' */ rtB.Merge_b = 0U; /* SystemInitialize for MATLAB Function: '/Log Ambient Lv' */ rtDW.current_Ambient_Lv_not_empty = false; /* SystemInitialize for Chart: '/Spd_OSA_Trigger' */ rtDW.is_active_c834_HVAC_model = 0U; rtDW.is_c834_HVAC_model = IN_NO_ACTIVE_CHILD_o; /* SystemInitialize for Chart: '/Chart' */ rtB.req_OSA = 0U; rtB.req_REC = 0U; rtDW.X_prev = 0; rtDW.is_active_c776_HVAC_model = 0U; rtDW.is_c776_HVAC_model = IN_NO_ACTIVE_CHILD_o; rtDW.is_PARTIAL_REC_ON = IN_NO_ACTIVE_CHILD_o; rtDW.is_COND_2 = IN_NO_ACTIVE_CHILD_o; /* SystemInitialize for Chart: '/Zone_Climate_Logic_Auto_FL2' */ Zone_Climate_Logic_Auto_FL2_Init(&rtB.out_def_a, &rtB.out_face_p, &rtB.out_foot_e, &rtB.out_auto_c, &rtB.out_ac_h, &rtDW.sf_Zone_Climate_Logic_Auto_FL2); /* SystemInitialize for Chart: '/Zone_Climate_Logic_Auto_FL3' */ Zone_Climate_Logic_Auto_FL2_Init(&rtB.out_def_m, &rtB.out_face_a, &rtB.out_foot_m, &rtB.out_auto_d, &rtB.out_ac_i, &rtDW.sf_Zone_Climate_Logic_Auto_FL3); /* SystemInitialize for Chart: '/Zone_Climate_Logic_Auto_FL1' */ Zone_Climate_Logic_Auto_FL1_Init(&rtB.out_def_i, &rtB.out_face_o, &rtB.out_foot_g, &rtB.out_auto_h, &rtB.out_ac_m, &rtDW.sf_Zone_Climate_Logic_Auto_FL1); /* SystemInitialize for Chart: '/Zone_Climate_Logic_Auto_FL4' */ Zone_Climate_Logic_Auto_FL1_Init(&rtB.out_def, &rtB.out_face, &rtB.out_foot, &rtB.out_auto, &rtB.out_ac, &rtDW.sf_Zone_Climate_Logic_Auto_FL4); /* SystemInitialize for Chart: '/Full_Rec_Active' */ rtDW.is_active_c836_HVAC_model = 0U; rtDW.is_c836_HVAC_model = IN_NO_ACTIVE_CHILD_o; /* SystemInitialize for IfAction SubSystem: '/Homing' */ /* SystemInitialize for IfAction SubSystem: '/Switch Case Action Subsystem3' */ /* SystemInitialize for IfAction SubSystem: '/If Action Subsystem' */ /* Start for DataStoreMemory: '/Data Store Memory' */ rtDW.Start_timer_n = 1.0; /* SystemInitialize for MATLAB Function: '/MATLAB Function' */ MATLABFunction_Init(&rtDW.sf_MATLABFunction_h); /* End of SystemInitialize for SubSystem: '/If Action Subsystem' */ /* End of SystemInitialize for SubSystem: '/Switch Case Action Subsystem3' */ /* SystemInitialize for Merge: '/Merge' */ rtB.Merge_ac = 0; /* End of SystemInitialize for SubSystem: '/Homing' */ /* SystemInitialize for Merge: '/Merge' */ rtB.Merge_f1 = 0; /* SystemInitialize for IfAction SubSystem: '/Homing' */ /* SystemInitialize for IfAction SubSystem: '/Switch Case Action Subsystem3' */ /* SystemInitialize for IfAction SubSystem: '/If Action Subsystem' */ /* Start for DataStoreMemory: '/Data Store Memory' */ rtDW.Start_timer_j = 1.0; /* SystemInitialize for MATLAB Function: '/MATLAB Function' */ MATLABFunction_Init(&rtDW.sf_MATLABFunction_hk); /* End of SystemInitialize for SubSystem: '/If Action Subsystem' */ /* End of SystemInitialize for SubSystem: '/Switch Case Action Subsystem3' */ /* SystemInitialize for Merge: '/Merge' */ rtB.Merge_p = 0; /* End of SystemInitialize for SubSystem: '/Homing' */ /* SystemInitialize for Merge: '/Merge' */ rtB.Merge_e = 0; /* SystemInitialize for IfAction SubSystem: '/Homing' */ /* SystemInitialize for IfAction SubSystem: '/Switch Case Action Subsystem3' */ /* SystemInitialize for IfAction SubSystem: '/If Action Subsystem' */ /* Start for DataStoreMemory: '/Data Store Memory' */ rtDW.Start_timer = 1.0; /* SystemInitialize for MATLAB Function: '/MATLAB Function' */ MATLABFunction_Init(&rtDW.sf_MATLABFunction_g); /* End of SystemInitialize for SubSystem: '/If Action Subsystem' */ /* End of SystemInitialize for SubSystem: '/Switch Case Action Subsystem3' */ /* SystemInitialize for Merge: '/Merge' */ rtB.Merge_h = 0; /* End of SystemInitialize for SubSystem: '/Homing' */ /* SystemInitialize for Merge: '/Merge' */ rtB.Merge_b4 = 0; /* SystemInitialize for IfAction SubSystem: '/Start Control Front' */ /* SystemInitialize for Merge: '/Merge' */ rtB.Merge_fb = 0; /* End of SystemInitialize for SubSystem: '/Start Control Front' */ /* SystemInitialize for IfAction SubSystem: '/Start Control Rear' */ /* SystemInitialize for Merge: '/Merge' */ rtB.Merge_c = 0; /* End of SystemInitialize for SubSystem: '/Start Control Rear' */ } } /* Model terminate function */ void HVAC_model_terminate(void) { /* (no terminate code required) */ } /* * File trailer for generated code. * * [EOF] */