From 8366cdbffa5f913d6bd4ae43461a3d835a78f29d Mon Sep 17 00:00:00 2001 From: cfif Date: Mon, 16 Feb 2026 16:48:49 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HVAC_model.c | 3643 ++++++++++++++++++++++++------------------ HVAC_model.h | 366 ++--- HVAC_model_data.c | 230 +-- HVAC_model_private.h | 17 +- HVAC_model_types.h | 63 +- Model_Task.c | 26 +- 6 files changed, 2359 insertions(+), 1986 deletions(-) diff --git a/HVAC_model.c b/HVAC_model.c index 7191e83..1f8cc8b 100644 --- a/HVAC_model.c +++ b/HVAC_model.c @@ -3,9 +3,9 @@ * * Code generated for Simulink model 'HVAC_model'. * - * Model version : 1.604 + * Model version : 1.614 * Simulink Coder version : 24.1 (R2024a) 19-Nov-2023 - * C/C++ source code generated on : Fri Feb 13 13:56:38 2026 + * C/C++ source code generated on : Mon Feb 16 16:26:45 2026 * * Target selection: ert.tlc * Embedded hardware selection: ARM Compatible->ARM Cortex-M @@ -19,13 +19,15 @@ #include #include "HVAC_model_private.h" #include "HVAC_model_types.h" -#include #include /* Exported block states */ -ActuatorCmdBus Actuator_Ch0_Command_Model;/* '/Data Store Memory15' */ +ActuatorCmdBus Actuator_Ch0_Command_Model;/* '/Data Store Memory15' */ +ActuatorCmdBus Actuator_Ch1_Command_Model;/* '/Data Store Memory15' */ +ActuatorCmdBus Actuator_Ch2_Command_Model;/* '/Data Store Memory15' */ CmdBusStatus Status_Sensor_Model; /* '/Data Store Memory' */ CmdBusError CCU_Errors_Model; /* '/Data Store Memory3' */ +CmdBusPWMGet PWM_Get; /* '/Data Store Memory1' */ /* Block signals (default storage) */ B rtB; @@ -33,877 +35,32 @@ 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_; -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; -} /* * Output and update for action system: - * '/If Action Subsystem3' - * '/If Action Subsystem3' - * '/If Action Subsystem3' - * '/If Action Subsystem3' - * '/If Action Subsystem3' - * '/If Action Subsystem3' - * '/If Action Subsystem3' + * '/If Action Subsystem3' + * '/If Action Subsystem3' + * '/If Action Subsystem3' + * '/If Action Subsystem3' + * '/If Action Subsystem3' + * '/If Action Subsystem3' + * '/If Action Subsystem3' */ void IfActionSubsystem3(int8_t rtu_stepIn, int8_t *rty_step) { - int32_t i; + int32_t i; - /* BusCreator: '/Bus Creator' incorporates: - * DataStoreWrite: '/Data Store Write' - * SignalConversion generated from: '/Bus Creator' - * */ - for (i = 0; i < 9; i++) { - Actuator_Ch0_Command_Model.POS[i] = 0U; - Actuator_Ch0_Command_Model.BUS_ADR[i] = 0U; - Actuator_Ch0_Command_Model.MODE[i] = 0U; - Actuator_Ch0_Command_Model.COM[i] = 0U; - Actuator_Ch0_Command_Model.Stall_SET[i] = 0U; - Actuator_Ch0_Command_Model.Lnoise_SET[i] = 0U; - Actuator_Ch0_Command_Model.Autos_SET[i] = 0U; - Actuator_Ch0_Command_Model.Speed_SET[i] = 0U; - Actuator_Ch0_Command_Model.Coils_Stop_SET[i] = 0U; - } - - /* End of BusCreator: '/Bus Creator' */ - - /* SignalConversion generated from: '/stepIn' */ - *rty_step = rtu_stepIn; -} - -/* - * Output and update for atomic system: - * '/MAX POSITION' - * '/MAX POSITION' - */ -void MAXPOSITION(int16_t rty_y[9]) -{ - int32_t i; - - /* : y = step; */ - /* : fprintf('SIMULINK POSITION '); */ - printf("SIMULINK POSITION "); - fflush(stdout); - - /* : for i = 1:numel(step) */ - for (i = 0; i < 9; i++) { - /* : fprintf('%d ', int16(step(i))); */ - printf("%d ", rty_y[i]); - fflush(stdout); - } - - /* : fprintf('\n'); */ - printf("\n"); - fflush(stdout); -} - -/* - * Output and update for atomic system: - * '/MAX POSITION1' - * '/MAX POSITION1' - */ -void MAXPOSITION1(int8_t rty_y[9]) -{ - int32_t i; - - /* : y = step; */ - /* : fprintf('SIMULINK Stall_Slave '); */ - printf("SIMULINK Stall_Slave "); - fflush(stdout); - - /* : for i = 1:numel(step) */ - for (i = 0; i < 9; i++) { - /* : fprintf('%d ', int16(step(i))); */ - printf("%d ", (int16_t)rty_y[i]); - fflush(stdout); - } - - /* : fprintf('\n'); */ - printf("\n"); - fflush(stdout); -} - -/* - * Output and update for atomic system: - * '/MAX POSITION' - * '/MAX POSITION' - */ -void MAXPOSITION_l(const double rtu_step[9], double rty_y[9]) -{ - int32_t i; - - /* : y = step; */ - memcpy(&rty_y[0], &rtu_step[0], 9U * sizeof(double)); - - /* : fprintf('SIMULINK MAX POSITION '); */ - printf("SIMULINK MAX POSITION "); - fflush(stdout); - - /* : for i = 1:numel(step) */ - for (i = 0; i < 9; i++) { - /* : fprintf('%f ', step(i)); */ - printf("%f ", rtu_step[i]); - fflush(stdout); - } - - /* : fprintf('\n'); */ - printf("\n"); - fflush(stdout); -} - -/* Model step function */ -void HVAC_model_step(void) -{ - double rtb_Divide1_j[9]; - double rtb_y_gj[9]; - double rtb_Divide1_n; - int32_t i; - int16_t rtb_y_ff[9]; - int16_t rtb_Switch_f; - int8_t rtb_y_b[9]; - int8_t rtb_Switch_l4; - bool rtb_RelationalOperator_j[9]; - bool rtb_FailCond; - bool rtb_LogicalOperator1; - bool rtb_LogicalOperator1_b; - bool rtb_LogicalOperator1_f; - bool rtb_LogicalOperator1_i; - bool rtb_LogicalOperator1_k; - bool rtb_LogicalOperator1_ln; - bool rtb_LogicalOperator1_n; - bool tmp; - - /* Product: '/Divide1' incorporates: - * Constant: '/Constant' - * Constant: '/Constant1' - * DataStoreRead: '/Data Store Read1' - * Product: '/Divide' - */ - rtb_Divide1_n = (double)rtDW.ADC_Data_Model.Sensor_Ambient_Temp / 4095.0 * 5.0; - - /* Logic: '/Logical Operator' incorporates: - * Constant: '/Constant' - * Constant: '/Constant' - * RelationalOperator: '/Compare' - * RelationalOperator: '/Compare' - */ - rtb_FailCond = ((rtb_Divide1_n < 0.1) || (rtb_Divide1_n > 4.9)); - - /* 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)); - - /* Switch: '/Switch' incorporates: - * Constant: '/Constant2' - * DataStoreRead: '/Data Store Read1' - * Lookup_n-D: '/1-D Lookup Table' - */ - if (rtb_LogicalOperator1) { - rtb_Switch_f = 100; - } else { - rtb_Switch_f = look1_iu16tdIs16_binlcs - (rtDW.ADC_Data_Model.Sensor_Ambient_Temp, rtConstP.pooled15, - rtConstP.uDLookupTable_tableData, 1023U); - } - - /* End of Switch: '/Switch' */ - - /* MATLAB Function: '/Write Ambient' */ - /* : fprintf('Ambient = %d * 0.1 C\n',Ambient); */ - printf("Ambient = %d * 0.1 C\n", rtb_Switch_f); - fflush(stdout); - - /* MATLAB Function: '/Write ERROR' incorporates: - * DataStoreRead: '/Data Store Read1' - */ - /* : if(AmbientErr) */ - if (rtb_LogicalOperator1) { - /* : fprintf('CCU_Body_Err.CCU_AmbienTemptSenErr_Stat = 0x1 (Failure), Sensor_Ambient_Temp = %u\n',Sensor_Ambient_Temp); */ - printf("CCU_Body_Err.CCU_AmbienTemptSenErr_Stat = 0x1 (Failure), Sensor_Ambient_Temp = %u\n", - rtDW.ADC_Data_Model.Sensor_Ambient_Temp); - 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)) { - rtDW.t_start_delay_private_DSTATE = rtDW.t_now; - } - - /* End of Switch: '/Switch' */ - - /* Product: '/Divide1' incorporates: - * Constant: '/Constant' - * Constant: '/Constant1' - * DataStoreRead: '/Data Store Read1' - * Product: '/Divide' - */ - rtb_Divide1_n = (double)rtDW.ADC_Data_Model.Sensor_Evap_Temp / 4095.0 * 5.0; - - /* Logic: '/Logical Operator' incorporates: - * Constant: '/Constant' - * Constant: '/Constant' - * RelationalOperator: '/Compare' - * RelationalOperator: '/Compare' - */ - rtb_LogicalOperator1 = ((rtb_Divide1_n < 0.1) || (rtb_Divide1_n > 4.9)); - - /* Switch: '/Switch' incorporates: - * Constant: '/Constant' - * Constant: '/Constant2' - * DataStoreRead: '/Data Store Read1' - * DataStoreRead: '/Data Store Read4' - * Logic: '/Logical Operator1' - * Lookup_n-D: '/1-D Lookup Table' - * MATLAB Function: '/Write ERROR' - * RelationalOperator: '/Compare' - * Sum: '/Subtract' - * UnitDelay: '/t_start_delay_private ' - */ - /* : if(EvapFErr) */ - if (rtb_LogicalOperator1 && (rtDW.t_now - rtDW.t_start_delay_private_DSTATE_p >= - 3000U)) { - rtb_Switch_f = -100; - - /* : fprintf('CCU_Body_Err.CCU_EvaTempSenErrF_Stat = 0x1 (Failure), Sensor_Evap_Temp = %u\n',Sensor_Evap_Temp); */ - printf("CCU_Body_Err.CCU_EvaTempSenErrF_Stat = 0x1 (Failure), Sensor_Evap_Temp = %u\n", - rtDW.ADC_Data_Model.Sensor_Evap_Temp); - fflush(stdout); - } else { - rtb_Switch_f = look1_iu16tdIs16_binlcs(rtDW.ADC_Data_Model.Sensor_Evap_Temp, - rtConstP.pooled15, rtConstP.pooled1, 1023U); - } - - /* End of Switch: '/Switch' */ - - /* MATLAB Function: '/Write Eva_F' */ - /* : fprintf('Eva_F = %d * 0.1 C\n',Eva_F); */ - printf("Eva_F = %d * 0.1 C\n", rtb_Switch_f); - fflush(stdout); - - /* Switch: '/Switch' incorporates: - * DataStoreRead: '/Data Store Read4' - * Logic: '/Logical Operator3' - * Logic: '/Logical Operator4' - * UnitDelay: '/Cond_prev_private ' - * UnitDelay: '/t_start_delay_private ' - */ - if (rtb_LogicalOperator1 && (!rtDW.Cond_prev_private_DSTATE_h)) { - rtDW.t_start_delay_private_DSTATE_p = rtDW.t_now; - } - - /* End of Switch: '/Switch' */ - - /* Product: '/Divide1' incorporates: - * Constant: '/Constant' - * Constant: '/Constant1' - * DataStoreRead: '/Data Store Read1' - * Product: '/Divide' - */ - rtb_Divide1_n = (double)rtDW.ADC_Data_Model.Sensor_Rear_Evap_Temp / 4095.0 * - 5.0; - - /* Logic: '/Logical Operator' incorporates: - * Constant: '/Constant' - * Constant: '/Constant' - * RelationalOperator: '/Compare' - * RelationalOperator: '/Compare' - */ - rtb_LogicalOperator1_f = ((rtb_Divide1_n < 0.1) || (rtb_Divide1_n > 4.9)); - - /* Switch: '/Switch' incorporates: - * Constant: '/Constant' - * Constant: '/Constant2' - * DataStoreRead: '/Data Store Read1' - * DataStoreRead: '/Data Store Read4' - * Logic: '/Logical Operator1' - * Lookup_n-D: '/1-D Lookup Table' - * MATLAB Function: '/Write ERROR' - * RelationalOperator: '/Compare' - * Sum: '/Subtract' - * UnitDelay: '/t_start_delay_private ' - */ - /* : if(EvapRErr) */ - if (rtb_LogicalOperator1_f && (rtDW.t_now - - rtDW.t_start_delay_private_DSTATE_pk >= 3000U)) { - rtb_Switch_f = -100; - - /* : fprintf('CCU_Body_Err.CCU_EvaTempSenErrR_Stat = 0x1 (Failure), Sensor_Rear_Evap_Temp = %u\n',Sensor_Rear_Evap_Temp); */ - printf("CCU_Body_Err.CCU_EvaTempSenErrR_Stat = 0x1 (Failure), Sensor_Rear_Evap_Temp = %u\n", - rtDW.ADC_Data_Model.Sensor_Rear_Evap_Temp); - fflush(stdout); - } else { - rtb_Switch_f = look1_iu16tdIs16_binlcs - (rtDW.ADC_Data_Model.Sensor_Rear_Evap_Temp, rtConstP.pooled15, - rtConstP.pooled1, 1023U); - } - - /* End of Switch: '/Switch' */ - - /* MATLAB Function: '/Write Eva_F' */ - /* : fprintf('Eva_R = %d * 0.1 C\n',Eva_R); */ - printf("Eva_R = %d * 0.1 C\n", rtb_Switch_f); - fflush(stdout); - - /* Switch: '/Switch' incorporates: - * DataStoreRead: '/Data Store Read4' - * Logic: '/Logical Operator3' - * Logic: '/Logical Operator4' - * UnitDelay: '/Cond_prev_private ' - * UnitDelay: '/t_start_delay_private ' - */ - if (rtb_LogicalOperator1_f && (!rtDW.Cond_prev_private_DSTATE_i)) { - rtDW.t_start_delay_private_DSTATE_pk = rtDW.t_now; - } - - /* End of Switch: '/Switch' */ - - /* Product: '/Divide1' incorporates: - * Constant: '/Constant' - * Constant: '/Constant1' - * DataStoreRead: '/Data Store Read1' - * Product: '/Divide' - */ - rtb_Divide1_n = (double)rtDW.ADC_Data_Model.Sensor_Incar_Temp_FL / 4095.0 * - 5.0; - - /* Logic: '/Logical Operator' incorporates: - * Constant: '/Constant' - * Constant: '/Constant' - * RelationalOperator: '/Compare' - * RelationalOperator: '/Compare' - */ - rtb_LogicalOperator1_k = ((rtb_Divide1_n < 0.15) || (rtb_Divide1_n > 4.9)); - - /* Switch: '/Switch' incorporates: - * Constant: '/Constant' - * Constant: '/Constant2' - * DataStoreRead: '/Data Store Read1' - * DataStoreRead: '/Data Store Read4' - * Logic: '/Logical Operator1' - * Lookup_n-D: '/1-D Lookup Table' - * MATLAB Function: '/Write ERROR' - * RelationalOperator: '/Compare' - * Sum: '/Subtract' - * UnitDelay: '/t_start_delay_private ' - */ - /* : if(IncarFLErr) */ - if (rtb_LogicalOperator1_k && (rtDW.t_now - - rtDW.t_start_delay_private_DSTATE_b >= 3000U)) { - rtb_Switch_f = 200; - - /* : fprintf('CCU_Body_Err.CCU_IncarTempErrF_Stat = 0x1 (Failure), Sensor_Incar_Temp_FL = %u\n',Sensor_Incar_Temp_FL); */ - printf("CCU_Body_Err.CCU_IncarTempErrF_Stat = 0x1 (Failure), Sensor_Incar_Temp_FL = %u\n", - rtDW.ADC_Data_Model.Sensor_Incar_Temp_FL); - fflush(stdout); - } else { - rtb_Switch_f = look1_iu16tdIs16_binlcs - (rtDW.ADC_Data_Model.Sensor_Incar_Temp_FL, rtConstP.pooled15, - rtConstP.pooled2, 1023U); - } - - /* End of Switch: '/Switch' */ - - /* MATLAB Function: '/Write IncarFL' */ - /* : fprintf('IncarFL = %d * 0.1 C\n',IncarFL); */ - printf("IncarFL = %d * 0.1 C\n", rtb_Switch_f); - fflush(stdout); - - /* Switch: '/Switch' incorporates: - * DataStoreRead: '/Data Store Read4' - * Logic: '/Logical Operator3' - * Logic: '/Logical Operator4' - * UnitDelay: '/Cond_prev_private ' - * UnitDelay: '/t_start_delay_private ' - */ - if (rtb_LogicalOperator1_k && (!rtDW.Cond_prev_private_DSTATE_c)) { - rtDW.t_start_delay_private_DSTATE_b = rtDW.t_now; - } - - /* End of Switch: '/Switch' */ - - /* Product: '/Divide1' incorporates: - * Constant: '/Constant' - * Constant: '/Constant1' - * DataStoreRead: '/Data Store Read1' - * Product: '/Divide' - */ - rtb_Divide1_n = (double)rtDW.ADC_Data_Model.Sensor_Incar_Temp_FR / 4095.0 * - 5.0; - - /* Logic: '/Logical Operator' incorporates: - * Constant: '/Constant' - * Constant: '/Constant' - * RelationalOperator: '/Compare' - * RelationalOperator: '/Compare' - */ - rtb_LogicalOperator1_b = ((rtb_Divide1_n < 0.15) || (rtb_Divide1_n > 4.9)); - - /* Switch: '/Switch' incorporates: - * Constant: '/Constant' - * Constant: '/Constant2' - * DataStoreRead: '/Data Store Read1' - * DataStoreRead: '/Data Store Read4' - * Logic: '/Logical Operator1' - * Lookup_n-D: '/1-D Lookup Table' - * MATLAB Function: '/Write ERROR' - * RelationalOperator: '/Compare' - * Sum: '/Subtract' - * UnitDelay: '/t_start_delay_private ' - */ - /* : if(IncarFRErr) */ - if (rtb_LogicalOperator1_b && (rtDW.t_now - - rtDW.t_start_delay_private_DSTATE_g >= 3000U)) { - rtb_Switch_f = 200; - - /* : fprintf('CCU_Body_Err.CCU_IncarTempErrR_Stat = 0x1 (Failure), Sensor_Incar_Temp_FR = %u\n',Sensor_Incar_Temp_FR); */ - printf("CCU_Body_Err.CCU_IncarTempErrR_Stat = 0x1 (Failure), Sensor_Incar_Temp_FR = %u\n", - rtDW.ADC_Data_Model.Sensor_Incar_Temp_FR); - fflush(stdout); - } else { - rtb_Switch_f = look1_iu16tdIs16_binlcs - (rtDW.ADC_Data_Model.Sensor_Incar_Temp_FR, rtConstP.pooled15, - rtConstP.pooled2, 1023U); - } - - /* End of Switch: '/Switch' */ - - /* MATLAB Function: '/Write IncarFR' */ - /* : fprintf('IncarFR = %d * 0.1 C\n',IncarFR); */ - printf("IncarFR = %d * 0.1 C\n", rtb_Switch_f); - fflush(stdout); - - /* Switch: '/Switch' incorporates: - * DataStoreRead: '/Data Store Read4' - * Logic: '/Logical Operator3' - * Logic: '/Logical Operator4' - * UnitDelay: '/Cond_prev_private ' - * UnitDelay: '/t_start_delay_private ' - */ - if (rtb_LogicalOperator1_b && (!rtDW.Cond_prev_private_DSTATE_hm)) { - rtDW.t_start_delay_private_DSTATE_g = rtDW.t_now; - } - - /* End of Switch: '/Switch' */ - - /* Product: '/Divide1' incorporates: - * Constant: '/Constant' - * Constant: '/Constant1' - * DataStoreRead: '/Data Store Read1' - * Product: '/Divide' - */ - rtb_Divide1_n = (double)rtDW.ADC_Data_Model.Sensor_Incar_Temp_RL / 4095.0 * - 5.0; - - /* Logic: '/Logical Operator' incorporates: - * Constant: '/Constant' - * Constant: '/Constant' - * RelationalOperator: '/Compare' - * RelationalOperator: '/Compare' - */ - rtb_LogicalOperator1_ln = ((rtb_Divide1_n < 0.15) || (rtb_Divide1_n > 4.9)); - - /* Switch: '/Switch' incorporates: - * Constant: '/Constant' - * Constant: '/Constant2' - * DataStoreRead: '/Data Store Read1' - * DataStoreRead: '/Data Store Read4' - * Logic: '/Logical Operator1' - * Lookup_n-D: '/1-D Lookup Table' - * MATLAB Function: '/Write ERROR' - * RelationalOperator: '/Compare' - * Sum: '/Subtract' - * UnitDelay: '/t_start_delay_private ' - */ - /* : if(IncarRLErr) */ - if (rtb_LogicalOperator1_ln && (rtDW.t_now - - rtDW.t_start_delay_private_DSTATE_j >= 3000U)) { - rtb_Switch_f = 200; - - /* : fprintf('CCU_Body_Err.CCU_IncarTempErrF_Stat = 0x1 (Failure), Sensor_Incar_Temp_RL = %u\n',Sensor_Incar_Temp_RL); */ - printf("CCU_Body_Err.CCU_IncarTempErrF_Stat = 0x1 (Failure), Sensor_Incar_Temp_RL = %u\n", - rtDW.ADC_Data_Model.Sensor_Incar_Temp_RL); - fflush(stdout); - } else { - rtb_Switch_f = look1_iu16tdIs16_binlcs - (rtDW.ADC_Data_Model.Sensor_Incar_Temp_RL, rtConstP.pooled15, - rtConstP.pooled2, 1023U); - } - - /* End of Switch: '/Switch' */ - - /* MATLAB Function: '/Write IncarRL' */ - /* : fprintf('IncarRL = %d * 0.1 C\n',IncarRL); */ - printf("IncarRL = %d * 0.1 C\n", rtb_Switch_f); - fflush(stdout); - - /* Switch: '/Switch' incorporates: - * DataStoreRead: '/Data Store Read4' - * Logic: '/Logical Operator3' - * Logic: '/Logical Operator4' - * UnitDelay: '/Cond_prev_private ' - * UnitDelay: '/t_start_delay_private ' - */ - if (rtb_LogicalOperator1_ln && (!rtDW.Cond_prev_private_DSTATE_b)) { - rtDW.t_start_delay_private_DSTATE_j = rtDW.t_now; - } - - /* End of Switch: '/Switch' */ - - /* Product: '/Divide1' incorporates: - * Constant: '/Constant' - * Constant: '/Constant1' - * DataStoreRead: '/Data Store Read1' - * Product: '/Divide' - */ - rtb_Divide1_n = (double)rtDW.ADC_Data_Model.Sensor_Incar_Temp_RR / 4095.0 * - 5.0; - - /* Logic: '/Logical Operator' incorporates: - * Constant: '/Constant' - * Constant: '/Constant' - * RelationalOperator: '/Compare' - * RelationalOperator: '/Compare' - */ - rtb_LogicalOperator1_i = ((rtb_Divide1_n < 0.15) || (rtb_Divide1_n > 4.9)); - - /* Logic: '/Logical Operator1' incorporates: - * Constant: '/Constant' - * DataStoreRead: '/Data Store Read4' - * RelationalOperator: '/Compare' - * Sum: '/Subtract' - * UnitDelay: '/t_start_delay_private ' - */ - rtb_LogicalOperator1_n = (rtb_LogicalOperator1_i && (rtDW.t_now - - rtDW.t_start_delay_private_DSTATE_c >= 3000U)); - - /* BusCreator: '/Bus Creator' incorporates: - * DataStoreWrite: '/Data Store Write' - * DataTypeConversion: '/Data Type Conversion' - */ - CCU_Errors_Model.CCU_IncarTempErrF_Stat = 0U; - CCU_Errors_Model.CCU_IncarTempErrR_Stat = rtb_LogicalOperator1_n; - CCU_Errors_Model.CCU_DuctTempSenErrF_Stat = 0U; - CCU_Errors_Model.CCU_DuctTempSenErrR_Stat = 0U; - CCU_Errors_Model.CCU_EvaTempSenErrF_Stat = 0U; - CCU_Errors_Model.CCU_EvaTempSenErrR_Stat = 0U; - CCU_Errors_Model.CCU_DeflectorSwErrF_Stat = 0U; - CCU_Errors_Model.CCU_DeflectorSwErrR_Stat = 0U; - CCU_Errors_Model.CCU_PressSenErr_Stat = 0U; - 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 = 0U; - CCU_Errors_Model.CCU_ActuatorErrR_Stat = 0U; - 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; - - /* Switch: '/Switch' incorporates: - * Constant: '/Constant2' - * DataStoreRead: '/Data Store Read1' - * Lookup_n-D: '/1-D Lookup Table' - */ - if (rtb_LogicalOperator1_n) { - rtb_Switch_f = 200; - } else { - rtb_Switch_f = look1_iu16tdIs16_binlcs - (rtDW.ADC_Data_Model.Sensor_Incar_Temp_RR, rtConstP.pooled15, - rtConstP.pooled2, 1023U); - } - - /* End of Switch: '/Switch' */ - - /* BusCreator: '/Bus Creator' incorporates: - * DataStoreWrite: '/Data Store Write' - */ - Status_Sensor_Model.Battery = 0; - Status_Sensor_Model.AMB = 0; - Status_Sensor_Model.Incar_FL = 0; - Status_Sensor_Model.Incar_FR = 0; - Status_Sensor_Model.Incar_RL = 0; - Status_Sensor_Model.Incar_RR = rtb_Switch_f; - Status_Sensor_Model.Eva_F = 0; - Status_Sensor_Model.Eva_R = 0; - Status_Sensor_Model.Pressure = 0; - 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; - - /* MATLAB Function: '/Write ERROR' incorporates: - * DataStoreRead: '/Data Store Read1' - */ - /* : if(IncarRRErr) */ - if (rtb_LogicalOperator1_n) { - /* : fprintf('CCU_Body_Err.CCU_IncarTempErrR_Stat = 0x1 (Failure), Sensor_Incar_Temp_RR = %u\n',Sensor_Incar_Temp_RR); */ - printf("CCU_Body_Err.CCU_IncarTempErrR_Stat = 0x1 (Failure), Sensor_Incar_Temp_RR = %u\n", - rtDW.ADC_Data_Model.Sensor_Incar_Temp_RR); - fflush(stdout); - } - - /* End of MATLAB Function: '/Write ERROR' */ - - /* MATLAB Function: '/Write IncarFL' */ - /* : fprintf('IncarRR = %d * 0.1 C\n',IncarRR); */ - printf("IncarRR = %d * 0.1 C\n", rtb_Switch_f); - fflush(stdout); - - /* Switch: '/Switch' incorporates: - * DataStoreRead: '/Data Store Read4' - * Logic: '/Logical Operator3' - * Logic: '/Logical Operator4' - * UnitDelay: '/Cond_prev_private ' - * UnitDelay: '/t_start_delay_private ' - */ - if (rtb_LogicalOperator1_i && (!rtDW.Cond_prev_private_DSTATE_g)) { - rtDW.t_start_delay_private_DSTATE_c = rtDW.t_now; - } - - /* End of Switch: '/Switch' */ - - /* Switch: '/Switch' incorporates: - * Constant: '/Constant1' - * DataStoreRead: '/Data Store Read' - * DataStoreRead: '/Data Store Read2' - */ - if (rtDW.stepSig_private > 0) { - rtb_Switch_l4 = rtDW.stepSig_private; - } else { - rtb_Switch_l4 = 1; - } - - /* End of Switch: '/Switch' */ - - /* SwitchCase: '/Switch Case' */ - switch (rtb_Switch_l4) { - case 1: - /* Outputs for IfAction SubSystem: '/Stop Mode' incorporates: - * ActionPort: '/Action Port' - */ - /* If: '/If1' incorporates: - * DataStoreRead: '/Data Store Read1' - * DataStoreWrite: '/Data Store Write' - * DataStoreWrite: '/Data Store Write1' - */ - if ((rtDW.Actuator_Ch0_Status_Model.Busy_Ch0 == 0) && - (rtDW.Actuator_Ch0_Status_Model.Error_Connect_Ch0 == 0)) { - /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: - * ActionPort: '/Action Port' - */ - /* BusCreator: '/Bus Creator' incorporates: - * DataStoreWrite: '/Data Store Write' - * SignalConversion generated from: '/Bus Creator' - * */ - for (i = 0; i < 9; i++) { - Actuator_Ch0_Command_Model.POS[i] = 0U; - Actuator_Ch0_Command_Model.BUS_ADR[i] = 0U; - Actuator_Ch0_Command_Model.MODE[i] = 2U; - Actuator_Ch0_Command_Model.COM[i] = 1U; - Actuator_Ch0_Command_Model.Stall_SET[i] = 0U; - Actuator_Ch0_Command_Model.Lnoise_SET[i] = 0U; - Actuator_Ch0_Command_Model.Autos_SET[i] = 0U; - Actuator_Ch0_Command_Model.Speed_SET[i] = 0U; - Actuator_Ch0_Command_Model.Coils_Stop_SET[i] = 0U; - } - - /* End of BusCreator: '/Bus Creator' */ - - /* Merge: '/Merge' incorporates: - * Constant: '/Constant' - * Sum: '/step inc' - */ - rtB.Merge = (int8_t)(rtb_Switch_l4 + 1); - - /* End of Outputs for SubSystem: '/If Action Subsystem2' */ - } else { - /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: - * ActionPort: '/Action Port' - */ - IfActionSubsystem3(rtb_Switch_l4, &rtB.Merge); - - /* 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 Write' - * DataStoreWrite: '/Data Store Write1' - */ - if ((rtDW.Actuator_Ch0_Status_Model.Busy_Ch0 == 0) && - (rtDW.Actuator_Ch0_Status_Model.Error_Connect_Ch0 == 0)) { - /* Outputs for IfAction SubSystem: '/If Action Subsystem' incorporates: - * ActionPort: '/Action Port' - */ - /* BusCreator: '/Bus Creator' incorporates: - * DataStoreWrite: '/Data Store Write2' - * SignalConversion generated from: '/Bus Creator' - * */ - for (i = 0; i < 9; i++) { - Actuator_Ch0_Command_Model.POS[i] = 6000U; - Actuator_Ch0_Command_Model.BUS_ADR[i] = 0U; - Actuator_Ch0_Command_Model.MODE[i] = 0U; - Actuator_Ch0_Command_Model.COM[i] = 2U; - Actuator_Ch0_Command_Model.Stall_SET[i] = 0U; - Actuator_Ch0_Command_Model.Lnoise_SET[i] = 0U; - Actuator_Ch0_Command_Model.Autos_SET[i] = 0U; - Actuator_Ch0_Command_Model.Speed_SET[i] = 0U; - Actuator_Ch0_Command_Model.Coils_Stop_SET[i] = 0U; - } - - /* End of BusCreator: '/Bus Creator' */ - - /* MATLAB Function: '/Initial CPOS Min' */ - /* : y = step; */ - /* : fprintf('SIMULINK Initial CPOS Min - 6000\n'); */ - printf("SIMULINK Initial CPOS Min - 6000\n"); - fflush(stdout); - - /* Merge: '/Merge' incorporates: - * Constant: '/Constant' - * Merge: '/Merge' - * SignalConversion generated from: '/step' - * Sum: '/step inc' - */ - rtB.Merge = (int8_t)(rtb_Switch_l4 + 1); - - /* End of Outputs for SubSystem: '/If Action Subsystem' */ - } else { - /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: - * ActionPort: '/Action Port' - */ - /* BusCreator: '/Bus Creator' incorporates: - * DataStoreWrite: '/Data Store Write' - * SignalConversion generated from: '/Bus Creator' - * */ - for (i = 0; i < 9; i++) { + /* BusCreator: '/Bus Creator' incorporates: + * DataStoreWrite: '/Data Store Write' + * SignalConversion generated from: '/Bus Creator' + * */ + for (i = 0; i < 9; i++) { Actuator_Ch0_Command_Model.POS[i] = 0U; Actuator_Ch0_Command_Model.BUS_ADR[i] = 0U; Actuator_Ch0_Command_Model.MODE[i] = 0U; @@ -913,601 +70,267 @@ void HVAC_model_step(void) Actuator_Ch0_Command_Model.Autos_SET[i] = 0U; Actuator_Ch0_Command_Model.Speed_SET[i] = 0U; Actuator_Ch0_Command_Model.Coils_Stop_SET[i] = 0U; - } - - /* End of BusCreator: '/Bus Creator' */ - - /* Merge: '/Merge' incorporates: - * Merge: '/Merge' - * SignalConversion generated from: '/stepIn1' - */ - rtB.Merge = rtb_Switch_l4; - - /* End of Outputs for SubSystem: '/If Action Subsystem3' */ } - /* End of If: '/If' */ - /* End of Outputs for SubSystem: '/Initial CPOS Min' */ - break; + /* End of BusCreator: '/Bus Creator' */ - case 3: - /* Outputs for IfAction SubSystem: '/Normal Mode' incorporates: - * ActionPort: '/Action Port' - */ - /* MATLAB Function: '/MAX POSITION1' incorporates: - * DataStoreRead: '/Data Store Read1' - * DataStoreWrite: '/Data Store Write' - */ - /* : fprintf('Busy_Ch0_private '); */ - printf("Busy_Ch0_private "); - fflush(stdout); + /* SignalConversion generated from: '/stepIn' */ + *rty_step = rtu_stepIn; +} - /* : for i = 1:numel(Busy_Ch0_private) */ - /* : fprintf('%d ', int16(Busy_Ch0_private(i))); */ - printf("%d ", (int16_t)rtDW.Actuator_Ch0_Status_Model.Busy_Ch0); - fflush(stdout); +/* + * Output and update for atomic system: + * '/Initial CPOS Min' + * '/Initial CPOS Min' + */ +void InitialCPOSMin(double rtu_LOGGER, int8_t rtu_step, int8_t *rty_y) +{ + *rty_y = rtu_step; - /* : fprintf('\n'); */ - printf("\n"); - fflush(stdout); - - /* MATLAB Function: '/MAX POSITION2' incorporates: - * DataStoreRead: '/Data Store Read1' - * DataStoreWrite: '/Data Store Write1' - */ - /* : fprintf('Error_Connect_Ch0_private '); */ - printf("Error_Connect_Ch0_private "); - fflush(stdout); - - /* : for i = 1:numel(Busy_Ch0_private) */ - /* : fprintf('%d ', int16(Busy_Ch0_private(i))); */ - printf("%d ", (int16_t)rtDW.Actuator_Ch0_Status_Model.Error_Connect_Ch0); - fflush(stdout); - - /* : fprintf('\n'); */ - printf("\n"); - fflush(stdout); - - /* If: '/If1' incorporates: - * DataStoreRead: '/Data Store Read1' - * DataStoreWrite: '/Data Store Write' - * DataStoreWrite: '/Data Store Write1' - */ - if ((rtDW.Actuator_Ch0_Status_Model.Busy_Ch0 == 0) && - (rtDW.Actuator_Ch0_Status_Model.Error_Connect_Ch0 == 0)) { - /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: - * ActionPort: '/Action Port' - */ - /* BusCreator: '/Bus Creator' incorporates: - * DataStoreWrite: '/Data Store Write1' - * SignalConversion generated from: '/Bus Creator' - * */ - for (i = 0; i < 9; i++) { - Actuator_Ch0_Command_Model.POS[i] = 0U; - Actuator_Ch0_Command_Model.BUS_ADR[i] = 0U; - Actuator_Ch0_Command_Model.MODE[i] = 0U; - Actuator_Ch0_Command_Model.COM[i] = 1U; - Actuator_Ch0_Command_Model.Stall_SET[i] = 0U; - Actuator_Ch0_Command_Model.Lnoise_SET[i] = 0U; - Actuator_Ch0_Command_Model.Autos_SET[i] = 0U; - Actuator_Ch0_Command_Model.Speed_SET[i] = 0U; - Actuator_Ch0_Command_Model.Coils_Stop_SET[i] = 0U; - } - - /* End of BusCreator: '/Bus Creator' */ - - /* MATLAB Function: '/Normal Mode' */ - /* : y = step; */ - /* : fprintf('SIMULINK Normal Mode\n'); */ - printf("SIMULINK Normal Mode\n"); - fflush(stdout); - - /* Merge: '/Merge' incorporates: - * Constant: '/Constant' - * SignalConversion generated from: '/step' - * Sum: '/step inc' - */ - rtB.Merge = (int8_t)(rtb_Switch_l4 + 1); - - /* End of Outputs for SubSystem: '/If Action Subsystem2' */ - } else { - /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: - * ActionPort: '/Action Port' - */ - IfActionSubsystem3(rtb_Switch_l4, &rtB.Merge); - - /* 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 Write' - * DataStoreWrite: '/Data Store Write1' - */ - if ((rtDW.Actuator_Ch0_Status_Model.Busy_Ch0 == 0) && - (rtDW.Actuator_Ch0_Status_Model.Error_Connect_Ch0 == 0)) { - /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: - * ActionPort: '/Action Port' - */ - /* BusCreator: '/Bus Creator' incorporates: - * Constant: '/Constant1' - * Constant: '/Constant10' - * Constant: '/Constant11' - * Constant: '/Constant14' - * Constant: '/Constant2' - * Constant: '/Constant9' - * DataStoreWrite: '/Data Store Write7' - * SignalConversion generated from: '/Bus Creator' - * */ - for (i = 0; i < 9; i++) { - Actuator_Ch0_Command_Model.POS[i] = 1U; - Actuator_Ch0_Command_Model.BUS_ADR[i] = 0U; - Actuator_Ch0_Command_Model.MODE[i] = 0U; - Actuator_Ch0_Command_Model.COM[i] = 3U; - Actuator_Ch0_Command_Model.Stall_SET[i] = 1U; - Actuator_Ch0_Command_Model.Lnoise_SET[i] = 0U; - Actuator_Ch0_Command_Model.Autos_SET[i] = 1U; - Actuator_Ch0_Command_Model.Speed_SET[i] = 3U; - Actuator_Ch0_Command_Model.Coils_Stop_SET[i] = 0U; - } - - /* End of BusCreator: '/Bus Creator' */ - - /* MATLAB Function: '/Move to position Min' */ - /* : y = step; */ - /* : fprintf('SIMULINK Move to position Min - 1\n'); */ - printf("SIMULINK Move to position Min - 1\n"); - fflush(stdout); - - /* Merge: '/Merge' incorporates: - * Constant: '/Constant' - * SignalConversion generated from: '/step' - * Sum: '/step inc' - */ - rtB.Merge = (int8_t)(rtb_Switch_l4 + 1); - - /* End of Outputs for SubSystem: '/If Action Subsystem2' */ - } else { - /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: - * ActionPort: '/Action Port' - */ - IfActionSubsystem3(rtb_Switch_l4, &rtB.Merge); - - /* 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' - */ - /* RelationalOperator: '/Relational Operator1' incorporates: - * DataStoreRead: '/Data Store Read1' - * RelationalOperator: '/Relational Operator' - */ - for (i = 0; i < 9; i++) { - rtb_RelationalOperator_j[i] = - (rtDW.Actuator_Ch0_Status_Model.in_Act_Stall_Slave_Ch0[i] == 1); - } - - /* End of RelationalOperator: '/Relational Operator1' */ - - /* Logic: '/Logical Operator2' incorporates: - * RelationalOperator: '/Relational Operator' - */ - rtb_LogicalOperator1_n = rtb_RelationalOperator_j[0]; - for (i = 0; i < 8; i++) { - rtb_LogicalOperator1_n = (rtb_LogicalOperator1_n || - rtb_RelationalOperator_j[i + 1]); - } - - /* RelationalOperator: '/Relational Operator' incorporates: - * DataStoreRead: '/Data Store Read1' - */ - for (i = 0; i < 9; i++) { - rtb_RelationalOperator_j[i] = - (rtDW.Actuator_Ch0_Status_Model.in_CPOS_ALL_Ch0[i] == 1); - } - - /* End of RelationalOperator: '/Relational Operator' */ - - /* Logic: '/Logical Operator1' incorporates: - * RelationalOperator: '/Relational Operator' - */ - tmp = rtb_RelationalOperator_j[0]; - for (i = 0; i < 8; i++) { - tmp = (tmp || rtb_RelationalOperator_j[i + 1]); - } - - /* If: '/If2' incorporates: - * DataStoreRead: '/Data Store Read1' - * DataStoreWrite: '/Data Store Write' - * DataStoreWrite: '/Data Store Write1' - * DataTypeConversion: '/Data Type Conversion' - * DataTypeConversion: '/Data Type Conversion1' - * Logic: '/Logical Operator' - * Logic: '/Logical Operator1' - * Logic: '/Logical Operator2' - */ - if ((rtDW.Actuator_Ch0_Status_Model.Busy_Ch0 == 0) && - (rtDW.Actuator_Ch0_Status_Model.Error_Connect_Ch0 == 0) && - (rtb_LogicalOperator1_n || tmp)) { - /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: - * ActionPort: '/Action Port' - */ - /* DataStoreWrite: '/Data Store Write1' */ - for (i = 0; i < 9; i++) { - rtDW.MinPositionCh0_private[i] = - rtDW.Actuator_Ch0_Status_Model.in_CPOS_ALL_Ch0[i]; - } - - /* End of DataStoreWrite: '/Data Store Write1' */ - - /* Merge: '/Merge' incorporates: - * Constant: '/Constant' - * Sum: '/step inc' - */ - rtB.Merge = (int8_t)(rtb_Switch_l4 + 1); - - /* MATLAB Function: '/MIN POSITION' */ - /* : y = step; */ - /* : fprintf('SIMULINK Min_position_Ch0 '); */ - printf("SIMULINK Min_position_Ch0 "); - fflush(stdout); - - /* : for i = 1:numel(step) */ - for (i = 0; i < 9; i++) { - /* : fprintf('%d ', int16(step(i))); */ - printf("%d ", rtDW.Actuator_Ch0_Status_Model.in_CPOS_ALL_Ch0[i]); + /* : y = step; */ + /* : if(LOGGER) */ + if (rtu_LOGGER != 0.0) { + /* : fprintf('SIMULINK Initial CPOS Min - 6000\n'); */ + printf("SIMULINK Initial CPOS Min - 6000\n"); fflush(stdout); - } - - /* : fprintf('\n'); */ - printf("\n"); - fflush(stdout); - - /* End of MATLAB Function: '/MIN POSITION' */ - /* End of Outputs for SubSystem: '/If Action Subsystem2' */ - } else { - /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: - * ActionPort: '/Action Port' - */ - IfActionSubsystem3(rtb_Switch_l4, &rtB.Merge); - - /* End of Outputs for SubSystem: '/If Action Subsystem3' */ } +} - /* End of If: '/If2' */ - /* End of Outputs for SubSystem: '/Check Stall Min' */ - for (i = 0; i < 9; i++) { - /* Outputs for IfAction SubSystem: '/Check Stall Min' incorporates: - * ActionPort: '/Action Port' - */ - rtb_y_ff[i] = rtDW.Actuator_Ch0_Status_Model.in_CPOS_ALL_Ch0[i]; +/* + * Output and update for atomic system: + * '/Normal Mode' + * '/Normal Mode' + */ +void NormalMode(double rtu_LOGGER, int8_t rtu_step, int8_t *rty_y) +{ + *rty_y = rtu_step; - /* End of Outputs for SubSystem: '/Check Stall Min' */ - } - - /* Outputs for IfAction SubSystem: '/Check Stall Min' incorporates: - * ActionPort: '/Action Port' - */ - /* MATLAB Function: '/MAX POSITION' incorporates: - * DataStoreRead: '/Data Store Read1' - */ - MAXPOSITION(rtb_y_ff); - - /* End of Outputs for SubSystem: '/Check Stall Min' */ - for (i = 0; i < 9; i++) { - /* Outputs for IfAction SubSystem: '/Check Stall Min' incorporates: - * ActionPort: '/Action Port' - */ - rtb_y_b[i] = rtDW.Actuator_Ch0_Status_Model.in_Act_Stall_Slave_Ch0[i]; - - /* End of Outputs for SubSystem: '/Check Stall Min' */ - } - - /* Outputs for IfAction SubSystem: '/Check Stall Min' incorporates: - * ActionPort: '/Action Port' - */ - /* MATLAB Function: '/MAX POSITION1' incorporates: - * DataStoreRead: '/Data Store Read1' - */ - MAXPOSITION1(rtb_y_b); - - /* 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 Write' - * DataStoreWrite: '/Data Store Write1' - */ - if ((rtDW.Actuator_Ch0_Status_Model.Busy_Ch0 == 0) && - (rtDW.Actuator_Ch0_Status_Model.Error_Connect_Ch0 == 0)) { - /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: - * ActionPort: '/Action Port' - */ - /* BusCreator: '/Bus Creator' incorporates: - * DataStoreWrite: '/Data Store Write2' - * SignalConversion generated from: '/Bus Creator' - * */ - for (i = 0; i < 9; i++) { - Actuator_Ch0_Command_Model.POS[i] = 1U; - Actuator_Ch0_Command_Model.BUS_ADR[i] = 0U; - Actuator_Ch0_Command_Model.MODE[i] = 0U; - Actuator_Ch0_Command_Model.COM[i] = 2U; - Actuator_Ch0_Command_Model.Stall_SET[i] = 0U; - Actuator_Ch0_Command_Model.Lnoise_SET[i] = 0U; - Actuator_Ch0_Command_Model.Autos_SET[i] = 0U; - Actuator_Ch0_Command_Model.Speed_SET[i] = 0U; - Actuator_Ch0_Command_Model.Coils_Stop_SET[i] = 0U; - } - - /* End of BusCreator: '/Bus Creator' */ - - /* MATLAB Function: '/Initial CPOS Max' */ - /* : y = step; */ - /* : fprintf('SIMULINK Initial CPOS Max - 1\n'); */ - printf("SIMULINK Initial CPOS Max - 1\n"); - fflush(stdout); - - /* Merge: '/Merge' incorporates: - * Constant: '/Constant' - * SignalConversion generated from: '/step' - * Sum: '/step inc' - */ - rtB.Merge = (int8_t)(rtb_Switch_l4 + 1); - - /* End of Outputs for SubSystem: '/If Action Subsystem2' */ - } else { - /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: - * ActionPort: '/Action Port' - */ - IfActionSubsystem3(rtb_Switch_l4, &rtB.Merge); - - /* 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 Write' - * DataStoreWrite: '/Data Store Write1' - */ - if ((rtDW.Actuator_Ch0_Status_Model.Busy_Ch0 == 0) && - (rtDW.Actuator_Ch0_Status_Model.Error_Connect_Ch0 == 0)) { - /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: - * ActionPort: '/Action Port' - */ - /* BusCreator: '/Bus Creator' incorporates: - * Constant: '/Constant1' - * Constant: '/Constant10' - * Constant: '/Constant11' - * Constant: '/Constant14' - * Constant: '/Constant2' - * Constant: '/Constant9' - * DataStoreWrite: '/Data Store Write7' - * SignalConversion generated from: '/Bus Creator' - * */ - for (i = 0; i < 9; i++) { - Actuator_Ch0_Command_Model.POS[i] = 6000U; - Actuator_Ch0_Command_Model.BUS_ADR[i] = 0U; - Actuator_Ch0_Command_Model.MODE[i] = 0U; - Actuator_Ch0_Command_Model.COM[i] = 3U; - Actuator_Ch0_Command_Model.Stall_SET[i] = 1U; - Actuator_Ch0_Command_Model.Lnoise_SET[i] = 0U; - Actuator_Ch0_Command_Model.Autos_SET[i] = 1U; - Actuator_Ch0_Command_Model.Speed_SET[i] = 3U; - Actuator_Ch0_Command_Model.Coils_Stop_SET[i] = 0U; - } - - /* End of BusCreator: '/Bus Creator' */ - - /* MATLAB Function: '/Move to position Max' */ - /* : y = step; */ - /* : fprintf('SIMULINK Move to position Max - 6000\n'); */ - printf("SIMULINK Move to position Max - 6000\n"); - fflush(stdout); - - /* Merge: '/Merge' incorporates: - * Constant: '/Constant' - * SignalConversion generated from: '/step' - * Sum: '/step inc' - */ - rtB.Merge = (int8_t)(rtb_Switch_l4 + 1); - - /* End of Outputs for SubSystem: '/If Action Subsystem2' */ - } else { - /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: - * ActionPort: '/Action Port' - */ - IfActionSubsystem3(rtb_Switch_l4, &rtB.Merge); - - /* 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' - */ - /* RelationalOperator: '/Relational Operator1' incorporates: - * DataStoreRead: '/Data Store Read1' - * RelationalOperator: '/Relational Operator' - */ - for (i = 0; i < 9; i++) { - rtb_RelationalOperator_j[i] = - (rtDW.Actuator_Ch0_Status_Model.in_Act_Stall_Slave_Ch0[i] == 1); - } - - /* End of RelationalOperator: '/Relational Operator1' */ - - /* Logic: '/Logical Operator2' incorporates: - * RelationalOperator: '/Relational Operator' - */ - rtb_LogicalOperator1_n = rtb_RelationalOperator_j[0]; - for (i = 0; i < 8; i++) { - rtb_LogicalOperator1_n = (rtb_LogicalOperator1_n || - rtb_RelationalOperator_j[i + 1]); - } - - /* RelationalOperator: '/Relational Operator' incorporates: - * DataStoreRead: '/Data Store Read1' - */ - for (i = 0; i < 9; i++) { - rtb_RelationalOperator_j[i] = - (rtDW.Actuator_Ch0_Status_Model.in_CPOS_ALL_Ch0[i] == 6000); - } - - /* End of RelationalOperator: '/Relational Operator' */ - - /* Logic: '/Logical Operator1' incorporates: - * RelationalOperator: '/Relational Operator' - */ - tmp = rtb_RelationalOperator_j[0]; - for (i = 0; i < 8; i++) { - tmp = (tmp || rtb_RelationalOperator_j[i + 1]); - } - - /* If: '/If2' incorporates: - * DataStoreRead: '/Data Store Read1' - * DataStoreWrite: '/Data Store Write' - * DataStoreWrite: '/Data Store Write1' - * DataTypeConversion: '/Data Type Conversion' - * DataTypeConversion: '/Data Type Conversion1' - * Logic: '/Logical Operator' - * Logic: '/Logical Operator1' - * Logic: '/Logical Operator2' - */ - if ((rtDW.Actuator_Ch0_Status_Model.Busy_Ch0 == 0) && - (rtDW.Actuator_Ch0_Status_Model.Error_Connect_Ch0 == 0) && - (rtb_LogicalOperator1_n || tmp)) { - /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: - * ActionPort: '/Action Port' - */ - /* DataStoreWrite: '/Data Store Write1' */ - for (i = 0; i < 9; i++) { - rtDW.MinPositionCh0_private[i] = - rtDW.Actuator_Ch0_Status_Model.in_CPOS_ALL_Ch0[i]; - } - - /* End of DataStoreWrite: '/Data Store Write1' */ - - /* Merge: '/Merge' incorporates: - * Constant: '/Constant' - * Sum: '/step inc' - */ - rtB.Merge = (int8_t)(rtb_Switch_l4 + 1); - - /* MATLAB Function: '/MIN POSITION' */ - /* : y = step; */ - /* : fprintf('SIMULINK Max_position_Ch0 '); */ - printf("SIMULINK Max_position_Ch0 "); - fflush(stdout); - - /* : for i = 1:numel(step) */ - for (i = 0; i < 9; i++) { - /* : fprintf('%d ', int16(step(i))); */ - printf("%d ", rtDW.Actuator_Ch0_Status_Model.in_CPOS_ALL_Ch0[i]); + /* : y = step; */ + /* : if(LOGGER) */ + if (rtu_LOGGER != 0.0) { + /* : fprintf('SIMULINK Normal Mode\n'); */ + printf("SIMULINK Normal Mode\n"); fflush(stdout); - } - - /* : fprintf('\n'); */ - printf("\n"); - fflush(stdout); - - /* End of MATLAB Function: '/MIN POSITION' */ - /* End of Outputs for SubSystem: '/If Action Subsystem2' */ - } else { - /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: - * ActionPort: '/Action Port' - */ - IfActionSubsystem3(rtb_Switch_l4, &rtB.Merge); - - /* End of Outputs for SubSystem: '/If Action Subsystem3' */ } +} - /* End of If: '/If2' */ - /* End of Outputs for SubSystem: '/Check Stall Max' */ +/* + * Output and update for atomic system: + * '/Move to position Min' + * '/Move to position Min' + * '/Move to position Min' + */ +void MovetopositionMin(double rtu_LOGGER, int8_t rtu_step, int8_t *rty_y) +{ + *rty_y = rtu_step; + + /* : y = step; */ + /* : if(LOGGER) */ + if (rtu_LOGGER != 0.0) { + /* : fprintf('SIMULINK Move to position Min - 1\n'); */ + printf("SIMULINK Move to position Min - 1\n"); + fflush(stdout); + } +} + +/* + * Output and update for atomic system: + * '/MIN POSITION' + * '/MIN POSITION' + * '/MIN POSITION' + */ +void MINPOSITION(int16_t rty_y[9], double rtu_LOGGER) +{ + int32_t i; + + /* : y = step; */ + /* : if(LOGGER) */ + if (rtu_LOGGER != 0.0) { + /* : fprintf('SIMULINK Min_position_Ch0 '); */ + printf("SIMULINK Min_position_Ch0 "); + fflush(stdout); + + /* : for i = 1:numel(step) */ + for (i = 0; i < 9; i++) { + /* : fprintf('%d ', int16(step(i))); */ + printf("%d ", rty_y[i]); + fflush(stdout); + } + + /* : fprintf('\n'); */ + printf("\n"); + fflush(stdout); + } +} + +/* + * Output and update for atomic system: + * '/Initial CPOS Max' + * '/Initial CPOS Max' + * '/Initial CPOS Max' + */ +void InitialCPOSMax(double rtu_LOGGER, int8_t rtu_step, int8_t *rty_y) +{ + *rty_y = rtu_step; + + /* : y = step; */ + /* : if(LOGGER) */ + if (rtu_LOGGER != 0.0) { + /* : fprintf('SIMULINK Initial CPOS Max - 1\n'); */ + printf("SIMULINK Initial CPOS Max - 1\n"); + fflush(stdout); + } +} + +/* + * Output and update for atomic system: + * '/Move to position Max' + * '/Move to position Max' + * '/Move to position Max' + */ +void MovetopositionMax(int8_t rtu_step, double rtu_LOGGER, int8_t *rty_y) +{ + *rty_y = rtu_step; + + /* : y = step; */ + /* : if(LOGGER) */ + if (rtu_LOGGER != 0.0) { + /* : fprintf('SIMULINK Move to position Max - 6000\n'); */ + printf("SIMULINK Move to position Max - 6000\n"); + fflush(stdout); + } +} + +/* + * Output and update for atomic system: + * '/MIN POSITION' + * '/MIN POSITION' + * '/MIN POSITION' + */ +void MINPOSITION_g(int16_t rty_y[9], double rtu_LOGGER) +{ + int32_t i; + + /* : y = step; */ + /* : if(LOGGER) */ + if (rtu_LOGGER != 0.0) { + /* : fprintf('SIMULINK Max_position_Ch0 '); */ + printf("SIMULINK Max_position_Ch0 "); + fflush(stdout); + + /* : for i = 1:numel(step) */ + for (i = 0; i < 9; i++) { + /* : fprintf('%d ', int16(step(i))); */ + printf("%d ", rty_y[i]); + fflush(stdout); + } + + /* : fprintf('\n'); */ + printf("\n"); + fflush(stdout); + } +} + +/* + * Output and update for atomic system: + * '/Write Ignition' + * '/Write Ignition' + */ +void WriteIgnition(double rtu_LOGGER, int8_t rtu_step) +{ + /* : if(LOGGER) */ + if (rtu_LOGGER != 0.0) { + /* : fprintf('step = %d\n',step); */ + printf("step = %d\n", rtu_step); + fflush(stdout); + } +} + +/* + * Output and update for action system: + * '/If Action Subsystem3' + * '/If Action Subsystem3' + * '/If Action Subsystem3' + * '/If Action Subsystem3' + * '/If Action Subsystem3' + * '/If Action Subsystem3' + * '/If Action Subsystem3' + */ +void IfActionSubsystem3_m(int8_t rtu_stepIn, int8_t *rty_step) +{ + int32_t i; + + /* BusCreator: '/Bus Creator' incorporates: + * DataStoreWrite: '/Data Store Write' + * SignalConversion generated from: '/Bus Creator' + * */ for (i = 0; i < 9; i++) { - /* Outputs for IfAction SubSystem: '/Check Stall Max' incorporates: - * ActionPort: '/Action Port' - */ - rtb_y_ff[i] = rtDW.Actuator_Ch0_Status_Model.in_CPOS_ALL_Ch0[i]; - - /* End of Outputs for SubSystem: '/Check Stall Max' */ + Actuator_Ch1_Command_Model.POS[i] = 0U; + Actuator_Ch1_Command_Model.BUS_ADR[i] = 0U; + Actuator_Ch1_Command_Model.MODE[i] = 0U; + Actuator_Ch1_Command_Model.COM[i] = 0U; + Actuator_Ch1_Command_Model.Stall_SET[i] = 0U; + Actuator_Ch1_Command_Model.Lnoise_SET[i] = 0U; + Actuator_Ch1_Command_Model.Autos_SET[i] = 0U; + Actuator_Ch1_Command_Model.Speed_SET[i] = 0U; + Actuator_Ch1_Command_Model.Coils_Stop_SET[i] = 0U; } - /* Outputs for IfAction SubSystem: '/Check Stall Max' incorporates: - * ActionPort: '/Action Port' - */ - /* MATLAB Function: '/MAX POSITION' incorporates: - * DataStoreRead: '/Data Store Read1' - */ - MAXPOSITION(rtb_y_ff); + /* End of BusCreator: '/Bus Creator' */ - /* End of Outputs for SubSystem: '/Check Stall Max' */ + /* SignalConversion generated from: '/stepIn' */ + *rty_step = rtu_stepIn; +} + +/* + * Output and update for action system: + * '/If Action Subsystem3' + * '/If Action Subsystem3' + * '/If Action Subsystem3' + * '/If Action Subsystem3' + * '/If Action Subsystem3' + * '/If Action Subsystem3' + * '/If Action Subsystem3' + */ +void IfActionSubsystem3_n(int8_t rtu_stepIn, int8_t *rty_step) +{ + int32_t i; + + /* BusCreator: '/Bus Creator' incorporates: + * DataStoreWrite: '/Data Store Write' + * SignalConversion generated from: '/Bus Creator' + * */ for (i = 0; i < 9; i++) { - /* Outputs for IfAction SubSystem: '/Check Stall Max' incorporates: - * ActionPort: '/Action Port' - */ - rtb_y_b[i] = rtDW.Actuator_Ch0_Status_Model.in_Act_Stall_Slave_Ch0[i]; - - /* End of Outputs for SubSystem: '/Check Stall Max' */ + Actuator_Ch2_Command_Model.POS[i] = 0U; + Actuator_Ch2_Command_Model.BUS_ADR[i] = 0U; + Actuator_Ch2_Command_Model.MODE[i] = 0U; + Actuator_Ch2_Command_Model.COM[i] = 0U; + Actuator_Ch2_Command_Model.Stall_SET[i] = 0U; + Actuator_Ch2_Command_Model.Lnoise_SET[i] = 0U; + Actuator_Ch2_Command_Model.Autos_SET[i] = 0U; + Actuator_Ch2_Command_Model.Speed_SET[i] = 0U; + Actuator_Ch2_Command_Model.Coils_Stop_SET[i] = 0U; } - /* Outputs for IfAction SubSystem: '/Check Stall Max' incorporates: - * ActionPort: '/Action Port' - */ - /* MATLAB Function: '/MAX POSITION1' incorporates: - * DataStoreRead: '/Data Store Read1' - */ - MAXPOSITION1(rtb_y_b); + /* End of BusCreator: '/Bus Creator' */ - /* End of Outputs for SubSystem: '/Check Stall Max' */ - break; + /* SignalConversion generated from: '/stepIn' */ + *rty_step = rtu_stepIn; +} - case 9: - /* Outputs for IfAction SubSystem: '/Homing' incorporates: - * ActionPort: '/Action Port' - */ - /* Merge: '/Merge' incorporates: - * SignalConversion generated from: '/stepIn' - */ - rtB.Merge = rtb_Switch_l4; +/* Model step function */ +void HVAC_model_step(void) +{ + int32_t i; + int16_t rtb_y_ey[9]; + int8_t rtb_Switch; + int8_t rtb_y_fb; + bool rtb_RelationalOperator_j[9]; + bool tmp; + bool tmp_0; - /* Outputs for IfAction SubSystem: '/Switch Case Action Subsystem2' incorporates: - * ActionPort: '/Action Port' - */ - /* SwitchCase: '/Switch Case' incorporates: - * BusCreator: '/Bus Creator' - * DataStoreWrite: '/Data Store Write1' - * MATLAB Function: '/MAX POSITION' + /* BusCreator: '/Bus Creator' incorporates: + * DataStoreWrite: '/Data Store Write' */ CCU_Errors_Model.CCU_IncarTempErrF_Stat = 0U; CCU_Errors_Model.CCU_IncarTempErrR_Stat = 0U; @@ -1533,129 +356,1887 @@ void HVAC_model_step(void) CCU_Errors_Model.CCU_IonizationErr_Stat = 0U; CCU_Errors_Model.CCU_AromaErr_Stat = 0U; - /* : for i = 1:numel(ErrCallibration) */ - for (i = 0; i < 9; i++) { - /* BusCreator: '/Bus Creator1' incorporates: - * DataStoreWrite: '/Data Store Write' - * SignalConversion generated from: '/Bus Creator1' - * */ - Actuator_Ch0_Command_Model.POS[i] = 0U; - Actuator_Ch0_Command_Model.BUS_ADR[i] = 0U; - Actuator_Ch0_Command_Model.MODE[i] = 2U; - Actuator_Ch0_Command_Model.COM[i] = 0U; - Actuator_Ch0_Command_Model.Stall_SET[i] = 0U; - Actuator_Ch0_Command_Model.Lnoise_SET[i] = 0U; - Actuator_Ch0_Command_Model.Autos_SET[i] = 0U; - Actuator_Ch0_Command_Model.Speed_SET[i] = 0U; - Actuator_Ch0_Command_Model.Coils_Stop_SET[i] = 0U; - - /* DataStoreWrite: '/Data Store Write' incorporates: - * Logic: '/Logical Operator' - */ - rtDW.ErrorCalibrationCh0_private[i] = false; - - /* Product: '/Divide1' incorporates: - * Constant: '/ACT1' - * DataStoreRead: '/MAX ACT1T ' - * DataStoreRead: '/MIN ACT1T ' - * Sum: '/ACT1T' - */ - rtb_Divide1_j[i] = (double)(int16_t)(rtDW.MaxPositionCh0_private[i] - - rtDW.MinPositionCh0_private[i]) / (double)rtConstP.pooled18[i]; - } - - MAXPOSITION_l(rtb_Divide1_j, rtb_y_gj); - - /* End of SwitchCase: '/Switch Case' */ - /* End of Outputs for SubSystem: '/Switch Case Action Subsystem2' */ - - /* MATLAB Function: '/MAX POSITION' incorporates: - * DataStoreRead: '/Data Store Read2' + /* Switch: '/Switch' incorporates: + * Constant: '/Constant1' + * DataStoreRead: '/Data Store Read' + * DataStoreRead: '/Data Store Read2' */ - /* : y = step; */ - /* : fprintf('SIMULINK MAX POSITION '); */ - printf("SIMULINK MAX POSITION "); - fflush(stdout); - - /* : for i = 1:numel(step) */ - for (i = 0; i < 9; i++) { - /* : fprintf('%d ', int16(step(i))); */ - printf("%d ", rtDW.MaxPositionCh0_private[i]); - fflush(stdout); + if (rtDW.stepSig_private > 0) { + rtb_Switch = rtDW.stepSig_private; + } else { + rtb_Switch = 1; } - /* : fprintf('\n'); */ - printf("\n"); - fflush(stdout); + /* End of Switch: '/Switch' */ - /* End of MATLAB Function: '/MAX POSITION' */ + /* SwitchCase: '/Switch Case' */ + switch (rtb_Switch) { + case 1: + /* Outputs for IfAction SubSystem: '/Stop Mode' incorporates: + * ActionPort: '/Action Port' + */ + /* If: '/If1' incorporates: + * DataStoreRead: '/Data Store Read1' + * DataStoreWrite: '/Data Store Write' + * DataStoreWrite: '/Data Store Write1' + */ + if ((rtDW.Actuator_Ch0_Status_Model.Busy == 0) && + (rtDW.Actuator_Ch0_Status_Model.Error_Connect == 0)) { + /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: + * ActionPort: '/Action Port' + */ + /* BusCreator: '/Bus Creator' incorporates: + * DataStoreWrite: '/Data Store Write' + * SignalConversion generated from: '/Bus Creator' + * */ + for (i = 0; i < 9; i++) { + Actuator_Ch0_Command_Model.POS[i] = 0U; + Actuator_Ch0_Command_Model.BUS_ADR[i] = 0U; + Actuator_Ch0_Command_Model.MODE[i] = 2U; + Actuator_Ch0_Command_Model.COM[i] = 1U; + Actuator_Ch0_Command_Model.Stall_SET[i] = 0U; + Actuator_Ch0_Command_Model.Lnoise_SET[i] = 0U; + Actuator_Ch0_Command_Model.Autos_SET[i] = 0U; + Actuator_Ch0_Command_Model.Speed_SET[i] = 0U; + Actuator_Ch0_Command_Model.Coils_Stop_SET[i] = 0U; + } - /* MATLAB Function: '/MIN POSITION' incorporates: - * DataStoreRead: '/Data Store Read3' + /* End of BusCreator: '/Bus Creator' */ + + /* Merge: '/Merge' incorporates: + * Constant: '/Constant' + * Sum: '/step inc' + */ + rtB.Merge = (int8_t)(rtb_Switch + 1); + + /* End of Outputs for SubSystem: '/If Action Subsystem2' */ + } else { + /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: + * ActionPort: '/Action Port' + */ + IfActionSubsystem3(rtb_Switch, &rtB.Merge); + + /* 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 Write' + * DataStoreWrite: '/Data Store Write1' + */ + if ((rtDW.Actuator_Ch0_Status_Model.Busy == 0) && + (rtDW.Actuator_Ch0_Status_Model.Error_Connect == 0)) { + /* Outputs for IfAction SubSystem: '/If Action Subsystem' incorporates: + * ActionPort: '/Action Port' + */ + /* BusCreator: '/Bus Creator' incorporates: + * DataStoreWrite: '/Data Store Write2' + * SignalConversion generated from: '/Bus Creator' + * */ + for (i = 0; i < 9; i++) { + Actuator_Ch0_Command_Model.POS[i] = 6000U; + Actuator_Ch0_Command_Model.BUS_ADR[i] = 0U; + Actuator_Ch0_Command_Model.MODE[i] = 0U; + Actuator_Ch0_Command_Model.COM[i] = 2U; + Actuator_Ch0_Command_Model.Stall_SET[i] = 0U; + Actuator_Ch0_Command_Model.Lnoise_SET[i] = 0U; + Actuator_Ch0_Command_Model.Autos_SET[i] = 0U; + Actuator_Ch0_Command_Model.Speed_SET[i] = 0U; + Actuator_Ch0_Command_Model.Coils_Stop_SET[i] = 0U; + } + + /* End of BusCreator: '/Bus Creator' */ + + /* MATLAB Function: '/Initial CPOS Min' incorporates: + * Constant: '/Constant' + * DataStoreRead: '/Data Store Read3' + * Sum: '/step inc' + */ + InitialCPOSMin(rtDW.LOGGER_LIN, (int8_t)(rtb_Switch + 1), &rtb_y_fb); + + /* Merge: '/Merge' incorporates: + * Constant: '/Constant' + * Merge: '/Merge' + * SignalConversion generated from: '/step' + * Sum: '/step inc' + */ + rtB.Merge = (int8_t)(rtb_Switch + 1); + + /* End of Outputs for SubSystem: '/If Action Subsystem' */ + } else { + /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: + * ActionPort: '/Action Port' + */ + /* BusCreator: '/Bus Creator' incorporates: + * DataStoreWrite: '/Data Store Write' + * SignalConversion generated from: '/Bus Creator' + * */ + for (i = 0; i < 9; i++) { + Actuator_Ch0_Command_Model.POS[i] = 0U; + Actuator_Ch0_Command_Model.BUS_ADR[i] = 0U; + Actuator_Ch0_Command_Model.MODE[i] = 0U; + Actuator_Ch0_Command_Model.COM[i] = 0U; + Actuator_Ch0_Command_Model.Stall_SET[i] = 0U; + Actuator_Ch0_Command_Model.Lnoise_SET[i] = 0U; + Actuator_Ch0_Command_Model.Autos_SET[i] = 0U; + Actuator_Ch0_Command_Model.Speed_SET[i] = 0U; + Actuator_Ch0_Command_Model.Coils_Stop_SET[i] = 0U; + } + + /* End of BusCreator: '/Bus Creator' */ + + /* Merge: '/Merge' incorporates: + * Merge: '/Merge' + * SignalConversion generated from: '/stepIn1' + */ + rtB.Merge = rtb_Switch; + + /* 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 Write' + * DataStoreWrite: '/Data Store Write1' + */ + if ((rtDW.Actuator_Ch0_Status_Model.Busy == 0) && + (rtDW.Actuator_Ch0_Status_Model.Error_Connect == 0)) { + /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: + * ActionPort: '/Action Port' + */ + /* BusCreator: '/Bus Creator' incorporates: + * DataStoreWrite: '/Data Store Write1' + * SignalConversion generated from: '/Bus Creator' + * */ + for (i = 0; i < 9; i++) { + Actuator_Ch0_Command_Model.POS[i] = 0U; + Actuator_Ch0_Command_Model.BUS_ADR[i] = 0U; + Actuator_Ch0_Command_Model.MODE[i] = 0U; + Actuator_Ch0_Command_Model.COM[i] = 1U; + Actuator_Ch0_Command_Model.Stall_SET[i] = 0U; + Actuator_Ch0_Command_Model.Lnoise_SET[i] = 0U; + Actuator_Ch0_Command_Model.Autos_SET[i] = 0U; + Actuator_Ch0_Command_Model.Speed_SET[i] = 0U; + Actuator_Ch0_Command_Model.Coils_Stop_SET[i] = 0U; + } + + /* End of BusCreator: '/Bus Creator' */ + + /* MATLAB Function: '/Normal Mode' incorporates: + * Constant: '/Constant' + * DataStoreRead: '/Data Store Read3' + * Sum: '/step inc' + */ + NormalMode(rtDW.LOGGER_LIN, (int8_t)(rtb_Switch + 1), &rtb_y_fb); + + /* Merge: '/Merge' incorporates: + * Constant: '/Constant' + * SignalConversion generated from: '/step' + * Sum: '/step inc' + */ + rtB.Merge = (int8_t)(rtb_Switch + 1); + + /* End of Outputs for SubSystem: '/If Action Subsystem2' */ + } else { + /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: + * ActionPort: '/Action Port' + */ + IfActionSubsystem3(rtb_Switch, &rtB.Merge); + + /* 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 Write' + * DataStoreWrite: '/Data Store Write1' + */ + if ((rtDW.Actuator_Ch0_Status_Model.Busy == 0) && + (rtDW.Actuator_Ch0_Status_Model.Error_Connect == 0)) { + /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: + * ActionPort: '/Action Port' + */ + /* BusCreator: '/Bus Creator' incorporates: + * Constant: '/Constant1' + * Constant: '/Constant10' + * Constant: '/Constant11' + * Constant: '/Constant14' + * Constant: '/Constant2' + * Constant: '/Constant9' + * DataStoreWrite: '/Data Store Write7' + * SignalConversion generated from: '/Bus Creator' + * */ + for (i = 0; i < 9; i++) { + Actuator_Ch0_Command_Model.POS[i] = 1U; + Actuator_Ch0_Command_Model.BUS_ADR[i] = 0U; + Actuator_Ch0_Command_Model.MODE[i] = 0U; + Actuator_Ch0_Command_Model.COM[i] = 3U; + Actuator_Ch0_Command_Model.Stall_SET[i] = 1U; + Actuator_Ch0_Command_Model.Lnoise_SET[i] = 0U; + Actuator_Ch0_Command_Model.Autos_SET[i] = 1U; + Actuator_Ch0_Command_Model.Speed_SET[i] = 3U; + Actuator_Ch0_Command_Model.Coils_Stop_SET[i] = 0U; + } + + /* End of BusCreator: '/Bus Creator' */ + + /* MATLAB Function: '/Move to position Min' incorporates: + * Constant: '/Constant' + * DataStoreRead: '/Data Store Read3' + * Sum: '/step inc' + */ + MovetopositionMin(rtDW.LOGGER_LIN, (int8_t)(rtb_Switch + 1), &rtb_y_fb); + + /* Merge: '/Merge' incorporates: + * Constant: '/Constant' + * SignalConversion generated from: '/step' + * Sum: '/step inc' + */ + rtB.Merge = (int8_t)(rtb_Switch + 1); + + /* End of Outputs for SubSystem: '/If Action Subsystem2' */ + } else { + /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: + * ActionPort: '/Action Port' + */ + IfActionSubsystem3(rtb_Switch, &rtB.Merge); + + /* 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' + */ + /* RelationalOperator: '/Relational Operator1' incorporates: + * DataStoreRead: '/Data Store Read1' + * RelationalOperator: '/Relational Operator' + */ + for (i = 0; i < 9; i++) { + rtb_RelationalOperator_j[i] = + (rtDW.Actuator_Ch0_Status_Model.in_Act_Stall_Slave[i] == 1); + } + + /* End of RelationalOperator: '/Relational Operator1' */ + + /* Logic: '/Logical Operator2' incorporates: + * RelationalOperator: '/Relational Operator' + */ + tmp = rtb_RelationalOperator_j[0]; + for (i = 0; i < 8; i++) { + tmp = (tmp || rtb_RelationalOperator_j[i + 1]); + } + + /* RelationalOperator: '/Relational Operator' incorporates: + * DataStoreRead: '/Data Store Read1' + */ + for (i = 0; i < 9; i++) { + rtb_RelationalOperator_j[i] = + (rtDW.Actuator_Ch0_Status_Model.in_CPOS_ALL[i] == 1); + } + + /* End of RelationalOperator: '/Relational Operator' */ + + /* Logic: '/Logical Operator1' incorporates: + * RelationalOperator: '/Relational Operator' + */ + tmp_0 = rtb_RelationalOperator_j[0]; + for (i = 0; i < 8; i++) { + tmp_0 = (tmp_0 || rtb_RelationalOperator_j[i + 1]); + } + + /* If: '/If2' incorporates: + * DataStoreRead: '/Data Store Read1' + * DataStoreWrite: '/Data Store Write' + * DataStoreWrite: '/Data Store Write1' + * DataTypeConversion: '/Data Type Conversion' + * DataTypeConversion: '/Data Type Conversion1' + * Logic: '/Logical Operator' + * Logic: '/Logical Operator1' + * Logic: '/Logical Operator2' + */ + if ((rtDW.Actuator_Ch0_Status_Model.Busy == 0) && + (rtDW.Actuator_Ch0_Status_Model.Error_Connect == 0) && (tmp || tmp_0)) { + /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: + * ActionPort: '/Action Port' + */ + /* Merge: '/Merge' incorporates: + * Constant: '/Constant' + * Sum: '/step inc' + */ + rtB.Merge = (int8_t)(rtb_Switch + 1); + + /* End of Outputs for SubSystem: '/If Action Subsystem2' */ + for (i = 0; i < 9; i++) { + /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: + * ActionPort: '/Action Port' + */ + rtb_y_ey[i] = rtDW.Actuator_Ch0_Status_Model.in_CPOS_ALL[i]; + + /* End of Outputs for SubSystem: '/If Action Subsystem2' */ + } + + /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: + * ActionPort: '/Action Port' + */ + /* MATLAB Function: '/MIN POSITION' incorporates: + * DataStoreRead: '/Data Store Read3' + */ + MINPOSITION(rtb_y_ey, rtDW.LOGGER_LIN); + + /* End of Outputs for SubSystem: '/If Action Subsystem2' */ + } else { + /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: + * ActionPort: '/Action Port' + */ + IfActionSubsystem3(rtb_Switch, &rtB.Merge); + + /* 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 Write' + * DataStoreWrite: '/Data Store Write1' + */ + if ((rtDW.Actuator_Ch0_Status_Model.Busy == 0) && + (rtDW.Actuator_Ch0_Status_Model.Error_Connect == 0)) { + /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: + * ActionPort: '/Action Port' + */ + /* BusCreator: '/Bus Creator' incorporates: + * DataStoreWrite: '/Data Store Write2' + * SignalConversion generated from: '/Bus Creator' + * */ + for (i = 0; i < 9; i++) { + Actuator_Ch0_Command_Model.POS[i] = 1U; + Actuator_Ch0_Command_Model.BUS_ADR[i] = 0U; + Actuator_Ch0_Command_Model.MODE[i] = 0U; + Actuator_Ch0_Command_Model.COM[i] = 2U; + Actuator_Ch0_Command_Model.Stall_SET[i] = 0U; + Actuator_Ch0_Command_Model.Lnoise_SET[i] = 0U; + Actuator_Ch0_Command_Model.Autos_SET[i] = 0U; + Actuator_Ch0_Command_Model.Speed_SET[i] = 0U; + Actuator_Ch0_Command_Model.Coils_Stop_SET[i] = 0U; + } + + /* End of BusCreator: '/Bus Creator' */ + + /* MATLAB Function: '/Initial CPOS Max' incorporates: + * Constant: '/Constant' + * DataStoreRead: '/Data Store Read3' + * Sum: '/step inc' + */ + InitialCPOSMax(rtDW.LOGGER_LIN, (int8_t)(rtb_Switch + 1), &rtb_y_fb); + + /* Merge: '/Merge' incorporates: + * Constant: '/Constant' + * SignalConversion generated from: '/step' + * Sum: '/step inc' + */ + rtB.Merge = (int8_t)(rtb_Switch + 1); + + /* End of Outputs for SubSystem: '/If Action Subsystem2' */ + } else { + /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: + * ActionPort: '/Action Port' + */ + IfActionSubsystem3(rtb_Switch, &rtB.Merge); + + /* 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 Write' + * DataStoreWrite: '/Data Store Write1' + */ + if ((rtDW.Actuator_Ch0_Status_Model.Busy == 0) && + (rtDW.Actuator_Ch0_Status_Model.Error_Connect == 0)) { + /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: + * ActionPort: '/Action Port' + */ + /* BusCreator: '/Bus Creator' incorporates: + * Constant: '/Constant1' + * Constant: '/Constant10' + * Constant: '/Constant11' + * Constant: '/Constant14' + * Constant: '/Constant2' + * Constant: '/Constant9' + * DataStoreWrite: '/Data Store Write7' + * SignalConversion generated from: '/Bus Creator' + * */ + for (i = 0; i < 9; i++) { + Actuator_Ch0_Command_Model.POS[i] = 6000U; + Actuator_Ch0_Command_Model.BUS_ADR[i] = 0U; + Actuator_Ch0_Command_Model.MODE[i] = 0U; + Actuator_Ch0_Command_Model.COM[i] = 3U; + Actuator_Ch0_Command_Model.Stall_SET[i] = 1U; + Actuator_Ch0_Command_Model.Lnoise_SET[i] = 0U; + Actuator_Ch0_Command_Model.Autos_SET[i] = 1U; + Actuator_Ch0_Command_Model.Speed_SET[i] = 3U; + Actuator_Ch0_Command_Model.Coils_Stop_SET[i] = 0U; + } + + /* End of BusCreator: '/Bus Creator' */ + + /* MATLAB Function: '/Move to position Max' incorporates: + * Constant: '/Constant' + * DataStoreRead: '/Data Store Read3' + * Sum: '/step inc' + */ + MovetopositionMax((int8_t)(rtb_Switch + 1), rtDW.LOGGER_LIN, &rtb_y_fb); + + /* Merge: '/Merge' incorporates: + * Constant: '/Constant' + * SignalConversion generated from: '/step' + * Sum: '/step inc' + */ + rtB.Merge = (int8_t)(rtb_Switch + 1); + + /* End of Outputs for SubSystem: '/If Action Subsystem2' */ + } else { + /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: + * ActionPort: '/Action Port' + */ + IfActionSubsystem3(rtb_Switch, &rtB.Merge); + + /* 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' + */ + /* RelationalOperator: '/Relational Operator1' incorporates: + * DataStoreRead: '/Data Store Read1' + * RelationalOperator: '/Relational Operator' + */ + for (i = 0; i < 9; i++) { + rtb_RelationalOperator_j[i] = + (rtDW.Actuator_Ch0_Status_Model.in_Act_Stall_Slave[i] == 1); + } + + /* End of RelationalOperator: '/Relational Operator1' */ + + /* Logic: '/Logical Operator2' incorporates: + * RelationalOperator: '/Relational Operator' + */ + tmp = rtb_RelationalOperator_j[0]; + for (i = 0; i < 8; i++) { + tmp = (tmp || rtb_RelationalOperator_j[i + 1]); + } + + /* RelationalOperator: '/Relational Operator' incorporates: + * DataStoreRead: '/Data Store Read1' + */ + for (i = 0; i < 9; i++) { + rtb_RelationalOperator_j[i] = + (rtDW.Actuator_Ch0_Status_Model.in_CPOS_ALL[i] == 6000); + } + + /* End of RelationalOperator: '/Relational Operator' */ + + /* Logic: '/Logical Operator1' incorporates: + * RelationalOperator: '/Relational Operator' + */ + tmp_0 = rtb_RelationalOperator_j[0]; + for (i = 0; i < 8; i++) { + tmp_0 = (tmp_0 || rtb_RelationalOperator_j[i + 1]); + } + + /* If: '/If2' incorporates: + * DataStoreRead: '/Data Store Read1' + * DataStoreWrite: '/Data Store Write' + * DataStoreWrite: '/Data Store Write1' + * DataTypeConversion: '/Data Type Conversion' + * DataTypeConversion: '/Data Type Conversion1' + * Logic: '/Logical Operator' + * Logic: '/Logical Operator1' + * Logic: '/Logical Operator2' + */ + if ((rtDW.Actuator_Ch0_Status_Model.Busy == 0) && + (rtDW.Actuator_Ch0_Status_Model.Error_Connect == 0) && (tmp || tmp_0)) { + /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: + * ActionPort: '/Action Port' + */ + /* Merge: '/Merge' incorporates: + * Constant: '/Constant' + * Sum: '/step inc' + */ + rtB.Merge = (int8_t)(rtb_Switch + 1); + + /* End of Outputs for SubSystem: '/If Action Subsystem2' */ + for (i = 0; i < 9; i++) { + /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: + * ActionPort: '/Action Port' + */ + rtb_y_ey[i] = rtDW.Actuator_Ch0_Status_Model.in_CPOS_ALL[i]; + + /* End of Outputs for SubSystem: '/If Action Subsystem2' */ + } + + /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: + * ActionPort: '/Action Port' + */ + /* MATLAB Function: '/MIN POSITION' incorporates: + * DataStoreRead: '/Data Store Read3' + */ + MINPOSITION_g(rtb_y_ey, rtDW.LOGGER_LIN); + + /* End of Outputs for SubSystem: '/If Action Subsystem2' */ + } else { + /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: + * ActionPort: '/Action Port' + */ + IfActionSubsystem3(rtb_Switch, &rtB.Merge); + + /* End of Outputs for SubSystem: '/If Action Subsystem3' */ + } + + /* End of If: '/If2' */ + /* End of Outputs for SubSystem: '/Check Stall Max' */ + break; + + case 9: + break; + } + + /* End of SwitchCase: '/Switch Case' */ + + /* DataStoreWrite: '/Finish write stepSig' */ + rtDW.stepSig_private = rtB.Merge; + + /* MATLAB Function: '/Write Ignition' incorporates: + * DataStoreRead: '/Data Store Read3' */ - /* : y = step; */ - /* : fprintf('SIMULINK MIN POSITION '); */ - printf("SIMULINK MIN POSITION "); - fflush(stdout); + WriteIgnition(rtDW.LOGGER_LIN, rtb_Switch); - /* : for i = 1:numel(step) */ - for (i = 0; i < 9; i++) { - /* : fprintf('%d ', int16(step(i))); */ - printf("%d ", rtDW.MinPositionCh0_private[i]); - fflush(stdout); + /* Switch: '/Switch' incorporates: + * Constant: '/Constant1' + * DataStoreRead: '/Data Store Read' + * DataStoreRead: '/Data Store Read2' + */ + if (rtDW.stepSig_private_c > 0) { + rtb_Switch = rtDW.stepSig_private_c; + } else { + rtb_Switch = 1; } - /* : fprintf('\n'); */ - printf("\n"); - fflush(stdout); + /* End of Switch: '/Switch' */ - /* End of MATLAB Function: '/MIN POSITION' */ - /* End of Outputs for SubSystem: '/Homing' */ - break; - } + /* SwitchCase: '/Switch Case' */ + switch (rtb_Switch) { + case 1: + /* Outputs for IfAction SubSystem: '/Stop Mode' incorporates: + * ActionPort: '/Action Port' + */ + /* If: '/If1' incorporates: + * DataStoreRead: '/Data Store Read1' + * DataStoreWrite: '/Data Store Write' + * DataStoreWrite: '/Data Store Write1' + */ + if ((rtDW.Actuator_Ch1_Status_Model.Busy == 0) && + (rtDW.Actuator_Ch1_Status_Model.Error_Connect == 0)) { + /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: + * ActionPort: '/Action Port' + */ + /* BusCreator: '/Bus Creator' incorporates: + * DataStoreWrite: '/Data Store Write' + * SignalConversion generated from: '/Bus Creator' + * */ + for (i = 0; i < 9; i++) { + Actuator_Ch1_Command_Model.POS[i] = 0U; + Actuator_Ch1_Command_Model.BUS_ADR[i] = 0U; + Actuator_Ch1_Command_Model.MODE[i] = 2U; + Actuator_Ch1_Command_Model.COM[i] = 1U; + Actuator_Ch1_Command_Model.Stall_SET[i] = 0U; + Actuator_Ch1_Command_Model.Lnoise_SET[i] = 0U; + Actuator_Ch1_Command_Model.Autos_SET[i] = 0U; + Actuator_Ch1_Command_Model.Speed_SET[i] = 0U; + Actuator_Ch1_Command_Model.Coils_Stop_SET[i] = 0U; + } - /* End of SwitchCase: '/Switch Case' */ + /* End of BusCreator: '/Bus Creator' */ - /* DataStoreWrite: '/Finish write stepSig' */ - rtDW.stepSig_private = rtB.Merge; + /* Merge: '/Merge' incorporates: + * Constant: '/Constant' + * Sum: '/step inc' + */ + rtB.Merge_c = (int8_t)(rtb_Switch + 1); - /* MATLAB Function: '/Write Ignition' */ - /* : fprintf('step = %d\n',step); */ - printf("step = %d\n", rtb_Switch_l4); - fflush(stdout); + /* End of Outputs for SubSystem: '/If Action Subsystem2' */ + } else { + /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: + * ActionPort: '/Action Port' + */ + IfActionSubsystem3_m(rtb_Switch, &rtB.Merge_c); - /* Update for UnitDelay: '/Cond_prev_private ' */ - rtDW.Cond_prev_private_DSTATE = rtb_FailCond; + /* End of Outputs for SubSystem: '/If Action Subsystem3' */ + } - /* Update for UnitDelay: '/Cond_prev_private ' */ - rtDW.Cond_prev_private_DSTATE_h = rtb_LogicalOperator1; + /* End of If: '/If1' */ + /* End of Outputs for SubSystem: '/Stop Mode' */ + break; - /* Update for UnitDelay: '/Cond_prev_private ' */ - rtDW.Cond_prev_private_DSTATE_i = rtb_LogicalOperator1_f; + case 2: + /* Outputs for IfAction SubSystem: '/Initial CPOS Min' incorporates: + * ActionPort: '/Action Port' + */ + /* If: '/If' incorporates: + * DataStoreRead: '/Data Store Read1' + * DataStoreWrite: '/Data Store Write' + * DataStoreWrite: '/Data Store Write1' + */ + if ((rtDW.Actuator_Ch1_Status_Model.Busy == 0) && + (rtDW.Actuator_Ch1_Status_Model.Error_Connect == 0)) { + /* Outputs for IfAction SubSystem: '/If Action Subsystem' incorporates: + * ActionPort: '/Action Port' + */ + /* BusCreator: '/Bus Creator' incorporates: + * DataStoreWrite: '/Data Store Write2' + * SignalConversion generated from: '/Bus Creator' + * */ + for (i = 0; i < 9; i++) { + Actuator_Ch1_Command_Model.POS[i] = 6000U; + Actuator_Ch1_Command_Model.BUS_ADR[i] = 0U; + Actuator_Ch1_Command_Model.MODE[i] = 0U; + Actuator_Ch1_Command_Model.COM[i] = 2U; + Actuator_Ch1_Command_Model.Stall_SET[i] = 0U; + Actuator_Ch1_Command_Model.Lnoise_SET[i] = 0U; + Actuator_Ch1_Command_Model.Autos_SET[i] = 0U; + Actuator_Ch1_Command_Model.Speed_SET[i] = 0U; + Actuator_Ch1_Command_Model.Coils_Stop_SET[i] = 0U; + } - /* Update for UnitDelay: '/Cond_prev_private ' */ - rtDW.Cond_prev_private_DSTATE_c = rtb_LogicalOperator1_k; + /* End of BusCreator: '/Bus Creator' */ - /* Update for UnitDelay: '/Cond_prev_private ' */ - rtDW.Cond_prev_private_DSTATE_hm = rtb_LogicalOperator1_b; + /* MATLAB Function: '/Initial CPOS Min' incorporates: + * Constant: '/Constant' + * DataStoreRead: '/Data Store Read3' + * Sum: '/step inc' + */ + InitialCPOSMin(rtDW.LOGGER_LIN, (int8_t)(rtb_Switch + 1), &rtb_y_fb); - /* Update for UnitDelay: '/Cond_prev_private ' */ - rtDW.Cond_prev_private_DSTATE_b = rtb_LogicalOperator1_ln; + /* Merge: '/Merge' incorporates: + * Constant: '/Constant' + * Merge: '/Merge' + * SignalConversion generated from: '/step' + * Sum: '/step inc' + */ + rtB.Merge_c = (int8_t)(rtb_Switch + 1); - /* Update for UnitDelay: '/Cond_prev_private ' */ - rtDW.Cond_prev_private_DSTATE_g = rtb_LogicalOperator1_i; + /* End of Outputs for SubSystem: '/If Action Subsystem' */ + } else { + /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: + * ActionPort: '/Action Port' + */ + /* BusCreator: '/Bus Creator' incorporates: + * DataStoreWrite: '/Data Store Write' + * SignalConversion generated from: '/Bus Creator' + * */ + for (i = 0; i < 9; i++) { + Actuator_Ch1_Command_Model.POS[i] = 0U; + Actuator_Ch1_Command_Model.BUS_ADR[i] = 0U; + Actuator_Ch1_Command_Model.MODE[i] = 0U; + Actuator_Ch1_Command_Model.COM[i] = 0U; + Actuator_Ch1_Command_Model.Stall_SET[i] = 0U; + Actuator_Ch1_Command_Model.Lnoise_SET[i] = 0U; + Actuator_Ch1_Command_Model.Autos_SET[i] = 0U; + Actuator_Ch1_Command_Model.Speed_SET[i] = 0U; + Actuator_Ch1_Command_Model.Coils_Stop_SET[i] = 0U; + } + + /* End of BusCreator: '/Bus Creator' */ + + /* Merge: '/Merge' incorporates: + * Merge: '/Merge' + * SignalConversion generated from: '/stepIn1' + */ + rtB.Merge_c = rtb_Switch; + + /* 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 Write' + * DataStoreWrite: '/Data Store Write1' + */ + if ((rtDW.Actuator_Ch1_Status_Model.Busy == 0) && + (rtDW.Actuator_Ch1_Status_Model.Error_Connect == 0)) { + /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: + * ActionPort: '/Action Port' + */ + /* BusCreator: '/Bus Creator' incorporates: + * DataStoreWrite: '/Data Store Write1' + * SignalConversion generated from: '/Bus Creator' + * */ + for (i = 0; i < 9; i++) { + Actuator_Ch1_Command_Model.POS[i] = 0U; + Actuator_Ch1_Command_Model.BUS_ADR[i] = 0U; + Actuator_Ch1_Command_Model.MODE[i] = 0U; + Actuator_Ch1_Command_Model.COM[i] = 1U; + Actuator_Ch1_Command_Model.Stall_SET[i] = 0U; + Actuator_Ch1_Command_Model.Lnoise_SET[i] = 0U; + Actuator_Ch1_Command_Model.Autos_SET[i] = 0U; + Actuator_Ch1_Command_Model.Speed_SET[i] = 0U; + Actuator_Ch1_Command_Model.Coils_Stop_SET[i] = 0U; + } + + /* End of BusCreator: '/Bus Creator' */ + + /* MATLAB Function: '/Normal Mode' incorporates: + * Constant: '/Constant' + * DataStoreRead: '/Data Store Read3' + * Sum: '/step inc' + */ + NormalMode(rtDW.LOGGER_LIN, (int8_t)(rtb_Switch + 1), &rtb_y_fb); + + /* Merge: '/Merge' incorporates: + * Constant: '/Constant' + * SignalConversion generated from: '/step' + * Sum: '/step inc' + */ + rtB.Merge_c = (int8_t)(rtb_Switch + 1); + + /* End of Outputs for SubSystem: '/If Action Subsystem2' */ + } else { + /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: + * ActionPort: '/Action Port' + */ + IfActionSubsystem3_m(rtb_Switch, &rtB.Merge_c); + + /* 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 Write' + * DataStoreWrite: '/Data Store Write1' + */ + if ((rtDW.Actuator_Ch1_Status_Model.Busy == 0) && + (rtDW.Actuator_Ch1_Status_Model.Error_Connect == 0)) { + /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: + * ActionPort: '/Action Port' + */ + /* BusCreator: '/Bus Creator' incorporates: + * Constant: '/Constant1' + * Constant: '/Constant10' + * Constant: '/Constant11' + * Constant: '/Constant14' + * Constant: '/Constant2' + * Constant: '/Constant9' + * DataStoreWrite: '/Data Store Write7' + * SignalConversion generated from: '/Bus Creator' + * */ + for (i = 0; i < 9; i++) { + Actuator_Ch1_Command_Model.POS[i] = 1U; + Actuator_Ch1_Command_Model.BUS_ADR[i] = 0U; + Actuator_Ch1_Command_Model.MODE[i] = 0U; + Actuator_Ch1_Command_Model.COM[i] = 3U; + Actuator_Ch1_Command_Model.Stall_SET[i] = 1U; + Actuator_Ch1_Command_Model.Lnoise_SET[i] = 0U; + Actuator_Ch1_Command_Model.Autos_SET[i] = 1U; + Actuator_Ch1_Command_Model.Speed_SET[i] = 3U; + Actuator_Ch1_Command_Model.Coils_Stop_SET[i] = 0U; + } + + /* End of BusCreator: '/Bus Creator' */ + + /* MATLAB Function: '/Move to position Min' incorporates: + * Constant: '/Constant' + * DataStoreRead: '/Data Store Read3' + * Sum: '/step inc' + */ + MovetopositionMin(rtDW.LOGGER_LIN, (int8_t)(rtb_Switch + 1), &rtb_y_fb); + + /* Merge: '/Merge' incorporates: + * Constant: '/Constant' + * SignalConversion generated from: '/step' + * Sum: '/step inc' + */ + rtB.Merge_c = (int8_t)(rtb_Switch + 1); + + /* End of Outputs for SubSystem: '/If Action Subsystem2' */ + } else { + /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: + * ActionPort: '/Action Port' + */ + IfActionSubsystem3_m(rtb_Switch, &rtB.Merge_c); + + /* 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' + */ + /* RelationalOperator: '/Relational Operator1' incorporates: + * DataStoreRead: '/Data Store Read1' + * RelationalOperator: '/Relational Operator' + */ + for (i = 0; i < 9; i++) { + rtb_RelationalOperator_j[i] = + (rtDW.Actuator_Ch1_Status_Model.in_Act_Stall_Slave[i] == 1); + } + + /* End of RelationalOperator: '/Relational Operator1' */ + + /* Logic: '/Logical Operator2' incorporates: + * RelationalOperator: '/Relational Operator' + */ + tmp = rtb_RelationalOperator_j[0]; + for (i = 0; i < 8; i++) { + tmp = (tmp || rtb_RelationalOperator_j[i + 1]); + } + + /* RelationalOperator: '/Relational Operator' incorporates: + * DataStoreRead: '/Data Store Read1' + */ + for (i = 0; i < 9; i++) { + rtb_RelationalOperator_j[i] = + (rtDW.Actuator_Ch1_Status_Model.in_CPOS_ALL[i] == 1); + } + + /* End of RelationalOperator: '/Relational Operator' */ + + /* Logic: '/Logical Operator1' incorporates: + * RelationalOperator: '/Relational Operator' + */ + tmp_0 = rtb_RelationalOperator_j[0]; + for (i = 0; i < 8; i++) { + tmp_0 = (tmp_0 || rtb_RelationalOperator_j[i + 1]); + } + + /* If: '/If2' incorporates: + * DataStoreRead: '/Data Store Read1' + * DataStoreWrite: '/Data Store Write' + * DataStoreWrite: '/Data Store Write1' + * DataTypeConversion: '/Data Type Conversion' + * DataTypeConversion: '/Data Type Conversion1' + * Logic: '/Logical Operator' + * Logic: '/Logical Operator1' + * Logic: '/Logical Operator2' + */ + if ((rtDW.Actuator_Ch1_Status_Model.Busy == 0) && + (rtDW.Actuator_Ch1_Status_Model.Error_Connect == 0) && (tmp || tmp_0)) { + /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: + * ActionPort: '/Action Port' + */ + /* Merge: '/Merge' incorporates: + * Constant: '/Constant' + * Sum: '/step inc' + */ + rtB.Merge_c = (int8_t)(rtb_Switch + 1); + + /* End of Outputs for SubSystem: '/If Action Subsystem2' */ + for (i = 0; i < 9; i++) { + /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: + * ActionPort: '/Action Port' + */ + rtb_y_ey[i] = rtDW.Actuator_Ch1_Status_Model.in_CPOS_ALL[i]; + + /* End of Outputs for SubSystem: '/If Action Subsystem2' */ + } + + /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: + * ActionPort: '/Action Port' + */ + /* MATLAB Function: '/MIN POSITION' incorporates: + * DataStoreRead: '/Data Store Read3' + */ + MINPOSITION(rtb_y_ey, rtDW.LOGGER_LIN); + + /* End of Outputs for SubSystem: '/If Action Subsystem2' */ + } else { + /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: + * ActionPort: '/Action Port' + */ + IfActionSubsystem3_m(rtb_Switch, &rtB.Merge_c); + + /* 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 Write' + * DataStoreWrite: '/Data Store Write1' + */ + if ((rtDW.Actuator_Ch1_Status_Model.Busy == 0) && + (rtDW.Actuator_Ch1_Status_Model.Error_Connect == 0)) { + /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: + * ActionPort: '/Action Port' + */ + /* BusCreator: '/Bus Creator' incorporates: + * DataStoreWrite: '/Data Store Write2' + * SignalConversion generated from: '/Bus Creator' + * */ + for (i = 0; i < 9; i++) { + Actuator_Ch1_Command_Model.POS[i] = 1U; + Actuator_Ch1_Command_Model.BUS_ADR[i] = 0U; + Actuator_Ch1_Command_Model.MODE[i] = 0U; + Actuator_Ch1_Command_Model.COM[i] = 2U; + Actuator_Ch1_Command_Model.Stall_SET[i] = 0U; + Actuator_Ch1_Command_Model.Lnoise_SET[i] = 0U; + Actuator_Ch1_Command_Model.Autos_SET[i] = 0U; + Actuator_Ch1_Command_Model.Speed_SET[i] = 0U; + Actuator_Ch1_Command_Model.Coils_Stop_SET[i] = 0U; + } + + /* End of BusCreator: '/Bus Creator' */ + + /* MATLAB Function: '/Initial CPOS Max' incorporates: + * Constant: '/Constant' + * DataStoreRead: '/Data Store Read3' + * Sum: '/step inc' + */ + InitialCPOSMax(rtDW.LOGGER_LIN, (int8_t)(rtb_Switch + 1), &rtb_y_fb); + + /* Merge: '/Merge' incorporates: + * Constant: '/Constant' + * SignalConversion generated from: '/step' + * Sum: '/step inc' + */ + rtB.Merge_c = (int8_t)(rtb_Switch + 1); + + /* End of Outputs for SubSystem: '/If Action Subsystem2' */ + } else { + /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: + * ActionPort: '/Action Port' + */ + IfActionSubsystem3_m(rtb_Switch, &rtB.Merge_c); + + /* 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 Write' + * DataStoreWrite: '/Data Store Write1' + */ + if ((rtDW.Actuator_Ch1_Status_Model.Busy == 0) && + (rtDW.Actuator_Ch1_Status_Model.Error_Connect == 0)) { + /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: + * ActionPort: '/Action Port' + */ + /* BusCreator: '/Bus Creator' incorporates: + * Constant: '/Constant1' + * Constant: '/Constant10' + * Constant: '/Constant11' + * Constant: '/Constant14' + * Constant: '/Constant2' + * Constant: '/Constant9' + * DataStoreWrite: '/Data Store Write7' + * SignalConversion generated from: '/Bus Creator' + * */ + for (i = 0; i < 9; i++) { + Actuator_Ch1_Command_Model.POS[i] = 6000U; + Actuator_Ch1_Command_Model.BUS_ADR[i] = 0U; + Actuator_Ch1_Command_Model.MODE[i] = 0U; + Actuator_Ch1_Command_Model.COM[i] = 3U; + Actuator_Ch1_Command_Model.Stall_SET[i] = 1U; + Actuator_Ch1_Command_Model.Lnoise_SET[i] = 0U; + Actuator_Ch1_Command_Model.Autos_SET[i] = 1U; + Actuator_Ch1_Command_Model.Speed_SET[i] = 3U; + Actuator_Ch1_Command_Model.Coils_Stop_SET[i] = 0U; + } + + /* End of BusCreator: '/Bus Creator' */ + + /* MATLAB Function: '/Move to position Max' incorporates: + * Constant: '/Constant' + * DataStoreRead: '/Data Store Read3' + * Sum: '/step inc' + */ + MovetopositionMax((int8_t)(rtb_Switch + 1), rtDW.LOGGER_LIN, &rtb_y_fb); + + /* Merge: '/Merge' incorporates: + * Constant: '/Constant' + * SignalConversion generated from: '/step' + * Sum: '/step inc' + */ + rtB.Merge_c = (int8_t)(rtb_Switch + 1); + + /* End of Outputs for SubSystem: '/If Action Subsystem2' */ + } else { + /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: + * ActionPort: '/Action Port' + */ + IfActionSubsystem3_m(rtb_Switch, &rtB.Merge_c); + + /* 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' + */ + /* RelationalOperator: '/Relational Operator1' incorporates: + * DataStoreRead: '/Data Store Read1' + * RelationalOperator: '/Relational Operator' + */ + for (i = 0; i < 9; i++) { + rtb_RelationalOperator_j[i] = + (rtDW.Actuator_Ch1_Status_Model.in_Act_Stall_Slave[i] == 1); + } + + /* End of RelationalOperator: '/Relational Operator1' */ + + /* Logic: '/Logical Operator2' incorporates: + * RelationalOperator: '/Relational Operator' + */ + tmp = rtb_RelationalOperator_j[0]; + for (i = 0; i < 8; i++) { + tmp = (tmp || rtb_RelationalOperator_j[i + 1]); + } + + /* RelationalOperator: '/Relational Operator' incorporates: + * DataStoreRead: '/Data Store Read1' + */ + for (i = 0; i < 9; i++) { + rtb_RelationalOperator_j[i] = + (rtDW.Actuator_Ch1_Status_Model.in_CPOS_ALL[i] == 6000); + } + + /* End of RelationalOperator: '/Relational Operator' */ + + /* Logic: '/Logical Operator1' incorporates: + * RelationalOperator: '/Relational Operator' + */ + tmp_0 = rtb_RelationalOperator_j[0]; + for (i = 0; i < 8; i++) { + tmp_0 = (tmp_0 || rtb_RelationalOperator_j[i + 1]); + } + + /* If: '/If2' incorporates: + * DataStoreRead: '/Data Store Read1' + * DataStoreWrite: '/Data Store Write' + * DataStoreWrite: '/Data Store Write1' + * DataTypeConversion: '/Data Type Conversion' + * DataTypeConversion: '/Data Type Conversion1' + * Logic: '/Logical Operator' + * Logic: '/Logical Operator1' + * Logic: '/Logical Operator2' + */ + if ((rtDW.Actuator_Ch1_Status_Model.Busy == 0) && + (rtDW.Actuator_Ch1_Status_Model.Error_Connect == 0) && (tmp || tmp_0)) { + /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: + * ActionPort: '/Action Port' + */ + /* Merge: '/Merge' incorporates: + * Constant: '/Constant' + * Sum: '/step inc' + */ + rtB.Merge_c = (int8_t)(rtb_Switch + 1); + + /* End of Outputs for SubSystem: '/If Action Subsystem2' */ + for (i = 0; i < 9; i++) { + /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: + * ActionPort: '/Action Port' + */ + rtb_y_ey[i] = rtDW.Actuator_Ch1_Status_Model.in_CPOS_ALL[i]; + + /* End of Outputs for SubSystem: '/If Action Subsystem2' */ + } + + /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: + * ActionPort: '/Action Port' + */ + /* MATLAB Function: '/MIN POSITION' incorporates: + * DataStoreRead: '/Data Store Read3' + */ + MINPOSITION_g(rtb_y_ey, rtDW.LOGGER_LIN); + + /* End of Outputs for SubSystem: '/If Action Subsystem2' */ + } else { + /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: + * ActionPort: '/Action Port' + */ + IfActionSubsystem3_m(rtb_Switch, &rtB.Merge_c); + + /* End of Outputs for SubSystem: '/If Action Subsystem3' */ + } + + /* End of If: '/If2' */ + /* End of Outputs for SubSystem: '/Check Stall Max' */ + break; + + case 9: + break; + } + + /* End of SwitchCase: '/Switch Case' */ + + /* DataStoreWrite: '/Finish write stepSig' */ + rtDW.stepSig_private_c = rtB.Merge_c; + + /* MATLAB Function: '/Write Ignition' incorporates: + * DataStoreRead: '/Data Store Read3' + */ + WriteIgnition(rtDW.LOGGER_LIN, rtb_Switch); + + /* Switch: '/Switch' incorporates: + * Constant: '/Constant1' + * DataStoreRead: '/Data Store Read' + * DataStoreRead: '/Data Store Read2' + */ + if (rtDW.stepSig_private_p > 0) { + rtb_Switch = rtDW.stepSig_private_p; + } else { + rtb_Switch = 1; + } + + /* End of Switch: '/Switch' */ + + /* SwitchCase: '/Switch Case' */ + switch (rtb_Switch) { + case 1: + /* Outputs for IfAction SubSystem: '/Stop Mode' incorporates: + * ActionPort: '/Action Port' + */ + /* If: '/If1' incorporates: + * DataStoreRead: '/Data Store Read1' + * DataStoreWrite: '/Data Store Write' + * DataStoreWrite: '/Data Store Write1' + */ + if ((rtDW.Actuator_Ch2_Status_Model.Busy == 0) && + (rtDW.Actuator_Ch2_Status_Model.Error_Connect == 0)) { + /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: + * ActionPort: '/Action Port' + */ + /* BusCreator: '/Bus Creator' incorporates: + * DataStoreWrite: '/Data Store Write' + * SignalConversion generated from: '/Bus Creator' + * */ + for (i = 0; i < 9; i++) { + Actuator_Ch2_Command_Model.POS[i] = 0U; + Actuator_Ch2_Command_Model.BUS_ADR[i] = 0U; + Actuator_Ch2_Command_Model.MODE[i] = 2U; + Actuator_Ch2_Command_Model.COM[i] = 1U; + Actuator_Ch2_Command_Model.Stall_SET[i] = 0U; + Actuator_Ch2_Command_Model.Lnoise_SET[i] = 0U; + Actuator_Ch2_Command_Model.Autos_SET[i] = 0U; + Actuator_Ch2_Command_Model.Speed_SET[i] = 0U; + Actuator_Ch2_Command_Model.Coils_Stop_SET[i] = 0U; + } + + /* End of BusCreator: '/Bus Creator' */ + + /* Merge: '/Merge' incorporates: + * Constant: '/Constant' + * Sum: '/step inc' + */ + rtB.Merge_cs = (int8_t)(rtb_Switch + 1); + + /* End of Outputs for SubSystem: '/If Action Subsystem2' */ + } else { + /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: + * ActionPort: '/Action Port' + */ + IfActionSubsystem3_n(rtb_Switch, &rtB.Merge_cs); + + /* 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' + */ + /* MATLAB Function: '/Write Ignition' incorporates: + * DataStoreRead: '/Data Store Read1' + * DataStoreRead: '/Data Store Read3' + * DataStoreWrite: '/Data Store Write' + */ + /* : if(LOGGER) */ + if (rtDW.LOGGER_LIN != 0.0) { + /* : fprintf('LIN 3 busy = %u\n',step); */ + printf("LIN 3 busy = %u\n", rtDW.Actuator_Ch2_Status_Model.Busy); + fflush(stdout); + } + + /* End of MATLAB Function: '/Write Ignition' */ + + /* MATLAB Function: '/Write Ignition1' incorporates: + * DataStoreRead: '/Data Store Read1' + * DataStoreRead: '/Data Store Read2' + * DataStoreWrite: '/Data Store Write1' + */ + /* : if(LOGGER) */ + if (rtDW.LOGGER_LIN != 0.0) { + /* : fprintf('LIN 3 Error_Connect = %u\n',step); */ + printf("LIN 3 Error_Connect = %u\n", + rtDW.Actuator_Ch2_Status_Model.Error_Connect); + fflush(stdout); + } + + /* End of MATLAB Function: '/Write Ignition1' */ + + /* If: '/If' incorporates: + * DataStoreRead: '/Data Store Read1' + * DataStoreWrite: '/Data Store Write' + * DataStoreWrite: '/Data Store Write1' + */ + if ((rtDW.Actuator_Ch2_Status_Model.Busy == 0) && + (rtDW.Actuator_Ch2_Status_Model.Error_Connect == 0)) { + /* Outputs for IfAction SubSystem: '/If Action Subsystem' incorporates: + * ActionPort: '/Action Port' + */ + /* BusCreator: '/Bus Creator' incorporates: + * DataStoreWrite: '/Data Store Write2' + * SignalConversion generated from: '/Bus Creator' + * */ + for (i = 0; i < 9; i++) { + Actuator_Ch2_Command_Model.POS[i] = 6000U; + Actuator_Ch2_Command_Model.BUS_ADR[i] = 0U; + Actuator_Ch2_Command_Model.MODE[i] = 0U; + Actuator_Ch2_Command_Model.COM[i] = 2U; + Actuator_Ch2_Command_Model.Stall_SET[i] = 0U; + Actuator_Ch2_Command_Model.Lnoise_SET[i] = 0U; + Actuator_Ch2_Command_Model.Autos_SET[i] = 0U; + Actuator_Ch2_Command_Model.Speed_SET[i] = 0U; + Actuator_Ch2_Command_Model.Coils_Stop_SET[i] = 0U; + } + + /* End of BusCreator: '/Bus Creator' */ + + /* MATLAB Function: '/Initial CPOS Min' incorporates: + * DataStoreRead: '/Data Store Read3' + */ + /* : y = step; */ + /* : if(LOGGER) */ + if (rtDW.LOGGER_LIN != 0.0) { + /* : fprintf('LIN 3 SIMULINK Initial CPOS Min - 6000\n'); */ + printf("LIN 3 SIMULINK Initial CPOS Min - 6000\n"); + fflush(stdout); + } + + /* End of MATLAB Function: '/Initial CPOS Min' */ + + /* Merge: '/Merge' incorporates: + * Constant: '/Constant' + * Merge: '/Merge' + * SignalConversion generated from: '/step' + * Sum: '/step inc' + */ + rtB.Merge_cs = (int8_t)(rtb_Switch + 1); + + /* End of Outputs for SubSystem: '/If Action Subsystem' */ + } else { + /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: + * ActionPort: '/Action Port' + */ + /* BusCreator: '/Bus Creator' incorporates: + * DataStoreWrite: '/Data Store Write' + * SignalConversion generated from: '/Bus Creator' + * */ + for (i = 0; i < 9; i++) { + Actuator_Ch2_Command_Model.POS[i] = 0U; + Actuator_Ch2_Command_Model.BUS_ADR[i] = 0U; + Actuator_Ch2_Command_Model.MODE[i] = 0U; + Actuator_Ch2_Command_Model.COM[i] = 0U; + Actuator_Ch2_Command_Model.Stall_SET[i] = 0U; + Actuator_Ch2_Command_Model.Lnoise_SET[i] = 0U; + Actuator_Ch2_Command_Model.Autos_SET[i] = 0U; + Actuator_Ch2_Command_Model.Speed_SET[i] = 0U; + Actuator_Ch2_Command_Model.Coils_Stop_SET[i] = 0U; + } + + /* End of BusCreator: '/Bus Creator' */ + + /* Merge: '/Merge' incorporates: + * Merge: '/Merge' + * SignalConversion generated from: '/stepIn1' + */ + rtB.Merge_cs = rtb_Switch; + + /* 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 Write' + * DataStoreWrite: '/Data Store Write1' + */ + if ((rtDW.Actuator_Ch2_Status_Model.Busy == 0) && + (rtDW.Actuator_Ch2_Status_Model.Error_Connect == 0)) { + /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: + * ActionPort: '/Action Port' + */ + /* BusCreator: '/Bus Creator' incorporates: + * DataStoreWrite: '/Data Store Write1' + * SignalConversion generated from: '/Bus Creator' + * */ + for (i = 0; i < 9; i++) { + Actuator_Ch2_Command_Model.POS[i] = 0U; + Actuator_Ch2_Command_Model.BUS_ADR[i] = 0U; + Actuator_Ch2_Command_Model.MODE[i] = 0U; + Actuator_Ch2_Command_Model.COM[i] = 1U; + Actuator_Ch2_Command_Model.Stall_SET[i] = 0U; + Actuator_Ch2_Command_Model.Lnoise_SET[i] = 0U; + Actuator_Ch2_Command_Model.Autos_SET[i] = 0U; + Actuator_Ch2_Command_Model.Speed_SET[i] = 0U; + Actuator_Ch2_Command_Model.Coils_Stop_SET[i] = 0U; + } + + /* End of BusCreator: '/Bus Creator' */ + + /* MATLAB Function: '/Normal Mode' incorporates: + * DataStoreRead: '/Data Store Read3' + */ + /* : y = step; */ + /* : if(LOGGER) */ + if (rtDW.LOGGER_LIN != 0.0) { + /* : fprintf('LIN 3 SIMULINK Normal Mode\n'); */ + printf("LIN 3 SIMULINK Normal Mode\n"); + fflush(stdout); + } + + /* End of MATLAB Function: '/Normal Mode' */ + + /* Merge: '/Merge' incorporates: + * Constant: '/Constant' + * SignalConversion generated from: '/step' + * Sum: '/step inc' + */ + rtB.Merge_cs = (int8_t)(rtb_Switch + 1); + + /* End of Outputs for SubSystem: '/If Action Subsystem2' */ + } else { + /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: + * ActionPort: '/Action Port' + */ + IfActionSubsystem3_n(rtb_Switch, &rtB.Merge_cs); + + /* 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 Write' + * DataStoreWrite: '/Data Store Write1' + */ + if ((rtDW.Actuator_Ch2_Status_Model.Busy == 0) && + (rtDW.Actuator_Ch2_Status_Model.Error_Connect == 0)) { + /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: + * ActionPort: '/Action Port' + */ + /* BusCreator: '/Bus Creator' incorporates: + * Constant: '/Constant1' + * Constant: '/Constant10' + * Constant: '/Constant11' + * Constant: '/Constant14' + * Constant: '/Constant2' + * Constant: '/Constant9' + * DataStoreWrite: '/Data Store Write7' + * SignalConversion generated from: '/Bus Creator' + * */ + for (i = 0; i < 9; i++) { + Actuator_Ch2_Command_Model.POS[i] = 1U; + Actuator_Ch2_Command_Model.BUS_ADR[i] = 0U; + Actuator_Ch2_Command_Model.MODE[i] = 0U; + Actuator_Ch2_Command_Model.COM[i] = 3U; + Actuator_Ch2_Command_Model.Stall_SET[i] = 1U; + Actuator_Ch2_Command_Model.Lnoise_SET[i] = 0U; + Actuator_Ch2_Command_Model.Autos_SET[i] = 1U; + Actuator_Ch2_Command_Model.Speed_SET[i] = 3U; + Actuator_Ch2_Command_Model.Coils_Stop_SET[i] = 0U; + } + + /* End of BusCreator: '/Bus Creator' */ + + /* MATLAB Function: '/Move to position Min' incorporates: + * Constant: '/Constant' + * DataStoreRead: '/Data Store Read3' + * Sum: '/step inc' + */ + MovetopositionMin(rtDW.LOGGER_LIN, (int8_t)(rtb_Switch + 1), &rtb_y_fb); + + /* Merge: '/Merge' incorporates: + * Constant: '/Constant' + * SignalConversion generated from: '/step' + * Sum: '/step inc' + */ + rtB.Merge_cs = (int8_t)(rtb_Switch + 1); + + /* End of Outputs for SubSystem: '/If Action Subsystem2' */ + } else { + /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: + * ActionPort: '/Action Port' + */ + IfActionSubsystem3_n(rtb_Switch, &rtB.Merge_cs); + + /* 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' + */ + /* RelationalOperator: '/Relational Operator1' incorporates: + * DataStoreRead: '/Data Store Read1' + * RelationalOperator: '/Relational Operator' + */ + for (i = 0; i < 9; i++) { + rtb_RelationalOperator_j[i] = + (rtDW.Actuator_Ch2_Status_Model.in_Act_Stall_Slave[i] == 1); + } + + /* End of RelationalOperator: '/Relational Operator1' */ + + /* Logic: '/Logical Operator2' incorporates: + * RelationalOperator: '/Relational Operator' + */ + tmp = rtb_RelationalOperator_j[0]; + for (i = 0; i < 8; i++) { + tmp = (tmp || rtb_RelationalOperator_j[i + 1]); + } + + /* RelationalOperator: '/Relational Operator' incorporates: + * DataStoreRead: '/Data Store Read1' + */ + for (i = 0; i < 9; i++) { + rtb_RelationalOperator_j[i] = + (rtDW.Actuator_Ch2_Status_Model.in_CPOS_ALL[i] == 1); + } + + /* End of RelationalOperator: '/Relational Operator' */ + + /* Logic: '/Logical Operator1' incorporates: + * RelationalOperator: '/Relational Operator' + */ + tmp_0 = rtb_RelationalOperator_j[0]; + for (i = 0; i < 8; i++) { + tmp_0 = (tmp_0 || rtb_RelationalOperator_j[i + 1]); + } + + /* If: '/If2' incorporates: + * DataStoreRead: '/Data Store Read1' + * DataStoreWrite: '/Data Store Write' + * DataStoreWrite: '/Data Store Write1' + * DataTypeConversion: '/Data Type Conversion' + * DataTypeConversion: '/Data Type Conversion1' + * Logic: '/Logical Operator' + * Logic: '/Logical Operator1' + * Logic: '/Logical Operator2' + */ + if ((rtDW.Actuator_Ch2_Status_Model.Busy == 0) && + (rtDW.Actuator_Ch2_Status_Model.Error_Connect == 0) && (tmp || tmp_0)) { + /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: + * ActionPort: '/Action Port' + */ + /* Merge: '/Merge' incorporates: + * Constant: '/Constant' + * Sum: '/step inc' + */ + rtB.Merge_cs = (int8_t)(rtb_Switch + 1); + + /* End of Outputs for SubSystem: '/If Action Subsystem2' */ + for (i = 0; i < 9; i++) { + /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: + * ActionPort: '/Action Port' + */ + rtb_y_ey[i] = rtDW.Actuator_Ch2_Status_Model.in_CPOS_ALL[i]; + + /* End of Outputs for SubSystem: '/If Action Subsystem2' */ + } + + /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: + * ActionPort: '/Action Port' + */ + /* MATLAB Function: '/MIN POSITION' incorporates: + * DataStoreRead: '/Data Store Read3' + */ + MINPOSITION(rtb_y_ey, rtDW.LOGGER_LIN); + + /* End of Outputs for SubSystem: '/If Action Subsystem2' */ + } else { + /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: + * ActionPort: '/Action Port' + */ + IfActionSubsystem3_n(rtb_Switch, &rtB.Merge_cs); + + /* 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 Write' + * DataStoreWrite: '/Data Store Write1' + */ + if ((rtDW.Actuator_Ch2_Status_Model.Busy == 0) && + (rtDW.Actuator_Ch2_Status_Model.Error_Connect == 0)) { + /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: + * ActionPort: '/Action Port' + */ + /* BusCreator: '/Bus Creator' incorporates: + * DataStoreWrite: '/Data Store Write2' + * SignalConversion generated from: '/Bus Creator' + * */ + for (i = 0; i < 9; i++) { + Actuator_Ch2_Command_Model.POS[i] = 1U; + Actuator_Ch2_Command_Model.BUS_ADR[i] = 0U; + Actuator_Ch2_Command_Model.MODE[i] = 0U; + Actuator_Ch2_Command_Model.COM[i] = 2U; + Actuator_Ch2_Command_Model.Stall_SET[i] = 0U; + Actuator_Ch2_Command_Model.Lnoise_SET[i] = 0U; + Actuator_Ch2_Command_Model.Autos_SET[i] = 0U; + Actuator_Ch2_Command_Model.Speed_SET[i] = 0U; + Actuator_Ch2_Command_Model.Coils_Stop_SET[i] = 0U; + } + + /* End of BusCreator: '/Bus Creator' */ + + /* MATLAB Function: '/Initial CPOS Max' incorporates: + * Constant: '/Constant' + * DataStoreRead: '/Data Store Read3' + * Sum: '/step inc' + */ + InitialCPOSMax(rtDW.LOGGER_LIN, (int8_t)(rtb_Switch + 1), &rtb_y_fb); + + /* Merge: '/Merge' incorporates: + * Constant: '/Constant' + * SignalConversion generated from: '/step' + * Sum: '/step inc' + */ + rtB.Merge_cs = (int8_t)(rtb_Switch + 1); + + /* End of Outputs for SubSystem: '/If Action Subsystem2' */ + } else { + /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: + * ActionPort: '/Action Port' + */ + IfActionSubsystem3_n(rtb_Switch, &rtB.Merge_cs); + + /* 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 Write' + * DataStoreWrite: '/Data Store Write1' + */ + if ((rtDW.Actuator_Ch2_Status_Model.Busy == 0) && + (rtDW.Actuator_Ch2_Status_Model.Error_Connect == 0)) { + /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: + * ActionPort: '/Action Port' + */ + /* BusCreator: '/Bus Creator' incorporates: + * Constant: '/Constant1' + * Constant: '/Constant10' + * Constant: '/Constant11' + * Constant: '/Constant14' + * Constant: '/Constant2' + * Constant: '/Constant9' + * DataStoreWrite: '/Data Store Write7' + * SignalConversion generated from: '/Bus Creator' + * */ + for (i = 0; i < 9; i++) { + Actuator_Ch2_Command_Model.POS[i] = 6000U; + Actuator_Ch2_Command_Model.BUS_ADR[i] = 0U; + Actuator_Ch2_Command_Model.MODE[i] = 0U; + Actuator_Ch2_Command_Model.COM[i] = 3U; + Actuator_Ch2_Command_Model.Stall_SET[i] = 1U; + Actuator_Ch2_Command_Model.Lnoise_SET[i] = 0U; + Actuator_Ch2_Command_Model.Autos_SET[i] = 1U; + Actuator_Ch2_Command_Model.Speed_SET[i] = 3U; + Actuator_Ch2_Command_Model.Coils_Stop_SET[i] = 0U; + } + + /* End of BusCreator: '/Bus Creator' */ + + /* MATLAB Function: '/Move to position Max' incorporates: + * Constant: '/Constant' + * DataStoreRead: '/Data Store Read3' + * Sum: '/step inc' + */ + MovetopositionMax((int8_t)(rtb_Switch + 1), rtDW.LOGGER_LIN, &rtb_y_fb); + + /* Merge: '/Merge' incorporates: + * Constant: '/Constant' + * SignalConversion generated from: '/step' + * Sum: '/step inc' + */ + rtB.Merge_cs = (int8_t)(rtb_Switch + 1); + + /* End of Outputs for SubSystem: '/If Action Subsystem2' */ + } else { + /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: + * ActionPort: '/Action Port' + */ + IfActionSubsystem3_n(rtb_Switch, &rtB.Merge_cs); + + /* 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' + */ + /* RelationalOperator: '/Relational Operator1' incorporates: + * DataStoreRead: '/Data Store Read1' + * RelationalOperator: '/Relational Operator' + */ + for (i = 0; i < 9; i++) { + rtb_RelationalOperator_j[i] = + (rtDW.Actuator_Ch2_Status_Model.in_Act_Stall_Slave[i] == 1); + } + + /* End of RelationalOperator: '/Relational Operator1' */ + + /* Logic: '/Logical Operator2' incorporates: + * RelationalOperator: '/Relational Operator' + */ + tmp = rtb_RelationalOperator_j[0]; + for (i = 0; i < 8; i++) { + tmp = (tmp || rtb_RelationalOperator_j[i + 1]); + } + + /* RelationalOperator: '/Relational Operator' incorporates: + * DataStoreRead: '/Data Store Read1' + */ + for (i = 0; i < 9; i++) { + rtb_RelationalOperator_j[i] = + (rtDW.Actuator_Ch2_Status_Model.in_CPOS_ALL[i] == 6000); + } + + /* End of RelationalOperator: '/Relational Operator' */ + + /* Logic: '/Logical Operator1' incorporates: + * RelationalOperator: '/Relational Operator' + */ + tmp_0 = rtb_RelationalOperator_j[0]; + for (i = 0; i < 8; i++) { + tmp_0 = (tmp_0 || rtb_RelationalOperator_j[i + 1]); + } + + /* If: '/If2' incorporates: + * DataStoreRead: '/Data Store Read1' + * DataStoreWrite: '/Data Store Write' + * DataStoreWrite: '/Data Store Write1' + * DataTypeConversion: '/Data Type Conversion' + * DataTypeConversion: '/Data Type Conversion1' + * Logic: '/Logical Operator' + * Logic: '/Logical Operator1' + * Logic: '/Logical Operator2' + */ + if ((rtDW.Actuator_Ch2_Status_Model.Busy == 0) && + (rtDW.Actuator_Ch2_Status_Model.Error_Connect == 0) && (tmp || tmp_0)) { + /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: + * ActionPort: '/Action Port' + */ + /* Merge: '/Merge' incorporates: + * Constant: '/Constant' + * Sum: '/step inc' + */ + rtB.Merge_cs = (int8_t)(rtb_Switch + 1); + + /* End of Outputs for SubSystem: '/If Action Subsystem2' */ + for (i = 0; i < 9; i++) { + /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: + * ActionPort: '/Action Port' + */ + rtb_y_ey[i] = rtDW.Actuator_Ch2_Status_Model.in_CPOS_ALL[i]; + + /* End of Outputs for SubSystem: '/If Action Subsystem2' */ + } + + /* Outputs for IfAction SubSystem: '/If Action Subsystem2' incorporates: + * ActionPort: '/Action Port' + */ + /* MATLAB Function: '/MIN POSITION' incorporates: + * DataStoreRead: '/Data Store Read3' + */ + MINPOSITION_g(rtb_y_ey, rtDW.LOGGER_LIN); + + /* End of Outputs for SubSystem: '/If Action Subsystem2' */ + } else { + /* Outputs for IfAction SubSystem: '/If Action Subsystem3' incorporates: + * ActionPort: '/Action Port' + */ + IfActionSubsystem3_n(rtb_Switch, &rtB.Merge_cs); + + /* End of Outputs for SubSystem: '/If Action Subsystem3' */ + } + + /* End of If: '/If2' */ + /* End of Outputs for SubSystem: '/Check Stall Max' */ + break; + + case 9: + break; + } + + /* End of SwitchCase: '/Switch Case' */ + + /* Outport: '/Out1' incorporates: + * DataStoreRead: '/Data Store Read10' + */ + rtY.Out1 = CCU_Errors_Model; + + /* DataStoreWrite: '/Finish write stepSig' */ + rtDW.stepSig_private_p = rtB.Merge_cs; + + /* MATLAB Function: '/Write Ignition' incorporates: + * DataStoreRead: '/Data Store Read3' + */ + /* : if(LOGGER) */ + if (rtDW.LOGGER_LIN != 0.0) { + /* : fprintf('LIN 3 step = %d\n',step); */ + printf("LIN 3 step = %d\n", rtb_Switch); + fflush(stdout); + } + + /* End of MATLAB Function: '/Write Ignition' */ + + /* DataStoreWrite: '/Data Store Write' incorporates: + * Constant: '/Constant' + */ + rtDW.LOGGER_LIN = 1.0; } /* Model initialize function */ void HVAC_model_initialize(void) { - /* (no initialization code required) */ + /* (no initialization code required) */ } /* Model terminate function */ void HVAC_model_terminate(void) { - /* (no terminate code required) */ + /* (no terminate code required) */ } /* diff --git a/HVAC_model.h b/HVAC_model.h index e191d33..ebc1cba 100644 --- a/HVAC_model.h +++ b/HVAC_model.h @@ -3,9 +3,9 @@ * * Code generated for Simulink model 'HVAC_model'. * - * Model version : 1.604 + * Model version : 1.613 * Simulink Coder version : 24.1 (R2024a) 19-Nov-2023 - * C/C++ source code generated on : Fri Feb 13 13:56:38 2026 + * C/C++ source code generated on : Mon Feb 16 16:08:44 2026 * * Target selection: ert.tlc * Embedded hardware selection: ARM Compatible->ARM Cortex-M @@ -40,78 +40,47 @@ /* Block signals (default storage) */ typedef struct { - int8_t Merge; /* '/Merge' */ + int8_t Merge; /* '/Merge' */ + int8_t Merge_c; /* '/Merge' */ + int8_t Merge_cs; /* '/Merge' */ } B; /* Block states (default storage) for system '' */ typedef struct { - ActuatorCmdBusInput Actuator_Ch0_Status_Model;/* '/Data Store Memory17' */ + ActuatorCmdBusInput Actuator_Ch0_Status_Model;/* '/Data Store Memory17' */ + ActuatorCmdBusInput Actuator_Ch1_Status_Model;/* '/Data Store Memory17' */ + ActuatorCmdBusInput Actuator_Ch2_Status_Model;/* '/Data Store Memory17' */ CmdBusADCData ADC_Data_Model; /* '/Data Store Memory2' */ - uint32_t t_start_delay_private_DSTATE;/* '/t_start_delay_private ' */ - uint32_t t_start_delay_private_DSTATE_p;/* '/t_start_delay_private ' */ - uint32_t t_start_delay_private_DSTATE_pk;/* '/t_start_delay_private ' */ - uint32_t t_start_delay_private_DSTATE_b;/* '/t_start_delay_private ' */ - uint32_t t_start_delay_private_DSTATE_g;/* '/t_start_delay_private ' */ - uint32_t t_start_delay_private_DSTATE_j;/* '/t_start_delay_private ' */ - uint32_t t_start_delay_private_DSTATE_c;/* '/t_start_delay_private ' */ + double LOGGER_ACP; /* '/Data Store Memory1' */ + double LOGGER_LIN; /* '/Data Store Memory1' */ + CmdBusADCDataKey ADC_Key_Data_Model; /* '/Data Store Memory3' */ + CmdBusPwm PWM_Set_Model; /* '/Data Store Memory3' */ + uint32_t t_start_delay_private_DSTATE;/* '/t_start_delay_private ' */ uint32_t t_now; /* '/Data Store Memory5' */ - int16_t MinPositionCh0_private[9]; /* '/Data Store Memory12' */ - int16_t MaxPositionCh0_private[9]; /* '/Data Store Memory13' */ - bool Cond_prev_private_DSTATE; /* '/Cond_prev_private ' */ - bool Cond_prev_private_DSTATE_h; /* '/Cond_prev_private ' */ - bool Cond_prev_private_DSTATE_i; /* '/Cond_prev_private ' */ - bool Cond_prev_private_DSTATE_c; /* '/Cond_prev_private ' */ - bool Cond_prev_private_DSTATE_hm; /* '/Cond_prev_private ' */ - bool Cond_prev_private_DSTATE_b; /* '/Cond_prev_private ' */ - bool Cond_prev_private_DSTATE_g; /* '/Cond_prev_private ' */ - int8_t stepSig_private; /* '/Data Store Memory' */ - bool ErrorCalibrationCh0_private[9]; /* '/Data Store Memory1' */ + bool Cond_prev_private_DSTATE; /* '/Cond_prev_private ' */ + int8_t stepSig_private; /* '/Data Store Memory' */ + int8_t stepSig_private_c; /* '/Data Store Memory' */ + int8_t stepSig_private_p; /* '/Data Store Memory' */ } DW; /* Constant parameters (default storage) */ typedef struct { /* Expression: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 698 694 690 686 683 679 676 672 668 665 662 658 655 652 648 645 642 639 636 632 629 626 623 620 617 615 612 609 606 603 600 598 595 592 590 587 584 582 579 577 574 571 569 566 564 562 559 557 554 552 550 547 545 543 540 538 536 534 532 529 527 525 523 521 519 517 514 512 510 508 506 504 502 500 498 496 494 492 490 489 487 485 483 481 479 477 475 474 472 470 468 466 464 463 461 459 457 456 454 452 451 449 447 445 444 442 440 439 437 436 434 432 431 429 428 426 424 423 421 420 418 417 415 414 412 411 409 408 406 405 403 402 400 399 397 396 394 393 391 390 389 387 386 384 383 382 380 379 377 376 375 373 372 371 369 368 366 365 364 362 361 360 359 357 356 355 353 352 351 349 348 347 346 344 343 342 341 339 338 337 336 334 333 332 331 330 328 327 326 325 324 322 321 320 319 318 317 315 314 313 312 311 310 308 307 306 305 304 303 302 300 299 298 297 296 295 294 293 292 290 289 288 287 286 285 284 283 282 281 280 279 278 276 275 274 273 272 271 270 269 268 267 266 265 264 263 262 261 260 259 258 257 256 255 254 253 252 251 250 249 248 247 246 245 244 243 242 241 240 239 238 237 236 235 234 233 232 231 230 229 228 227 226 225 224 223 222 221 220 219 218 217 217 216 215 214 213 212 211 210 209 208 207 206 205 204 203 202 202 201 200 199 198 197 196 195 194 193 192 192 191 190 189 188 187 186 185 184 183 183 182 181 180 179 178 177 176 175 175 174 173 172 171 170 169 168 168 167 166 165 164 163 162 161 161 160 159 158 157 156 155 155 154 153 152 151 150 149 149 148 147 146 145 144 143 143 142 141 140 139 138 138 137 136 135 134 133 133 132 131 130 129 128 128 127 126 125 124 123 123 122 121 120 119 118 118 117 116 115 114 114 113 112 111 110 109 109 108 107 106 105 105 104 103 102 101 100 100 99 98 97 96 96 95 94 93 92 91 91 90 89 88 87 87 86 85 84 83 83 82 81 80 79 78 78 77 76 75 74 74 73 72 71 70 70 69 68 67 66 66 65 64 63 62 62 61 60 59 58 58 57 56 55 54 54 53 52 51 50 50 49 48 47 46 45 45 44 43 42 41 41 40 39 38 37 37 36 35 34 33 33 32 31 30 29 29 28 27 26 25 25 24 23 22 21 21 20 19 18 17 17 16 15 14 13 13 12 11 10 9 9 8 7 6 5 5 4 3 2 1 1 0 0 -1 -2 -3 -3 -4 -5 -6 -7 -7 -8 -9 -10 -11 -12 -12 -13 -14 -15 -16 -17 -17 -18 -19 -20 -21 -22 -22 -23 -24 -25 -26 -27 -27 -28 -29 -30 -31 -32 -32 -33 -34 -35 -36 -37 -37 -38 -39 -40 -41 -42 -42 -43 -44 -45 -46 -47 -48 -48 -49 -50 -51 -52 -53 -53 -54 -55 -56 -57 -58 -59 -59 -60 -61 -62 -63 -64 -65 -66 -66 -67 -68 -69 -70 -71 -72 -73 -73 -74 -75 -76 -77 -78 -79 -80 -80 -81 -82 -83 -84 -85 -86 -87 -88 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -175 -176 -177 -178 -179 -180 -181 -182 -183 -185 -186 -187 -188 -189 -190 -191 -193 -194 -195 -196 -197 -198 -200 -201 -202 -203 -204 -206 -207 -208 -209 -211 -212 -213 -214 -216 -217 -218 -219 -221 -222 -223 -225 -226 -227 -228 -230 -231 -232 -234 -235 -237 -238 -239 -241 -242 -243 -245 -246 -248 -249 -250 -252 -253 -255 -256 -258 -259 -261 -262 -263 -265 -266 -268 -270 -271 -273 -274 -276 -277 -279 -280 -282 -284 -285 -287 -288 -290 -292 -293 -295 -297 -299 -300 -302 -304 -305 -307 -309 -311 -313 -314 -316 -318 -320 -322 -324 -326 -328 -329 -331 -333 -335 -337 -339 -341 -344 -346 -348 -350 -352 -354 -356 -359 -361 -363 -365 -368 -370 -372 -375 -377 -380 -382 -385 -387 -390 -392 -395 -398 -400 -403 -406 -409 -412 -414 -417 -420 -423 -427 -430 -433 -436 -440 -443 -446 -450 -453 -457 -461 -465 -469 -473 -477 -481 -485 -490 -494 -499 -504 -509 -514 -519 -524 -530 -536 -542 -548 -555 -561 -569 -576 -584 -592 -601 -611 -621 -632 -644 -657 -671 -687 -705 -727 -752 -785 -831 -911] - * Referenced by: '/1-D Lookup Table' + * Referenced by: '/1-D Lookup Table' */ double uDLookupTable_tableData[1024]; - /* Pooled Parameter (Expression: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 848 844 840 836 832 829 825 821 818 814 811 807 804 800 797 794 790 787 784 781 778 774 771 768 765 762 759 756 753 750 748 745 742 739 736 734 731 728 725 723 720 717 715 712 710 707 705 702 700 697 695 692 690 688 685 683 680 678 676 674 671 669 667 665 662 660 658 656 654 652 649 647 645 643 641 639 637 635 633 631 629 627 625 623 621 619 617 615 613 611 609 607 606 604 602 600 598 596 595 593 591 589 587 586 584 582 580 579 577 575 573 572 570 568 567 565 563 562 560 558 557 555 554 552 550 549 547 546 544 542 541 539 538 536 535 533 532 530 529 527 526 524 523 521 520 518 517 515 514 512 511 509 508 507 505 504 502 501 499 498 497 495 494 492 491 490 488 487 486 484 483 482 480 479 478 476 475 474 472 471 470 468 467 466 465 463 462 461 459 458 457 456 454 453 452 451 449 448 447 446 444 443 442 441 440 438 437 436 435 433 432 431 430 429 427 426 425 424 423 422 420 419 418 417 416 415 413 412 411 410 409 408 407 405 404 403 402 401 400 399 398 397 395 394 393 392 391 390 389 388 387 385 384 383 382 381 380 379 378 377 376 375 374 373 372 370 369 368 367 366 365 364 363 362 361 360 359 358 357 356 355 354 353 352 351 350 349 348 347 346 345 344 343 342 341 340 339 338 337 336 335 334 333 332 331 330 329 328 327 326 325 324 323 322 321 320 319 318 317 316 315 314 313 312 311 310 309 308 307 306 306 305 304 303 302 301 300 299 298 297 296 295 294 293 292 291 290 290 289 288 287 286 285 284 283 282 281 280 279 278 277 277 276 275 274 273 272 271 270 269 268 267 266 266 265 264 263 262 261 260 259 258 257 257 256 255 254 253 252 251 250 249 248 248 247 246 245 244 243 242 241 240 240 239 238 237 236 235 234 233 232 232 231 230 229 228 227 226 225 225 224 223 222 221 220 219 218 218 217 216 215 214 213 212 211 211 210 209 208 207 206 205 204 204 203 202 201 200 199 198 198 197 196 195 194 193 192 191 191 190 189 188 187 186 185 185 184 183 182 181 180 179 178 178 177 176 175 174 173 172 172 171 170 169 168 167 166 166 165 164 163 162 161 160 160 159 158 157 156 155 154 154 153 152 151 150 149 148 147 147 146 145 144 143 142 141 141 140 139 138 137 136 135 135 134 133 132 131 130 129 128 128 127 126 125 124 123 122 122 121 120 119 118 117 116 115 115 114 113 112 111 110 109 108 108 107 106 105 104 103 102 101 101 100 99 98 97 96 95 94 94 93 92 91 90 89 88 87 86 86 85 84 83 82 81 80 79 78 77 77 76 75 74 73 72 71 70 69 68 68 67 66 65 64 63 62 61 60 59 58 58 57 56 55 54 53 52 51 50 49 48 47 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -45 -46 -47 -48 -49 -50 -51 -52 -53 -55 -56 -57 -58 -59 -60 -61 -63 -64 -65 -66 -67 -68 -69 -71 -72 -73 -74 -75 -77 -78 -79 -80 -81 -83 -84 -85 -86 -87 -89 -90 -91 -92 -94 -95 -96 -97 -99 -100 -101 -102 -104 -105 -106 -108 -109 -110 -112 -113 -114 -116 -117 -118 -120 -121 -122 -124 -125 -126 -128 -129 -131 -132 -133 -135 -136 -138 -139 -141 -142 -144 -145 -146 -148 -149 -151 -152 -154 -155 -157 -159 -160 -162 -163 -165 -166 -168 -170 -171 -173 -174 -176 -178 -179 -181 -183 -184 -186 -188 -189 -191 -193 -195 -196 -198 -200 -202 -204 -205 -207 -209 -211 -213 -215 -217 -219 -221 -223 -225 -227 -229 -231 -233 -235 -237 -239 -241 -243 -245 -248 -250 -252 -254 -257 -259 -261 -263 -266 -268 -271 -273 -276 -278 -281 -283 -286 -288 -291 -294 -296 -299 -302 -305 -308 -311 -314 -317 -320 -323 -326 -329 -332 -336 -339 -342 -346 -349 -353 -357 -360 -364 -368 -372 -376 -380 -384 -389 -393 -398 -402 -407 -412 -417 -422 -428 -433 -439 -445 -451 -457 -463 -470 -477 -485 -492 -500 -509 -518 -528 -538 -549 -560 -573 -587 -602 -620 -639 -662 -690 -725 -774 -859 ]) - * Referenced by: - * '/1-D Lookup Table' - * '/1-D Lookup Table' + /* Computed Parameter: uDLookupTable_bp01Data + * Referenced by: '/1-D Lookup Table' */ - double pooled1[1024]; - - /* Pooled Parameter (Expression: [-2731 3108 2584 2319 2146 2020 1922 1841 1774 1716 1666 1621 1581 1544 1511 1481 1453 1427 1403 1380 1358 1338 1319 1301 1284 1268 1252 1237 1223 1209 1196 1184 1171 1160 1148 1137 1127 1117 1107 1097 1088 1079 1070 1061 1053 1045 1037 1029 1021 1014 1007 1000 993 986 979 973 967 960 954 948 942 937 931 925 920 915 909 904 899 894 889 884 880 875 870 866 861 857 852 848 844 840 836 831 827 823 820 816 812 808 804 801 797 793 790 786 783 780 776 773 770 766 763 760 757 754 750 747 744 741 738 735 732 729 727 724 721 718 715 713 710 707 704 702 699 697 694 691 689 686 684 681 679 676 674 672 669 667 664 662 660 658 655 653 651 648 646 644 642 640 637 635 633 631 629 627 625 623 621 618 616 614 612 610 608 606 604 602 601 599 597 595 593 591 589 587 586 584 582 580 578 576 575 573 571 569 568 566 564 563 561 559 557 556 554 552 551 549 547 546 544 543 541 539 538 536 534 533 531 530 528 527 525 523 522 520 519 517 516 514 513 511 510 508 507 505 504 502 501 500 498 497 495 494 492 491 490 488 487 485 484 483 481 480 479 477 476 475 473 472 471 469 468 467 465 464 463 461 460 459 457 456 455 454 452 451 450 449 447 446 445 444 442 441 440 439 437 436 435 434 432 431 430 429 428 426 425 424 423 422 420 419 418 417 416 415 413 412 411 410 409 408 406 405 404 403 402 401 400 399 397 396 395 394 393 392 391 390 389 387 386 385 384 383 382 381 380 379 378 377 376 375 373 372 371 370 369 368 367 366 365 364 363 362 361 360 359 358 357 356 355 354 353 352 351 350 349 348 347 346 345 344 343 342 341 340 339 338 337 336 335 334 333 332 331 330 329 328 327 326 325 324 323 322 321 320 319 318 317 316 315 314 313 312 311 310 309 308 307 307 306 305 304 303 302 301 300 299 298 297 296 295 294 293 293 292 291 290 289 288 287 286 285 284 283 282 281 281 280 279 278 277 276 275 274 273 272 272 271 270 269 268 267 266 265 264 264 263 262 261 260 259 258 257 256 256 255 254 253 252 251 250 249 249 248 247 246 245 244 243 242 242 241 240 239 238 237 236 235 235 234 233 232 231 230 229 229 228 227 226 225 224 223 223 222 221 220 219 218 217 217 216 215 214 213 212 211 211 210 209 208 207 206 206 205 204 203 202 201 200 200 199 198 197 196 195 195 194 193 192 191 190 190 189 188 187 186 185 184 184 183 182 181 180 179 179 178 177 176 175 174 174 173 172 171 170 169 169 168 167 166 165 164 164 163 162 161 160 159 159 158 157 156 155 154 154 153 152 151 150 149 149 148 147 146 145 144 144 143 142 141 140 139 139 138 137 136 135 134 134 133 132 131 130 129 129 128 127 126 125 124 124 123 122 121 120 119 118 118 117 116 115 114 113 113 112 111 110 109 108 108 107 106 105 104 103 103 102 101 100 99 98 97 97 96 95 94 93 92 92 91 90 89 88 87 86 86 85 84 83 82 81 80 80 79 78 77 76 75 74 74 73 72 71 70 69 68 67 67 66 65 64 63 62 61 60 60 59 58 57 56 55 54 53 53 52 51 50 49 48 47 46 45 45 44 43 42 41 40 39 38 37 36 36 35 34 33 32 31 30 29 28 27 26 26 25 24 23 22 21 20 19 18 17 16 15 14 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 -1 -2 -3 -4 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -68 -69 -70 -71 -72 -73 -74 -75 -77 -78 -79 -80 -81 -82 -84 -85 -86 -87 -88 -89 -91 -92 -93 -94 -95 -97 -98 -99 -100 -101 -103 -104 -105 -106 -108 -109 -110 -111 -113 -114 -115 -117 -118 -119 -120 -122 -123 -124 -126 -127 -128 -130 -131 -132 -134 -135 -136 -138 -139 -141 -142 -143 -145 -146 -148 -149 -150 -152 -153 -155 -156 -158 -159 -161 -162 -164 -165 -167 -168 -170 -172 -173 -175 -176 -178 -179 -181 -183 -184 -186 -188 -189 -191 -193 -194 -196 -198 -199 -201 -203 -205 -206 -208 -210 -212 -214 -216 -217 -219 -221 -223 -225 -227 -229 -231 -233 -235 -237 -239 -241 -243 -245 -247 -250 -252 -254 -256 -258 -261 -263 -265 -268 -270 -272 -275 -277 -280 -282 -285 -287 -290 -292 -295 -298 -300 -303 -306 -309 -312 -314 -317 -320 -323 -327 -330 -333 -336 -339 -343 -346 -350 -353 -357 -361 -364 -368 -372 -376 -380 -384 -389 -393 -398 -402 -407 -412 -417 -422 -427 -433 -438 -444 -450 -456 -463 -470 -477 -484 -492 -500 -508 -517 -526 -537 -547 -559 -572 -585 -601 -618 -637 -660 -687 -722 -771 -856 - ]) - * Referenced by: - * '/1-D Lookup Table' - * '/1-D Lookup Table' - * '/1-D Lookup Table' - * '/1-D Lookup Table' - */ - double pooled2[1024]; - - /* Pooled Parameter (Expression: [0:4:4092]) - * Referenced by: - * '/1-D Lookup Table' - * '/1-D Lookup Table' - * '/1-D Lookup Table' - * '/1-D Lookup Table' - * '/1-D Lookup Table' - * '/1-D Lookup Table' - * '/1-D Lookup Table' - */ - uint16_t pooled15[1024]; - - /* Pooled Parameter (Expression: [5900 6100 6050 6010 5990 5800 6015 0 8500]) - * Referenced by: - * '/ACT1' - * '/ACT1' - */ - uint16_t pooled18[9]; + uint16_t uDLookupTable_bp01Data[1024]; } ConstP; +/* External outputs (root outports fed by signals with default storage) */ +typedef struct { + CmdBusError Out1; /* '/Out1' */ +} ExtY; + /* Real-time Model Data Structure */ struct tag_RTM { const char * volatile errorStatus; @@ -123,6 +92,9 @@ extern B rtB; /* Block states (default storage) */ extern DW rtDW; +/* External outputs (root outports fed by signals with default storage) */ +extern ExtY rtY; + /* Constant parameters (default storage) */ extern const ConstP rtConstP; @@ -134,9 +106,12 @@ extern const ConstP rtConstP; * states and exports their symbols. * */ -extern ActuatorCmdBus Actuator_Ch0_Command_Model;/* '/Data Store Memory15' */ +extern ActuatorCmdBus Actuator_Ch0_Command_Model;/* '/Data Store Memory15' */ +extern ActuatorCmdBus Actuator_Ch1_Command_Model;/* '/Data Store Memory15' */ +extern ActuatorCmdBus Actuator_Ch2_Command_Model;/* '/Data Store Memory15' */ extern CmdBusStatus Status_Sensor_Model;/* '/Data Store Memory' */ extern CmdBusError CCU_Errors_Model; /* '/Data Store Memory3' */ +extern CmdBusPWMGet PWM_Get; /* '/Data Store Memory1' */ /* Model entry point functions */ extern void HVAC_model_initialize(void); @@ -149,32 +124,9 @@ extern RT_MODEL *const rtM; /*- * These blocks were eliminated from the model due to optimizations: * - * Block '/ACT1' : Unused code path elimination - * Block '/ACT1T' : Unused code path elimination - * Block '/Compare' : Unused code path elimination - * Block '/Constant' : Unused code path elimination - * Block '/Compare' : Unused code path elimination - * Block '/Constant' : Unused code path elimination - * Block '/Constant' : Unused code path elimination - * Block '/Constant1' : Unused code path elimination - * Block '/Divide1' : Unused code path elimination - * Block '/Logical Operator' : Unused code path elimination - * Block '/Switch' : Unused code path elimination - * Block '/Constant' : Unused code path elimination - * Block '/Constant1' : Unused code path elimination - * Block '/Constant2' : Unused code path elimination - * Block '/step inc' : Unused code path elimination - * Block '/Compare' : Unused code path elimination - * Block '/Constant' : Unused code path elimination - * Block '/Compare' : Unused code path elimination - * Block '/Constant' : Unused code path elimination - * Block '/Constant' : Unused code path elimination - * Block '/Constant1' : Unused code path elimination - * Block '/Constant2' : Unused code path elimination - * Block '/Logical Operator1' : Unused code path elimination - * Block '/step inc' : Unused code path elimination - * Block '/Display3' : Unused code path elimination - * Block '/Data Type Conversion' : Eliminate redundant data type conversion + * Block '/Display3' : Unused code path elimination + * Block '/Display3' : Unused code path elimination + * Block '/Display3' : Unused code path elimination */ /*- @@ -194,134 +146,124 @@ extern RT_MODEL *const rtM; * '' : 'HVAC_model' * '' : 'HVAC_model/ACP' * '' : 'HVAC_model/LIN' - * '' : 'HVAC_model/ACP/Ambient' - * '' : 'HVAC_model/ACP/EvapF' - * '' : 'HVAC_model/ACP/EvapR' - * '' : 'HVAC_model/ACP/IncarFL' - * '' : 'HVAC_model/ACP/IncarFR' - * '' : 'HVAC_model/ACP/IncarRL' - * '' : 'HVAC_model/ACP/IncarRR' - * '' : 'HVAC_model/ACP/Ambient/CAN ERROR' - * '' : 'HVAC_model/ACP/Ambient/Compare To Constant' - * '' : 'HVAC_model/ACP/Ambient/Compare To Constant1' - * '' : 'HVAC_model/ACP/Ambient/Compare To Constant2' - * '' : 'HVAC_model/ACP/Ambient/RealTime_Timer' - * '' : 'HVAC_model/ACP/Ambient/Status_Sensor_Model' - * '' : 'HVAC_model/ACP/Ambient/UDS ERROR' - * '' : 'HVAC_model/ACP/Ambient/Write Ambient' - * '' : 'HVAC_model/ACP/Ambient/Write ERROR' - * '' : 'HVAC_model/ACP/EvapF/CAN ERROR' - * '' : 'HVAC_model/ACP/EvapF/Compare To Constant' - * '' : 'HVAC_model/ACP/EvapF/Compare To Constant1' - * '' : 'HVAC_model/ACP/EvapF/Compare To Constant2' - * '' : 'HVAC_model/ACP/EvapF/RealTime_Timer' - * '' : 'HVAC_model/ACP/EvapF/Status_Sensor_Model' - * '' : 'HVAC_model/ACP/EvapF/UDS ERROR' - * '' : 'HVAC_model/ACP/EvapF/Write ERROR' - * '' : 'HVAC_model/ACP/EvapF/Write Eva_F' - * '' : 'HVAC_model/ACP/EvapR/CAN ERROR' - * '' : 'HVAC_model/ACP/EvapR/Compare To Constant' - * '' : 'HVAC_model/ACP/EvapR/Compare To Constant1' - * '' : 'HVAC_model/ACP/EvapR/Compare To Constant2' - * '' : 'HVAC_model/ACP/EvapR/RealTime_Timer' - * '' : 'HVAC_model/ACP/EvapR/Status_Sensor_Model' - * '' : 'HVAC_model/ACP/EvapR/UDS ERROR' - * '' : 'HVAC_model/ACP/EvapR/Write ERROR' - * '' : 'HVAC_model/ACP/EvapR/Write Eva_F' - * '' : 'HVAC_model/ACP/IncarFL/CAN ERROR' - * '' : 'HVAC_model/ACP/IncarFL/Compare To Constant' - * '' : 'HVAC_model/ACP/IncarFL/Compare To Constant1' - * '' : 'HVAC_model/ACP/IncarFL/Compare To Constant2' - * '' : 'HVAC_model/ACP/IncarFL/RealTime_Timer' - * '' : 'HVAC_model/ACP/IncarFL/Status_Sensor_Model' - * '' : 'HVAC_model/ACP/IncarFL/UDS ERROR' - * '' : 'HVAC_model/ACP/IncarFL/Write ERROR' - * '' : 'HVAC_model/ACP/IncarFL/Write IncarFL' - * '' : 'HVAC_model/ACP/IncarFR/CAN ERROR' - * '' : 'HVAC_model/ACP/IncarFR/Compare To Constant' - * '' : 'HVAC_model/ACP/IncarFR/Compare To Constant1' - * '' : 'HVAC_model/ACP/IncarFR/Compare To Constant2' - * '' : 'HVAC_model/ACP/IncarFR/RealTime_Timer' - * '' : 'HVAC_model/ACP/IncarFR/Status_Sensor_Model' - * '' : 'HVAC_model/ACP/IncarFR/UDS ERROR' - * '' : 'HVAC_model/ACP/IncarFR/Write ERROR' - * '' : 'HVAC_model/ACP/IncarFR/Write IncarFR' - * '' : 'HVAC_model/ACP/IncarRL/CAN ERROR' - * '' : 'HVAC_model/ACP/IncarRL/Compare To Constant' - * '' : 'HVAC_model/ACP/IncarRL/Compare To Constant1' - * '' : 'HVAC_model/ACP/IncarRL/Compare To Constant2' - * '' : 'HVAC_model/ACP/IncarRL/RealTime_Timer' - * '' : 'HVAC_model/ACP/IncarRL/Status_Sensor_Model' - * '' : 'HVAC_model/ACP/IncarRL/UDS ERROR' - * '' : 'HVAC_model/ACP/IncarRL/Write ERROR' - * '' : 'HVAC_model/ACP/IncarRL/Write IncarRL' - * '' : 'HVAC_model/ACP/IncarRR/CAN ERROR' - * '' : 'HVAC_model/ACP/IncarRR/Compare To Constant' - * '' : 'HVAC_model/ACP/IncarRR/Compare To Constant1' - * '' : 'HVAC_model/ACP/IncarRR/Compare To Constant2' - * '' : 'HVAC_model/ACP/IncarRR/RealTime_Timer' - * '' : 'HVAC_model/ACP/IncarRR/Status_Sensor_Model' - * '' : 'HVAC_model/ACP/IncarRR/UDS ERROR' - * '' : 'HVAC_model/ACP/IncarRR/Write ERROR' - * '' : 'HVAC_model/ACP/IncarRR/Write IncarFL' - * '' : 'HVAC_model/LIN/CHANEL0' - * '' : 'HVAC_model/LIN/CHANEL0/Check Stall Max' - * '' : 'HVAC_model/LIN/CHANEL0/Check Stall Min' - * '' : 'HVAC_model/LIN/CHANEL0/Homing' - * '' : 'HVAC_model/LIN/CHANEL0/Initial CPOS Max' - * '' : 'HVAC_model/LIN/CHANEL0/Initial CPOS Min' - * '' : 'HVAC_model/LIN/CHANEL0/Move to position Max' - * '' : 'HVAC_model/LIN/CHANEL0/Move to position Min' - * '' : 'HVAC_model/LIN/CHANEL0/Normal Mode' - * '' : 'HVAC_model/LIN/CHANEL0/Stop Mode' - * '' : 'HVAC_model/LIN/CHANEL0/Write Ignition' - * '' : 'HVAC_model/LIN/CHANEL0/Check Stall Max/If Action Subsystem2' - * '' : 'HVAC_model/LIN/CHANEL0/Check Stall Max/If Action Subsystem3' - * '' : 'HVAC_model/LIN/CHANEL0/Check Stall Max/MAX POSITION' - * '' : 'HVAC_model/LIN/CHANEL0/Check Stall Max/MAX POSITION1' - * '' : 'HVAC_model/LIN/CHANEL0/Check Stall Max/If Action Subsystem2/MIN POSITION' - * '' : 'HVAC_model/LIN/CHANEL0/Check Stall Min/If Action Subsystem2' - * '' : 'HVAC_model/LIN/CHANEL0/Check Stall Min/If Action Subsystem3' - * '' : 'HVAC_model/LIN/CHANEL0/Check Stall Min/MAX POSITION' - * '' : 'HVAC_model/LIN/CHANEL0/Check Stall Min/MAX POSITION1' - * '' : 'HVAC_model/LIN/CHANEL0/Check Stall Min/If Action Subsystem2/MIN POSITION' - * '' : 'HVAC_model/LIN/CHANEL0/Homing/MAX POSITION' - * '' : 'HVAC_model/LIN/CHANEL0/Homing/MIN POSITION' - * '' : 'HVAC_model/LIN/CHANEL0/Homing/Switch Case Action Subsystem' - * '' : 'HVAC_model/LIN/CHANEL0/Homing/Switch Case Action Subsystem1' - * '' : 'HVAC_model/LIN/CHANEL0/Homing/Switch Case Action Subsystem2' - * '' : 'HVAC_model/LIN/CHANEL0/Homing/Switch Case Action Subsystem/Compare To Constant' - * '' : 'HVAC_model/LIN/CHANEL0/Homing/Switch Case Action Subsystem/Compare To Constant1' - * '' : 'HVAC_model/LIN/CHANEL0/Homing/Switch Case Action Subsystem1/CAN ERROR' - * '' : 'HVAC_model/LIN/CHANEL0/Homing/Switch Case Action Subsystem1/Compare To Constant' - * '' : 'HVAC_model/LIN/CHANEL0/Homing/Switch Case Action Subsystem1/MAX POSITION' - * '' : 'HVAC_model/LIN/CHANEL0/Homing/Switch Case Action Subsystem1/UDS ERROR' - * '' : 'HVAC_model/LIN/CHANEL0/Homing/Switch Case Action Subsystem1/CAN ERROR/Write ERROR' - * '' : 'HVAC_model/LIN/CHANEL0/Homing/Switch Case Action Subsystem2/CAN ERROR' - * '' : 'HVAC_model/LIN/CHANEL0/Homing/Switch Case Action Subsystem2/Compare To Constant3' - * '' : 'HVAC_model/LIN/CHANEL0/Homing/Switch Case Action Subsystem2/Compare To Constant4' - * '' : 'HVAC_model/LIN/CHANEL0/Homing/Switch Case Action Subsystem2/MAX POSITION' - * '' : 'HVAC_model/LIN/CHANEL0/Homing/Switch Case Action Subsystem2/UDS ERROR' - * '' : 'HVAC_model/LIN/CHANEL0/Homing/Switch Case Action Subsystem2/CAN ERROR/Write ERROR' - * '' : 'HVAC_model/LIN/CHANEL0/Initial CPOS Max/If Action Subsystem2' - * '' : 'HVAC_model/LIN/CHANEL0/Initial CPOS Max/If Action Subsystem3' - * '' : 'HVAC_model/LIN/CHANEL0/Initial CPOS Max/If Action Subsystem2/Initial CPOS Max' - * '' : 'HVAC_model/LIN/CHANEL0/Initial CPOS Min/If Action Subsystem' - * '' : 'HVAC_model/LIN/CHANEL0/Initial CPOS Min/If Action Subsystem3' - * '' : 'HVAC_model/LIN/CHANEL0/Initial CPOS Min/If Action Subsystem/Initial CPOS Min' - * '' : 'HVAC_model/LIN/CHANEL0/Move to position Max/If Action Subsystem2' - * '' : 'HVAC_model/LIN/CHANEL0/Move to position Max/If Action Subsystem3' - * '' : 'HVAC_model/LIN/CHANEL0/Move to position Max/If Action Subsystem2/Move to position Max' - * '' : 'HVAC_model/LIN/CHANEL0/Move to position Min/If Action Subsystem2' - * '' : 'HVAC_model/LIN/CHANEL0/Move to position Min/If Action Subsystem3' - * '' : 'HVAC_model/LIN/CHANEL0/Move to position Min/If Action Subsystem2/Move to position Min' - * '' : 'HVAC_model/LIN/CHANEL0/Normal Mode/If Action Subsystem2' - * '' : 'HVAC_model/LIN/CHANEL0/Normal Mode/If Action Subsystem3' - * '' : 'HVAC_model/LIN/CHANEL0/Normal Mode/MAX POSITION1' - * '' : 'HVAC_model/LIN/CHANEL0/Normal Mode/MAX POSITION2' - * '' : 'HVAC_model/LIN/CHANEL0/Normal Mode/If Action Subsystem2/Normal Mode' - * '' : 'HVAC_model/LIN/CHANEL0/Stop Mode/If Action Subsystem2' - * '' : 'HVAC_model/LIN/CHANEL0/Stop Mode/If Action Subsystem3' + * '' : 'HVAC_model/PWN' + * '' : 'HVAC_model/ACP/Ambient' + * '' : 'HVAC_model/ACP/Write' + * '' : 'HVAC_model/ACP/Write1' + * '' : 'HVAC_model/ACP/Write2' + * '' : 'HVAC_model/ACP/Write3' + * '' : 'HVAC_model/ACP/Write4' + * '' : 'HVAC_model/ACP/Ambient/Compare To Constant' + * '' : 'HVAC_model/ACP/Ambient/Compare To Constant1' + * '' : 'HVAC_model/ACP/Ambient/Compare To Constant2' + * '' : 'HVAC_model/ACP/Ambient/RealTime_Timer' + * '' : 'HVAC_model/ACP/Ambient/Status_Sensor_Model' + * '' : 'HVAC_model/ACP/Ambient/UDS ERROR' + * '' : 'HVAC_model/ACP/Ambient/Write Ambient' + * '' : 'HVAC_model/ACP/Ambient/Write ERROR' + * '' : 'HVAC_model/LIN/CHANEL0' + * '' : 'HVAC_model/LIN/CHANEL1' + * '' : 'HVAC_model/LIN/CHANEL2' + * '' : 'HVAC_model/LIN/CHANEL0/Check Stall Max' + * '' : 'HVAC_model/LIN/CHANEL0/Check Stall Min' + * '' : 'HVAC_model/LIN/CHANEL0/Initial CPOS Max' + * '' : 'HVAC_model/LIN/CHANEL0/Initial CPOS Min' + * '' : 'HVAC_model/LIN/CHANEL0/Move to position Max' + * '' : 'HVAC_model/LIN/CHANEL0/Move to position Min' + * '' : 'HVAC_model/LIN/CHANEL0/Normal Mode' + * '' : 'HVAC_model/LIN/CHANEL0/Stop Mode' + * '' : 'HVAC_model/LIN/CHANEL0/Write Ignition' + * '' : 'HVAC_model/LIN/CHANEL0/Check Stall Max/If Action Subsystem2' + * '' : 'HVAC_model/LIN/CHANEL0/Check Stall Max/If Action Subsystem3' + * '' : 'HVAC_model/LIN/CHANEL0/Check Stall Max/If Action Subsystem2/MIN POSITION' + * '' : 'HVAC_model/LIN/CHANEL0/Check Stall Min/If Action Subsystem2' + * '' : 'HVAC_model/LIN/CHANEL0/Check Stall Min/If Action Subsystem3' + * '' : 'HVAC_model/LIN/CHANEL0/Check Stall Min/If Action Subsystem2/MIN POSITION' + * '' : 'HVAC_model/LIN/CHANEL0/Initial CPOS Max/If Action Subsystem2' + * '' : 'HVAC_model/LIN/CHANEL0/Initial CPOS Max/If Action Subsystem3' + * '' : 'HVAC_model/LIN/CHANEL0/Initial CPOS Max/If Action Subsystem2/Initial CPOS Max' + * '' : 'HVAC_model/LIN/CHANEL0/Initial CPOS Min/If Action Subsystem' + * '' : 'HVAC_model/LIN/CHANEL0/Initial CPOS Min/If Action Subsystem3' + * '' : 'HVAC_model/LIN/CHANEL0/Initial CPOS Min/If Action Subsystem/Initial CPOS Min' + * '' : 'HVAC_model/LIN/CHANEL0/Move to position Max/If Action Subsystem2' + * '' : 'HVAC_model/LIN/CHANEL0/Move to position Max/If Action Subsystem3' + * '' : 'HVAC_model/LIN/CHANEL0/Move to position Max/If Action Subsystem2/Move to position Max' + * '' : 'HVAC_model/LIN/CHANEL0/Move to position Min/If Action Subsystem2' + * '' : 'HVAC_model/LIN/CHANEL0/Move to position Min/If Action Subsystem3' + * '' : 'HVAC_model/LIN/CHANEL0/Move to position Min/If Action Subsystem2/Move to position Min' + * '' : 'HVAC_model/LIN/CHANEL0/Normal Mode/If Action Subsystem2' + * '' : 'HVAC_model/LIN/CHANEL0/Normal Mode/If Action Subsystem3' + * '' : 'HVAC_model/LIN/CHANEL0/Normal Mode/If Action Subsystem2/Normal Mode' + * '' : 'HVAC_model/LIN/CHANEL0/Stop Mode/If Action Subsystem2' + * '' : 'HVAC_model/LIN/CHANEL0/Stop Mode/If Action Subsystem3' + * '' : 'HVAC_model/LIN/CHANEL1/Check Stall Max' + * '' : 'HVAC_model/LIN/CHANEL1/Check Stall Min' + * '' : 'HVAC_model/LIN/CHANEL1/Initial CPOS Max' + * '' : 'HVAC_model/LIN/CHANEL1/Initial CPOS Min' + * '' : 'HVAC_model/LIN/CHANEL1/Move to position Max' + * '' : 'HVAC_model/LIN/CHANEL1/Move to position Min' + * '' : 'HVAC_model/LIN/CHANEL1/Normal Mode' + * '' : 'HVAC_model/LIN/CHANEL1/Stop Mode' + * '' : 'HVAC_model/LIN/CHANEL1/Write Ignition' + * '' : 'HVAC_model/LIN/CHANEL1/Check Stall Max/If Action Subsystem2' + * '' : 'HVAC_model/LIN/CHANEL1/Check Stall Max/If Action Subsystem3' + * '' : 'HVAC_model/LIN/CHANEL1/Check Stall Max/If Action Subsystem2/MIN POSITION' + * '' : 'HVAC_model/LIN/CHANEL1/Check Stall Min/If Action Subsystem2' + * '' : 'HVAC_model/LIN/CHANEL1/Check Stall Min/If Action Subsystem3' + * '' : 'HVAC_model/LIN/CHANEL1/Check Stall Min/If Action Subsystem2/MIN POSITION' + * '' : 'HVAC_model/LIN/CHANEL1/Initial CPOS Max/If Action Subsystem2' + * '' : 'HVAC_model/LIN/CHANEL1/Initial CPOS Max/If Action Subsystem3' + * '' : 'HVAC_model/LIN/CHANEL1/Initial CPOS Max/If Action Subsystem2/Initial CPOS Max' + * '' : 'HVAC_model/LIN/CHANEL1/Initial CPOS Min/If Action Subsystem' + * '' : 'HVAC_model/LIN/CHANEL1/Initial CPOS Min/If Action Subsystem3' + * '' : 'HVAC_model/LIN/CHANEL1/Initial CPOS Min/If Action Subsystem/Initial CPOS Min' + * '' : 'HVAC_model/LIN/CHANEL1/Move to position Max/If Action Subsystem2' + * '' : 'HVAC_model/LIN/CHANEL1/Move to position Max/If Action Subsystem3' + * '' : 'HVAC_model/LIN/CHANEL1/Move to position Max/If Action Subsystem2/Move to position Max' + * '' : 'HVAC_model/LIN/CHANEL1/Move to position Min/If Action Subsystem2' + * '' : 'HVAC_model/LIN/CHANEL1/Move to position Min/If Action Subsystem3' + * '' : 'HVAC_model/LIN/CHANEL1/Move to position Min/If Action Subsystem2/Move to position Min' + * '' : 'HVAC_model/LIN/CHANEL1/Normal Mode/If Action Subsystem2' + * '' : 'HVAC_model/LIN/CHANEL1/Normal Mode/If Action Subsystem3' + * '' : 'HVAC_model/LIN/CHANEL1/Normal Mode/If Action Subsystem2/Normal Mode' + * '' : 'HVAC_model/LIN/CHANEL1/Stop Mode/If Action Subsystem2' + * '' : 'HVAC_model/LIN/CHANEL1/Stop Mode/If Action Subsystem3' + * '' : 'HVAC_model/LIN/CHANEL2/Check Stall Max' + * '' : 'HVAC_model/LIN/CHANEL2/Check Stall Min' + * '' : 'HVAC_model/LIN/CHANEL2/Initial CPOS Max' + * '' : 'HVAC_model/LIN/CHANEL2/Initial CPOS Min' + * '' : 'HVAC_model/LIN/CHANEL2/Move to position Max' + * '' : 'HVAC_model/LIN/CHANEL2/Move to position Min' + * '' : 'HVAC_model/LIN/CHANEL2/Normal Mode' + * '' : 'HVAC_model/LIN/CHANEL2/Stop Mode' + * '' : 'HVAC_model/LIN/CHANEL2/Write Ignition' + * '' : 'HVAC_model/LIN/CHANEL2/Check Stall Max/If Action Subsystem2' + * '' : 'HVAC_model/LIN/CHANEL2/Check Stall Max/If Action Subsystem3' + * '' : 'HVAC_model/LIN/CHANEL2/Check Stall Max/If Action Subsystem2/MIN POSITION' + * '' : 'HVAC_model/LIN/CHANEL2/Check Stall Min/If Action Subsystem2' + * '' : 'HVAC_model/LIN/CHANEL2/Check Stall Min/If Action Subsystem3' + * '' : 'HVAC_model/LIN/CHANEL2/Check Stall Min/If Action Subsystem2/MIN POSITION' + * '' : 'HVAC_model/LIN/CHANEL2/Initial CPOS Max/If Action Subsystem2' + * '' : 'HVAC_model/LIN/CHANEL2/Initial CPOS Max/If Action Subsystem3' + * '' : 'HVAC_model/LIN/CHANEL2/Initial CPOS Max/If Action Subsystem2/Initial CPOS Max' + * '' : 'HVAC_model/LIN/CHANEL2/Initial CPOS Min/If Action Subsystem' + * '' : 'HVAC_model/LIN/CHANEL2/Initial CPOS Min/If Action Subsystem3' + * '' : 'HVAC_model/LIN/CHANEL2/Initial CPOS Min/If Action Subsystem/Initial CPOS Min' + * '' : 'HVAC_model/LIN/CHANEL2/Move to position Max/If Action Subsystem2' + * '' : 'HVAC_model/LIN/CHANEL2/Move to position Max/If Action Subsystem3' + * '' : 'HVAC_model/LIN/CHANEL2/Move to position Max/If Action Subsystem2/Move to position Max' + * '' : 'HVAC_model/LIN/CHANEL2/Move to position Min/If Action Subsystem2' + * '' : 'HVAC_model/LIN/CHANEL2/Move to position Min/If Action Subsystem3' + * '' : 'HVAC_model/LIN/CHANEL2/Move to position Min/If Action Subsystem2/Move to position Min' + * '' : 'HVAC_model/LIN/CHANEL2/Normal Mode/If Action Subsystem2' + * '' : 'HVAC_model/LIN/CHANEL2/Normal Mode/If Action Subsystem3' + * '' : 'HVAC_model/LIN/CHANEL2/Normal Mode/If Action Subsystem2/Normal Mode' + * '' : 'HVAC_model/LIN/CHANEL2/Stop Mode/If Action Subsystem2' + * '' : 'HVAC_model/LIN/CHANEL2/Stop Mode/If Action Subsystem3' + * '' : 'HVAC_model/PWN/Write' + * '' : 'HVAC_model/PWN/Write1' + * '' : 'HVAC_model/PWN/Write2' + * '' : 'HVAC_model/PWN/Write3' */ #endif /* HVAC_model_h_ */ diff --git a/HVAC_model_data.c b/HVAC_model_data.c index b67f084..245762f 100644 --- a/HVAC_model_data.c +++ b/HVAC_model_data.c @@ -3,9 +3,9 @@ * * Code generated for Simulink model 'HVAC_model'. * - * Model version : 1.604 + * Model version : 1.613 * Simulink Coder version : 24.1 (R2024a) 19-Nov-2023 - * C/C++ source code generated on : Fri Feb 13 13:56:38 2026 + * C/C++ source code generated on : Mon Feb 16 16:08:44 2026 * * Target selection: ert.tlc * Embedded hardware selection: ARM Compatible->ARM Cortex-M @@ -20,7 +20,7 @@ /* Constant parameters (default storage) */ const ConstP rtConstP = { /* Expression: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 698 694 690 686 683 679 676 672 668 665 662 658 655 652 648 645 642 639 636 632 629 626 623 620 617 615 612 609 606 603 600 598 595 592 590 587 584 582 579 577 574 571 569 566 564 562 559 557 554 552 550 547 545 543 540 538 536 534 532 529 527 525 523 521 519 517 514 512 510 508 506 504 502 500 498 496 494 492 490 489 487 485 483 481 479 477 475 474 472 470 468 466 464 463 461 459 457 456 454 452 451 449 447 445 444 442 440 439 437 436 434 432 431 429 428 426 424 423 421 420 418 417 415 414 412 411 409 408 406 405 403 402 400 399 397 396 394 393 391 390 389 387 386 384 383 382 380 379 377 376 375 373 372 371 369 368 366 365 364 362 361 360 359 357 356 355 353 352 351 349 348 347 346 344 343 342 341 339 338 337 336 334 333 332 331 330 328 327 326 325 324 322 321 320 319 318 317 315 314 313 312 311 310 308 307 306 305 304 303 302 300 299 298 297 296 295 294 293 292 290 289 288 287 286 285 284 283 282 281 280 279 278 276 275 274 273 272 271 270 269 268 267 266 265 264 263 262 261 260 259 258 257 256 255 254 253 252 251 250 249 248 247 246 245 244 243 242 241 240 239 238 237 236 235 234 233 232 231 230 229 228 227 226 225 224 223 222 221 220 219 218 217 217 216 215 214 213 212 211 210 209 208 207 206 205 204 203 202 202 201 200 199 198 197 196 195 194 193 192 192 191 190 189 188 187 186 185 184 183 183 182 181 180 179 178 177 176 175 175 174 173 172 171 170 169 168 168 167 166 165 164 163 162 161 161 160 159 158 157 156 155 155 154 153 152 151 150 149 149 148 147 146 145 144 143 143 142 141 140 139 138 138 137 136 135 134 133 133 132 131 130 129 128 128 127 126 125 124 123 123 122 121 120 119 118 118 117 116 115 114 114 113 112 111 110 109 109 108 107 106 105 105 104 103 102 101 100 100 99 98 97 96 96 95 94 93 92 91 91 90 89 88 87 87 86 85 84 83 83 82 81 80 79 78 78 77 76 75 74 74 73 72 71 70 70 69 68 67 66 66 65 64 63 62 62 61 60 59 58 58 57 56 55 54 54 53 52 51 50 50 49 48 47 46 45 45 44 43 42 41 41 40 39 38 37 37 36 35 34 33 33 32 31 30 29 29 28 27 26 25 25 24 23 22 21 21 20 19 18 17 17 16 15 14 13 13 12 11 10 9 9 8 7 6 5 5 4 3 2 1 1 0 0 -1 -2 -3 -3 -4 -5 -6 -7 -7 -8 -9 -10 -11 -12 -12 -13 -14 -15 -16 -17 -17 -18 -19 -20 -21 -22 -22 -23 -24 -25 -26 -27 -27 -28 -29 -30 -31 -32 -32 -33 -34 -35 -36 -37 -37 -38 -39 -40 -41 -42 -42 -43 -44 -45 -46 -47 -48 -48 -49 -50 -51 -52 -53 -53 -54 -55 -56 -57 -58 -59 -59 -60 -61 -62 -63 -64 -65 -66 -66 -67 -68 -69 -70 -71 -72 -73 -73 -74 -75 -76 -77 -78 -79 -80 -80 -81 -82 -83 -84 -85 -86 -87 -88 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -175 -176 -177 -178 -179 -180 -181 -182 -183 -185 -186 -187 -188 -189 -190 -191 -193 -194 -195 -196 -197 -198 -200 -201 -202 -203 -204 -206 -207 -208 -209 -211 -212 -213 -214 -216 -217 -218 -219 -221 -222 -223 -225 -226 -227 -228 -230 -231 -232 -234 -235 -237 -238 -239 -241 -242 -243 -245 -246 -248 -249 -250 -252 -253 -255 -256 -258 -259 -261 -262 -263 -265 -266 -268 -270 -271 -273 -274 -276 -277 -279 -280 -282 -284 -285 -287 -288 -290 -292 -293 -295 -297 -299 -300 -302 -304 -305 -307 -309 -311 -313 -314 -316 -318 -320 -322 -324 -326 -328 -329 -331 -333 -335 -337 -339 -341 -344 -346 -348 -350 -352 -354 -356 -359 -361 -363 -365 -368 -370 -372 -375 -377 -380 -382 -385 -387 -390 -392 -395 -398 -400 -403 -406 -409 -412 -414 -417 -420 -423 -427 -430 -433 -436 -440 -443 -446 -450 -453 -457 -461 -465 -469 -473 -477 -481 -485 -490 -494 -499 -504 -509 -514 -519 -524 -530 -536 -542 -548 -555 -561 -569 -576 -584 -592 -601 -611 -621 -632 -644 -657 -671 -687 -705 -727 -752 -785 -831 -911] - * Referenced by: '/1-D Lookup Table' + * Referenced by: '/1-D Lookup Table' */ { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, @@ -118,219 +118,8 @@ const ConstP rtConstP = { -601.0, -611.0, -621.0, -632.0, -644.0, -657.0, -671.0, -687.0, -705.0, -727.0, -752.0, -785.0, -831.0, -911.0 }, - /* Pooled Parameter (Expression: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 848 844 840 836 832 829 825 821 818 814 811 807 804 800 797 794 790 787 784 781 778 774 771 768 765 762 759 756 753 750 748 745 742 739 736 734 731 728 725 723 720 717 715 712 710 707 705 702 700 697 695 692 690 688 685 683 680 678 676 674 671 669 667 665 662 660 658 656 654 652 649 647 645 643 641 639 637 635 633 631 629 627 625 623 621 619 617 615 613 611 609 607 606 604 602 600 598 596 595 593 591 589 587 586 584 582 580 579 577 575 573 572 570 568 567 565 563 562 560 558 557 555 554 552 550 549 547 546 544 542 541 539 538 536 535 533 532 530 529 527 526 524 523 521 520 518 517 515 514 512 511 509 508 507 505 504 502 501 499 498 497 495 494 492 491 490 488 487 486 484 483 482 480 479 478 476 475 474 472 471 470 468 467 466 465 463 462 461 459 458 457 456 454 453 452 451 449 448 447 446 444 443 442 441 440 438 437 436 435 433 432 431 430 429 427 426 425 424 423 422 420 419 418 417 416 415 413 412 411 410 409 408 407 405 404 403 402 401 400 399 398 397 395 394 393 392 391 390 389 388 387 385 384 383 382 381 380 379 378 377 376 375 374 373 372 370 369 368 367 366 365 364 363 362 361 360 359 358 357 356 355 354 353 352 351 350 349 348 347 346 345 344 343 342 341 340 339 338 337 336 335 334 333 332 331 330 329 328 327 326 325 324 323 322 321 320 319 318 317 316 315 314 313 312 311 310 309 308 307 306 306 305 304 303 302 301 300 299 298 297 296 295 294 293 292 291 290 290 289 288 287 286 285 284 283 282 281 280 279 278 277 277 276 275 274 273 272 271 270 269 268 267 266 266 265 264 263 262 261 260 259 258 257 257 256 255 254 253 252 251 250 249 248 248 247 246 245 244 243 242 241 240 240 239 238 237 236 235 234 233 232 232 231 230 229 228 227 226 225 225 224 223 222 221 220 219 218 218 217 216 215 214 213 212 211 211 210 209 208 207 206 205 204 204 203 202 201 200 199 198 198 197 196 195 194 193 192 191 191 190 189 188 187 186 185 185 184 183 182 181 180 179 178 178 177 176 175 174 173 172 172 171 170 169 168 167 166 166 165 164 163 162 161 160 160 159 158 157 156 155 154 154 153 152 151 150 149 148 147 147 146 145 144 143 142 141 141 140 139 138 137 136 135 135 134 133 132 131 130 129 128 128 127 126 125 124 123 122 122 121 120 119 118 117 116 115 115 114 113 112 111 110 109 108 108 107 106 105 104 103 102 101 101 100 99 98 97 96 95 94 94 93 92 91 90 89 88 87 86 86 85 84 83 82 81 80 79 78 77 77 76 75 74 73 72 71 70 69 68 68 67 66 65 64 63 62 61 60 59 58 58 57 56 55 54 53 52 51 50 49 48 47 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -45 -46 -47 -48 -49 -50 -51 -52 -53 -55 -56 -57 -58 -59 -60 -61 -63 -64 -65 -66 -67 -68 -69 -71 -72 -73 -74 -75 -77 -78 -79 -80 -81 -83 -84 -85 -86 -87 -89 -90 -91 -92 -94 -95 -96 -97 -99 -100 -101 -102 -104 -105 -106 -108 -109 -110 -112 -113 -114 -116 -117 -118 -120 -121 -122 -124 -125 -126 -128 -129 -131 -132 -133 -135 -136 -138 -139 -141 -142 -144 -145 -146 -148 -149 -151 -152 -154 -155 -157 -159 -160 -162 -163 -165 -166 -168 -170 -171 -173 -174 -176 -178 -179 -181 -183 -184 -186 -188 -189 -191 -193 -195 -196 -198 -200 -202 -204 -205 -207 -209 -211 -213 -215 -217 -219 -221 -223 -225 -227 -229 -231 -233 -235 -237 -239 -241 -243 -245 -248 -250 -252 -254 -257 -259 -261 -263 -266 -268 -271 -273 -276 -278 -281 -283 -286 -288 -291 -294 -296 -299 -302 -305 -308 -311 -314 -317 -320 -323 -326 -329 -332 -336 -339 -342 -346 -349 -353 -357 -360 -364 -368 -372 -376 -380 -384 -389 -393 -398 -402 -407 -412 -417 -422 -428 -433 -439 -445 -451 -457 -463 -470 -477 -485 -492 -500 -509 -518 -528 -538 -549 -560 -573 -587 -602 -620 -639 -662 -690 -725 -774 -859 ]) - * Referenced by: - * '/1-D Lookup Table' - * '/1-D Lookup Table' - */ - { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 848.0, - 844.0, 840.0, 836.0, 832.0, 829.0, 825.0, 821.0, 818.0, 814.0, 811.0, 807.0, - 804.0, 800.0, 797.0, 794.0, 790.0, 787.0, 784.0, 781.0, 778.0, 774.0, 771.0, - 768.0, 765.0, 762.0, 759.0, 756.0, 753.0, 750.0, 748.0, 745.0, 742.0, 739.0, - 736.0, 734.0, 731.0, 728.0, 725.0, 723.0, 720.0, 717.0, 715.0, 712.0, 710.0, - 707.0, 705.0, 702.0, 700.0, 697.0, 695.0, 692.0, 690.0, 688.0, 685.0, 683.0, - 680.0, 678.0, 676.0, 674.0, 671.0, 669.0, 667.0, 665.0, 662.0, 660.0, 658.0, - 656.0, 654.0, 652.0, 649.0, 647.0, 645.0, 643.0, 641.0, 639.0, 637.0, 635.0, - 633.0, 631.0, 629.0, 627.0, 625.0, 623.0, 621.0, 619.0, 617.0, 615.0, 613.0, - 611.0, 609.0, 607.0, 606.0, 604.0, 602.0, 600.0, 598.0, 596.0, 595.0, 593.0, - 591.0, 589.0, 587.0, 586.0, 584.0, 582.0, 580.0, 579.0, 577.0, 575.0, 573.0, - 572.0, 570.0, 568.0, 567.0, 565.0, 563.0, 562.0, 560.0, 558.0, 557.0, 555.0, - 554.0, 552.0, 550.0, 549.0, 547.0, 546.0, 544.0, 542.0, 541.0, 539.0, 538.0, - 536.0, 535.0, 533.0, 532.0, 530.0, 529.0, 527.0, 526.0, 524.0, 523.0, 521.0, - 520.0, 518.0, 517.0, 515.0, 514.0, 512.0, 511.0, 509.0, 508.0, 507.0, 505.0, - 504.0, 502.0, 501.0, 499.0, 498.0, 497.0, 495.0, 494.0, 492.0, 491.0, 490.0, - 488.0, 487.0, 486.0, 484.0, 483.0, 482.0, 480.0, 479.0, 478.0, 476.0, 475.0, - 474.0, 472.0, 471.0, 470.0, 468.0, 467.0, 466.0, 465.0, 463.0, 462.0, 461.0, - 459.0, 458.0, 457.0, 456.0, 454.0, 453.0, 452.0, 451.0, 449.0, 448.0, 447.0, - 446.0, 444.0, 443.0, 442.0, 441.0, 440.0, 438.0, 437.0, 436.0, 435.0, 433.0, - 432.0, 431.0, 430.0, 429.0, 427.0, 426.0, 425.0, 424.0, 423.0, 422.0, 420.0, - 419.0, 418.0, 417.0, 416.0, 415.0, 413.0, 412.0, 411.0, 410.0, 409.0, 408.0, - 407.0, 405.0, 404.0, 403.0, 402.0, 401.0, 400.0, 399.0, 398.0, 397.0, 395.0, - 394.0, 393.0, 392.0, 391.0, 390.0, 389.0, 388.0, 387.0, 385.0, 384.0, 383.0, - 382.0, 381.0, 380.0, 379.0, 378.0, 377.0, 376.0, 375.0, 374.0, 373.0, 372.0, - 370.0, 369.0, 368.0, 367.0, 366.0, 365.0, 364.0, 363.0, 362.0, 361.0, 360.0, - 359.0, 358.0, 357.0, 356.0, 355.0, 354.0, 353.0, 352.0, 351.0, 350.0, 349.0, - 348.0, 347.0, 346.0, 345.0, 344.0, 343.0, 342.0, 341.0, 340.0, 339.0, 338.0, - 337.0, 336.0, 335.0, 334.0, 333.0, 332.0, 331.0, 330.0, 329.0, 328.0, 327.0, - 326.0, 325.0, 324.0, 323.0, 322.0, 321.0, 320.0, 319.0, 318.0, 317.0, 316.0, - 315.0, 314.0, 313.0, 312.0, 311.0, 310.0, 309.0, 308.0, 307.0, 306.0, 306.0, - 305.0, 304.0, 303.0, 302.0, 301.0, 300.0, 299.0, 298.0, 297.0, 296.0, 295.0, - 294.0, 293.0, 292.0, 291.0, 290.0, 290.0, 289.0, 288.0, 287.0, 286.0, 285.0, - 284.0, 283.0, 282.0, 281.0, 280.0, 279.0, 278.0, 277.0, 277.0, 276.0, 275.0, - 274.0, 273.0, 272.0, 271.0, 270.0, 269.0, 268.0, 267.0, 266.0, 266.0, 265.0, - 264.0, 263.0, 262.0, 261.0, 260.0, 259.0, 258.0, 257.0, 257.0, 256.0, 255.0, - 254.0, 253.0, 252.0, 251.0, 250.0, 249.0, 248.0, 248.0, 247.0, 246.0, 245.0, - 244.0, 243.0, 242.0, 241.0, 240.0, 240.0, 239.0, 238.0, 237.0, 236.0, 235.0, - 234.0, 233.0, 232.0, 232.0, 231.0, 230.0, 229.0, 228.0, 227.0, 226.0, 225.0, - 225.0, 224.0, 223.0, 222.0, 221.0, 220.0, 219.0, 218.0, 218.0, 217.0, 216.0, - 215.0, 214.0, 213.0, 212.0, 211.0, 211.0, 210.0, 209.0, 208.0, 207.0, 206.0, - 205.0, 204.0, 204.0, 203.0, 202.0, 201.0, 200.0, 199.0, 198.0, 198.0, 197.0, - 196.0, 195.0, 194.0, 193.0, 192.0, 191.0, 191.0, 190.0, 189.0, 188.0, 187.0, - 186.0, 185.0, 185.0, 184.0, 183.0, 182.0, 181.0, 180.0, 179.0, 178.0, 178.0, - 177.0, 176.0, 175.0, 174.0, 173.0, 172.0, 172.0, 171.0, 170.0, 169.0, 168.0, - 167.0, 166.0, 166.0, 165.0, 164.0, 163.0, 162.0, 161.0, 160.0, 160.0, 159.0, - 158.0, 157.0, 156.0, 155.0, 154.0, 154.0, 153.0, 152.0, 151.0, 150.0, 149.0, - 148.0, 147.0, 147.0, 146.0, 145.0, 144.0, 143.0, 142.0, 141.0, 141.0, 140.0, - 139.0, 138.0, 137.0, 136.0, 135.0, 135.0, 134.0, 133.0, 132.0, 131.0, 130.0, - 129.0, 128.0, 128.0, 127.0, 126.0, 125.0, 124.0, 123.0, 122.0, 122.0, 121.0, - 120.0, 119.0, 118.0, 117.0, 116.0, 115.0, 115.0, 114.0, 113.0, 112.0, 111.0, - 110.0, 109.0, 108.0, 108.0, 107.0, 106.0, 105.0, 104.0, 103.0, 102.0, 101.0, - 101.0, 100.0, 99.0, 98.0, 97.0, 96.0, 95.0, 94.0, 94.0, 93.0, 92.0, 91.0, - 90.0, 89.0, 88.0, 87.0, 86.0, 86.0, 85.0, 84.0, 83.0, 82.0, 81.0, 80.0, 79.0, - 78.0, 77.0, 77.0, 76.0, 75.0, 74.0, 73.0, 72.0, 71.0, 70.0, 69.0, 68.0, 68.0, - 67.0, 66.0, 65.0, 64.0, 63.0, 62.0, 61.0, 60.0, 59.0, 58.0, 58.0, 57.0, 56.0, - 55.0, 54.0, 53.0, 52.0, 51.0, 50.0, 49.0, 48.0, 47.0, 47.0, 46.0, 45.0, 44.0, - 43.0, 42.0, 41.0, 40.0, 39.0, 38.0, 37.0, 36.0, 35.0, 34.0, 33.0, 32.0, 31.0, - 31.0, 30.0, 29.0, 28.0, 27.0, 26.0, 25.0, 24.0, 23.0, 22.0, 21.0, 20.0, 19.0, - 18.0, 17.0, 16.0, 15.0, 14.0, 13.0, 12.0, 11.0, 10.0, 9.0, 8.0, 7.0, 6.0, - 5.0, 4.0, 3.0, 2.0, 1.0, 0.0, 0.0, -1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, - -8.0, -9.0, -10.0, -11.0, -12.0, -13.0, -14.0, -15.0, -16.0, -17.0, -18.0, - -19.0, -20.0, -21.0, -22.0, -23.0, -24.0, -25.0, -26.0, -27.0, -28.0, -29.0, - -31.0, -32.0, -33.0, -34.0, -35.0, -36.0, -37.0, -38.0, -39.0, -40.0, -41.0, - -42.0, -43.0, -45.0, -46.0, -47.0, -48.0, -49.0, -50.0, -51.0, -52.0, -53.0, - -55.0, -56.0, -57.0, -58.0, -59.0, -60.0, -61.0, -63.0, -64.0, -65.0, -66.0, - -67.0, -68.0, -69.0, -71.0, -72.0, -73.0, -74.0, -75.0, -77.0, -78.0, -79.0, - -80.0, -81.0, -83.0, -84.0, -85.0, -86.0, -87.0, -89.0, -90.0, -91.0, -92.0, - -94.0, -95.0, -96.0, -97.0, -99.0, -100.0, -101.0, -102.0, -104.0, -105.0, - -106.0, -108.0, -109.0, -110.0, -112.0, -113.0, -114.0, -116.0, -117.0, - -118.0, -120.0, -121.0, -122.0, -124.0, -125.0, -126.0, -128.0, -129.0, - -131.0, -132.0, -133.0, -135.0, -136.0, -138.0, -139.0, -141.0, -142.0, - -144.0, -145.0, -146.0, -148.0, -149.0, -151.0, -152.0, -154.0, -155.0, - -157.0, -159.0, -160.0, -162.0, -163.0, -165.0, -166.0, -168.0, -170.0, - -171.0, -173.0, -174.0, -176.0, -178.0, -179.0, -181.0, -183.0, -184.0, - -186.0, -188.0, -189.0, -191.0, -193.0, -195.0, -196.0, -198.0, -200.0, - -202.0, -204.0, -205.0, -207.0, -209.0, -211.0, -213.0, -215.0, -217.0, - -219.0, -221.0, -223.0, -225.0, -227.0, -229.0, -231.0, -233.0, -235.0, - -237.0, -239.0, -241.0, -243.0, -245.0, -248.0, -250.0, -252.0, -254.0, - -257.0, -259.0, -261.0, -263.0, -266.0, -268.0, -271.0, -273.0, -276.0, - -278.0, -281.0, -283.0, -286.0, -288.0, -291.0, -294.0, -296.0, -299.0, - -302.0, -305.0, -308.0, -311.0, -314.0, -317.0, -320.0, -323.0, -326.0, - -329.0, -332.0, -336.0, -339.0, -342.0, -346.0, -349.0, -353.0, -357.0, - -360.0, -364.0, -368.0, -372.0, -376.0, -380.0, -384.0, -389.0, -393.0, - -398.0, -402.0, -407.0, -412.0, -417.0, -422.0, -428.0, -433.0, -439.0, - -445.0, -451.0, -457.0, -463.0, -470.0, -477.0, -485.0, -492.0, -500.0, - -509.0, -518.0, -528.0, -538.0, -549.0, -560.0, -573.0, -587.0, -602.0, - -620.0, -639.0, -662.0, -690.0, -725.0, -774.0, -859.0 }, - - /* Pooled Parameter (Expression: [-2731 3108 2584 2319 2146 2020 1922 1841 1774 1716 1666 1621 1581 1544 1511 1481 1453 1427 1403 1380 1358 1338 1319 1301 1284 1268 1252 1237 1223 1209 1196 1184 1171 1160 1148 1137 1127 1117 1107 1097 1088 1079 1070 1061 1053 1045 1037 1029 1021 1014 1007 1000 993 986 979 973 967 960 954 948 942 937 931 925 920 915 909 904 899 894 889 884 880 875 870 866 861 857 852 848 844 840 836 831 827 823 820 816 812 808 804 801 797 793 790 786 783 780 776 773 770 766 763 760 757 754 750 747 744 741 738 735 732 729 727 724 721 718 715 713 710 707 704 702 699 697 694 691 689 686 684 681 679 676 674 672 669 667 664 662 660 658 655 653 651 648 646 644 642 640 637 635 633 631 629 627 625 623 621 618 616 614 612 610 608 606 604 602 601 599 597 595 593 591 589 587 586 584 582 580 578 576 575 573 571 569 568 566 564 563 561 559 557 556 554 552 551 549 547 546 544 543 541 539 538 536 534 533 531 530 528 527 525 523 522 520 519 517 516 514 513 511 510 508 507 505 504 502 501 500 498 497 495 494 492 491 490 488 487 485 484 483 481 480 479 477 476 475 473 472 471 469 468 467 465 464 463 461 460 459 457 456 455 454 452 451 450 449 447 446 445 444 442 441 440 439 437 436 435 434 432 431 430 429 428 426 425 424 423 422 420 419 418 417 416 415 413 412 411 410 409 408 406 405 404 403 402 401 400 399 397 396 395 394 393 392 391 390 389 387 386 385 384 383 382 381 380 379 378 377 376 375 373 372 371 370 369 368 367 366 365 364 363 362 361 360 359 358 357 356 355 354 353 352 351 350 349 348 347 346 345 344 343 342 341 340 339 338 337 336 335 334 333 332 331 330 329 328 327 326 325 324 323 322 321 320 319 318 317 316 315 314 313 312 311 310 309 308 307 307 306 305 304 303 302 301 300 299 298 297 296 295 294 293 293 292 291 290 289 288 287 286 285 284 283 282 281 281 280 279 278 277 276 275 274 273 272 272 271 270 269 268 267 266 265 264 264 263 262 261 260 259 258 257 256 256 255 254 253 252 251 250 249 249 248 247 246 245 244 243 242 242 241 240 239 238 237 236 235 235 234 233 232 231 230 229 229 228 227 226 225 224 223 223 222 221 220 219 218 217 217 216 215 214 213 212 211 211 210 209 208 207 206 206 205 204 203 202 201 200 200 199 198 197 196 195 195 194 193 192 191 190 190 189 188 187 186 185 184 184 183 182 181 180 179 179 178 177 176 175 174 174 173 172 171 170 169 169 168 167 166 165 164 164 163 162 161 160 159 159 158 157 156 155 154 154 153 152 151 150 149 149 148 147 146 145 144 144 143 142 141 140 139 139 138 137 136 135 134 134 133 132 131 130 129 129 128 127 126 125 124 124 123 122 121 120 119 118 118 117 116 115 114 113 113 112 111 110 109 108 108 107 106 105 104 103 103 102 101 100 99 98 97 97 96 95 94 93 92 92 91 90 89 88 87 86 86 85 84 83 82 81 80 80 79 78 77 76 75 74 74 73 72 71 70 69 68 67 67 66 65 64 63 62 61 60 60 59 58 57 56 55 54 53 53 52 51 50 49 48 47 46 45 45 44 43 42 41 40 39 38 37 36 36 35 34 33 32 31 30 29 28 27 26 26 25 24 23 22 21 20 19 18 17 16 15 14 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 -1 -2 -3 -4 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -68 -69 -70 -71 -72 -73 -74 -75 -77 -78 -79 -80 -81 -82 -84 -85 -86 -87 -88 -89 -91 -92 -93 -94 -95 -97 -98 -99 -100 -101 -103 -104 -105 -106 -108 -109 -110 -111 -113 -114 -115 -117 -118 -119 -120 -122 -123 -124 -126 -127 -128 -130 -131 -132 -134 -135 -136 -138 -139 -141 -142 -143 -145 -146 -148 -149 -150 -152 -153 -155 -156 -158 -159 -161 -162 -164 -165 -167 -168 -170 -172 -173 -175 -176 -178 -179 -181 -183 -184 -186 -188 -189 -191 -193 -194 -196 -198 -199 -201 -203 -205 -206 -208 -210 -212 -214 -216 -217 -219 -221 -223 -225 -227 -229 -231 -233 -235 -237 -239 -241 -243 -245 -247 -250 -252 -254 -256 -258 -261 -263 -265 -268 -270 -272 -275 -277 -280 -282 -285 -287 -290 -292 -295 -298 -300 -303 -306 -309 -312 -314 -317 -320 -323 -327 -330 -333 -336 -339 -343 -346 -350 -353 -357 -361 -364 -368 -372 -376 -380 -384 -389 -393 -398 -402 -407 -412 -417 -422 -427 -433 -438 -444 -450 -456 -463 -470 -477 -484 -492 -500 -508 -517 -526 -537 -547 -559 -572 -585 -601 -618 -637 -660 -687 -722 -771 -856 - ]) - * Referenced by: - * '/1-D Lookup Table' - * '/1-D Lookup Table' - * '/1-D Lookup Table' - * '/1-D Lookup Table' - */ - { -2731.0, 3108.0, 2584.0, 2319.0, 2146.0, 2020.0, 1922.0, 1841.0, 1774.0, - 1716.0, 1666.0, 1621.0, 1581.0, 1544.0, 1511.0, 1481.0, 1453.0, 1427.0, - 1403.0, 1380.0, 1358.0, 1338.0, 1319.0, 1301.0, 1284.0, 1268.0, 1252.0, - 1237.0, 1223.0, 1209.0, 1196.0, 1184.0, 1171.0, 1160.0, 1148.0, 1137.0, - 1127.0, 1117.0, 1107.0, 1097.0, 1088.0, 1079.0, 1070.0, 1061.0, 1053.0, - 1045.0, 1037.0, 1029.0, 1021.0, 1014.0, 1007.0, 1000.0, 993.0, 986.0, 979.0, - 973.0, 967.0, 960.0, 954.0, 948.0, 942.0, 937.0, 931.0, 925.0, 920.0, 915.0, - 909.0, 904.0, 899.0, 894.0, 889.0, 884.0, 880.0, 875.0, 870.0, 866.0, 861.0, - 857.0, 852.0, 848.0, 844.0, 840.0, 836.0, 831.0, 827.0, 823.0, 820.0, 816.0, - 812.0, 808.0, 804.0, 801.0, 797.0, 793.0, 790.0, 786.0, 783.0, 780.0, 776.0, - 773.0, 770.0, 766.0, 763.0, 760.0, 757.0, 754.0, 750.0, 747.0, 744.0, 741.0, - 738.0, 735.0, 732.0, 729.0, 727.0, 724.0, 721.0, 718.0, 715.0, 713.0, 710.0, - 707.0, 704.0, 702.0, 699.0, 697.0, 694.0, 691.0, 689.0, 686.0, 684.0, 681.0, - 679.0, 676.0, 674.0, 672.0, 669.0, 667.0, 664.0, 662.0, 660.0, 658.0, 655.0, - 653.0, 651.0, 648.0, 646.0, 644.0, 642.0, 640.0, 637.0, 635.0, 633.0, 631.0, - 629.0, 627.0, 625.0, 623.0, 621.0, 618.0, 616.0, 614.0, 612.0, 610.0, 608.0, - 606.0, 604.0, 602.0, 601.0, 599.0, 597.0, 595.0, 593.0, 591.0, 589.0, 587.0, - 586.0, 584.0, 582.0, 580.0, 578.0, 576.0, 575.0, 573.0, 571.0, 569.0, 568.0, - 566.0, 564.0, 563.0, 561.0, 559.0, 557.0, 556.0, 554.0, 552.0, 551.0, 549.0, - 547.0, 546.0, 544.0, 543.0, 541.0, 539.0, 538.0, 536.0, 534.0, 533.0, 531.0, - 530.0, 528.0, 527.0, 525.0, 523.0, 522.0, 520.0, 519.0, 517.0, 516.0, 514.0, - 513.0, 511.0, 510.0, 508.0, 507.0, 505.0, 504.0, 502.0, 501.0, 500.0, 498.0, - 497.0, 495.0, 494.0, 492.0, 491.0, 490.0, 488.0, 487.0, 485.0, 484.0, 483.0, - 481.0, 480.0, 479.0, 477.0, 476.0, 475.0, 473.0, 472.0, 471.0, 469.0, 468.0, - 467.0, 465.0, 464.0, 463.0, 461.0, 460.0, 459.0, 457.0, 456.0, 455.0, 454.0, - 452.0, 451.0, 450.0, 449.0, 447.0, 446.0, 445.0, 444.0, 442.0, 441.0, 440.0, - 439.0, 437.0, 436.0, 435.0, 434.0, 432.0, 431.0, 430.0, 429.0, 428.0, 426.0, - 425.0, 424.0, 423.0, 422.0, 420.0, 419.0, 418.0, 417.0, 416.0, 415.0, 413.0, - 412.0, 411.0, 410.0, 409.0, 408.0, 406.0, 405.0, 404.0, 403.0, 402.0, 401.0, - 400.0, 399.0, 397.0, 396.0, 395.0, 394.0, 393.0, 392.0, 391.0, 390.0, 389.0, - 387.0, 386.0, 385.0, 384.0, 383.0, 382.0, 381.0, 380.0, 379.0, 378.0, 377.0, - 376.0, 375.0, 373.0, 372.0, 371.0, 370.0, 369.0, 368.0, 367.0, 366.0, 365.0, - 364.0, 363.0, 362.0, 361.0, 360.0, 359.0, 358.0, 357.0, 356.0, 355.0, 354.0, - 353.0, 352.0, 351.0, 350.0, 349.0, 348.0, 347.0, 346.0, 345.0, 344.0, 343.0, - 342.0, 341.0, 340.0, 339.0, 338.0, 337.0, 336.0, 335.0, 334.0, 333.0, 332.0, - 331.0, 330.0, 329.0, 328.0, 327.0, 326.0, 325.0, 324.0, 323.0, 322.0, 321.0, - 320.0, 319.0, 318.0, 317.0, 316.0, 315.0, 314.0, 313.0, 312.0, 311.0, 310.0, - 309.0, 308.0, 307.0, 307.0, 306.0, 305.0, 304.0, 303.0, 302.0, 301.0, 300.0, - 299.0, 298.0, 297.0, 296.0, 295.0, 294.0, 293.0, 293.0, 292.0, 291.0, 290.0, - 289.0, 288.0, 287.0, 286.0, 285.0, 284.0, 283.0, 282.0, 281.0, 281.0, 280.0, - 279.0, 278.0, 277.0, 276.0, 275.0, 274.0, 273.0, 272.0, 272.0, 271.0, 270.0, - 269.0, 268.0, 267.0, 266.0, 265.0, 264.0, 264.0, 263.0, 262.0, 261.0, 260.0, - 259.0, 258.0, 257.0, 256.0, 256.0, 255.0, 254.0, 253.0, 252.0, 251.0, 250.0, - 249.0, 249.0, 248.0, 247.0, 246.0, 245.0, 244.0, 243.0, 242.0, 242.0, 241.0, - 240.0, 239.0, 238.0, 237.0, 236.0, 235.0, 235.0, 234.0, 233.0, 232.0, 231.0, - 230.0, 229.0, 229.0, 228.0, 227.0, 226.0, 225.0, 224.0, 223.0, 223.0, 222.0, - 221.0, 220.0, 219.0, 218.0, 217.0, 217.0, 216.0, 215.0, 214.0, 213.0, 212.0, - 211.0, 211.0, 210.0, 209.0, 208.0, 207.0, 206.0, 206.0, 205.0, 204.0, 203.0, - 202.0, 201.0, 200.0, 200.0, 199.0, 198.0, 197.0, 196.0, 195.0, 195.0, 194.0, - 193.0, 192.0, 191.0, 190.0, 190.0, 189.0, 188.0, 187.0, 186.0, 185.0, 184.0, - 184.0, 183.0, 182.0, 181.0, 180.0, 179.0, 179.0, 178.0, 177.0, 176.0, 175.0, - 174.0, 174.0, 173.0, 172.0, 171.0, 170.0, 169.0, 169.0, 168.0, 167.0, 166.0, - 165.0, 164.0, 164.0, 163.0, 162.0, 161.0, 160.0, 159.0, 159.0, 158.0, 157.0, - 156.0, 155.0, 154.0, 154.0, 153.0, 152.0, 151.0, 150.0, 149.0, 149.0, 148.0, - 147.0, 146.0, 145.0, 144.0, 144.0, 143.0, 142.0, 141.0, 140.0, 139.0, 139.0, - 138.0, 137.0, 136.0, 135.0, 134.0, 134.0, 133.0, 132.0, 131.0, 130.0, 129.0, - 129.0, 128.0, 127.0, 126.0, 125.0, 124.0, 124.0, 123.0, 122.0, 121.0, 120.0, - 119.0, 118.0, 118.0, 117.0, 116.0, 115.0, 114.0, 113.0, 113.0, 112.0, 111.0, - 110.0, 109.0, 108.0, 108.0, 107.0, 106.0, 105.0, 104.0, 103.0, 103.0, 102.0, - 101.0, 100.0, 99.0, 98.0, 97.0, 97.0, 96.0, 95.0, 94.0, 93.0, 92.0, 92.0, - 91.0, 90.0, 89.0, 88.0, 87.0, 86.0, 86.0, 85.0, 84.0, 83.0, 82.0, 81.0, 80.0, - 80.0, 79.0, 78.0, 77.0, 76.0, 75.0, 74.0, 74.0, 73.0, 72.0, 71.0, 70.0, 69.0, - 68.0, 67.0, 67.0, 66.0, 65.0, 64.0, 63.0, 62.0, 61.0, 60.0, 60.0, 59.0, 58.0, - 57.0, 56.0, 55.0, 54.0, 53.0, 53.0, 52.0, 51.0, 50.0, 49.0, 48.0, 47.0, 46.0, - 45.0, 45.0, 44.0, 43.0, 42.0, 41.0, 40.0, 39.0, 38.0, 37.0, 36.0, 36.0, 35.0, - 34.0, 33.0, 32.0, 31.0, 30.0, 29.0, 28.0, 27.0, 26.0, 26.0, 25.0, 24.0, 23.0, - 22.0, 21.0, 20.0, 19.0, 18.0, 17.0, 16.0, 15.0, 14.0, 14.0, 13.0, 12.0, 11.0, - 10.0, 9.0, 8.0, 7.0, 6.0, 5.0, 4.0, 3.0, 2.0, 1.0, 0.0, 0.0, -1.0, -2.0, - -3.0, -4.0, -4.0, -5.0, -6.0, -7.0, -8.0, -9.0, -10.0, -11.0, -12.0, -13.0, - -14.0, -15.0, -16.0, -17.0, -18.0, -19.0, -20.0, -21.0, -22.0, -23.0, -24.0, - -25.0, -26.0, -27.0, -28.0, -29.0, -30.0, -31.0, -32.0, -33.0, -34.0, -35.0, - -36.0, -37.0, -38.0, -39.0, -41.0, -42.0, -43.0, -44.0, -45.0, -46.0, -47.0, - -48.0, -49.0, -50.0, -51.0, -52.0, -53.0, -54.0, -55.0, -57.0, -58.0, -59.0, - -60.0, -61.0, -62.0, -63.0, -64.0, -65.0, -66.0, -68.0, -69.0, -70.0, -71.0, - -72.0, -73.0, -74.0, -75.0, -77.0, -78.0, -79.0, -80.0, -81.0, -82.0, -84.0, - -85.0, -86.0, -87.0, -88.0, -89.0, -91.0, -92.0, -93.0, -94.0, -95.0, -97.0, - -98.0, -99.0, -100.0, -101.0, -103.0, -104.0, -105.0, -106.0, -108.0, -109.0, - -110.0, -111.0, -113.0, -114.0, -115.0, -117.0, -118.0, -119.0, -120.0, - -122.0, -123.0, -124.0, -126.0, -127.0, -128.0, -130.0, -131.0, -132.0, - -134.0, -135.0, -136.0, -138.0, -139.0, -141.0, -142.0, -143.0, -145.0, - -146.0, -148.0, -149.0, -150.0, -152.0, -153.0, -155.0, -156.0, -158.0, - -159.0, -161.0, -162.0, -164.0, -165.0, -167.0, -168.0, -170.0, -172.0, - -173.0, -175.0, -176.0, -178.0, -179.0, -181.0, -183.0, -184.0, -186.0, - -188.0, -189.0, -191.0, -193.0, -194.0, -196.0, -198.0, -199.0, -201.0, - -203.0, -205.0, -206.0, -208.0, -210.0, -212.0, -214.0, -216.0, -217.0, - -219.0, -221.0, -223.0, -225.0, -227.0, -229.0, -231.0, -233.0, -235.0, - -237.0, -239.0, -241.0, -243.0, -245.0, -247.0, -250.0, -252.0, -254.0, - -256.0, -258.0, -261.0, -263.0, -265.0, -268.0, -270.0, -272.0, -275.0, - -277.0, -280.0, -282.0, -285.0, -287.0, -290.0, -292.0, -295.0, -298.0, - -300.0, -303.0, -306.0, -309.0, -312.0, -314.0, -317.0, -320.0, -323.0, - -327.0, -330.0, -333.0, -336.0, -339.0, -343.0, -346.0, -350.0, -353.0, - -357.0, -361.0, -364.0, -368.0, -372.0, -376.0, -380.0, -384.0, -389.0, - -393.0, -398.0, -402.0, -407.0, -412.0, -417.0, -422.0, -427.0, -433.0, - -438.0, -444.0, -450.0, -456.0, -463.0, -470.0, -477.0, -484.0, -492.0, - -500.0, -508.0, -517.0, -526.0, -537.0, -547.0, -559.0, -572.0, -585.0, - -601.0, -618.0, -637.0, -660.0, -687.0, -722.0, -771.0, -856.0 }, - - /* Pooled Parameter (Expression: [0:4:4092]) - * Referenced by: - * '/1-D Lookup Table' - * '/1-D Lookup Table' - * '/1-D Lookup Table' - * '/1-D Lookup Table' - * '/1-D Lookup Table' - * '/1-D Lookup Table' - * '/1-D Lookup Table' + /* Computed Parameter: uDLookupTable_bp01Data + * Referenced by: '/1-D Lookup Table' */ { 0U, 4U, 8U, 12U, 16U, 20U, 24U, 28U, 32U, 36U, 40U, 44U, 48U, 52U, 56U, 60U, 64U, 68U, 72U, 76U, 80U, 84U, 88U, 92U, 96U, 100U, 104U, 108U, 112U, 116U, @@ -421,14 +210,7 @@ const ConstP rtConstP = { 3948U, 3952U, 3956U, 3960U, 3964U, 3968U, 3972U, 3976U, 3980U, 3984U, 3988U, 3992U, 3996U, 4000U, 4004U, 4008U, 4012U, 4016U, 4020U, 4024U, 4028U, 4032U, 4036U, 4040U, 4044U, 4048U, 4052U, 4056U, 4060U, 4064U, 4068U, 4072U, 4076U, - 4080U, 4084U, 4088U, 4092U }, - - /* Pooled Parameter (Expression: [5900 6100 6050 6010 5990 5800 6015 0 8500]) - * Referenced by: - * '/ACT1' - * '/ACT1' - */ - { 5900U, 6100U, 6050U, 6010U, 5990U, 5800U, 6015U, 0U, 8500U } + 4080U, 4084U, 4088U, 4092U } }; /* diff --git a/HVAC_model_private.h b/HVAC_model_private.h index 8da5414..9c7e71b 100644 --- a/HVAC_model_private.h +++ b/HVAC_model_private.h @@ -3,9 +3,9 @@ * * Code generated for Simulink model 'HVAC_model'. * - * Model version : 1.604 + * Model version : 1.613 * Simulink Coder version : 24.1 (R2024a) 19-Nov-2023 - * C/C++ source code generated on : Fri Feb 13 13:56:38 2026 + * C/C++ source code generated on : Mon Feb 16 16:08:44 2026 * * Target selection: ert.tlc * Embedded hardware selection: ARM Compatible->ARM Cortex-M @@ -25,9 +25,16 @@ extern int16_t look1_iu16tdIs16_binlcs(uint16_t u0, const uint16_t bp0[], const double table[], uint32_t maxIndex); extern void IfActionSubsystem3(int8_t rtu_stepIn, int8_t *rty_step); -extern void MAXPOSITION(int16_t rty_y[9]); -extern void MAXPOSITION1(int8_t rty_y[9]); -extern void MAXPOSITION_l(const double rtu_step[9], double rty_y[9]); +extern void InitialCPOSMin(double rtu_LOGGER, int8_t rtu_step, int8_t *rty_y); +extern void NormalMode(double rtu_LOGGER, int8_t rtu_step, int8_t *rty_y); +extern void MovetopositionMin(double rtu_LOGGER, int8_t rtu_step, int8_t *rty_y); +extern void MINPOSITION(int16_t rty_y[9], double rtu_LOGGER); +extern void InitialCPOSMax(double rtu_LOGGER, int8_t rtu_step, int8_t *rty_y); +extern void MovetopositionMax(int8_t rtu_step, double rtu_LOGGER, int8_t *rty_y); +extern void MINPOSITION_g(int16_t rty_y[9], double rtu_LOGGER); +extern void WriteIgnition(double rtu_LOGGER, int8_t rtu_step); +extern void IfActionSubsystem3_m(int8_t rtu_stepIn, int8_t *rty_step); +extern void IfActionSubsystem3_n(int8_t rtu_stepIn, int8_t *rty_step); #endif /* HVAC_model_private_h_ */ diff --git a/HVAC_model_types.h b/HVAC_model_types.h index 888626e..7a0d88e 100644 --- a/HVAC_model_types.h +++ b/HVAC_model_types.h @@ -3,9 +3,9 @@ * * Code generated for Simulink model 'HVAC_model'. * - * Model version : 1.604 + * Model version : 1.613 * Simulink Coder version : 24.1 (R2024a) 19-Nov-2023 - * C/C++ source code generated on : Fri Feb 13 13:56:38 2026 + * C/C++ source code generated on : Mon Feb 16 16:08:44 2026 * * Target selection: ert.tlc * Embedded hardware selection: ARM Compatible->ARM Cortex-M @@ -124,6 +124,19 @@ typedef struct { #endif +#ifndef DEFINED_TYPEDEF_FOR_CmdBusADCDataKey_ +#define DEFINED_TYPEDEF_FOR_CmdBusADCDataKey_ + +typedef struct { + uint8_t ST_ReservePower; + uint8_t ST_BATTChiller; + uint8_t EmergencyAirCleanSwitch; + uint8_t FireExtinguishSwitch; + uint8_t Ign_Wakeup; +} CmdBusADCDataKey; + +#endif + #ifndef DEFINED_TYPEDEF_FOR_ActuatorCmdBus_ #define DEFINED_TYPEDEF_FOR_ActuatorCmdBus_ @@ -145,21 +158,45 @@ typedef struct { #define DEFINED_TYPEDEF_FOR_ActuatorCmdBusInput_ typedef struct { - int16_t in_CPOS_ALL_Ch0[9]; - int8_t in_Act_Emrf_Slave_Ch0[9]; - int8_t in_Mode_Slave_Ch0[9]; - int8_t in_Act_Err1_Supply_Ch0[9]; - int8_t in_Act_Err2_Communication_Ch0[9]; - int8_t in_Act_Err3_Temperature_Ch0[9]; - int8_t in_Act_Err4_Permanent_Electrical_Ch0[9]; - int8_t in_Act_Stall_Slave_Ch0[9]; - int8_t in_Act_Reset_Ch0[9]; - uint8_t Busy_Ch0; - uint8_t Error_Connect_Ch0; + int16_t in_CPOS_ALL[9]; + int8_t in_Act_Emrf_Slave[9]; + int8_t in_Mode_Slave[9]; + int8_t in_Act_Err1_Supply[9]; + int8_t in_Act_Err2_Communication[9]; + int8_t in_Act_Err3_Temperature[9]; + int8_t in_Act_Err4_Permanent_Electrical[9]; + int8_t in_Act_Stall_Slave[9]; + int8_t in_Act_Reset[9]; + uint8_t Busy; + uint8_t Error_Connect; } ActuatorCmdBusInput; #endif +#ifndef DEFINED_TYPEDEF_FOR_CmdBusPWMGet_ +#define DEFINED_TYPEDEF_FOR_CmdBusPWMGet_ + +typedef struct { + uint8_t pwmPercentFront; + uint8_t pwmPercentRear; + uint8_t pwmPercentFrontReserved; + uint8_t pwmPercentRearReserved; +} CmdBusPWMGet; + +#endif + +#ifndef DEFINED_TYPEDEF_FOR_CmdBusPwm_ +#define DEFINED_TYPEDEF_FOR_CmdBusPwm_ + +typedef struct { + uint8_t pwmPercentFront; + uint8_t pwmPercentRear; + uint8_t pwmPercentFrontReserved; + uint8_t pwmPercentRearReserved; +} CmdBusPwm; + +#endif + /* Forward declaration for rtModel */ typedef struct tag_RTM RT_MODEL; diff --git a/Model_Task.c b/Model_Task.c index fb2b98b..f711108 100644 --- a/Model_Task.c +++ b/Model_Task.c @@ -38,7 +38,31 @@ static bool setActuatorBusy(tModelTask *env) { memcpy(&env->triggerActuatorCmdBus_1, &Actuator_Ch0_Command_Model, sizeof(ActuatorCmdBus)); - rtDW.Actuator_Ch0_Status_Model.Busy_Ch0 = 1; + rtDW.Actuator_Ch0_Status_Model.Busy = 1; + return true; + } + } + + for (uint8_t i = 0; i < env->linTaskActuator2->LIN_ISSR_ALL; ++i) { + if (Actuator_Ch1_Command_Model.COM[i] != 0) { + + env->triggerCommand2 = true; + + memcpy(&env->triggerActuatorCmdBus_2, &Actuator_Ch1_Command_Model, sizeof(ActuatorCmdBus)); + + rtDW.Actuator_Ch1_Status_Model.Busy = 1; + return true; + } + } + + for (uint8_t i = 0; i < env->linTaskActuator3->LIN_ISSR_ALL; ++i) { + if (Actuator_Ch2_Command_Model.COM[i] != 0) { + + env->triggerCommand3 = true; + + memcpy(&env->triggerActuatorCmdBus_3, &Actuator_Ch2_Command_Model, sizeof(ActuatorCmdBus)); + + rtDW.Actuator_Ch2_Status_Model.Busy = 1; return true; } }