From a911e96c72e7ce3fe93e5490acdd5bbebfa95d79 Mon Sep 17 00:00:00 2001 From: cfif Date: Tue, 21 Apr 2026 17:51:17 +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 | 96 ++++++++++++++++++++++++---------------------------- HVAC_model.h | 23 ++++--------- 2 files changed, 50 insertions(+), 69 deletions(-) diff --git a/HVAC_model.c b/HVAC_model.c index 24fbdfb..e96f543 100644 --- a/HVAC_model.c +++ b/HVAC_model.c @@ -3,9 +3,9 @@ * * Code generated for Simulink model 'HVAC_model'. * - * Model version : 1.820 + * Model version : 1.824 * Simulink Coder version : 24.1 (R2024a) 19-Nov-2023 - * C/C++ source code generated on : Tue Apr 21 14:12:53 2026 + * C/C++ source code generated on : Tue Apr 21 17:06:10 2026 * * Target selection: ert.tlc * Embedded hardware selection: ARM Compatible->ARM Cortex-M @@ -7361,14 +7361,7 @@ void HVAC_model_step(void) * ActionPort: '/Action Port' */ for (i = 0; i < 9; i++) { - /* DataStoreWrite: '/Data Store Write4' incorporates: - * Constant: '/Constant1' - */ - rtDW.Autos_private[i] = 1U; - - /* DataStoreWrite: '/Data Store Write2' incorporates: - * Constant: '/Constant10' - */ + /* DataStoreWrite: '/Data Store Write2' */ rtDW.Stall_private[i] = 1U; /* DataStoreWrite: '/Data Store Write3' incorporates: @@ -7376,16 +7369,21 @@ void HVAC_model_step(void) */ rtDW.Lnoise_private[i] = 0U; - /* DataStoreWrite: '/Data Store Write6' incorporates: - * Constant: '/Constant14' - */ - rtDW.Coils_private[i] = 0U; - /* DataStoreWrite: '/Data Store Write5' incorporates: * Constant: '/Constant2' */ rtDW.Speed_private[i] = 3U; + /* DataStoreWrite: '/Data Store Write4' incorporates: + * Constant: '/Constant3' + */ + rtDW.Autos_private[i] = 0U; + + /* DataStoreWrite: '/Data Store Write6' incorporates: + * Constant: '/Constant4' + */ + rtDW.Coils_private[i] = 3U; + /* DataStoreWrite: '/Data Store Write' */ rtDW.POS_private[i] = 0U; @@ -7440,8 +7438,7 @@ void HVAC_model_step(void) * Logic: '/Logical Operator2' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator1' - * SignalConversion generated from: '/Bus Selector' - * */ + */ for (i = 0; i < 9; i++) { rtb_LogicalOperator3_c[i] = ((Actuator_Ch0_Status_Model.in_Act_Stall_Slave[i] == 1) || @@ -7478,7 +7475,6 @@ void HVAC_model_step(void) for (i = 0; i < 9; i++) { /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read1' - * SignalConversion generated from: '/Bus Selector' */ if (rtDW.ErrorCalibration_private[i] != 0) { rtDW.MinPositionCh0_private[i] = @@ -7595,14 +7591,7 @@ void HVAC_model_step(void) * ActionPort: '/Action Port' */ for (i = 0; i < 9; i++) { - /* DataStoreWrite: '/Data Store Write4' incorporates: - * Constant: '/Constant1' - */ - rtDW.Autos_private[i] = 1U; - - /* DataStoreWrite: '/Data Store Write2' incorporates: - * Constant: '/Constant10' - */ + /* DataStoreWrite: '/Data Store Write2' */ rtDW.Stall_private[i] = 1U; /* DataStoreWrite: '/Data Store Write3' incorporates: @@ -7610,16 +7599,21 @@ void HVAC_model_step(void) */ rtDW.Lnoise_private[i] = 0U; - /* DataStoreWrite: '/Data Store Write6' incorporates: - * Constant: '/Constant14' - */ - rtDW.Coils_private[i] = 0U; - /* DataStoreWrite: '/Data Store Write5' incorporates: * Constant: '/Constant2' */ rtDW.Speed_private[i] = 3U; + /* DataStoreWrite: '/Data Store Write4' incorporates: + * Constant: '/Constant3' + */ + rtDW.Autos_private[i] = 0U; + + /* DataStoreWrite: '/Data Store Write6' incorporates: + * Constant: '/Constant4' + */ + rtDW.Coils_private[i] = 3U; + /* DataStoreWrite: '/Data Store Write' */ rtDW.POS_private[i] = 6000U; @@ -7674,8 +7668,7 @@ void HVAC_model_step(void) * Logic: '/Logical Operator2' * RelationalOperator: '/Relational Operator' * RelationalOperator: '/Relational Operator1' - * SignalConversion generated from: '/Bus Selector' - * */ + */ for (i = 0; i < 9; i++) { rtb_LogicalOperator3_c[i] = ((Actuator_Ch0_Status_Model.in_Act_Stall_Slave[i] == 1) || @@ -7712,7 +7705,6 @@ void HVAC_model_step(void) for (i = 0; i < 9; i++) { /* Switch: '/Switch' incorporates: * DataStoreRead: '/Data Store Read1' - * SignalConversion generated from: '/Bus Selector' */ if (rtDW.ErrorCalibration_private[i] != 0) { rtDW.MaxPositionCh0_private[i] = @@ -7809,12 +7801,12 @@ void HVAC_model_step(void) * DataStoreRead: '/MIN ACT1T 1' * Logic: '/Logical Operator2' */ - /* : fprintf("Homing 0\n"); */ - printf("Homing 0\n"); - fflush(stdout); - /* : if(LOGGER>0) */ if (rtDW.LOGGER_LIN > 0.0) { + /* : fprintf("Homing 0\n"); */ + printf("Homing 0\n"); + fflush(stdout); + /* : for i = 1:numel(MAX) */ for (i = 0; i < 9; i++) { /* : fprintf('ACT%d MAX = %d KOEF = %f Callibration = %d \n', int16(i), int16(MAX(i)), KOEF(i), int16(ERRORS(i))); */ @@ -7900,8 +7892,8 @@ void HVAC_model_step(void) /* MATLAB Function: '/Write ERROR' incorporates: * DataStoreRead: '/Data Store Read6' */ - /* : if(LOGGER>0) */ - if (rtDW.LOGGER_LIN > 0.0) { + /* : if(LOGGER>=0) */ + if (rtDW.LOGGER_LIN >= 0.0) { /* : for i = 1:numel(ErrCallibration) */ for (i = 0; i < 9; i++) { /* : if ErrCallibration(i) == 1 */ @@ -7943,12 +7935,12 @@ void HVAC_model_step(void) * DataStoreRead: '/MIN ACT1T 1' * DataStoreWrite: '/Data Store Write' */ - /* : fprintf("Homing 1. Start Callibration \n"); */ - printf("Homing 1. Start Callibration \n"); - fflush(stdout); - /* : if(LOGGER>0) */ if (rtDW.LOGGER_LIN > 0.0) { + /* : fprintf("Homing 1. Start Callibration \n"); */ + printf("Homing 1. Start Callibration \n"); + fflush(stdout); + /* : for i = 1:numel(MAX) */ for (i = 0; i < 9; i++) { /* : if(ERRORS(i)==1) */ @@ -8023,12 +8015,12 @@ void HVAC_model_step(void) * DataStoreRead: '/Data Store Read5' * DataStoreRead: '/MIN ACT1T 1' */ - /* : fprintf("Homing 3. Callibration \n"); */ - printf("Homing 3. Callibration \n"); - fflush(stdout); - /* : if(LOGGER>0) */ if (rtDW.LOGGER_LIN > 0.0) { + /* : fprintf("Homing 3. Callibration \n"); */ + printf("Homing 3. Callibration \n"); + fflush(stdout); + /* : for i = 1:numel(MAX) */ for (i = 0; i < 9; i++) { /* : if(ERRORS(i)==1) */ @@ -8077,8 +8069,8 @@ void HVAC_model_step(void) * DataStoreRead: '/Data Store Read1' * DataStoreRead: '/Data Store Read5' */ - /* : if(LOGGER>0) */ - if (rtDW.LOGGER_LIN > 0.0) { + /* : if(LOGGER>1) */ + if (rtDW.LOGGER_LIN > 1.0) { /* : fprintf("Homing 3. Start Time on step %d\n",int16(step)); */ rtb_Divide1 = rt_roundd(rtDW.ErrorHomming_private); if (rtb_Divide1 < 32768.0) { @@ -8145,8 +8137,8 @@ void HVAC_model_step(void) /* MATLAB Function: '/MAX POSITION' incorporates: * DataStoreRead: '/Data Store Read5' */ - /* : if(LOGGER>0) */ - if (rtDW.LOGGER_LIN > 0.0) { + /* : if(LOGGER>1) */ + if (rtDW.LOGGER_LIN > 1.0) { /* : fprintf("Homing 3. Start TIme dt = %d \n",int32(data)); */ rtb_dt_l = rtb_dt_f1; if (rtb_dt_f1 > 2147483647U) { diff --git a/HVAC_model.h b/HVAC_model.h index 155a0cf..29d4b13 100644 --- a/HVAC_model.h +++ b/HVAC_model.h @@ -3,9 +3,9 @@ * * Code generated for Simulink model 'HVAC_model'. * - * Model version : 1.820 + * Model version : 1.824 * Simulink Coder version : 24.1 (R2024a) 19-Nov-2023 - * C/C++ source code generated on : Tue Apr 21 14:12:53 2026 + * C/C++ source code generated on : Tue Apr 21 17:06:10 2026 * * Target selection: ert.tlc * Embedded hardware selection: ARM Compatible->ARM Cortex-M @@ -780,34 +780,23 @@ extern RT_MODEL *const rtM; * Block '/Display1' : Unused code path elimination * Block '/Display' : Unused code path elimination * Block '/Display1' : Unused code path elimination - * Block '/Display' : Unused code path elimination - * Block '/Display' : Unused code path elimination - * Block '/Display1' : Unused code path elimination - * Block '/Display2' : Unused code path elimination * Block '/Display' : Unused code path elimination - * Block '/Display' : Unused code path elimination - * Block '/Display1' : Unused code path elimination - * Block '/Display2' : Unused code path elimination - * Block '/Display3' : Unused code path elimination - * Block '/Display' : Unused code path elimination - * Block '/Display' : Unused code path elimination * Block '/Display1' : Unused code path elimination - * Block '/Display2' : Unused code path elimination * Block '/Display1' : Unused code path elimination * Block '/Display1' : Unused code path elimination * Block '/Display' : Unused code path elimination * Block '/Display' : Unused code path elimination * Block '/Display' : Unused code path elimination * Block '/Display1' : Unused code path elimination - * Block '/Display' : Unused code path elimination - * Block '/Display1' : Unused code path elimination - * Block '/Display2' : Unused code path elimination - * Block '/Display3' : Unused code path elimination * Block '/Display' : Unused code path elimination * Block '/Display1' : Unused code path elimination * Block '/Display' : Unused code path elimination * Block '/Display' : Unused code path elimination * Block '/Display3' : Unused code path elimination + * Block '/Constant1' : Unused code path elimination + * Block '/Constant14' : Unused code path elimination + * Block '/Constant1' : Unused code path elimination + * Block '/Constant14' : Unused code path elimination * Block '/Display' : Unused code path elimination * Block '/Display' : Unused code path elimination * Block '/Display1' : Unused code path elimination