Sfoglia il codice sorgente

Промежуточный коммит.

TelenkovDmitry 8 mesi fa
parent
commit
f284c97628

+ 4 - 0
fw/modules/io/digital_input.c

@@ -7,6 +7,8 @@
 #include "mux.h"
 #include <stdio.h>
 
+#if defined (MDIO_88)
+
 // Цифровые входы
 // *port; pin; mode; port_source; pin_source; deb_counter; p_flag; cnt;
 din_t d_inputs[DI_NUMBER] = {
@@ -427,3 +429,5 @@ void EXINT15_10_IRQHandler(void)
         }
     }    
 }
+
+#endif

+ 2 - 0
fw/modules/io/digital_output.c

@@ -7,6 +7,7 @@
 #include "mux.h"
 #include <stdio.h>
 
+#if defined (MDIO_88)
 
 uint16_t output_state_bit;
 uint16_t output_mode_bit;
@@ -325,3 +326,4 @@ void TMR1_BRK_TMR9_IRQHandler(void)
     }
 }
 
+#endif

+ 29 - 0
fw/modules/modbus/modbus_ai_params.c

@@ -0,0 +1,29 @@
+#include "at32f403a_407.h"
+#include "modbus_ai_params.h"
+#include "settings_api.h"
+#include "modbus_params.h"
+
+
+extern mb_param_t mb_param[];
+
+#if defined (MAI_12)
+
+//
+uint16_t mb_init_ai_params(uint16_t i)
+{
+    uint16_t index = i;
+    uint16_t addr = 0;  
+  
+    mb_param[index].reg = 0x0300;
+	mb_param[index].size = 1;
+	mb_param[index].param = (uint8_t*)&settings.ai_mode_bits;
+	mb_param[index].set = NULL;
+    mb_param[index].get = NULL;
+    mb_param[index].check_handler = mb_check_dummy;
+    
+    index++;
+    
+    return index;
+}
+
+#endif

+ 24 - 0
fw/modules/modbus/modbus_ai_params.h

@@ -0,0 +1,24 @@
+#ifndef __MODBUS_AI_PARAMS_H
+#define __MODBUS_AI_PARAMS_H
+
+#include "mb.h"
+#include "mbport.h"
+#include "modbus.h"
+#include <stdbool.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+  
+//
+uint16_t mb_init_ai_params(uint16_t i);
+  
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // __MODBUS_AI_PARAMS_H

+ 12 - 0
fw/modules/modbus/modbus_ao_params.c

@@ -0,0 +1,12 @@
+#include "at32f403a_407.h"
+#include "modbus_ao_params.h"
+
+#if defined (MAO_8)
+
+//
+void mb_init_ao_params(void)
+{
+
+}
+
+#endif

+ 24 - 0
fw/modules/modbus/modbus_ao_params.h

@@ -0,0 +1,24 @@
+#ifndef __MODBUS_AO_PARAMS_H
+#define __MODBUS_AO_PARAMS_H
+
+#include "mb.h"
+#include "mbport.h"
+#include "modbus.h"
+#include <stdbool.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+  
+//
+void mb_init_ao_params(void);
+  
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // __MODBUS_AO_PARAMS_H

+ 219 - 0
fw/modules/modbus/modbus_dio_params.c

@@ -0,0 +1,219 @@
+#include "at32f403a_407.h"
+#include "modbus_dio_params.h"
+#include "modbus_params.h"
+#include "digital_input.h"
+#include "digital_output.h"
+#include "settings_api.h"
+
+extern mb_param_t mb_param[];
+
+#if defined (MDIO_88)
+
+
+//
+uint16_t mb_init_dio_params(uint16_t i)
+{
+    uint16_t index = i;
+    uint16_t addr = 0;  
+  
+    mb_param[index].reg = 0x0100;
+	mb_param[index].size = 1;
+	mb_param[index].param = (uint8_t*)&di_state_bit;  // Текущее состояние входов
+	mb_param[index].set = NULL;
+    mb_param[index].get = NULL;
+    mb_param[index].check_handler = mb_check_dummy;
+    
+    index++;
+    
+        // Счетчики импульсов. Регистры 0x0102 - 0x0111
+    addr = 0x0102;
+    for (int i = 0; i < DI_NUMBER; i++)
+    {
+        mb_param[index].reg = addr;
+        mb_param[index].size = 2;
+        mb_param[index].param = (uint8_t*)&di_cnt[i];  // Счетчик ипульсов
+        mb_param[index].set = NULL;
+        mb_param[index].get = NULL;
+        mb_param[index].check_handler = mb_check_dummy;
+        
+        addr += 2;
+        index++;
+    }
+    
+    // Режим работы входов
+    mb_param[index].reg = 0x0120;
+	mb_param[index].size = 1;
+	mb_param[index].param = (uint8_t*)&settings.di_mode_bits;  
+	mb_param[index].set = mb_set_din_mode;
+    mb_param[index].get = NULL;
+    mb_param[index].check_handler = mb_check_dummy;
+    
+    index++;
+    
+    // Нормальное состояние входов
+    mb_param[index].reg = 0x0122;
+	mb_param[index].size = 1;
+	mb_param[index].param = (uint8_t*)&settings.di_norm_state_bits;  
+	mb_param[index].set = NULL;
+    mb_param[index].get = NULL;
+    mb_param[index].check_handler = mb_check_dummy;
+    
+    index++;
+ 
+    // Время антидребезга
+    addr = 0x0124;
+    for (int i = 0; i < DI_NUMBER; i++)
+    {
+        mb_param[index].reg = addr;
+        mb_param[index].size = 1;
+        mb_param[index].param = (uint8_t*)&settings.di_debounce[i];
+        mb_param[index].set = NULL;
+        mb_param[index].get = NULL;
+        mb_param[index].check_handler = mb_check_dummy;
+        
+        addr++;
+        index++;
+    }
+
+    // Текущее состояние датчиков нагрузки
+    mb_param[index].reg = 0x0130;
+	mb_param[index].size = 1;
+	mb_param[index].param = (uint8_t*)&di_load_state_bit;
+	mb_param[index].set = NULL;
+    mb_param[index].get = NULL;
+    mb_param[index].check_handler = mb_check_dummy;
+    
+    index++;
+    
+    // Слово достоверности датчиков нагрузки [1 - показания достоверны, 0 - нет]
+    mb_param[index].reg = 0x0131;
+	mb_param[index].size = 1;
+	mb_param[index].param = (uint8_t*)&di_credibility_state_bit;
+	mb_param[index].set = NULL;
+    mb_param[index].get = NULL;
+    mb_param[index].check_handler = mb_check_dummy;
+    
+    index++;
+    
+    // Текущее состояние выходов
+    mb_param[index].reg = 0x0200;
+	mb_param[index].size = 1;
+	mb_param[index].param = (uint8_t*)&output_state_bit;  
+	mb_param[index].set = mb_set_do;
+    mb_param[index].get = NULL;
+    mb_param[index].check_handler = mb_check_dummy;
+    
+    index++;
+    
+    // Режим работы выходов
+    mb_param[index].reg = 0x0202;
+	mb_param[index].size = 1;
+	mb_param[index].param = (uint8_t*)&output_mode_bit;  
+	mb_param[index].set = mb_set_do_mode;
+    mb_param[index].get = NULL;
+    mb_param[index].check_handler = mb_check_dummy;
+    
+    index++;
+    
+    // Состояние выходов в безопасном режиме
+    mb_param[index].reg = 0x0203;
+	mb_param[index].size = 1;
+	mb_param[index].param = (uint8_t*)&settings.do_save_bits;  
+	mb_param[index].set = mb_set_do;
+    mb_param[index].get = NULL;
+    mb_param[index].check_handler = mb_check_dummy;
+    
+    index++;
+    
+    // Заполнение PWM. Регистры 0x0210 - 0x0217
+    addr = 0x0210;
+    for (int i = 0; i < DO_NUMBER; i++)
+    {
+        mb_param[index].reg = addr;
+        mb_param[index].size = 1;
+        mb_param[index].param = (uint8_t*)&output_pwm[i];  // Счетчик ипульсов
+        mb_param[index].set = mb_set_do;
+        mb_param[index].get = NULL;
+        mb_param[index].check_handler = mb_check_dummy;
+        
+        addr++;
+        index++;
+    }
+    
+    // Заполнение PWM в безопасном режиме. Регистры 0x0220 - 0x0227
+    addr = 0x0220;
+    for (int i = 0; i < DO_NUMBER; i++)
+    {
+        mb_param[index].reg = addr;
+        mb_param[index].size = 1;
+        mb_param[index].param = (uint8_t*)&output_pwm_save[i];  // Счетчик ипульсов
+        mb_param[index].set = mb_set_do;
+        mb_param[index].get = NULL;
+        mb_param[index].check_handler = mb_check_dummy;
+        
+        addr++;
+        index++;
+    }
+    
+    // Период PWM. Регистры 0x0220 - 0x0227
+    addr = 0x0230;
+    for (int i = 0; i < DO_NUMBER; i++)
+    {
+        mb_param[index].reg = addr;
+        mb_param[index].size = 1;
+        mb_param[index].param = (uint8_t*)&output_pwm_period[i];  // Счетчик ипульсов
+        mb_param[index].set = mb_set_do;
+        mb_param[index].get = NULL;
+        mb_param[index].check_handler = mb_check_dummy;
+        
+        addr++;
+        index++;
+    }
+    
+    // Период PWM. Регистры 0x0220 - 0x0227
+    addr = 0x0240;
+    for (int i = 0; i < DO_NUMBER; i++)
+    {
+        mb_param[index].reg = addr;
+        mb_param[index].size = 1;
+        mb_param[index].param = (uint8_t*)&output_pwm_period_save[i];  // Счетчик ипульсов
+        mb_param[index].set = mb_set_do;
+        mb_param[index].get = NULL;
+        mb_param[index].check_handler = mb_check_dummy;
+        
+        addr++;
+        index++;
+    }
+    
+    return index;
+}
+
+
+
+// -------------------------------------------------------------------------- //
+//                          Установка параметров
+// -------------------------------------------------------------------------- //
+
+//
+mb_delay_action_t mb_set_din_mode(void)
+{
+    di_set();
+    return MB_NO_ACTION;
+}
+
+//
+mb_delay_action_t mb_set_do(void)
+{
+    do_set_common();
+    return MB_NO_ACTION;
+}
+
+//
+mb_delay_action_t mb_set_do_mode(void)
+{
+    do_set_mode();
+    return MB_NO_ACTION;
+}
+
+#endif
+

+ 37 - 0
fw/modules/modbus/modbus_dio_params.h

@@ -0,0 +1,37 @@
+#ifndef __MODBUS_DIO_PARAMS_H
+#define __MODBUS_DIO_PARAMS_H
+
+#include "mb.h"
+#include "mbport.h"
+#include "modbus.h"
+#include <stdbool.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+  
+//
+uint16_t mb_init_dio_params(uint16_t i);
+  
+// -------------------------------------------------------------------------- //
+//                          Установка параметров
+// -------------------------------------------------------------------------- //
+
+//
+mb_delay_action_t mb_set_din_mode(void);
+
+//
+mb_delay_action_t mb_set_do(void);
+
+//
+mb_delay_action_t mb_set_do_mode(void);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // __MODBUS_DIO_PARAMS_H

+ 10 - 187
fw/modules/modbus/modbus_params.c

@@ -1,5 +1,6 @@
 #include "at32f403a_407.h"
 #include "modbus_params.h"
+#include "modbus_dio_params.h"
 #include "io.h"
 #include "uptime.h"
 #include "rtc.h"
@@ -55,175 +56,18 @@ void mb_init_params(void)
 {
     uint16_t index = 0;
     uint16_t addr = 0;
-    
-    mb_param[index].reg = 0x0100;
-	mb_param[index].size = 1;
-	mb_param[index].param = (uint8_t*)&di_state_bit;  // Текущее состояние входов
-	mb_param[index].set = NULL;
-    mb_param[index].get = NULL;
-    mb_param[index].check_handler = mb_check_dummy;
-    
-    index++;
-        
-    // Счетчики импульсов. Регистры 0x0102 - 0x0111
-    addr = 0x0102;
-    for (int i = 0; i < DI_NUMBER; i++)
-    {
-        mb_param[index].reg = addr;
-        mb_param[index].size = 2;
-        mb_param[index].param = (uint8_t*)&di_cnt[i];  // Счетчик ипульсов
-        mb_param[index].set = NULL;
-        mb_param[index].get = NULL;
-        mb_param[index].check_handler = mb_check_dummy;
-        
-        addr += 2;
-        index++;
-    } 
-    
-    // Режим работы входов
-    mb_param[index].reg = 0x0120;
-	mb_param[index].size = 1;
-	mb_param[index].param = (uint8_t*)&settings.di_mode_bits;  
-	mb_param[index].set = mb_set_din_mode;
-    mb_param[index].get = NULL;
-    mb_param[index].check_handler = mb_check_dummy;
-    
-    index++;
-    
-    // Нормальное состояние входов
-    mb_param[index].reg = 0x0122;
-	mb_param[index].size = 1;
-	mb_param[index].param = (uint8_t*)&settings.di_norm_state_bits;  
-	mb_param[index].set = NULL;
-    mb_param[index].get = NULL;
-    mb_param[index].check_handler = mb_check_dummy;
-    
-    index++;
- 
-    // Время антидребезга
-    addr = 0x0124;
-    for (int i = 0; i < DI_NUMBER; i++)
-    {
-        mb_param[index].reg = addr;
-        mb_param[index].size = 1;
-        mb_param[index].param = (uint8_t*)&settings.di_debounce[i];
-        mb_param[index].set = NULL;
-        mb_param[index].get = NULL;
-        mb_param[index].check_handler = mb_check_dummy;
-        
-        addr++;
-        index++;
-    }
 
-    // Текущее состояние датчиков нагрузки
-    mb_param[index].reg = 0x0130;
-	mb_param[index].size = 1;
-	mb_param[index].param = (uint8_t*)&di_load_state_bit;
-	mb_param[index].set = NULL;
-    mb_param[index].get = NULL;
-    mb_param[index].check_handler = mb_check_dummy;
-    
-    index++;
-    
-    // Слово достоверности датчиков нагрузки [1 - показания достоверны, 0 - нет]
-    mb_param[index].reg = 0x0131;
-	mb_param[index].size = 1;
-	mb_param[index].param = (uint8_t*)&di_credibility_state_bit;
-	mb_param[index].set = NULL;
-    mb_param[index].get = NULL;
-    mb_param[index].check_handler = mb_check_dummy;
-    
-    index++;
-    
-    // Текущее состояние выходов
-    mb_param[index].reg = 0x0200;
-	mb_param[index].size = 1;
-	mb_param[index].param = (uint8_t*)&output_state_bit;  
-	mb_param[index].set = mb_set_do;
-    mb_param[index].get = NULL;
-    mb_param[index].check_handler = mb_check_dummy;
-    
-    index++;
-    
-    // Режим работы выходов
-    mb_param[index].reg = 0x0202;
-	mb_param[index].size = 1;
-	mb_param[index].param = (uint8_t*)&output_mode_bit;  
-	mb_param[index].set = mb_set_do_mode;
-    mb_param[index].get = NULL;
-    mb_param[index].check_handler = mb_check_dummy;
-    
-    index++;
-    
-    // Состояние выходов в безопасном режиме
-    mb_param[index].reg = 0x0203;
-	mb_param[index].size = 1;
-	mb_param[index].param = (uint8_t*)&settings.do_save_bits;  
-	mb_param[index].set = mb_set_do;
-    mb_param[index].get = NULL;
-    mb_param[index].check_handler = mb_check_dummy;
-    
-    index++;
+#if defined (MDIO_88)
+    index = mb_init_dio_params(0);
+#endif 
     
-    // Заполнение PWM. Регистры 0x0210 - 0x0217
-    addr = 0x0210;
-    for (int i = 0; i < DO_NUMBER; i++)
-    {
-        mb_param[index].reg = addr;
-        mb_param[index].size = 1;
-        mb_param[index].param = (uint8_t*)&output_pwm[i];  // Счетчик ипульсов
-        mb_param[index].set = mb_set_do;
-        mb_param[index].get = NULL;
-        mb_param[index].check_handler = mb_check_dummy;
-        
-        addr++;
-        index++;
-    }
-    
-    // Заполнение PWM в безопасном режиме. Регистры 0x0220 - 0x0227
-    addr = 0x0220;
-    for (int i = 0; i < DO_NUMBER; i++)
-    {
-        mb_param[index].reg = addr;
-        mb_param[index].size = 1;
-        mb_param[index].param = (uint8_t*)&output_pwm_save[i];  // Счетчик ипульсов
-        mb_param[index].set = mb_set_do;
-        mb_param[index].get = NULL;
-        mb_param[index].check_handler = mb_check_dummy;
-        
-        addr++;
-        index++;
-    }
-    
-    // Период PWM. Регистры 0x0220 - 0x0227
-    addr = 0x0230;
-    for (int i = 0; i < DO_NUMBER; i++)
-    {
-        mb_param[index].reg = addr;
-        mb_param[index].size = 1;
-        mb_param[index].param = (uint8_t*)&output_pwm_period[i];  // Счетчик ипульсов
-        mb_param[index].set = mb_set_do;
-        mb_param[index].get = NULL;
-        mb_param[index].check_handler = mb_check_dummy;
-        
-        addr++;
-        index++;
-    }
+#if defined (MAI_12)
+    index = mb_init_ai_params(0);
+#endif    
     
-    // Период PWM. Регистры 0x0220 - 0x0227
-    addr = 0x0240;
-    for (int i = 0; i < DO_NUMBER; i++)
-    {
-        mb_param[index].reg = addr;
-        mb_param[index].size = 1;
-        mb_param[index].param = (uint8_t*)&output_pwm_period_save[i];  // Счетчик ипульсов
-        mb_param[index].set = mb_set_do;
-        mb_param[index].get = NULL;
-        mb_param[index].check_handler = mb_check_dummy;
-        
-        addr++;
-        index++;
-    }
+#if defined (MAO_8)
+    index = mb_init_ao_params();
+#endif    
     
     // ---------------------------------------------------------------------- //
 	//	Управление контроллером. Разные параметры.
@@ -598,27 +442,6 @@ void get_rtc(uint8_t* buf, uint8_t size)
 //                          Установка параметров
 // -------------------------------------------------------------------------- //
 
-//
-mb_delay_action_t mb_set_din_mode(void)
-{
-    di_set();
-    return MB_NO_ACTION;
-}
-
-//
-mb_delay_action_t mb_set_do(void)
-{
-    do_set_common();
-    return MB_NO_ACTION;
-}
-
-//
-mb_delay_action_t mb_set_do_mode(void)
-{
-    do_set_mode();
-    return MB_NO_ACTION;
-}
-
 //
 mb_delay_action_t mb_set_time(void)
 {

+ 7 - 11
fw/modules/modbus/modbus_params.h

@@ -11,8 +11,13 @@
 extern "C" {
 #endif
 
-  
-#define MB_PARAM_MAX			87 //54
+#if defined (MDIO_88)  
+#define MB_PARAM_MAX			87
+#endif
+
+#if defined (MAI_12)  
+#define MB_PARAM_MAX			87  
+#endif  
 
 
 //
@@ -59,15 +64,6 @@ bool mb_set_addr_serial(uint8_t *buf, uint8_t *addr);
 //
 mb_delay_action_t mb_set_time(void);
 
-//
-mb_delay_action_t mb_set_din_mode(void);
-
-//
-mb_delay_action_t mb_set_do(void);
-
-//
-mb_delay_action_t mb_set_do_mode(void);
-
 //
 mb_delay_action_t mb_password(void);
 

+ 17 - 0
fw/modules/settings/settings_ai.c

@@ -0,0 +1,17 @@
+#include "at32f403a_407.h" 
+#include "settings_api.h"
+#include "settings_ai.h"
+
+
+//
+void settings_ai_set_all_default(void)
+{
+    // Аналоговые входы
+    settings_ai_def(&settings);
+}
+
+//
+void settings_ai_def(settings_t *settings)
+{
+    settings->ai_mode_bits = 0;
+}

+ 15 - 0
fw/modules/settings/settings_ai.h

@@ -0,0 +1,15 @@
+#ifndef SETTINGS_AI_API_H
+#define SETTINGS_AI_API_H
+
+#include "settings_api.h"
+
+
+//
+void settings_ai_set_all_default(void);
+
+//
+void settings_ai_def(settings_t *settings);
+
+
+#endif /* #ifndef SETTINGS_AI_API_H */
+

+ 10 - 0
fw/modules/settings/settings_ao.c

@@ -0,0 +1,10 @@
+#include "at32f403a_407.h" 
+#include "settings_api.h"
+#include "settings_ao.h"
+
+
+//
+void settings_ao_set_all_default(void)
+{
+
+}

+ 10 - 0
fw/modules/settings/settings_ao.h

@@ -0,0 +1,10 @@
+#ifndef SETTINGS_AO_API_H
+#define SETTINGS_AO_API_H
+
+
+//
+void settings_ao_set_all_default(void);
+
+
+#endif /* #ifndef SETTINGS_AO_API_H */
+

+ 10 - 67
fw/modules/settings/settings_api.c

@@ -1,5 +1,8 @@
 #include "at32f403a_407.h" 
 #include "settings_api.h"
+#include "settings_dio.h"
+#include "settings_ao.h"
+#include "settings_ai.h"
 #include "sys_api.h"
 #include "FreeRTOS.h"
 #include "task.h"
@@ -113,52 +116,19 @@ uint32_t settings_get_crit_sec_crc(settings_t *settings)
 void settings_set_all_default(void)
 {
     settings_set_modbus_def(&settings.com_settings.mb_port);
-    
-    //memset(settings.com_settings.model, 0, MODEL_LEN);
-    //memcpy(settings.com_settings.model, MODEL_STR, strlen(MODEL_STR));
         
     settings.settings_version = SETTINGS_VERSION;
     settings.critical_section_crc = settings_get_crit_sec_crc(&settings);
     settings.control_word = SETTINGS_CONTROL_WORD;
 
-    // Дискретные/счетные входы
-    settings_din_def(&settings);
-    
-    // Выходы
-    settings_do_def(&settings);
-    
-    // Безопасный режим
-    settings.save_mode = 1; 
-    
-    // Время ожидания опроса (сек.)
-    settings.save_delay = 60;
-    
-    // Время ведения архива по каждому каналу (сек.)
-    for (uint8_t i = 0; i < ARCH_CH_NUMBER; i++) {
-        settings.period_archive[i] = 3600;
-    }
+#if defined (MDIO_88)    
+    settings_dio_set_all_default();
+#endif
     
-#if 0  
-    SETTINGS_SetWebParamsDef();
-    SETTINGS_SetTempWebParamsDef();
-    SETTINGS_SetInfoDef();
-    SETTINGS_SetGSMDef();
-    SETTINGS_SetFlagsDef();
-    
-    SETTINGS_SetEthternetSwitchDef();
-    SETTINGS_SetSntpDef();
-    SETTINGS_SetServerParamsDef();
-    SETTINGS_SetProxyParamsDef();
-    SETTINGS_SetPortGwDef();
-    SETTINGS_SetPSDDef();
-    SETTINGS_SetServiceDef();
-    
-    sSettings.settVer = SETTINGS_VERSION;
-    
-    sSettings.CritSecCRC = settings_get_crit_sec_crc();
-    
-    sSettings.controlWorld = SETTINGS_CONTROL_WORD;
-#endif    
+#if defined (MAI_12)
+    settings_ai_set_all_default();
+#endif
+
 }
 
 // -------------------------------------------------------------------------- //
@@ -385,33 +355,6 @@ void settings_init_mb_port(uint8_t mb_addr)
 }
 
 
-// Установить параметры дискретных входов по умолчанию
-void settings_din_def(settings_t *settings)
-{
-    settings->di_mode_bits = 0;
-    settings->di_norm_state_bits = 0;
-    
-    for (int i = 0; i < DI_NUMBER; i++) {
-        settings->di_debounce[i] = 50;
-    }
-}
-
-// Выходы
-void settings_do_def(settings_t *settings)
-{
-    settings->do_mode_bits = 0; // режим работы выхода (обычный выход)
-    settings->do_bits = 0;      // последнее сохраненное значение 
-    settings->do_save_bits = 0;
-    
-    for (uint8_t i = 0; i < DO_NUMBER; i++)
-    {
-        settings->do_pwm[i] = 30;
-        settings->do_pwm_save[i] = 30; // значение на выходах в бесопасном режиме работы
-        settings->do_pwm_period[i] = 50;
-        settings->do_pwm_period_save[i] = 50;
-    }
-}
-
 // -------------------------------------------------------------------------- //
 
 // Запись структуры настроек во flash

+ 2 - 8
fw/modules/settings/settings_api.h

@@ -100,10 +100,10 @@ typedef struct
 * (структура настроек всегда будет отличаться внутри основного ПО).
 * В случае повреждения критического сектора, загружаются параметры по умолчанию. */    
     
-#if defined (MDIO_88)      
     uint16_t    settings_version;   // Версия структуры настроек 
     uint32_t    control_word;       // Слово для контроля целостности структуры настроек
     
+#if defined (MDIO_88)          
     uint16_t    di_mode_bits;          // режим работы, 0 - вход, 1 - счетчик импульсов
     uint16_t    di_norm_state_bits;    // нормальное состояние (0 - разомкнут, 1 - замкнут)        
     uint16_t    di_debounce[DI_NUMBER]; // Дискретные входы
@@ -118,7 +118,7 @@ typedef struct
 #endif
 
 #if defined (MAI_12)
-    uint16_t    ai_mode[AI_NUMBER];
+    uint16_t    ai_mode_bits;       // режим работы входов, 0 - зимерение напряжения, 1 - тока
 #endif    
 
     
@@ -171,12 +171,6 @@ eMBParity settings_get_mb_par(modbus_t *mb_settings);
 //
 void settings_init_mb_port(uint8_t mb_addr);
 
-// Установить параметры дискретных входов по умолчанию
-void settings_din_def(settings_t *settings);
-
-// Выходы
-void settings_do_def(settings_t *settings);
-
 // -------------------------------------------------------------------------- //
 
 // Запись структуры настроек во flash

+ 55 - 0
fw/modules/settings/settings_dio.c

@@ -0,0 +1,55 @@
+#include "at32f403a_407.h" 
+#include "settings_api.h"
+#include "settings_dio.h"
+
+#if defined (MDIO_88)
+
+//
+void settings_dio_set_all_default(void)
+{
+    // Дискретные/счетные входы
+    settings_din_def(&settings);
+    
+    // Выходы
+    settings_do_def(&settings);
+    
+    // Безопасный режим
+    settings.save_mode = 1; 
+    
+    // Время ожидания опроса (сек.)
+    settings.save_delay = 60;
+    
+    // Время ведения архива по каждому каналу (сек.)
+    for (uint8_t i = 0; i < ARCH_CH_NUMBER; i++) {
+        settings.period_archive[i] = 3600;
+    }
+}
+
+// Установить параметры дискретных входов по умолчанию
+void settings_din_def(settings_t *settings)
+{
+    settings->di_mode_bits = 0;
+    settings->di_norm_state_bits = 0;
+    
+    for (int i = 0; i < DI_NUMBER; i++) {
+        settings->di_debounce[i] = 50;
+    }
+}
+
+// Выходы
+void settings_do_def(settings_t *settings)
+{
+    settings->do_mode_bits = 0; // режим работы выхода (обычный выход)
+    settings->do_bits = 0;      // последнее сохраненное значение 
+    settings->do_save_bits = 0;
+    
+    for (uint8_t i = 0; i < DO_NUMBER; i++)
+    {
+        settings->do_pwm[i] = 30;
+        settings->do_pwm_save[i] = 30; // значение на выходах в бесопасном режиме работы
+        settings->do_pwm_period[i] = 50;
+        settings->do_pwm_period_save[i] = 50;
+    }
+}
+
+#endif

+ 17 - 0
fw/modules/settings/settings_dio.h

@@ -0,0 +1,17 @@
+#ifndef SETTINGS_DIO_H
+#define SETTINGS_DIO_H
+
+#include "settings_api.h"
+
+//
+void settings_dio_set_all_default(void);
+
+//
+void settings_din_def(settings_t *settings);
+
+//
+void settings_do_def(settings_t *settings);
+
+
+#endif /* #ifndef SETTINGS_DIO_H */
+

+ 52 - 0
fw/modules/settings/settings_dio_api.c

@@ -0,0 +1,52 @@
+#include "at32f403a_407.h" 
+#include "settings_api.h"
+#include "settings_dio_api.h"
+
+
+//
+void settings_dio_set_all_default(void)
+{
+    // Дискретные/счетные входы
+    settings_din_def(&settings);
+    
+    // Выходы
+    settings_do_def(&settings);
+    
+    // Безопасный режим
+    settings.save_mode = 1; 
+    
+    // Время ожидания опроса (сек.)
+    settings.save_delay = 60;
+    
+    // Время ведения архива по каждому каналу (сек.)
+    for (uint8_t i = 0; i < ARCH_CH_NUMBER; i++) {
+        settings.period_archive[i] = 3600;
+    }
+}
+
+// Установить параметры дискретных входов по умолчанию
+void settings_din_def(settings_t *settings)
+{
+    settings->di_mode_bits = 0;
+    settings->di_norm_state_bits = 0;
+    
+    for (int i = 0; i < DI_NUMBER; i++) {
+        settings->di_debounce[i] = 50;
+    }
+}
+
+// Выходы
+void settings_do_def(settings_t *settings)
+{
+    settings->do_mode_bits = 0; // режим работы выхода (обычный выход)
+    settings->do_bits = 0;      // последнее сохраненное значение 
+    settings->do_save_bits = 0;
+    
+    for (uint8_t i = 0; i < DO_NUMBER; i++)
+    {
+        settings->do_pwm[i] = 30;
+        settings->do_pwm_save[i] = 30; // значение на выходах в бесопасном режиме работы
+        settings->do_pwm_period[i] = 50;
+        settings->do_pwm_period_save[i] = 50;
+    }
+}

+ 8 - 2
fw/user/main.cpp

@@ -104,6 +104,12 @@ void init_task(void *argument)
     // Настройки параметров порта Modbus
     settings_set_modbus_params(settings.com_settings.mb_port);
     
+#if 0
+// Только для теста    
+    settings_set_all_default();
+    settings_save(&settings);
+#endif
+    
 // -------------------------------------------------------------------------- //    
 // Безопасный режим, входы, выходы
     
@@ -121,12 +127,12 @@ void init_task(void *argument)
 // Цифровые входы/выходы
 
 #if defined (MDIO_88)
+    
     di_init();
     di_tim_init();
-    
     do_init();
-    
     xTaskCreate(di_task, "input_task", 2*configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL);
+    
 #endif
     
 #if defined (MAI_12)    

BIN
output/fw.bin


+ 76 - 75
project/ewarm/iap/iap.dep

@@ -263,6 +263,7 @@
             <file>$PROJ_DIR$\..\..\..\shared\freemodbus\include\mbfunc.h</file>
             <file>$PROJ_DIR$\..\..\..\shared\freemodbus\include\mbport.h</file>
             <file>$PROJ_DIR$\..\..\..\shared\freemodbus\include\mbproto.h</file>
+            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\include\mbutils.h</file>
             <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\portable\IAR\ARM_CM4F\port.c</file>
             <file>$PROJ_DIR$\..\..\..\shared\freemodbus\include\mbconfig.h</file>
             <file>$PROJ_DIR$\..\..\..\shared\freemodbus\port\port.h</file>
@@ -343,7 +344,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 249 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 270 62 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 110 198 164 221 265 309 210 20 148 104 95 272 64 91 178 157 201 114 188 61 46 231 181 228 241 254 260 256 257 140 215 88</file>
+                    <file> 249 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 271 62 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 110 198 164 221 266 310 210 20 148 104 95 273 64 91 178 157 201 114 188 61 46 231 181 228 241 254 261 256 257 140 215 88</file>
                 </tool>
             </inputs>
         </file>
@@ -362,7 +363,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 270 62 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
+                    <file> 271 62 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
                 </tool>
             </inputs>
         </file>
@@ -381,7 +382,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 270 62 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
+                    <file> 271 62 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
                 </tool>
             </inputs>
         </file>
@@ -400,7 +401,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 270 62 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
+                    <file> 271 62 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
                 </tool>
             </inputs>
         </file>
@@ -419,7 +420,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 270 62 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
+                    <file> 271 62 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
                 </tool>
             </inputs>
         </file>
@@ -432,13 +433,13 @@
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 307</file>
+                    <file> 308</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 221 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 270 62 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
+                    <file> 221 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 271 62 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
                 </tool>
             </inputs>
         </file>
@@ -457,7 +458,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 270 62 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
+                    <file> 271 62 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
                 </tool>
             </inputs>
         </file>
@@ -476,7 +477,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 270 62 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
+                    <file> 271 62 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
                 </tool>
             </inputs>
         </file>
@@ -489,13 +490,13 @@
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 310</file>
+                    <file> 311</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 270 62 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
+                    <file> 271 62 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
                 </tool>
             </inputs>
         </file>
@@ -514,7 +515,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 270 62 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
+                    <file> 271 62 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
                 </tool>
             </inputs>
         </file>
@@ -533,7 +534,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 270 62 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
+                    <file> 271 62 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
                 </tool>
             </inputs>
         </file>
@@ -552,7 +553,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 270 62 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
+                    <file> 271 62 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
                 </tool>
             </inputs>
         </file>
@@ -571,7 +572,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 270 62 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
+                    <file> 271 62 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
                 </tool>
             </inputs>
         </file>
@@ -590,7 +591,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 270 62 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
+                    <file> 271 62 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
                 </tool>
             </inputs>
         </file>
@@ -609,7 +610,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 270 62 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
+                    <file> 271 62 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
                 </tool>
             </inputs>
         </file>
@@ -628,7 +629,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 270 62 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
+                    <file> 271 62 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
                 </tool>
             </inputs>
         </file>
@@ -647,7 +648,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 187 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 270 62 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
+                    <file> 187 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 271 62 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
                 </tool>
             </inputs>
         </file>
@@ -660,13 +661,13 @@
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 312</file>
+                    <file> 313</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 270 62 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
+                    <file> 271 62 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
                 </tool>
             </inputs>
         </file>
@@ -685,7 +686,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 270 62 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
+                    <file> 271 62 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
                 </tool>
             </inputs>
         </file>
@@ -704,7 +705,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 270 62 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
+                    <file> 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 271 62 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
                 </tool>
             </inputs>
         </file>
@@ -723,7 +724,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 270 62 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
+                    <file> 271 62 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
                 </tool>
             </inputs>
         </file>
@@ -742,7 +743,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 270 62 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
+                    <file> 271 62 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
                 </tool>
             </inputs>
         </file>
@@ -761,7 +762,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 270 62 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
+                    <file> 271 62 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
                 </tool>
             </inputs>
         </file>
@@ -780,7 +781,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 270 62 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
+                    <file> 271 62 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
                 </tool>
             </inputs>
         </file>
@@ -799,7 +800,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 270 62 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
+                    <file> 271 62 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
                 </tool>
             </inputs>
         </file>
@@ -818,7 +819,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 270 62 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
+                    <file> 271 62 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
                 </tool>
             </inputs>
         </file>
@@ -837,7 +838,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 270 62 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
+                    <file> 271 62 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
                 </tool>
             </inputs>
         </file>
@@ -856,7 +857,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 270 62 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
+                    <file> 271 62 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
                 </tool>
             </inputs>
         </file>
@@ -884,7 +885,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 270 62 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
+                    <file> 271 62 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
                 </tool>
             </inputs>
         </file>
@@ -903,7 +904,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 270 62 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 126 181 231 228 309 210 164 20 148 104 95 272 64 91 178 188 114 241 254 260 157 201 256 257 265 45 301 68 283 198 215 88</file>
+                    <file> 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 271 62 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 126 181 231 228 310 210 164 20 148 104 95 273 64 91 178 188 114 241 254 261 157 201 256 257 266 45 302 68 284 198 215 88</file>
                 </tool>
             </inputs>
         </file>
@@ -922,7 +923,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 270 62 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 140 231 309 210 164 20 148 104 95 272 64 91 178 157 201</file>
+                    <file> 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 271 62 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 140 231 310 210 164 20 148 104 95 273 64 91 178 157 201</file>
                 </tool>
             </inputs>
         </file>
@@ -941,7 +942,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 270 62 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 265 61 167 254 260 309 210 164 20 148 104 95 272 64 91 178 157 201 256 257 231 68 282 181 228 188 114 241 126 46 45 198 215 88</file>
+                    <file> 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 271 62 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 266 61 167 254 261 310 210 164 20 148 104 95 273 64 91 178 157 201 256 257 231 68 283 181 228 188 114 241 126 46 45 198 215 88</file>
                 </tool>
             </inputs>
         </file>
@@ -960,7 +961,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 270 62 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 167 254 260 309 210 164 20 148 104 95 272 64 91 178 157 201 256 257 61 231 215 88</file>
+                    <file> 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 271 62 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 167 254 261 310 210 164 20 148 104 95 273 64 91 178 157 201 256 257 61 231 215 88</file>
                 </tool>
             </inputs>
         </file>
@@ -969,7 +970,7 @@
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 291</file>
+                    <file> 292</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
@@ -979,7 +980,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 270 62 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 181 231 228 309 210 164 20 148 104 95 272 64 91 178 188 114 241 254 260 157 201 256 257 265 274 215 88 76 242 198</file>
+                    <file> 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 271 62 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 181 231 228 310 210 164 20 148 104 95 273 64 91 178 188 114 241 254 261 157 201 256 257 266 275 215 88 76 242 198</file>
                 </tool>
             </inputs>
         </file>
@@ -994,7 +995,7 @@
             <inputs>
                 <tool>
                     <name>ILINK</name>
-                    <file> 89 79 96 105 237 56 85 155 166 58 220 142 170 138 194 121 217 234 43 69 180 173 124 39 84 246 74 49 230 146 38 209 99 108 232 302 55 53 153 222 100 93 191 77 171 154 165 236 151 123 132 41 50 186 125 135 200 109 250 149 297 52 291 63 40 90 226 196 207 174 219 73 59 245 183</file>
+                    <file> 89 79 96 105 237 56 85 155 166 58 220 142 170 138 194 121 217 234 43 69 180 173 124 39 84 246 74 49 230 146 38 209 99 108 232 303 55 53 153 222 100 93 191 77 171 154 165 236 151 123 132 41 50 186 125 135 200 109 250 149 298 52 292 63 40 90 226 196 207 174 219 73 59 245 183</file>
                 </tool>
             </inputs>
         </file>
@@ -1003,7 +1004,7 @@
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 302</file>
+                    <file> 303</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
@@ -1013,7 +1014,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 76 107 86 306 184 131 164 242 309 210 118 20 148 104 95 272 64 71 91 178 157 201</file>
+                    <file> 76 107 86 307 184 131 164 242 310 210 118 20 148 104 95 273 64 71 91 178 157 201</file>
                 </tool>
             </inputs>
         </file>
@@ -1032,7 +1033,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 76 107 86 306 184 131 164 242 215 88 260 26 134 118 227 101 224 71 244 87 106 270 62 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 309 210 20 148 104 95 272 64 91 178 157 201 254 256 257 267 259</file>
+                    <file> 76 107 86 307 184 131 164 242 215 88 261 26 134 118 227 101 224 71 244 87 106 271 62 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 310 210 20 148 104 95 273 64 91 178 157 201 254 256 257 268 260</file>
                 </tool>
             </inputs>
         </file>
@@ -1064,7 +1065,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 64 71 86 306 184 131 91 309 210 107 164 118 20 148 104 95 272 178 157 201</file>
+                    <file> 64 71 86 307 184 131 91 310 210 107 164 118 20 148 104 95 273 178 157 201</file>
                 </tool>
             </inputs>
         </file>
@@ -1083,7 +1084,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 309 210 107 86 306 184 131 164 118 20 148 104 95 272 64 71 91 178 157 201 114 254 260 26 134 227 101 224 244 87 106 270 62 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 256 257</file>
+                    <file> 310 210 107 86 307 184 131 164 118 20 148 104 95 273 64 71 91 178 157 201 114 254 261 26 134 227 101 224 244 87 106 271 62 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 256 257</file>
                 </tool>
             </inputs>
         </file>
@@ -1102,7 +1103,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 309 210 107 86 306 184 131 164 118 20 148 104 95 272 64 71 91 178</file>
+                    <file> 310 210 107 86 307 184 131 164 118 20 148 104 95 273 64 71 91 178</file>
                 </tool>
             </inputs>
         </file>
@@ -1121,7 +1122,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 76 107 86 306 184 131 164 242 309 210 118 20 148 104 95 272 64 71 91 178 157 201 114 45</file>
+                    <file> 76 107 86 307 184 131 164 242 310 210 118 20 148 104 95 273 64 71 91 178 157 201 114 45</file>
                 </tool>
             </inputs>
         </file>
@@ -1140,7 +1141,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 309 210 107 86 306 184 131 164 118 20 148 104 95 272 64 71 91 178 157 201 223</file>
+                    <file> 310 210 107 86 307 184 131 164 118 20 148 104 95 273 64 71 91 178 157 201 223</file>
                 </tool>
             </inputs>
         </file>
@@ -1159,7 +1160,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 76 107 86 306 184 131 164 242 215 88 309 210 118 20 148 104 95 272 64 71 91 178 157 201 45 156 198</file>
+                    <file> 76 107 86 307 184 131 164 242 215 88 310 210 118 20 148 104 95 273 64 71 91 178 157 201 45 156 198</file>
                 </tool>
             </inputs>
         </file>
@@ -1178,7 +1179,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 76 107 86 306 184 131 164 242 215 88 260 26 134 118 227 101 224 71 244 87 106 270 62 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 309 210 20 148 104 95 272 64 91 178 157 201 254 256 257 267 259</file>
+                    <file> 76 107 86 307 184 131 164 242 215 88 261 26 134 118 227 101 224 71 244 87 106 271 62 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 310 210 20 148 104 95 273 64 91 178 157 201 254 256 257 268 260</file>
                 </tool>
             </inputs>
         </file>
@@ -1197,7 +1198,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 76 107 86 306 184 131 164 242 309 210 118 20 148 104 95 272 64 71 91 178 201</file>
+                    <file> 76 107 86 307 184 131 164 242 310 210 118 20 148 104 95 273 64 71 91 178 201</file>
                 </tool>
             </inputs>
         </file>
@@ -1221,7 +1222,7 @@
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 297</file>
+                    <file> 298</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
@@ -1231,7 +1232,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 76 107 86 306 184 131 164 242 215 88 309 210 118 20 148 104 95 272 64 71 91 178 157 201 114</file>
+                    <file> 76 107 86 307 184 131 164 242 215 88 310 210 118 20 148 104 95 273 64 71 91 178 157 201 114</file>
                 </tool>
             </inputs>
         </file>
@@ -1250,7 +1251,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 76 107 86 306 184 131 164 242 309 210 118 20 148 104 95 272 64 71 91 178 157 201 45 301</file>
+                    <file> 76 107 86 307 184 131 164 242 310 210 118 20 148 104 95 273 64 71 91 178 157 201 45 302</file>
                 </tool>
             </inputs>
         </file>
@@ -1269,7 +1270,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 76 107 86 306 184 131 164 242 215 88 260 26 134 118 227 101 224 71 244 87 106 270 62 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 309 210 20 148 104 95 272 64 91 178 157 201 254 256 257 259 147 267 119</file>
+                    <file> 76 107 86 307 184 131 164 242 215 88 261 26 134 118 227 101 224 71 244 87 106 271 62 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 310 210 20 148 104 95 273 64 91 178 157 201 254 256 257 260 147 268 119</file>
                 </tool>
             </inputs>
         </file>
@@ -1288,7 +1289,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 76 107 86 306 184 131 164 242 215 88 260 26 134 118 227 101 224 71 244 87 106 270 62 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 309 210 20 148 104 95 272 64 91 178 157 201 254 256 257 267 259</file>
+                    <file> 76 107 86 307 184 131 164 242 215 88 261 26 134 118 227 101 224 71 244 87 106 271 62 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 310 210 20 148 104 95 273 64 91 178 157 201 254 256 257 268 260</file>
                 </tool>
             </inputs>
         </file>
@@ -1307,7 +1308,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 76 107 86 306 184 131 164 242 215 88 260 26 134 118 227 101 224 71 244 87 106 270 62 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 309 210 20 148 104 95 272 64 91 178 157 201 254 256 257 267 259 198</file>
+                    <file> 76 107 86 307 184 131 164 242 215 88 261 26 134 118 227 101 224 71 244 87 106 271 62 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 310 210 20 148 104 95 273 64 91 178 157 201 254 256 257 268 260 198</file>
                 </tool>
             </inputs>
         </file>
@@ -1326,7 +1327,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 76 107 86 306 184 131 164 242 215 88 260 26 134 118 227 101 224 71 244 87 106 270 62 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 309 210 20 148 104 95 272 64 91 178 157 201 254 256 257 267 259</file>
+                    <file> 76 107 86 307 184 131 164 242 215 88 261 26 134 118 227 101 224 71 244 87 106 271 62 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 310 210 20 148 104 95 273 64 91 178 157 201 254 256 257 268 260</file>
                 </tool>
             </inputs>
         </file>
@@ -1345,7 +1346,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 76 107 86 306 184 131 164 242 215 88 260 26 134 118 227 101 224 71 244 87 106 270 62 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 309 210 20 148 104 95 272 64 91 178 157 201 254 256 257 267 259</file>
+                    <file> 76 107 86 307 184 131 164 242 215 88 261 26 134 118 227 101 224 71 244 87 106 271 62 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 310 210 20 148 104 95 273 64 91 178 157 201 254 256 257 268 260</file>
                 </tool>
             </inputs>
         </file>
@@ -1364,7 +1365,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 76 107 86 306 184 131 164 242 215 88 260 26 134 118 227 101 224 71 244 87 106 270 62 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 309 210 20 148 104 95 272 64 91 178 157 201 254 256 257</file>
+                    <file> 76 107 86 307 184 131 164 242 215 88 261 26 134 118 227 101 224 71 244 87 106 271 62 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 310 210 20 148 104 95 273 64 91 178 157 201 254 256 257</file>
                 </tool>
             </inputs>
         </file>
@@ -1383,7 +1384,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 118 107 86 306 184 131 248 241 231 265 26 134 227 101 224 71 244 87 106 270 62 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 274 198 164</file>
+                    <file> 118 107 86 307 184 131 248 241 231 266 26 134 227 101 224 71 244 87 106 271 62 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 275 198 164</file>
                 </tool>
             </inputs>
         </file>
@@ -1402,7 +1403,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 110 198 107 86 306 184 131 164 26 134 118 227 101 224 71 244 87 106 270 62 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
+                    <file> 110 198 107 86 307 184 131 164 26 134 118 227 101 224 71 244 87 106 271 62 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54</file>
                 </tool>
             </inputs>
         </file>
@@ -1421,7 +1422,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 76 107 86 306 184 131 164 242 309 210 118 20 148 104 95 272 64 71 91 178 157 201 188 114 254 260 26 134 227 101 224 244 87 106 270 62 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 256 257</file>
+                    <file> 76 107 86 307 184 131 164 242 310 210 118 20 148 104 95 273 64 71 91 178 157 201 188 114 254 261 26 134 227 101 224 244 87 106 271 62 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 256 257</file>
                 </tool>
             </inputs>
         </file>
@@ -1440,7 +1441,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 270 62 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 309 210 164 20 148 104 95 272 64 91 178 157 201 260 254 256 257 140 231</file>
+                    <file> 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 271 62 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 310 210 164 20 148 104 95 273 64 91 178 157 201 261 254 256 257 140 231</file>
                 </tool>
             </inputs>
         </file>
@@ -1459,7 +1460,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 76 107 86 306 184 131 164 242 215 88 260 26 134 118 227 101 224 71 244 87 106 270 62 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 309 210 20 148 104 95 272 64 91 178 157 201 254 256 257 259 267 255 68</file>
+                    <file> 76 107 86 307 184 131 164 242 215 88 261 26 134 118 227 101 224 71 244 87 106 271 62 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 310 210 20 148 104 95 273 64 91 178 157 201 254 256 257 260 268 255 68</file>
                 </tool>
             </inputs>
         </file>
@@ -1472,13 +1473,13 @@
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 296</file>
+                    <file> 297</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 270 62 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 211 283 231</file>
+                    <file> 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 271 62 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 211 284 231</file>
                 </tool>
             </inputs>
         </file>
@@ -1497,7 +1498,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 118 107 86 306 184 131 241 231 248 181 26 134 227 101 224 71 244 87 106 270 62 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 228 309 210 164 20 148 104 95 272 64 91 178 188 114 254 260 157 201 256 257 265 274 127 215 88 198</file>
+                    <file> 118 107 86 307 184 131 241 231 248 181 26 134 227 101 224 71 244 87 106 271 62 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 228 310 210 164 20 148 104 95 273 64 91 178 188 114 254 261 157 201 256 257 266 275 127 215 88 198</file>
                 </tool>
             </inputs>
         </file>
@@ -1516,7 +1517,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 270 62 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 46 231 309 210 164 20 148 104 95 272 64 91 178 157 201 122</file>
+                    <file> 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 271 62 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 46 231 310 210 164 20 148 104 95 273 64 91 178 157 201 122</file>
                 </tool>
             </inputs>
         </file>
@@ -1535,7 +1536,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 260 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 270 62 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 309 210 164 20 148 104 95 272 64 91 178 157 201</file>
+                    <file> 261 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 271 62 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 310 210 164 20 148 104 95 273 64 91 178 157 201</file>
                 </tool>
             </inputs>
         </file>
@@ -1554,7 +1555,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 270 62 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 110 198 164 309 210 20 148 104 95 272 64 91 178 157 201 254 260 256 257 282 231 140 76 242</file>
+                    <file> 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 271 62 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 110 198 164 310 210 20 148 104 95 273 64 91 178 157 201 254 261 256 257 283 231 140 76 242</file>
                 </tool>
             </inputs>
         </file>
@@ -1573,7 +1574,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 270 62 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 282 231 140</file>
+                    <file> 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 271 62 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 283 231 140</file>
                 </tool>
             </inputs>
         </file>
@@ -1592,7 +1593,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 127 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 270 62 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 181 231 228 309 210 164 20 148 104 95 272 64 91 178 188 114 241 254 260 157 201 256 257 265 215 88 198</file>
+                    <file> 127 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 271 62 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 181 231 228 310 210 164 20 148 104 95 273 64 91 178 188 114 241 254 261 157 201 256 257 266 215 88 198</file>
                 </tool>
             </inputs>
         </file>
@@ -1611,7 +1612,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 76 107 86 306 184 131 164 242 215 88 260 26 134 118 227 101 224 71 244 87 106 270 62 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 309 210 20 148 104 95 272 64 91 178 157 201 254 256 257 68 267 119</file>
+                    <file> 76 107 86 307 184 131 164 242 215 88 261 26 134 118 227 101 224 71 244 87 106 271 62 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 310 210 20 148 104 95 273 64 91 178 157 201 254 256 257 68 268 119</file>
                 </tool>
             </inputs>
         </file>
@@ -1630,7 +1631,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 309 210 107 86 306 184 131 164 118 20 148 104 95 272 64 71 91 178 157 201 114 188 92 187 26 134 227 101 224 244 87 106 270 62 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 198 215 88</file>
+                    <file> 310 210 107 86 307 184 131 164 118 20 148 104 95 273 64 71 91 178 157 201 114 188 92 187 26 134 227 101 224 244 87 106 271 62 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 198 215 88</file>
                 </tool>
             </inputs>
         </file>
@@ -1649,7 +1650,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 26 134 118 107 86 306 184 131 227 101 224 71 244 87 106 270 62 305 190 225 240 129 120 292 311 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 293</file>
+                    <file> 26 134 118 107 86 307 184 131 227 101 224 71 244 87 106 271 62 306 190 225 240 129 120 293 312 161 172 75 163 67 130 103 144 97 78 143 182 204 238 44 54 294</file>
                 </tool>
             </inputs>
         </file>

File diff suppressed because it is too large
+ 148 - 161
project/ewarm/module_universal_io.dep


+ 19 - 1
project/ewarm/module_universal_io.ewp

@@ -225,7 +225,7 @@
                     <state>AT_START_F403A_V1</state>
                     <state>PRINTF_STDLIB</state>
                     <state>DEBUG</state>
-                    <state>MDIO_88</state>
+                    <state>MAI_12</state>
                 </option>
                 <option>
                     <name>CCPreprocFile</name>
@@ -2238,6 +2238,15 @@
                 <file>
                     <name>$PROJ_DIR$\..\..\fw\modules\modbus\modbus.c</name>
                 </file>
+                <file>
+                    <name>$PROJ_DIR$\..\..\fw\modules\modbus\modbus_ai_params.c</name>
+                </file>
+                <file>
+                    <name>$PROJ_DIR$\..\..\fw\modules\modbus\modbus_ao_params.c</name>
+                </file>
+                <file>
+                    <name>$PROJ_DIR$\..\..\fw\modules\modbus\modbus_dio_params.c</name>
+                </file>
                 <file>
                     <name>$PROJ_DIR$\..\..\fw\modules\modbus\modbus_params.c</name>
                 </file>
@@ -2247,9 +2256,18 @@
             </group>
             <group>
                 <name>settings</name>
+                <file>
+                    <name>$PROJ_DIR$\..\..\fw\modules\settings\settings_ai.c</name>
+                </file>
+                <file>
+                    <name>$PROJ_DIR$\..\..\fw\modules\settings\settings_ao.c</name>
+                </file>
                 <file>
                     <name>$PROJ_DIR$\..\..\fw\modules\settings\settings_api.c</name>
                 </file>
+                <file>
+                    <name>$PROJ_DIR$\..\..\fw\modules\settings\settings_dio.c</name>
+                </file>
             </group>
             <group>
                 <name>shift_reg</name>

+ 18 - 0
project/ewarm/module_universal_io.ewt

@@ -2447,6 +2447,15 @@
                 <file>
                     <name>$PROJ_DIR$\..\..\fw\modules\modbus\modbus.c</name>
                 </file>
+                <file>
+                    <name>$PROJ_DIR$\..\..\fw\modules\modbus\modbus_ai_params.c</name>
+                </file>
+                <file>
+                    <name>$PROJ_DIR$\..\..\fw\modules\modbus\modbus_ao_params.c</name>
+                </file>
+                <file>
+                    <name>$PROJ_DIR$\..\..\fw\modules\modbus\modbus_dio_params.c</name>
+                </file>
                 <file>
                     <name>$PROJ_DIR$\..\..\fw\modules\modbus\modbus_params.c</name>
                 </file>
@@ -2456,9 +2465,18 @@
             </group>
             <group>
                 <name>settings</name>
+                <file>
+                    <name>$PROJ_DIR$\..\..\fw\modules\settings\settings_ai.c</name>
+                </file>
+                <file>
+                    <name>$PROJ_DIR$\..\..\fw\modules\settings\settings_ao.c</name>
+                </file>
                 <file>
                     <name>$PROJ_DIR$\..\..\fw\modules\settings\settings_api.c</name>
                 </file>
+                <file>
+                    <name>$PROJ_DIR$\..\..\fw\modules\settings\settings_dio.c</name>
+                </file>
             </group>
             <group>
                 <name>shift_reg</name>

BIN
tools/__pycache__/log_reader.cpython-39.pyc


BIN
tools/__pycache__/mb_registers.cpython-39.pyc


+ 44 - 0
tools/analog_in.py

@@ -0,0 +1,44 @@
+from io_module import IO_Module
+from modbus import Modbus
+from log_reader import AnalogInputLogReader
+import colorama
+from colorama import Fore
+from time import sleep
+from serial import Serial
+from mb_registers import AI_REGS
+
+
+class IO_AnalogInput(IO_Module):
+    def __init__(self, modbus: Modbus):
+        self.modbus = modbus
+        super().__init__(self.modbus)
+        self.log = AnalogInputLogReader(self.modbus)
+
+    '''Чтение параметров'''
+
+    # Рожим работы входов
+    def get_inputs_mode(self):
+        data = self.modbus.read_holding_registers(AI_REGS['ain_mode'], 1)
+        return format(data[0], '012b')
+
+    '''Установка параметров'''
+
+    def set_inputs_mode(self, val):
+        self.modbus.write_holding_register(AI_REGS['ain_mode'], val)
+
+def main():
+    colorama.init(autoreset=True)
+    
+    serial_port = Serial('COM56', 115200, timeout=0.05, parity='N', xonxoff=False)
+    
+    modbus_tester = Modbus(serial_port, 1)
+    # dev_tester = IO_Digital(modbus_tester)
+    ai = IO_AnalogInput(modbus_tester)
+
+    '''Режим работы аналоговых входов'''
+    print(ai.get_inputs_mode())
+    ai.set_inputs_mode(0b00011000)
+    print(ai.get_inputs_mode())
+
+if __name__ == '__main__':
+    main()

+ 2 - 3
tools/digital_io.py

@@ -1,7 +1,6 @@
 from io_module import IO_Module
 from modbus import Modbus, MBError, NoResponseError
 from log_reader import DigitalLogReader
-import log_reader
 import colorama
 from colorama import Fore
 from time import sleep
@@ -190,8 +189,8 @@ def main():
     '''Тесты отдельного модуля DIO'''
     dio.sys.get_system_vars()
 
-    dio.print_inputs()
-    dio.get_inputs_counters()
+    # dio.print_inputs()
+    # dio.get_inputs_counters()
 
     # modbus_dut = Modbus(serial_port, 2)
     # dev_dut = IO_Digital(modbus_dut)

+ 3 - 2
tools/log_reader.py

@@ -155,8 +155,9 @@ class DigitalLogReader(LogReader):
 
 
 class AnalogInputLogReader(LogReader):
-    def __init__(self):
-        super().__init__()
+
+    def __init__(self, modbus: Modbus):
+        super().__init__(modbus)
 
     def get_archive(self):
         print("AnalogInputLogReader")

+ 2 - 0
tools/mb_registers.py

@@ -10,4 +10,6 @@ reg_table = {'out_cur': 0x0200, 'out_mode': 0x0202, 'out_mode_save': 0x0203, 'pw
 DIO_REGS = {'in_bits': 0x0100, 'in_cnt': 0x0102,'in_mode': 0x0120, 'in_norm': 0x0122,
             'in_deb_start': 0x124, 'load_bits': 0x0130, 'cred_bits': 0x0131, 'out_cur': 0x0200}
 
+AI_REGS = {'ain_mode': 0x0300}
+
 LOG_REGS = {'log_info': 0x0900, 'log_ent': 0x0901, 'arch_cap': 0x0902, 'arch_ent': 0x0903, 'arch_per': 0x0904}

Some files were not shown because too many files changed in this diff