2024-12-27 10:50:32 +03:00
/*
* control_station_project . c
*
* Created on : 1 <EFBFBD> <EFBFBD> <EFBFBD> . 2020 <EFBFBD> .
* Author : Yura
*/
# include <can_bs2bs.h>
# include <control_station_project.h>
# include <CAN_project.h>
# include <edrk_main.h>
# include <master_slave.h>
# include <math.h>
# include <modbus_hmi_update.h>
# include <modbus_svu_update.h>
# include <params_alg.h>
# include <params_motor.h>
# include <params_norma.h>
# include "control_station.h"
# include "CAN_Setup.h"
# include "global_time.h"
# include "IQmathLib.h"
# include "mathlib.h"
# include "modbus_table_v2.h"
# include "vector_control.h"
# include "RS_Functions.h"
/*CONTROL_STATION_TERMINAL_RS232
CONTROL_STATION_TERMINAL_CAN ,
CONTROL_STATION_INGETEAM_PULT_RS485 ,
CONTROL_STATION_MPU_SVU_CAN ,
CONTROL_STATION_MPU_KEY_CAN ,
CONTROL_STATION_MPU_SVU_RS485 ,
CONTROL_STATION_MPU_KEY_RS485 ,
CONTROL_STATION_ZADATCHIK_CAN ,
CONTROL_STATION_CMD_GO = 0 , // cmd_go <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> /<2F> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD>
CONTROL_STATION_CMD_SET_IZAD , // <20> <> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
CONTROL_STATION_CMD_SET_ROTOR , // <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
CONTROL_STATION_CMD_CHARGE , // <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
CONTROL_STATION_CMD_UNCHARGE , // <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
CONTROL_STATION_CMD_CHECKBACK , // <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
CONTROL_STATION_CMD_TEST_LEDS
*/
# define DEC_ZAD_OBOROTS 1
# define INC_ZAD_OBOROTS 1
/////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////
void detect_active_from_all_signals ( void )
{
if ( control_station . alive_control_station [ CONTROL_STATION_TERMINAL_RS232 ] )
{
// control_station.array_cmd[CONTROL_STATION_TERMINAL_RS232][CONTROL_STATION_CMD_ACTIVE_CONTROL] = control_station
}
}
/////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////
float plus_minus_oborots ( int key_plus , int key_minus , float ff , int ufconst_vector , int flag )
{
static float ff_add = 0 , ff_dec = 0 ;
float ff_add1 = 0 , ff_dec1 = 0 ;
float ff_add2 = 0 , ff_dec2 = 0 ;
float ff_add3 = 0 , ff_dec3 = 0 ;
2025-01-15 13:39:33 +03:00
static int prev_key_plus = 0 , prev_key_minus = 0 ;
2024-12-27 10:50:32 +03:00
static int direct_zad = 0 , direct_cur = 0 , only_plus = 0 , only_minus = 0 ;
static unsigned int old_time_plus_minus = 0 , count_press = 0 ;
if ( flag = = 1 )
{
count_press = 0 ;
ff_dec = 0 ;
ff_add = 0 ;
prev_key_plus = key_plus ;
prev_key_minus = key_minus ;
return ff ;
}
if ( ff > 0 )
{
// if (key_minus || key_plus)
only_plus = 1 ;
only_minus = 0 ;
}
else
if ( ff < 0 )
{
// if (key_minus || key_plus)
only_minus = 1 ;
only_plus = 0 ;
}
else
{
if ( key_minus = = 0 & & key_plus = = 0 )
{
only_plus = 0 ;
only_minus = 0 ;
}
}
//
//
// if (key_plus)
// {
// if (ff>0)
// direct_zad = 1;
// if (ff<0)
// direct_zad = -1;
// if (ff==0)
// direct_zad = 0;
//
// }
// if (key_minus)
// {
// if (ff>0)
// direct_zad = -1;
// if (ff<0)
// direct_zad = 1;
// if (ff==0)
// direct_zad = 0;
// }
if ( ufconst_vector = = 0 )
{
ff_add1 = INC_ZAD_OBOROTS * 10.0 ;
ff_dec1 = DEC_ZAD_OBOROTS * 10.0 ;
ff_add2 = INC_ZAD_OBOROTS * 30.0 ;
ff_dec2 = DEC_ZAD_OBOROTS * 30.0 ;
ff_add3 = INC_ZAD_OBOROTS * 60.0 ;
ff_dec3 = DEC_ZAD_OBOROTS * 60.0 ;
}
else
{
ff_add1 = INC_ZAD_OBOROTS ;
ff_dec1 = DEC_ZAD_OBOROTS ;
2025-01-15 13:39:33 +03:00
ff_add2 = INC_ZAD_OBOROTS * 5.0 ;
ff_dec2 = DEC_ZAD_OBOROTS * 5.0 ;
ff_add3 = INC_ZAD_OBOROTS * 10.0 ;
ff_dec3 = DEC_ZAD_OBOROTS * 10.0 ;
2024-12-27 10:50:32 +03:00
}
2025-01-15 13:39:33 +03:00
if ( detect_pause_milisec ( 500 , & old_time_plus_minus ) )
2024-12-27 10:50:32 +03:00
{
if ( key_minus | | key_plus )
{
2025-01-15 13:39:33 +03:00
if ( count_press < 100 )
2024-12-27 10:50:32 +03:00
count_press + + ;
}
else
count_press = 0 ;
2025-01-15 13:39:33 +03:00
if ( count_press = = 0 )
2024-12-27 10:50:32 +03:00
{
2025-01-15 13:39:33 +03:00
ff_dec = 0 ;
ff_add = 0 ;
2024-12-27 10:50:32 +03:00
}
2025-01-15 13:39:33 +03:00
if ( count_press = = 2 )
2024-12-27 10:50:32 +03:00
{
ff_dec = ff_dec1 ;
ff_add = ff_add1 ;
}
2025-01-15 13:39:33 +03:00
if ( count_press = = 10 )
{
ff_dec = ff_dec2 ;
ff_add = ff_add2 ;
2024-12-27 10:50:32 +03:00
}
2025-01-15 13:39:33 +03:00
if ( count_press = = 20 )
2024-12-27 10:50:32 +03:00
{
ff_dec = ff_dec3 ;
ff_add = ff_add3 ;
}
if ( key_minus )
{
if ( ff > ff_dec )
ff = ff - ff_dec ;
else
if ( ff < = ff_dec & & ff > 0 )
ff = 0 ;
else
2025-01-15 13:39:33 +03:00
if ( ff < = 0 & & only_plus = = 0 )
2024-12-27 10:50:32 +03:00
ff = ff - ff_add ;
}
else
if ( key_plus )
{
if ( ff > = 0 & & only_minus = = 0 )
ff = ff + ff_add ;
else
if ( ff > = - ff_dec & & ff < 0 )
ff = 0 ;
else
if ( ff < - ff_dec )
ff = ff + ff_dec ;
}
}
if ( ufconst_vector = = 0 )
2025-01-15 13:39:33 +03:00
ff = my_satur_float ( ff , fast_round ( MAX_ZADANIE_F * 100.0 ) , fast_round ( - MAX_ZADANIE_F * 100.0 ) ) ;
2024-12-27 10:50:32 +03:00
else
2025-01-15 13:39:33 +03:00
ff = my_satur_float ( ff , MAX_ZADANIE_OBOROTS_ROTOR , MIN_ZADANIE_OBOROTS_ROTOR ) ;
2024-12-27 10:50:32 +03:00
prev_key_plus = key_plus ;
prev_key_minus = key_minus ;
return ff ;
}
/////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////
void parse_parameters_from_one_control_station_another_bs ( int cc )
{
2025-01-15 13:39:33 +03:00
int i , pos_numbercmd ;
2024-12-27 10:50:32 +03:00
static int prev_checkback = 0 ;
static int flag_wait_revers_go = 0 ;
_iq _iq_ff ;
2025-01-15 13:39:33 +03:00
static unsigned int prev_charge = 0 , prev_uncharge = 0 , key_local_charge , key_local_uncharge ;
2024-12-27 10:50:32 +03:00
static unsigned int old_time_pult_ing = 0 ;
float ff = 0 , ff_add = 0 , ff_dec = 0 ;
int key_plus = 0 , key_minus = 0 ;
if ( edrk . ms . err_signals . alive_can_to_another_bs = = 0 )
{
//
// edrk.zadanie_from_another_bs.int_fzad = Unites[ANOTHER_BSU1_CAN_DEVICE][3];
// edrk.zadanie_from_another_bs.int_kzad = Unites[ANOTHER_BSU1_CAN_DEVICE][4];
// edrk.zadanie_from_another_bs.int_Izad = Unites[ANOTHER_BSU1_CAN_DEVICE][5];
// edrk.zadanie_from_another_bs.int_oborots_zad = Unites[ANOTHER_BSU1_CAN_DEVICE][6];
// edrk.zadanie_from_another_bs.int_power_zad = Unites[ANOTHER_BSU1_CAN_DEVICE][7];
// //
// edrk.zadanie_from_another_bs.iq_fzad = _IQ15toIQ(edrk.zadanie_from_another_bs.int_fzad);
// edrk.zadanie_from_another_bs.iq_kzad = _IQ15toIQ(edrk.zadanie_from_another_bs.int_kzad);
// edrk.zadanie_from_another_bs.iq_Izad = _IQ15toIQ(edrk.zadanie_from_another_bs.int_Izad);
// edrk.zadanie_from_another_bs.oborots_zad = edrk.zadanie_from_another_bs.int_oborots_zad;
// edrk.zadanie_from_another_bs.iq_power_zad = _IQ15toIQ(edrk.zadanie_from_another_bs.int_power_zad);
}
else
{
}
if ( control_station . alive_control_station [ cc ] )
{
}
else
{
for ( i = 0 ; i < CONTROL_STATION_CMD_LAST ; i + + )
control_station . array_cmd [ cc ] [ i ] = 0 ; // clear all data
return ; // <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// <20> "<22> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .
}
edrk . test_mode = 0 ;
// f.RScount = SECOND * 3;
for ( i = 0 ; i < CONTROL_STATION_CMD_LAST ; i + + )
control_station . array_cmd [ cc ] [ i ] = Unites [ ANOTHER_BSU1_CAN_DEVICE ] [ POS_STATION_CMD_ANOTHER_BSU1 + i ] ;
if ( control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_ACTIVE_CONTROL ] )
{
}
if ( edrk . MasterSlave = = MODE_SLAVE & & Unites [ ANOTHER_BSU1_CAN_DEVICE ] [ 12 ] > 0 & & Unites [ ANOTHER_BSU1_CAN_DEVICE ] [ 12 ] < 600 ) {
vect_control . iqId_min = _IQ ( ( float ) Unites [ ANOTHER_BSU1_CAN_DEVICE ] [ 12 ] / NORMA_ACP ) ;
}
/*
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_ACTIVE_CONTROL ] = control_station . active_control_station [ CONTROL_STATION_VPU_CAN ] ;
// scalar, vector, ufconst
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_UFCONST_VECTOR ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_UFCONST_VECTOR ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SCALAR_FOC ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_SCALAR_FOC ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_ROTOR_POWER ] = 0 ;
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// if
if ( ( detect_pause_milisec ( 100 , & old_time_pult_ing ) ) & & control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_ACTIVE_CONTROL ] )
{
// control_station.array_cmd[cc][CONTROL_STATION_CMD_SET_POWER] = control_station.raw_array_data[cc][4].all;
ff = control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_ROTOR ] ;
key_plus = edrk . from_vpu . bits . PLUS ;
key_minus = edrk . from_vpu . bits . MINUS ;
ff = plus_minus_oborots ( key_plus , key_minus , ff , control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_UFCONST_VECTOR ] ) ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_ROTOR ] = ff ;
}
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// pos_numbercmd = 15; // <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_CHECKBACK ] = edrk . from_vpu . bits . KVITIR ;
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
key_local_charge = 0 ; //edrk.from_shema.bits.SBOR_SHEMA;
key_local_uncharge = 0 ; //edrk.from_shema.bits.RAZBOR_SHEMA;
if ( key_local_charge & & prev_charge = = 0 )
{
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_CHARGE ] = 1 ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_UNCHARGE ] = 0 ;
}
else
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_CHARGE ] = 0 ;
prev_charge = key_local_charge ;
if ( key_local_uncharge & & prev_uncharge = = 0 )
{
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_UNCHARGE ] = 1 ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_CHARGE ] = 0 ;
}
else
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_UNCHARGE ] = 0 ;
prev_uncharge = key_local_uncharge ;
///////////////////////////////////////////
// <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_IZAD ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_SET_IZAD ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_KM ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_SET_KM ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_U_ZARYAD ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_SET_U_ZARYAD ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_K_U_DISBALANCE ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_SET_K_U_DISBALANCE ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_K_PLUS_U_DISBALANCE ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_SET_K_PLUS_U_DISBALANCE ] ;
// if (control_station.array_cmd[cc][CONTROL_STATION_CMD_SET_ROTOR]!=0)
// control_station.array_cmd[cc][CONTROL_STATION_CMD_GO] = 1;
// else
// control_station.array_cmd[cc][CONTROL_STATION_CMD_GO] = 0;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_GO ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_GO ] ;
//
// control_station.array_cmd[cc][CONTROL_STATION_CMD_TEST_LEDS] = 0;
//
// prev_checkback = control_station.raw_array_data[cc][pos_numbercmd].bits.bit1;
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> rs232
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_DISABLE_ON_PUMP ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_DISABLE_ON_PUMP ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_ENABLE_ON_CHARGE ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_ENABLE_ON_CHARGE ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_DISABLE_ON_QTV ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_DISABLE_ON_QTV ] ;
// 0 - auto on - rand pump
// 1 - auto on 1 pump
// 2 - auto on 2 pump
// 3 - manual on 1 pump
// 4 - manual on 2 pump
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_MODE_PUMP ] = control_station . array_cmd [ CONTROL_STATION_INGETEAM_PULT_RS485 ] [ CONTROL_STATION_CMD_MODE_PUMP ] ;
if ( control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_ACTIVE_CONTROL ] = = 0 )
return ;
*/
}
/////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////
void parse_parameters_from_one_control_station_pult_vpu ( int cc )
{
2025-01-15 13:39:33 +03:00
int i , pos_numbercmd ;
2024-12-27 10:50:32 +03:00
static int prev_checkback = 0 , prev_key_oborots = 0 ;
static int flag_wait_revers_go = 0 ;
_iq _iq_ff ;
2025-01-15 13:39:33 +03:00
static unsigned int prev_charge = 0 , prev_uncharge = 0 , key_local_charge , key_local_uncharge ;
2024-12-27 10:50:32 +03:00
static unsigned int old_time_pult_ing = 0 , old_time_pult_ing2 = 0 ;
float ff = 0 , ff_add = 0 , ff_dec = 0 ;
int key_plus = 0 , key_minus = 0 ;
if ( control_station . alive_control_station [ cc ] )
{
}
else
{
for ( i = 0 ; i < CONTROL_STATION_CMD_LAST ; i + + )
control_station . array_cmd [ cc ] [ i ] = 0 ; // clear all data
return ; // <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// <20> "<22> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .
}
edrk . test_mode = 0 ;
// f.RScount = SECOND * 3;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_ACTIVE_CONTROL ] = control_station . active_control_station [ CONTROL_STATION_VPU_CAN ] ;
///////////////////////////////////////////
// <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_IZAD ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_SET_IZAD ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_KM ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_SET_KM ] ;
2025-01-15 13:39:33 +03:00
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_U_ZARYAD ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_SET_U_ZARYAD ] ;
2024-12-27 10:50:32 +03:00
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_K_U_DISBALANCE ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_SET_K_U_DISBALANCE ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_K_PLUS_U_DISBALANCE ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_SET_K_PLUS_U_DISBALANCE ] ;
2025-01-15 13:39:33 +03:00
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_LIMIT_POWER ] = my_satur_int ( control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_SET_LIMIT_POWER ] , MAX_ZADANIE_POWER , MIN_ZADANIE_POWER ) ;
2024-12-27 10:50:32 +03:00
// scalar, vector, ufconst
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_UFCONST_VECTOR ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_UFCONST_VECTOR ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SCALAR_FOC ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_SCALAR_FOC ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_ROTOR_POWER ] = 0 ;
2025-01-15 13:39:33 +03:00
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_POWER ] = control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_LIMIT_POWER ] ;
2024-12-27 10:50:32 +03:00
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( ( detect_pause_milisec ( 100 , & old_time_pult_ing ) ) & & control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_ACTIVE_CONTROL ] )
{
ff = control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_ROTOR ] ;
key_plus = edrk . from_vpu . bits . PLUS ;
key_minus = edrk . from_vpu . bits . MINUS ;
///////////////
if ( edrk . from_vpu . bits . PROVOROT )
{
if ( detect_pause_milisec ( 1000 , & old_time_pult_ing2 ) )
{
edrk . Provorot = 1 ;
ff = PROVOROT_OBOROTS ;
}
}
else
old_time_pult_ing2 = global_time . miliseconds ;
if ( edrk . from_vpu . bits . PROVOROT ! = prev_key_oborots & & edrk . from_vpu . bits . PROVOROT = = 0 & & edrk . Provorot = = 1 )
{
ff = 0 ;
edrk . Provorot = 0 ;
}
prev_key_oborots = edrk . from_vpu . bits . PROVOROT ;
/////////////
ff = plus_minus_oborots ( key_plus , key_minus , ff , control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_UFCONST_VECTOR ] , 0 ) ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_ROTOR ] = ff ;
// control_station.array_cmd[CONTROL_STATION_INGETEAM_PULT_RS485][CONTROL_STATION_CMD_SET_ROTOR] = ff;
// control_station.array_cmd[CONTROL_STATION_ZADATCHIK_CAN][CONTROL_STATION_CMD_SET_ROTOR] = ff;
}
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// pos_numbercmd = 15; // <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_CHECKBACK ] = edrk . from_vpu . bits . KVITIR ;
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
key_local_charge = 0 ; //edrk.from_shema.bits.SBOR_SHEMA;
key_local_uncharge = 0 ; //edrk.from_shema.bits.RAZBOR_SHEMA;
if ( key_local_charge & & prev_charge = = 0 )
{
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_CHARGE ] = 1 ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_UNCHARGE ] = 0 ;
}
else
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_CHARGE ] = 0 ;
prev_charge = key_local_charge ;
if ( key_local_uncharge )
{
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_UNCHARGE ] = 1 ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_CHARGE ] = 0 ;
}
else
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_UNCHARGE ] = 0 ;
prev_uncharge = key_local_uncharge ;
// if (control_station.array_cmd[cc][CONTROL_STATION_CMD_SET_ROTOR]!=0)
// control_station.array_cmd[cc][CONTROL_STATION_CMD_GO] = 1;
// else
// control_station.array_cmd[cc][CONTROL_STATION_CMD_GO] = 0;
//
// control_station.array_cmd[cc][CONTROL_STATION_CMD_TEST_LEDS] = 0;
//
// prev_checkback = control_station.raw_array_data[cc][pos_numbercmd].bits.bit1;
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> rs232
if ( control_station . alive_control_station [ CONTROL_STATION_TERMINAL_RS232 ] )
{
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_GO ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_GO ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_DISABLE_ON_PUMP ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_DISABLE_ON_PUMP ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_ENABLE_ON_CHARGE ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_ENABLE_ON_CHARGE ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_DISABLE_ON_QTV ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_DISABLE_ON_QTV ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_DISABLE_ON_UMP ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_DISABLE_ON_UMP ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_MANUAL_DISCHARGE ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_MANUAL_DISCHARGE ] ;
}
else
if ( control_station . alive_control_station [ CONTROL_STATION_INGETEAM_PULT_RS485 ] )
{
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_GO ] = control_station . array_cmd [ CONTROL_STATION_INGETEAM_PULT_RS485 ] [ CONTROL_STATION_CMD_GO ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_DISABLE_ON_PUMP ] = control_station . array_cmd [ CONTROL_STATION_INGETEAM_PULT_RS485 ] [ CONTROL_STATION_CMD_DISABLE_ON_PUMP ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_ENABLE_ON_CHARGE ] = control_station . array_cmd [ CONTROL_STATION_INGETEAM_PULT_RS485 ] [ CONTROL_STATION_CMD_ENABLE_ON_CHARGE ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_DISABLE_ON_QTV ] = control_station . array_cmd [ CONTROL_STATION_INGETEAM_PULT_RS485 ] [ CONTROL_STATION_CMD_DISABLE_ON_QTV ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_DISABLE_ON_UMP ] = control_station . array_cmd [ CONTROL_STATION_INGETEAM_PULT_RS485 ] [ CONTROL_STATION_CMD_DISABLE_ON_UMP ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_MANUAL_DISCHARGE ] = control_station . array_cmd [ CONTROL_STATION_INGETEAM_PULT_RS485 ] [ CONTROL_STATION_CMD_MANUAL_DISCHARGE ] ;
edrk . Status_Ready . bits . ImitationReady2 = control_station . raw_array_data [ CONTROL_STATION_INGETEAM_PULT_RS485 ] [ 181 ] . all ;
edrk . Obmotka1 = control_station . raw_array_data [ CONTROL_STATION_INGETEAM_PULT_RS485 ] [ 194 ] . all ;
edrk . Obmotka2 = control_station . raw_array_data [ CONTROL_STATION_INGETEAM_PULT_RS485 ] [ 195 ] . all ;
edrk . disable_alg_u_disbalance = control_station . raw_array_data [ CONTROL_STATION_INGETEAM_PULT_RS485 ] [ 193 ] . all ;
}
// 0 - auto on - rand pump
// 1 - auto on 1 pump
// 2 - auto on 2 pump
// 3 - manual on 1 pump
// 4 - manual on 2 pump
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_MODE_PUMP ] = control_station . array_cmd [ CONTROL_STATION_INGETEAM_PULT_RS485 ] [ CONTROL_STATION_CMD_MODE_PUMP ] ;
if ( control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_ACTIVE_CONTROL ] = = 0 )
return ;
}
/////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////
void parse_parameters_from_one_control_station_pult_zadat4ik ( int cc )
{
2025-01-15 13:39:33 +03:00
int i , pos_numbercmd ;
2024-12-27 10:50:32 +03:00
static int prev_checkback = 0 , prev_key_oborots = 0 ;
static int flag_wait_revers_go = 0 ;
float ff = 0 , ff_add = 0 , ff_dec = 0 ;
int key_plus = 0 , key_minus = 0 ;
_iq _iq_ff ;
2025-01-15 13:39:33 +03:00
static unsigned int prev_charge = 0 , prev_uncharge = 0 , key_local_charge , key_local_uncharge ;
2024-12-27 10:50:32 +03:00
static unsigned int old_time_pult_ing = 0 , old_time_pult_ing2 = 0 ;
if ( control_station . alive_control_station [ cc ] )
{
}
else
{
for ( i = 0 ; i < CONTROL_STATION_CMD_LAST ; i + + )
control_station . array_cmd [ cc ] [ i ] = 0 ; // clear all data
return ; // <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// <20> "<22> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .
}
edrk . test_mode = 0 ;
// f.RScount = SECOND * 3;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_ACTIVE_CONTROL ] = control_station . active_control_station [ CONTROL_STATION_ZADATCHIK_CAN ] ;
///////////////////////////////////////////
// <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_IZAD ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_SET_IZAD ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_KM ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_SET_KM ] ;
2025-01-15 13:39:33 +03:00
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_U_ZARYAD ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_SET_U_ZARYAD ] ;
2024-12-27 10:50:32 +03:00
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_K_U_DISBALANCE ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_SET_K_U_DISBALANCE ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_K_PLUS_U_DISBALANCE ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_SET_K_PLUS_U_DISBALANCE ] ;
2025-01-15 13:39:33 +03:00
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_LIMIT_POWER ] = my_satur_int ( control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_SET_LIMIT_POWER ] , MAX_ZADANIE_POWER , MIN_ZADANIE_POWER ) ;
2024-12-27 10:50:32 +03:00
// scalar, vector, ufconst
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_UFCONST_VECTOR ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_UFCONST_VECTOR ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SCALAR_FOC ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_SCALAR_FOC ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_ROTOR_POWER ] = 0 ;
2025-01-15 13:39:33 +03:00
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_POWER ] = control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_LIMIT_POWER ] ;
2024-12-27 10:50:32 +03:00
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// if
if ( ( detect_pause_milisec ( 100 , & old_time_pult_ing ) ) & & control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_ACTIVE_CONTROL ] )
{
// control_station.array_cmd[cc][CONTROL_STATION_CMD_SET_POWER] = control_station.raw_array_data[cc][4].all;
ff = control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_ROTOR ] ;
key_plus = edrk . from_zadat4ik . bits . PLUS ;
key_minus = edrk . from_zadat4ik . bits . MINUS ;
if ( edrk . from_zadat4ik . bits . PROVOROT )
{
if ( detect_pause_milisec ( 1000 , & old_time_pult_ing2 ) )
{
edrk . Provorot = 1 ;
ff = PROVOROT_OBOROTS ;
}
}
else
old_time_pult_ing2 = global_time . miliseconds ;
if ( edrk . from_zadat4ik . bits . PROVOROT ! = prev_key_oborots & & edrk . from_zadat4ik . bits . PROVOROT = = 0 & & edrk . Provorot = = 1 )
{
ff = 0 ;
edrk . Provorot = 0 ;
}
prev_key_oborots = edrk . from_zadat4ik . bits . PROVOROT ;
ff = plus_minus_oborots ( key_plus , key_minus , ff , control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_UFCONST_VECTOR ] , 0 ) ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_ROTOR ] = ff ;
// control_station.array_cmd[CONTROL_STATION_INGETEAM_PULT_RS485][CONTROL_STATION_CMD_SET_ROTOR] = ff;
// control_station.array_cmd[CONTROL_STATION_VPU_CAN][CONTROL_STATION_CMD_SET_ROTOR] = ff;
}
2025-01-15 13:39:33 +03:00
2024-12-27 10:50:32 +03:00
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// pos_numbercmd = 15; // <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_CHECKBACK ] = edrk . from_zadat4ik . bits . KVITIR ;
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2025-01-15 13:39:33 +03:00
key_local_charge = edrk . from_shema . bits . SBOR_SHEMA ;
key_local_uncharge = edrk . from_shema . bits . RAZBOR_SHEMA ;
2024-12-27 10:50:32 +03:00
if ( key_local_uncharge & & key_local_charge )
{
key_local_charge = 0 ;
2025-01-15 13:39:33 +03:00
edrk . errors . e1 . bits . BOTH_KEYS_CHARGE_DISCHARGE | = 1 ;
2024-12-27 10:50:32 +03:00
}
if ( key_local_charge & & prev_charge = = 0 )
{
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_CHARGE ] = 1 ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_UNCHARGE ] = 0 ;
}
else
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_CHARGE ] = 0 ;
prev_charge = key_local_charge ;
if ( key_local_uncharge )
{
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_UNCHARGE ] = 1 ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_CHARGE ] = 0 ;
}
else
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_UNCHARGE ] = 0 ;
prev_uncharge = key_local_uncharge ;
// if (control_station.array_cmd[cc][CONTROL_STATION_CMD_SET_ROTOR]!=0)
// control_station.array_cmd[cc][CONTROL_STATION_CMD_GO] = 1;
// else
// control_station.array_cmd[cc][CONTROL_STATION_CMD_GO] = 0;
//
// control_station.array_cmd[cc][CONTROL_STATION_CMD_TEST_LEDS] = 0;
//
// prev_checkback = control_station.raw_array_data[cc][pos_numbercmd].bits.bit1;
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> rs232
if ( control_station . alive_control_station [ CONTROL_STATION_TERMINAL_RS232 ] )
{
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_GO ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_GO ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_DISABLE_ON_PUMP ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_DISABLE_ON_PUMP ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_ENABLE_ON_CHARGE ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_ENABLE_ON_CHARGE ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_DISABLE_ON_QTV ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_DISABLE_ON_QTV ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_DISABLE_ON_UMP ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_DISABLE_ON_UMP ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_MANUAL_DISCHARGE ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_MANUAL_DISCHARGE ] ;
}
else
if ( control_station . alive_control_station [ CONTROL_STATION_INGETEAM_PULT_RS485 ] )
{
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_GO ] = control_station . array_cmd [ CONTROL_STATION_INGETEAM_PULT_RS485 ] [ CONTROL_STATION_CMD_GO ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_DISABLE_ON_PUMP ] = control_station . array_cmd [ CONTROL_STATION_INGETEAM_PULT_RS485 ] [ CONTROL_STATION_CMD_DISABLE_ON_PUMP ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_ENABLE_ON_CHARGE ] = control_station . array_cmd [ CONTROL_STATION_INGETEAM_PULT_RS485 ] [ CONTROL_STATION_CMD_ENABLE_ON_CHARGE ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_DISABLE_ON_QTV ] = control_station . array_cmd [ CONTROL_STATION_INGETEAM_PULT_RS485 ] [ CONTROL_STATION_CMD_DISABLE_ON_QTV ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_DISABLE_ON_UMP ] = control_station . array_cmd [ CONTROL_STATION_INGETEAM_PULT_RS485 ] [ CONTROL_STATION_CMD_DISABLE_ON_UMP ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_MANUAL_DISCHARGE ] = control_station . array_cmd [ CONTROL_STATION_INGETEAM_PULT_RS485 ] [ CONTROL_STATION_CMD_MANUAL_DISCHARGE ] ;
edrk . Status_Ready . bits . ImitationReady2 = control_station . raw_array_data [ CONTROL_STATION_INGETEAM_PULT_RS485 ] [ 181 ] . all ;
edrk . Obmotka1 = control_station . raw_array_data [ CONTROL_STATION_INGETEAM_PULT_RS485 ] [ 194 ] . all ;
edrk . Obmotka2 = control_station . raw_array_data [ CONTROL_STATION_INGETEAM_PULT_RS485 ] [ 195 ] . all ;
edrk . disable_alg_u_disbalance = control_station . raw_array_data [ CONTROL_STATION_INGETEAM_PULT_RS485 ] [ 193 ] . all ;
}
// 0 - auto on - rand pump
// 1 - auto on 1 pump
// 2 - auto on 2 pump
// 3 - manual on 1 pump
// 4 - manual on 2 pump
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_MODE_PUMP ] = control_station . array_cmd [ CONTROL_STATION_INGETEAM_PULT_RS485 ] [ CONTROL_STATION_CMD_MODE_PUMP ] ;
if ( control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_ACTIVE_CONTROL ] = = 0 )
return ;
}
/////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////
void parse_parameters_from_one_control_station_pult_ingeteam ( int cc )
{
2025-01-15 13:39:33 +03:00
int i , pos_numbercmd ;
2024-12-27 10:50:32 +03:00
static int prev_checkback = 0 ;
static int flag_wait_revers_go = 0 ;
float ff = 0 , ff_add = 0 , ff_dec = 0 ;
int key_plus = 0 , key_minus = 0 ;
2025-01-15 13:39:33 +03:00
_iq _iq_ff ;
static unsigned int prev_key_local_charge_key = 0 , prev_key_local_uncharge_key = 0 , key_local_charge_key , key_local_uncharge_key ;
static unsigned int prev_key_local_charge_display = 0 , prev_key_local_uncharge_display = 0 , key_local_charge_display , key_local_uncharge_display ;
2024-12-27 10:50:32 +03:00
2025-01-15 13:39:33 +03:00
static unsigned int prev_charge = 0 , prev_uncharge = 0 , key_local_charge , key_local_uncharge ;
2024-12-27 10:50:32 +03:00
static unsigned int old_time_pult_ing = 0 , old_time_pult_ing2 = 0 ;
2025-01-15 13:39:33 +03:00
static unsigned int prev_key_local_charge_uncharge_display = 0 , key_local_charge_uncharge_display ;
2024-12-27 10:50:32 +03:00
if ( control_station . alive_control_station [ cc ] )
{
}
else
{
for ( i = 0 ; i < CONTROL_STATION_CMD_LAST ; i + + )
control_station . array_cmd [ cc ] [ i ] = 0 ; // clear all data
return ; // <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// <20> "<22> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .
}
// control_station.raw_array_data[CONTROL_STATION_TERMINAL_RS232]
edrk . test_mode = 0 ;
// f.RScount = SECOND * 3;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_ACTIVE_CONTROL ] = control_station . active_control_station [ CONTROL_STATION_INGETEAM_PULT_RS485 ] ;
///////////////////////////////////////////
// <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_IZAD ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_SET_IZAD ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_KM ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_SET_KM ] ;
2025-01-15 13:39:33 +03:00
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_U_ZARYAD ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_SET_U_ZARYAD ] ;
2024-12-27 10:50:32 +03:00
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_K_U_DISBALANCE ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_SET_K_U_DISBALANCE ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_K_PLUS_U_DISBALANCE ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_SET_K_PLUS_U_DISBALANCE ] ;
2025-01-15 13:39:33 +03:00
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_LIMIT_POWER ] = my_satur_int ( control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_SET_LIMIT_POWER ] , MAX_ZADANIE_POWER , MIN_ZADANIE_POWER ) ;
2024-12-27 10:50:32 +03:00
// vector, ufconst
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_UFCONST_VECTOR ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_UFCONST_VECTOR ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SCALAR_FOC ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_SCALAR_FOC ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_ROTOR_POWER ] = control_station . raw_array_data [ cc ] [ 3 ] . all ;
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// if
if ( ( detect_pause_milisec ( 100 , & old_time_pult_ing ) ) & & control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_ACTIVE_CONTROL ] )
{
if ( control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_ROTOR_POWER ] = = 1 )
{
2025-01-15 13:39:33 +03:00
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_POWER ] = control_station . raw_array_data [ cc ] [ 4 ] . all ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_ROTOR ] = MAX_ZADANIE_OBOROTS_ROTOR ;
2024-12-27 10:50:32 +03:00
}
else
{
2025-01-15 13:39:33 +03:00
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_POWER ] = control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_LIMIT_POWER ] ;
2024-12-27 10:50:32 +03:00
ff = control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_ROTOR ] ;
key_plus = edrk . from_ing2 . bits . KEY_PLUS ;
key_minus = edrk . from_ing2 . bits . KEY_MINUS ;
if ( key_plus | | key_minus )
{
ff = plus_minus_oborots ( key_plus , key_minus , ff , control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_UFCONST_VECTOR ] , 0 ) ;
old_time_pult_ing2 = global_time . miliseconds ;
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
control_station . flag_refresh_array [ cc ] = 2 ; // <20> <> <EFBFBD> -<2D> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
}
else
{
plus_minus_oborots ( 0 , 0 , ff , control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_UFCONST_VECTOR ] , 1 ) ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( detect_pause_milisec ( 3000 , & old_time_pult_ing2 ) )
if ( control_station . flag_refresh_array [ cc ] = = 0 )
2025-01-15 13:39:33 +03:00
ff = control_station . raw_array_data [ cc ] [ 5 ] . all ;
2024-12-27 10:50:32 +03:00
}
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_ROTOR ] = ff ;
// control_station.array_cmd[CONTROL_STATION_ZADATCHIK_CAN][CONTROL_STATION_CMD_SET_ROTOR] = ff;
// control_station.array_cmd[CONTROL_STATION_VPU_CAN][CONTROL_STATION_CMD_SET_ROTOR] = ff;
}
}
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// pos_numbercmd = 15; // <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_CHECKBACK ] = control_station . raw_array_data [ cc ] [ 1 ] . all ;
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
key_local_charge_key = edrk . from_ing2 . bits . KEY_SBOR ;
key_local_uncharge_key = edrk . from_ing2 . bits . KEY_RAZBOR ;
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
key_local_charge_uncharge_display = control_station . raw_array_data [ cc ] [ 2 ] . all ;
prev_key_local_charge_key = key_local_charge_key ;
prev_key_local_uncharge_key = key_local_uncharge_key ;
if ( prev_key_local_charge_uncharge_display ! = key_local_charge_uncharge_display )
{
if ( key_local_charge_uncharge_display = = 1 )
{
key_local_charge_display = 1 ;
key_local_uncharge_display = 0 ;
}
else
{
key_local_charge_display = 0 ;
key_local_uncharge_display = 1 ;
}
}
else
{
key_local_charge_display = 0 ;
key_local_uncharge_display = 0 ;
}
prev_key_local_charge_uncharge_display = key_local_charge_uncharge_display ;
prev_key_local_charge_display = key_local_charge_display ;
prev_key_local_uncharge_display = key_local_uncharge_display ;
key_local_charge = key_local_charge_key | | key_local_charge_display ;
key_local_uncharge = key_local_uncharge_key | | key_local_uncharge_display ;
if ( key_local_uncharge_key & & key_local_charge_key )
{
2025-01-15 13:39:33 +03:00
key_local_charge = 0 ;
edrk . errors . e1 . bits . BOTH_KEYS_CHARGE_DISCHARGE | = 1 ;
2024-12-27 10:50:32 +03:00
}
if ( key_local_charge & & prev_charge = = 0 )
{
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_CHARGE ] = 1 ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_UNCHARGE ] = 0 ;
}
else
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_CHARGE ] = 0 ;
2025-01-15 13:39:33 +03:00
prev_charge = key_local_charge ;
2024-12-27 10:50:32 +03:00
if ( key_local_uncharge )
{
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_UNCHARGE ] = 1 ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_CHARGE ] = 0 ;
}
else
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_UNCHARGE ] = 0 ;
prev_uncharge = key_local_uncharge ;
// if (control_station.array_cmd[cc][CONTROL_STATION_CMD_SET_ROTOR]!=0)
// control_station.array_cmd[cc][CONTROL_STATION_CMD_GO] = 1;
// else
// control_station.array_cmd[cc][CONTROL_STATION_CMD_GO] = 0;
//
//
// control_station.array_cmd[cc][CONTROL_STATION_CMD_TEST_LEDS] = 0;
//
// prev_checkback = control_station.raw_array_data[cc][pos_numbercmd].bits.bit1;
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> rs232
if ( control_station . alive_control_station [ CONTROL_STATION_TERMINAL_RS232 ] )
{
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_DISABLE_ON_PUMP ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_DISABLE_ON_PUMP ]
2025-01-15 13:39:33 +03:00
| control_station . raw_array_data [ cc ] [ 188 ] . all ;
2024-12-27 10:50:32 +03:00
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_ENABLE_ON_CHARGE ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_ENABLE_ON_CHARGE ]
2025-01-15 13:39:33 +03:00
| control_station . raw_array_data [ cc ] [ 191 ] . all ;
2024-12-27 10:50:32 +03:00
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_DISABLE_ON_QTV ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_DISABLE_ON_QTV ]
2025-01-15 13:39:33 +03:00
| control_station . raw_array_data [ cc ] [ 189 ] . all ;
2024-12-27 10:50:32 +03:00
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_DISABLE_ON_UMP ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_DISABLE_ON_UMP ]
2025-01-15 13:39:33 +03:00
| control_station . raw_array_data [ cc ] [ 190 ] . all ;
2024-12-27 10:50:32 +03:00
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_MANUAL_DISCHARGE ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_MANUAL_DISCHARGE ]
2025-01-15 13:39:33 +03:00
| control_station . raw_array_data [ cc ] [ 180 ] . all ;
2024-12-27 10:50:32 +03:00
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_GO ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_GO ]
2025-01-15 13:39:33 +03:00
| ! control_station . raw_array_data [ cc ] [ 192 ] . all ;
2024-12-27 10:50:32 +03:00
}
else
{
edrk . Status_Ready . bits . ImitationReady2 = control_station . raw_array_data [ cc ] [ 181 ] . all ;
edrk . Obmotka1 = control_station . raw_array_data [ cc ] [ 194 ] . all ;
edrk . Obmotka2 = control_station . raw_array_data [ cc ] [ 195 ] . all ;
edrk . disable_alg_u_disbalance = control_station . raw_array_data [ cc ] [ 193 ] . all ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_DISABLE_ON_PUMP ] = control_station . raw_array_data [ cc ] [ 188 ] . all ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_DISABLE_ON_QTV ] = control_station . raw_array_data [ cc ] [ 189 ] . all ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_DISABLE_ON_UMP ] = control_station . raw_array_data [ cc ] [ 190 ] . all ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_ENABLE_ON_CHARGE ] = control_station . raw_array_data [ cc ] [ 191 ] . all ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_MANUAL_DISCHARGE ] = control_station . raw_array_data [ cc ] [ 180 ] . all ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_GO ] = ! control_station . raw_array_data [ cc ] [ 192 ] . all ;
}
//control_station.array_cmd[cc][CONTROL_STATION_CMD_DISABLE_ON_PUMP] = control_station.raw_array_data[cc][188].all;
// control_station.array_cmd[cc][CONTROL_STATION_CMD_DISABLE_ON_QTV] = control_station.raw_array_data[cc][189].all;
//control_station.array_cmd[cc][CONTROL_STATION_CMD_DISABLE_ON_UMP] = control_station.raw_array_data[cc][190].all;
//control_station.array_cmd[cc][CONTROL_STATION_CMD_ENABLE_ON_CHARGE] = control_station.raw_array_data[cc][191].all;
// control_station.array_cmd[cc][CONTROL_STATION_CMD_MANUAL_DISCHARGE] = control_station.raw_array_data[cc][180].all;
// control_station.array_cmd[cc][CONTROL_STATION_CMD_GO] = !control_station.raw_array_data[cc][192].all;
// 0 - auto on - rand pump
// 1 - auto on 1 pump
// 2 - auto on 2 pump
// 3 - manual on 1 pump
// 4 - manual on 2 pump
if ( control_station . raw_array_data [ cc ] [ 9 ] . all < = 2 ) //<2F> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> _<EFBFBD> <5F> <EFBFBD> <EFBFBD> (0)_<> <5F> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> (1)
{
if ( control_station . raw_array_data [ cc ] [ 9 ] . all = = 0 ) // <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> (0) 1_2(1)
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_MODE_PUMP ] = 0 ;
if ( control_station . raw_array_data [ cc ] [ 9 ] . all = = 1 ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> _1
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_MODE_PUMP ] = 1 ;
if ( control_station . raw_array_data [ cc ] [ 9 ] . all = = 2 ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> _2
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_MODE_PUMP ] = 2 ;
}
else
{
if ( control_station . raw_array_data [ cc ] [ 9 ] . all = = 3 ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> _1_2
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_MODE_PUMP ] = 3 ;
if ( control_station . raw_array_data [ cc ] [ 9 ] . all = = 4 ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> _1_2
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_MODE_PUMP ] = 4 ;
}
if ( control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_ACTIVE_CONTROL ] = = 0 )
return ;
}
/////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////
void parse_parameters_from_one_control_station_MPU_SVU ( int cc )
{
2025-01-15 13:39:33 +03:00
int i ;
static int prev_checkback = 0 ;
static int flag_wait_revers_go = 0 ;
2024-12-27 10:50:32 +03:00
_iq _iq_ff ;
2025-01-15 13:39:33 +03:00
static unsigned int prev_charge = 0 , prev_uncharge = 0 , cmd_local_charge , cmd_local_uncharge ;
2024-12-27 10:50:32 +03:00
2025-01-15 13:39:33 +03:00
static unsigned int old_time_MPU_SVU = 0 ;
2024-12-27 10:50:32 +03:00
if ( control_station . alive_control_station [ cc ] )
{
}
else
{
for ( i = 0 ; i < CONTROL_STATION_CMD_LAST ; i + + )
control_station . array_cmd [ cc ] [ i ] = 0 ; // clear all data
return ; // <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// <20> "<22> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .
}
// control_station.raw_array_data[CONTROL_STATION_TERMINAL_RS232]
edrk . test_mode = 0 ;
// f.RScount = SECOND * 3;
// control_station.array_cmd[cc][CONTROL_STATION_CMD_ACTIVE_CONTROL] = control_station.active_control_station[CONTROL_STATION_MPU_SVU_CAN];
2025-01-15 13:39:33 +03:00
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_ACTIVE_CONTROL ] = control_station . active_control_station [ CONTROL_STATION_MPU_KEY_CAN ] ;
2024-12-27 10:50:32 +03:00
///////////////////////////////////////////
// <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_IZAD ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_SET_IZAD ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_KM ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_SET_KM ] ;
2025-01-15 13:39:33 +03:00
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_U_ZARYAD ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_SET_U_ZARYAD ] ;
2024-12-27 10:50:32 +03:00
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_K_U_DISBALANCE ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_SET_K_U_DISBALANCE ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_K_PLUS_U_DISBALANCE ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_SET_K_PLUS_U_DISBALANCE ] ;
2025-01-15 13:39:33 +03:00
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_LIMIT_POWER ] = my_satur_int ( control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_SET_LIMIT_POWER ] , MAX_ZADANIE_POWER , MIN_ZADANIE_POWER ) ;
//control_station.raw_array_data[cc][12].all; // <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2024-12-27 10:50:32 +03:00
// vector, ufconst
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_UFCONST_VECTOR ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_UFCONST_VECTOR ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SCALAR_FOC ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_SCALAR_FOC ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_ROTOR_POWER ] = control_station . raw_array_data [ cc ] [ 1 ] . all ;
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// if
if ( ( detect_pause_milisec ( 100 , & old_time_MPU_SVU ) )
& & control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_ACTIVE_CONTROL ] )
{
if ( control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_ROTOR_POWER ] = = 1 )
{
2025-01-15 13:39:33 +03:00
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_POWER ] = control_station . raw_array_data [ cc ] [ 3 ] . all ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_ROTOR ] = MAX_ZADANIE_OBOROTS_ROTOR ;
2024-12-27 10:50:32 +03:00
}
else
{
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_POWER ] = control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_LIMIT_POWER ] ;
2025-01-15 13:39:33 +03:00
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_ROTOR ] = control_station . raw_array_data [ cc ] [ 2 ] . all ;
2024-12-27 10:50:32 +03:00
}
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_CHECKBACK ] = control_station . raw_array_data [ cc ] [ 0 ] . all ;
2025-01-15 13:39:33 +03:00
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( edrk . flag_second_PCH = = 0 ) {
cmd_local_charge = control_station . raw_array_data [ cc ] [ 6 ] . all ;
cmd_local_uncharge = control_station . raw_array_data [ cc ] [ 9 ] . all ;
} else {
cmd_local_charge = modbus_table_can_in [ 129 ] . all ; //control_station.raw_array_data[cc][7].all;
cmd_local_uncharge = control_station . raw_array_data [ cc ] [ 10 ] . all ;
2024-12-27 10:50:32 +03:00
}
2025-01-15 13:39:33 +03:00
if ( cmd_local_charge & & cmd_local_uncharge )
{
cmd_local_charge = 0 ;
edrk . errors . e1 . bits . BOTH_KEYS_CHARGE_DISCHARGE | = 1 ;
}
2024-12-27 10:50:32 +03:00
2025-01-15 13:39:33 +03:00
if ( cmd_local_charge & & prev_charge = = 0 )
{
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_CHARGE ] = 1 ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_UNCHARGE ] = 0 ;
}
else
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_CHARGE ] = 0 ;
prev_charge = cmd_local_charge ;
2024-12-27 10:50:32 +03:00
2025-01-15 13:39:33 +03:00
if ( cmd_local_uncharge )
{
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_UNCHARGE ] = 1 ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_CHARGE ] = 0 ;
2024-12-27 10:50:32 +03:00
}
2025-01-15 13:39:33 +03:00
else
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_UNCHARGE ] = 0 ;
prev_uncharge = cmd_local_uncharge ;
2024-12-27 10:50:32 +03:00
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_BLOCK_BS ] = control_station . raw_array_data [ cc ] [ 4 ] . all ;
// if (control_station.array_cmd[cc][CONTROL_STATION_CMD_SET_ROTOR]!=0)
// control_station.array_cmd[cc][CONTROL_STATION_CMD_GO] = 1;
// else
// control_station.array_cmd[cc][CONTROL_STATION_CMD_GO] = 0;
//
//
// control_station.array_cmd[cc][CONTROL_STATION_CMD_TEST_LEDS] = 0;
//
// prev_checkback = control_station.raw_array_data[cc][pos_numbercmd].bits.bit1;
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> rs232
if ( control_station . alive_control_station [ CONTROL_STATION_TERMINAL_RS232 ] )
{
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_GO ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_GO ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_DISABLE_ON_PUMP ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_DISABLE_ON_PUMP ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_ENABLE_ON_CHARGE ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_ENABLE_ON_CHARGE ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_DISABLE_ON_QTV ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_DISABLE_ON_QTV ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_DISABLE_ON_UMP ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_DISABLE_ON_UMP ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_MANUAL_DISCHARGE ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_MANUAL_DISCHARGE ] ;
}
else
if ( control_station . alive_control_station [ CONTROL_STATION_INGETEAM_PULT_RS485 ] )
{
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_GO ] = control_station . array_cmd [ CONTROL_STATION_INGETEAM_PULT_RS485 ] [ CONTROL_STATION_CMD_GO ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_DISABLE_ON_PUMP ] = control_station . array_cmd [ CONTROL_STATION_INGETEAM_PULT_RS485 ] [ CONTROL_STATION_CMD_DISABLE_ON_PUMP ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_ENABLE_ON_CHARGE ] = control_station . array_cmd [ CONTROL_STATION_INGETEAM_PULT_RS485 ] [ CONTROL_STATION_CMD_ENABLE_ON_CHARGE ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_DISABLE_ON_QTV ] = control_station . array_cmd [ CONTROL_STATION_INGETEAM_PULT_RS485 ] [ CONTROL_STATION_CMD_DISABLE_ON_QTV ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_DISABLE_ON_UMP ] = control_station . array_cmd [ CONTROL_STATION_INGETEAM_PULT_RS485 ] [ CONTROL_STATION_CMD_DISABLE_ON_UMP ] ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_MANUAL_DISCHARGE ] = control_station . array_cmd [ CONTROL_STATION_INGETEAM_PULT_RS485 ] [ CONTROL_STATION_CMD_MANUAL_DISCHARGE ] ;
edrk . Status_Ready . bits . ImitationReady2 = control_station . raw_array_data [ CONTROL_STATION_INGETEAM_PULT_RS485 ] [ 181 ] . all ;
edrk . Obmotka1 = control_station . raw_array_data [ CONTROL_STATION_INGETEAM_PULT_RS485 ] [ 194 ] . all ;
edrk . Obmotka2 = control_station . raw_array_data [ CONTROL_STATION_INGETEAM_PULT_RS485 ] [ 195 ] . all ;
edrk . disable_alg_u_disbalance = control_station . raw_array_data [ CONTROL_STATION_INGETEAM_PULT_RS485 ] [ 193 ] . all ;
2025-01-15 13:39:33 +03:00
2024-12-27 10:50:32 +03:00
}
// 0 - auto on - rand pump
// 1 - auto on 1 pump
// 2 - auto on 2 pump
// 3 - manual on 1 pump
// 4 - manual on 2 pump
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_MODE_PUMP ] = control_station . array_cmd [ CONTROL_STATION_INGETEAM_PULT_RS485 ] [ CONTROL_STATION_CMD_MODE_PUMP ] ;
if ( control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_ACTIVE_CONTROL ] = = 0 )
return ;
}
/////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////
void parse_parameters_from_one_control_station_terminal_rs232 ( int cc )
{
2025-01-15 13:39:33 +03:00
int i , pos_numbercmd ;
static int prev_checkback = 0 ;
2024-12-27 10:50:32 +03:00
static int flag_wait_revers_go = 0 ;
2025-01-15 13:39:33 +03:00
static unsigned int prev_charge = 0 , prev_uncharge = 0 , key_local_charge , key_local_uncharge ;
2024-12-27 10:50:32 +03:00
float ff ;
_iq _iq_ff ;
if ( control_station . alive_control_station [ cc ] )
{
}
else
{
for ( i = 0 ; i < CONTROL_STATION_CMD_LAST ; i + + )
{
// control_station.array_cmd[cc][i] = 0; // clear all data
// <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> .<2E> . <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <>
}
return ; // <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// <20> "<22> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .
}
// control_station.raw_array_data[CONTROL_STATION_TERMINAL_RS232]
edrk . test_mode = 0 ;
// f.RScount = SECOND * 3;
2025-01-15 13:39:33 +03:00
pos_numbercmd = 15 ; // <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2024-12-27 10:50:32 +03:00
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_ACTIVE_CONTROL ] = control_station . raw_array_data [ cc ] [ pos_numbercmd ] . bits . bit0 ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_CHECKBACK ] = control_station . raw_array_data [ cc ] [ pos_numbercmd ] . bits . bit1 ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_UFCONST_VECTOR ] = control_station . raw_array_data [ cc ] [ pos_numbercmd ] . bits . bit2 ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_ROTOR_POWER ] = control_station . raw_array_data [ cc ] [ pos_numbercmd ] . bits . bit3 ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SCALAR_FOC ] = control_station . raw_array_data [ cc ] [ pos_numbercmd ] . bits . bit4 ;
//control_station.raw_array_data[cc][pos_numbercmd].bits.bit4 = Go
//control_station.raw_array_data[cc][pos_numbercmd].bits.bit5
// control_station.array_cmd[cc][CONTROL_STATION_CMD_CHARGE] = control_station.raw_array_data[cc][pos_numbercmd].bits.bit6;
// control_station.array_cmd[cc][CONTROL_STATION_CMD_UNCHARGE] = control_station.raw_array_data[cc][pos_numbercmd].bits.bit7;
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
key_local_charge = control_station . raw_array_data [ cc ] [ pos_numbercmd ] . bits . bit6 ; ;
key_local_uncharge = control_station . raw_array_data [ cc ] [ pos_numbercmd ] . bits . bit7 ;
if ( key_local_uncharge & & key_local_charge )
{
key_local_charge = 0 ;
2025-01-15 13:39:33 +03:00
edrk . errors . e1 . bits . BOTH_KEYS_CHARGE_DISCHARGE | = 1 ;
2024-12-27 10:50:32 +03:00
}
if ( key_local_charge & & prev_charge = = 0 )
{
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_CHARGE ] = 1 ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_UNCHARGE ] = 0 ;
}
else
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_CHARGE ] = 0 ;
prev_charge = key_local_charge ;
if ( key_local_uncharge )
{
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_UNCHARGE ] = 1 ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_CHARGE ] = 0 ;
}
else
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_UNCHARGE ] = 0 ;
prev_uncharge = key_local_uncharge ;
// 0 - auto on - rand pump
// 1 - auto on 1 pump
// 2 - auto on 2 pump
// 3 - manual on 1 pump
// 4 - manual on 2 pump
if ( control_station . raw_array_data [ cc ] [ pos_numbercmd ] . bits . bit8 = = 0 ) // <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> _<EFBFBD> <5F> <EFBFBD> <EFBFBD> (0)_<> <5F> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> (1)
{
if ( control_station . raw_array_data [ cc ] [ pos_numbercmd ] . bits . bit9 = = 0 ) // <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_MODE_PUMP ] = 0 ;
else
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
if ( control_station . raw_array_data [ cc ] [ pos_numbercmd ] . bits . bit10 = = 0 ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> _1_2 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_MODE_PUMP ] = 1 ;
else
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_MODE_PUMP ] = 2 ;
}
}
else // <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
if ( control_station . raw_array_data [ cc ] [ pos_numbercmd ] . bits . bit10 = = 0 ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> _1_2 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_MODE_PUMP ] = 3 ;
else
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_MODE_PUMP ] = 4 ;
}
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_TEST_LEDS ] = control_station . raw_array_data [ cc ] [ pos_numbercmd ] . bits . bit11 ;
//control_station.raw_array_data[cc][pos_numbercmd].bits.bit12
2025-01-15 13:39:33 +03:00
edrk . Status_Ready . bits . ImitationReady2 = control_station . raw_array_data [ cc ] [ pos_numbercmd ] . bits . bit13 ;
2024-12-27 10:50:32 +03:00
edrk . Run_Rascepitel_from_RS = control_station . raw_array_data [ cc ] [ pos_numbercmd ] . bits . bit14 ;
edrk . Obmotka1 = control_station . raw_array_data [ cc ] [ pos_numbercmd ] . bits . bit15 ;
edrk . Obmotka2 = control_station . raw_array_data [ cc ] [ pos_numbercmd + 1 ] . bits . bit0 ;
edrk . disable_alg_u_disbalance = control_station . raw_array_data [ cc ] [ pos_numbercmd + 1 ] . bits . bit1 ;
// control_station.raw_array_data[cc][pos_numbercmd+1].bits.bit2;
// control_station.raw_array_data[cc][pos_numbercmd+1].bits.bit3;
// control_station.raw_array_data[cc][pos_numbercmd+1].bits.bit4;
2025-01-15 13:39:33 +03:00
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_CROSS_STEND_AUTOMATS ] = control_station . raw_array_data [ cc ] [ pos_numbercmd + 1 ] . bits . bit2 ;
2024-12-27 10:50:32 +03:00
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_DISABLE_ON_UMP ] = control_station . raw_array_data [ cc ] [ pos_numbercmd + 1 ] . bits . bit3 ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_MANUAL_DISCHARGE ] = control_station . raw_array_data [ cc ] [ pos_numbercmd + 1 ] . bits . bit4 ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_DISABLE_ON_PUMP ] = control_station . raw_array_data [ cc ] [ pos_numbercmd + 1 ] . bits . bit5 ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_ENABLE_ON_CHARGE ] = control_station . raw_array_data [ cc ] [ pos_numbercmd + 1 ] . bits . bit6 ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_DISABLE_ON_QTV ] = control_station . raw_array_data [ cc ] [ pos_numbercmd + 1 ] . bits . bit7 ;
// control_station.array_cmd[cc][CONTROL_STATION_CMD_DISABLE_INTERRUPT_SYNC] = control_station.raw_array_data[cc][pos_numbercmd+1].bits.bit8;
// control_station.array_cmd[cc][CONTROL_STATION_CMD_DISABLE_INTERRUPT_TIMER2] = control_station.raw_array_data[cc][pos_numbercmd+1].bits.bit9;
edrk . disable_rascepitel_work = control_station . raw_array_data [ cc ] [ pos_numbercmd + 1 ] . bits . bit10 ;
edrk . enable_pwm_test_lines = control_station . raw_array_data [ cc ] [ pos_numbercmd + 1 ] . bits . bit11 ;
// analog
2025-01-15 13:39:33 +03:00
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_ROTOR ] = control_station . raw_array_data [ cc ] [ 0 ] . all ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_KM ] = control_station . raw_array_data [ cc ] [ 1 ] . all ;
2024-12-27 10:50:32 +03:00
2025-01-15 13:39:33 +03:00
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_POWER ] = my_satur_int ( control_station . raw_array_data [ cc ] [ 2 ] . all , MAX_ZADANIE_POWER , MIN_ZADANIE_POWER ) ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_IZAD ] = my_satur_int ( control_station . raw_array_data [ cc ] [ 3 ] . all , MAX_ZADANIE_I_M , 0 ) ;
2024-12-27 10:50:32 +03:00
2025-01-15 13:39:33 +03:00
if ( control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_CROSS_STEND_AUTOMATS ] = = 0 )
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_U_ZARYAD ] = control_station . raw_array_data [ cc ] [ 4 ] . all ;
2024-12-27 10:50:32 +03:00
else
2025-01-15 13:39:33 +03:00
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> , <20> .<2E> . <20> <> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_U_ZARYAD ] = 0 ;
2024-12-27 10:50:32 +03:00
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_K_U_DISBALANCE ] = control_station . raw_array_data [ cc ] [ 5 ] . all ;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_K_PLUS_U_DISBALANCE ] = control_station . raw_array_data [ cc ] [ 6 ] . all ;
2025-01-15 13:39:33 +03:00
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_SET_LIMIT_POWER ] = my_satur_int ( control_station . raw_array_data [ cc ] [ 7 ] . all , MAX_ZADANIE_POWER , MIN_ZADANIE_POWER ) ;
2024-12-27 10:50:32 +03:00
if ( control_station . raw_array_data [ cc ] [ 8 ] . all > 0 & & control_station . raw_array_data [ cc ] [ 8 ] . all < = 600 & & edrk . MasterSlave = = MODE_MASTER ) {
vect_control . iqId_min = _IQ ( ( float ) control_station . raw_array_data [ cc ] [ 8 ] . all / NORMA_ACP ) ;
}
prev_checkback = control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_CHECKBACK ] ; //control_station.raw_array_data[cc][pos_numbercmd].bits.bit1;
// edrk.KvitirRS = 1;
control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_GO ] = control_station . raw_array_data [ cc ] [ pos_numbercmd ] . bits . bit5 ;
// if (control_station.array_cmd[cc][CONTROL_STATION_CMD_ROTOR_POWER]==0)
// {
// if (control_station.array_cmd[cc][CONTROL_STATION_CMD_SET_ROTOR]!=0)
// control_station.array_cmd[cc][CONTROL_STATION_CMD_GO] = control_station.raw_array_data[cc][pos_numbercmd].bits.bit5;
// else
// control_station.array_cmd[cc][CONTROL_STATION_CMD_GO] = 0;
// }
// else
// {
// if (control_station.array_cmd[cc][CONTROL_STATION_CMD_SET_POWER]!=0)
// control_station.array_cmd[cc][CONTROL_STATION_CMD_GO] = control_station.raw_array_data[cc][pos_numbercmd].bits.bit5;
// else
// control_station.array_cmd[cc][CONTROL_STATION_CMD_GO] = 0;
// }
/*
edrk . from_rs . bits . ACTIVE = control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_ACTIVE_CONTROL ] ;
if ( edrk . from_rs . bits . ACTIVE = = 0 )
return ;
edrk . from_can . bits . ACTIVE = 0 ;
*/
if ( control_station . array_cmd [ cc ] [ CONTROL_STATION_CMD_ACTIVE_CONTROL ] = = 0 )
return ;
// <20> <> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> CAN <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> RS232
if ( control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_ACTIVE_CONTROL ] & & cc = = CONTROL_STATION_TERMINAL_CAN )
return ;
// edrk.DirectOUT = control_station.raw_array_data[cc][pos_numbercmd].bits.bit7;
// edrk.DirectNagrevOff = control_station.raw_array_data[cc][pos_numbercmd].bits.bit8;
// edrk.DirectBlockKeyOff = control_station.raw_array_data[cc][pos_numbercmd].bits.bit9;
//// edrk.DirectPumpON = control_station.raw_array_data[cc][pos_numbercmd].bits.bit10;
// edrk.DirectZaryadOn = control_station.raw_array_data[cc][pos_numbercmd].bits.bit11;
// edrk.SetSpeed = control_station.raw_array_data[cc][pos_numbercmd].bits.bit14;
////////////////////////////
/////////////////////////
}
//////////////////////////////////////////////////////
//////////////////////////////////////////////////////
//////////////////////////////////////////////////////
void parse_data_from_master_to_alg ( void )
{
if ( edrk . MasterSlave = = MODE_SLAVE )
{
control_station . active_array_cmd [ CONTROL_STATION_CMD_SET_ROTOR ] = control_station . array_cmd [ CONTROL_STATION_ANOTHER_BS ] [ CONTROL_STATION_CMD_SET_ROTOR ] ;
control_station . active_array_cmd [ CONTROL_STATION_CMD_SET_KM ] = control_station . array_cmd [ CONTROL_STATION_ANOTHER_BS ] [ CONTROL_STATION_CMD_SET_KM ] ;
control_station . active_array_cmd [ CONTROL_STATION_CMD_SET_IZAD ] = control_station . array_cmd [ CONTROL_STATION_ANOTHER_BS ] [ CONTROL_STATION_CMD_SET_IZAD ] ;
control_station . active_array_cmd [ CONTROL_STATION_CMD_SET_POWER ] = control_station . array_cmd [ CONTROL_STATION_ANOTHER_BS ] [ CONTROL_STATION_CMD_SET_POWER ] ;
}
}
//////////////////////////////////////////////////////
//////////////////////////////////////////////////////
//////////////////////////////////////////////////////
//////////////////////////////////////////////////////
//////////////////////////////////////////////////////
//////////////////////////////////////////////////////
void parse_analog_data_from_active_control_station_to_alg ( void )
{
2025-01-15 13:39:33 +03:00
float ff ;
2024-12-27 10:50:32 +03:00
_iq _iq_ff ;
int i ;
// edrk.disable_interrupt_sync = control_station.active_array_cmd[CONTROL_STATION_CMD_DISABLE_INTERRUPT_SYNC];
// edrk.disable_interrupt_timer2 = control_station.active_array_cmd[CONTROL_STATION_CMD_DISABLE_INTERRUPT_TIMER2];
edrk . NoDetectUZeroDischarge = control_station . active_array_cmd [ CONTROL_STATION_CMD_DISABLE_ON_QTV ] ;
// if (current_active_control==CONTROL_STATION_TERMINAL_RS232)
edrk . StartGEDfromControl = control_station . active_array_cmd [ CONTROL_STATION_CMD_GO ] ;
//////////////////
if ( control_station . active_array_cmd [ CONTROL_STATION_CMD_UFCONST_VECTOR ] = = 0 )
edrk . Mode_ScalarVectorUFConst = ALG_MODE_UF_CONST ;
else
if ( control_station . active_array_cmd [ CONTROL_STATION_CMD_SCALAR_FOC ] = = 0 )
{
if ( control_station . active_array_cmd [ CONTROL_STATION_CMD_ROTOR_POWER ] = = 0 )
edrk . Mode_ScalarVectorUFConst = ALG_MODE_SCALAR_OBOROTS ;
else
edrk . Mode_ScalarVectorUFConst = ALG_MODE_SCALAR_POWER ;
}
else
{
if ( control_station . active_array_cmd [ CONTROL_STATION_CMD_ROTOR_POWER ] = = 0 )
edrk . Mode_ScalarVectorUFConst = ALG_MODE_FOC_OBOROTS ;
else
edrk . Mode_ScalarVectorUFConst = ALG_MODE_FOC_POWER ;
}
//////////////////////////////////////////////////////
// edrk.W_from_RS = control_station.array_cmd[cc][CONTROL_STATION_CMD_SET_ROTOR]; //DataAnalog1;
// ff = control_station.active_array_cmd[CONTROL_STATION_CMD_SET_I_VOZBUD];//0;//DataAnalog4;
// edrk.I_zad_vozb_add_from_RS = my_satur_float(ff,MAX_ZADANIE_I_VOZBUD,0);
ff = control_station . active_array_cmd [ CONTROL_STATION_CMD_SET_U_ZARYAD ] ;
2025-01-15 13:39:33 +03:00
edrk . zadanie . ZadanieU_Charge = my_satur_float ( ff , MAX_ZADANIE_U_CHARGE , 0 ) ;
2024-12-27 10:50:32 +03:00
edrk . zadanie . iq_ZadanieU_Charge = _IQ ( edrk . zadanie . ZadanieU_Charge / NORMA_ACP ) ;
if ( edrk . Status_Ready . bits . ready_final = = 0 )
{
// <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
for ( i = 0 ; i < CONTROL_STATION_LAST ; i + + )
{
control_station . array_cmd [ i ] [ CONTROL_STATION_CMD_SET_ROTOR ] = 0 ;
// control_station.array_cmd[i][CONTROL_STATION_CMD_SET_KM] = 0;
// control_station.array_cmd[i][CONTROL_STATION_CMD_SET_IZAD] = 0;
control_station . array_cmd [ i ] [ CONTROL_STATION_CMD_SET_POWER ] = 0 ;
}
control_station . active_array_cmd [ CONTROL_STATION_CMD_SET_ROTOR ] = 0 ;
// control_station.active_array_cmd[CONTROL_STATION_CMD_SET_KM] = 0;
// control_station.active_array_cmd[CONTROL_STATION_CMD_SET_IZAD] = 0;
control_station . active_array_cmd [ CONTROL_STATION_CMD_SET_POWER ] = 0 ;
}
if ( edrk . Mode_ScalarVectorUFConst = = ALG_MODE_UF_CONST )
{
ff = control_station . active_array_cmd [ CONTROL_STATION_CMD_SET_ROTOR ] / 100.0 ;
2025-01-15 13:39:33 +03:00
ff = my_satur_float ( ff , MAX_ZADANIE_F , MIN_ZADANIE_F ) ;
2024-12-27 10:50:32 +03:00
edrk . zadanie . fzad = ff ; // <20> <> .
edrk . zadanie . iq_fzad = _IQ ( edrk . zadanie . fzad / NORMA_FROTOR ) ;
}
else
{
ff = control_station . active_array_cmd [ CONTROL_STATION_CMD_SET_ROTOR ] ;
2025-01-15 13:39:33 +03:00
ff = my_satur_float ( ff , MAX_ZADANIE_OBOROTS_ROTOR , MIN_ZADANIE_OBOROTS_ROTOR ) ;
2024-12-27 10:50:32 +03:00
edrk . zadanie . oborots_zad = ff ; // <20> <> /<2F> <> <EFBFBD>
edrk . zadanie . oborots_zad_hz = ff / 60.0 ; // <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> .
edrk . zadanie . iq_oborots_zad_hz = _IQ ( edrk . zadanie . oborots_zad_hz / NORMA_FROTOR ) ;
}
ff = control_station . active_array_cmd [ CONTROL_STATION_CMD_SET_KM ] / 10000.0 ;
2025-01-15 13:39:33 +03:00
edrk . zadanie . kzad = my_satur_float ( ff , K_STATOR_MAX , 0 ) ;
2024-12-27 10:50:32 +03:00
edrk . zadanie . iq_kzad = _IQ ( edrk . zadanie . kzad ) ;
ff = ( control_station . active_array_cmd [ CONTROL_STATION_CMD_SET_K_U_DISBALANCE ] / 100.0 ) ;
2025-01-15 13:39:33 +03:00
edrk . zadanie . k_u_disbalance = my_satur_float ( ff , MAX_ZADANIE_K_U_DISBALANCE , 0.0 ) ;
2024-12-27 10:50:32 +03:00
edrk . zadanie . iq_k_u_disbalance = _IQ ( edrk . zadanie . k_u_disbalance ) ;
ff = ( control_station . active_array_cmd [ CONTROL_STATION_CMD_SET_K_PLUS_U_DISBALANCE ] / 1000.0 ) ;
2025-01-15 13:39:33 +03:00
edrk . zadanie . kplus_u_disbalance = my_satur_float ( ff , 1.0 , 0.0 ) ;
2024-12-27 10:50:32 +03:00
edrk . zadanie . iq_kplus_u_disbalance = _IQ ( edrk . zadanie . kplus_u_disbalance ) ;
ff = control_station . active_array_cmd [ CONTROL_STATION_CMD_SET_IZAD ] ;
2025-01-15 13:39:33 +03:00
edrk . zadanie . Izad = my_satur_float ( ff , MAX_ZADANIE_I_M , 0 ) ;
2024-12-27 10:50:32 +03:00
edrk . zadanie . iq_Izad = _IQ ( edrk . zadanie . Izad / NORMA_MZZ ) ;
2025-01-15 13:39:33 +03:00
ff = control_station . active_array_cmd [ CONTROL_STATION_CMD_SET_LIMIT_POWER ] ; //kWt
edrk . zadanie . limit_power_zad = my_satur_float ( ff , MAX_ZADANIE_POWER , MIN_ZADANIE_POWER ) ; // kWt
2024-12-27 10:50:32 +03:00
edrk . zadanie . iq_limit_power_zad = _IQ ( edrk . zadanie . limit_power_zad * 1000.0 / ( NORMA_MZZ * NORMA_MZZ ) ) ; //Wt
ff = control_station . active_array_cmd [ CONTROL_STATION_CMD_SET_POWER ] ; //kWt
2025-01-15 13:39:33 +03:00
ff = my_satur_float ( ff , MAX_ZADANIE_POWER , MIN_ZADANIE_POWER ) ; // kWt
ff = my_satur_float ( ff , edrk . zadanie . limit_power_zad , - edrk . zadanie . limit_power_zad ) ; // kWt
2024-12-27 10:50:32 +03:00
edrk . zadanie . power_zad = ff ; // kWt
edrk . zadanie . iq_power_zad = _IQ ( edrk . zadanie . power_zad * 1000.0 / ( NORMA_MZZ * NORMA_MZZ ) ) ; //Wt
// StartGED
//////////////////////////////////////////////////////
// edrk.StartGEDRS = control_station.array_cmd[cc][CONTROL_STATION_CMD_GO];
/*
if ( edrk . summ_errors )
{
flag_wait_revers_go = 1 ;
}
if ( flag_wait_revers_go = = 1 )
edrk . StartGEDRS = 0 ;
if ( pcommand - > digit_data . Byte01 . bit_data . bit0 & & flag_wait_revers_go )
edrk . StartGEDRS = 0 ;
if ( pcommand - > digit_data . Byte01 . bit_data . bit0 = = 0 )
edrk . StartGEDRS = 0 ;
if ( pcommand - > digit_data . Byte01 . bit_data . bit0 = = 0 & & flag_wait_revers_go )
flag_wait_revers_go = 0 ;
if ( pcommand - > digit_data . Byte01 . bit_data . bit0 = = 1 & & flag_wait_revers_go = = 0 )
edrk . StartGEDRS = 1 ;
// edrk.StartGEDRS = pcommand->digit_data.Byte01.bit_data.bit0;
*/
// end StartGED
////////////////
// edrk.from_rs.bits.RAZBOR_SHEMA = pcommand->digit_data.Byte01.bit_data.bit5;
// SBOR SHEMA
/*
if ( edrk . summ_errors )
{
flag_wait_revers_sbor = 1 ;
}
if ( flag_wait_revers_sbor = = 1 )
edrk . from_can . bits . SBOR_SHEMA = 0 ;
if ( pcommand - > digit_data . Byte01 . bit_data . bit4 & & flag_wait_revers_sbor )
edrk . from_can . bits . SBOR_SHEMA = 0 ;
if ( pcommand - > digit_data . Byte01 . bit_data . bit4 = = 0 )
edrk . from_can . bits . SBOR_SHEMA = 0 ;
if ( pcommand - > digit_data . Byte01 . bit_data . bit4 = = 0 & & flag_wait_revers_sbor )
flag_wait_revers_sbor = 0 ;
if ( pcommand - > digit_data . Byte01 . bit_data . bit4 = = 1 & & flag_wait_revers_sbor = = 0 )
edrk . from_can . bits . SBOR_SHEMA = pcommand - > digit_data . Byte01 . bit_data . bit4 ;
prev_byte01_bit4 = pcommand - > digit_data . Byte01 . bit_data . bit4 ;
*/
// end SBOR SHEMA
// if (edrk.from_rs.bits.RAZBOR_SHEMA)
// edrk.from_rs.bits.SBOR_SHEMA = 0;
//edrk.SborRS = pcommand->digit_data.Byte01.bit_data.bit4;
// edrk.to_shema.bits.QTV_ON = pcommand->digit_data.Byte02.bit_data.bit3;
// edrk.RemouteFromRS = pcommand->digit_data.Byte01.bit_data.bit3;
// edrk.VozbudOnOffFromRS = pcommand->digit_data.Byte01.bit_data.bit1;
// edrk.enable_set_vozbud = pcommand->digit_data.Byte01.bit_data.bit1;
// edrk.SborRS = pcommand->digit_data.Byte01.bit_data.bit2;
// edrk.RazborRS = pcommand->digit_data.Byte01.bit_data.bit3;
// edrk.DirectOUT = pcommand->digit_data.Byte01.bit_data.bit4;
// edrk.StartGED = pcommand->digit_data.Byte01.bit_data.bit6;
// f.flag_distance = pcommand->digit_data.Byte01.bit_data.bit6;
// f.Set_power = pcommand->digit_data.Byte01.bit_data.bit7;
// f.Down50 = pcommand->digit_data.Byte02.bit_data.bit2;
// f.Up50 = pcommand->digit_data.Byte02.bit_data.bit3;
// f.Ciclelog = pcommand->digit_data.Byte02.bit_data.bit4;
// if (SPEED_SELECT_ZADAT==1)
// f.Provorot = pcommand->digit_data.Byte02.bit_data.bit5;
}
/////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////
void parse_parameters_from_all_control_station ( void )
{
parse_parameters_from_one_control_station_terminal_rs232 ( CONTROL_STATION_TERMINAL_RS232 ) ;
parse_parameters_from_one_control_station_terminal_rs232 ( CONTROL_STATION_TERMINAL_CAN ) ;
load_parameters_from_can_control_station_to_rs232 ( ) ;
if ( edrk . get_new_data_from_hmi = = 1 ) // <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ?
{
func_unpack_answer_from_Ingeteam ( CONTROL_STATION_INGETEAM_PULT_RS485 ) ;
parse_parameters_from_one_control_station_pult_ingeteam ( CONTROL_STATION_INGETEAM_PULT_RS485 ) ;
edrk . get_new_data_from_hmi = 2 ; // <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> modbus
}
parse_parameters_from_one_control_station_pult_zadat4ik ( CONTROL_STATION_ZADATCHIK_CAN ) ;
parse_parameters_from_one_control_station_pult_vpu ( CONTROL_STATION_VPU_CAN ) ;
parse_parameters_from_one_control_station_another_bs ( CONTROL_STATION_ANOTHER_BS ) ;
// unpack_answer_from_MPU_SVU_CAN(CONTROL_STATION_MPU_SVU_CAN);
2025-01-15 13:39:33 +03:00
unpack_answer_from_MPU_SVU_CAN ( CONTROL_STATION_MPU_KEY_CAN ) ;
2024-12-27 10:50:32 +03:00
// unpack_answer_from_MPU_SVU_RS(CONTROL_STATION_MPU_SVU_RS485);
2025-01-15 13:39:33 +03:00
// parse_parameters_from_one_control_station_MPU_SVU(CONTROL_STATION_MPU_SVU_CAN);
parse_parameters_from_one_control_station_MPU_SVU ( CONTROL_STATION_MPU_KEY_CAN ) ;
2024-12-27 10:50:32 +03:00
// parse_parameters_from_one_control_station_MPU_SVU(CONTROL_STATION_MPU_SVU_RS485);
}
/////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////
void load_parameters_from_active_control_station ( int current_control )
{
int i ;
if ( current_control > = CONTROL_STATION_LAST | | current_control < 0 )
{
// <20> <> <EFBFBD> -<2D> <> <20> <> <20> <> ! <20> <> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> !
for ( i = 0 ; i < CONTROL_STATION_CMD_LAST ; i + + )
2025-01-15 13:39:33 +03:00
control_station . active_array_cmd [ i ] = 0 ; // clear
2024-12-27 10:50:32 +03:00
return ;
}
for ( i = 0 ; i < CONTROL_STATION_CMD_LAST ; i + + )
control_station . active_array_cmd [ i ] = control_station . array_cmd [ current_control ] [ i ] ;
}
/////////////////////////////////////////////////////////////
// <20> <> <EFBFBD> <EFBFBD> rs232 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> , <20> CAN <20> <> <EFBFBD> , <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> CAN <20> RS232
// <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
/////////////////////////////////////////////////////////////
void load_parameters_from_can_control_station_to_rs232 ( void )
{
int i ;
if ( control_station . alive_control_station [ CONTROL_STATION_TERMINAL_CAN ] & &
control_station . alive_control_station [ CONTROL_STATION_TERMINAL_RS232 ] = = 0 )
{
for ( i = 0 ; i < CONTROL_STATION_CMD_LAST ; i + + )
control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ i ] = control_station . array_cmd [ CONTROL_STATION_TERMINAL_CAN ] [ i ] ;
}
}
/////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////
int get_current_station_control ( void )
{
int i ;
for ( i = 0 ; i < COUNT_CONTROL_STATION ; i + + )
if ( control_station . active_control_station [ i ] )
return i ; // <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> .
return CONTROL_STATION_LAST ; // <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
}
/////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> alive_control
/////////////////////////////////////////////////////////////
void control_station_test_alive_all_control ( void )
{
int test_a , test_b , real_box ;
// terminals can
2025-01-15 13:39:33 +03:00
if ( CAN_timeout [ get_real_in_mbox ( TERMINAL_TYPE_BOX , edrk . number_can_box_terminal_cmd ) ] = = 0 )
2024-12-27 10:50:32 +03:00
control_station . detect_get_data_control_station [ CONTROL_STATION_TERMINAL_CAN ] = 1 ;
// terminals rs232
// test <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> RS_Function.c
if ( rs_a . RS_DataReadyRequest )
{
rs_a . RS_DataReadyRequest = 0 ;
control_station . detect_get_data_control_station [ CONTROL_STATION_TERMINAL_RS232 ] = 1 ;
}
// mpu svu+key rs485
// test <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> RS_Function.c
// control_station.detect_get_data_control_station[CONTROL_STATION_MPU_KEY_RS485] = 1;
// control_station.detect_get_data_control_station[CONTROL_STATION_MPU_SVU_RS485] = 1;
// mpu svu+key can
2025-01-15 13:39:33 +03:00
if ( CAN_timeout [ get_real_in_mbox ( MPU_TYPE_BOX , 0 ) ] = = 0 )
2024-12-27 10:50:32 +03:00
{
control_station . detect_get_data_control_station [ CONTROL_STATION_MPU_KEY_CAN ] = 1 ;
control_station . detect_get_data_control_station [ CONTROL_STATION_MPU_SVU_CAN ] = 1 ;
}
// zadatchik can
real_box = get_real_in_mbox ( UNITS_TYPE_BOX , ZADATCHIK_CAN ) ;
if ( CAN_timeout [ real_box ] = = 0 )
control_station . detect_get_data_control_station [ CONTROL_STATION_ZADATCHIK_CAN ] = 1 ;
// vpu can
real_box = get_real_in_mbox ( UNITS_TYPE_BOX , VPU_CAN ) ;
if ( CAN_timeout [ real_box ] = = 0 )
control_station . detect_get_data_control_station [ CONTROL_STATION_VPU_CAN ] = 1 ;
// Ingeteam pult
// test <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> RS_Function.c
// control_station.detect_get_data_control_station[CONTROL_STATION_INGETEAM_PULT_RS485] = 1;
if ( rs_b . RS_DataReadyRequest )
{
rs_b . RS_DataReadyRequest = 0 ;
control_station . detect_get_data_control_station [ CONTROL_STATION_INGETEAM_PULT_RS485 ] = 1 ;
}
if ( rs_b . RS_DataReadyFullUpdate ) // <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ?
{
if ( control_station . flag_refresh_array [ CONTROL_STATION_INGETEAM_PULT_RS485 ] )
control_station . flag_refresh_array [ CONTROL_STATION_INGETEAM_PULT_RS485 ] - - ;
rs_b . RS_DataReadyFullUpdate = 0 ;
}
// another bs can
real_box = get_real_in_mbox ( UNITS_TYPE_BOX , ANOTHER_BSU1_CAN_DEVICE ) ;
if ( CAN_timeout [ real_box ] = = 0 )
control_station . detect_get_data_control_station [ CONTROL_STATION_ANOTHER_BS ] = 1 ;
}
/////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////
int control_station_select_active ( void )
{
int i ;
///
/// if (edrk.from_shema.bits.SVU) return;
// if (edrk.from_shema.bits.ZADA_DISPLAY) return;
//edrk.from_ing.bits.LOCAL_REMOUTE
// edrk.from_shema.bits.RAZBOR_SHEMA = !FROM_BSU_RAZBOR_SHEMA;
//edrk.from_shema.bits.SBOR_SHEMA = !FROM_BSU_SBOR_SHEMA;
// if (CAN_timeout[get_real_in_mbox(MPU_TYPE_BOX,0)]==0)
//{
// edrk.W_from_SVU = modbus_table_can_in[14].all;
// edrk.W_from_DISPLAY = modbus_table_can_in[16].all;
//
//edrk.from_rs.bits.ACTIVE
//////////////////////////////////////
// terminal rs232
//////////////////////////////////////
if ( control_station . alive_control_station [ CONTROL_STATION_TERMINAL_RS232 ] )
{
if ( control_station . array_cmd [ CONTROL_STATION_TERMINAL_RS232 ] [ CONTROL_STATION_CMD_ACTIVE_CONTROL ] )
{
control_station . active_control_station [ CONTROL_STATION_TERMINAL_RS232 ] = 1 ;
}
else
control_station . active_control_station [ CONTROL_STATION_TERMINAL_RS232 ] = 0 ;
}
else
control_station . active_control_station [ CONTROL_STATION_TERMINAL_RS232 ] = 0 ;
// <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> RS232 <20> <> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( control_station . active_control_station [ CONTROL_STATION_TERMINAL_RS232 ] )
{
for ( i = 0 ; i < COUNT_CONTROL_STATION ; i + + )
if ( i ! = CONTROL_STATION_TERMINAL_RS232 )
control_station . active_control_station [ i ] = 0 ;
return 0 ; // all ok
}
//////////////////////////////////////
// terminal can
//////////////////////////////////////
if ( control_station . alive_control_station [ CONTROL_STATION_TERMINAL_CAN ] )
{
if ( control_station . array_cmd [ CONTROL_STATION_TERMINAL_CAN ] [ CONTROL_STATION_CMD_ACTIVE_CONTROL ] )
{
control_station . active_control_station [ CONTROL_STATION_TERMINAL_CAN ] = 1 ;
}
else
control_station . active_control_station [ CONTROL_STATION_TERMINAL_CAN ] = 0 ;
}
else
control_station . active_control_station [ CONTROL_STATION_TERMINAL_CAN ] = 0 ;
// <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> CAN <20> <> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( control_station . active_control_station [ CONTROL_STATION_TERMINAL_CAN ] )
{
for ( i = 0 ; i < COUNT_CONTROL_STATION ; i + + )
if ( i ! = CONTROL_STATION_TERMINAL_CAN )
control_station . active_control_station [ i ] = 0 ;
return 0 ; // all ok
}
//////////////////////////////////////
// ingeteam pult rs485
//////////////////////////////////////
if ( edrk . from_ing1 . bits . LOCAL_REMOUTE = = 1 ) //LOCAL DISPLAY ON
{
if ( control_station . alive_control_station [ CONTROL_STATION_INGETEAM_PULT_RS485 ] )
{
control_station . active_control_station [ CONTROL_STATION_INGETEAM_PULT_RS485 ] = 1 ;
}
else
control_station . active_control_station [ CONTROL_STATION_INGETEAM_PULT_RS485 ] = 0 ;
// <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> PULT <20> <> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
for ( i = 0 ; i < COUNT_CONTROL_STATION ; i + + )
if ( i ! = CONTROL_STATION_INGETEAM_PULT_RS485 )
control_station . active_control_station [ i ] = 0 ;
if ( control_station . active_control_station [ CONTROL_STATION_INGETEAM_PULT_RS485 ] )
{
return 0 ; // <20> <> <EFBFBD> <20> <>
}
else
{
return 1 ; // <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> . <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> !!!
}
}
else
control_station . active_control_station [ CONTROL_STATION_INGETEAM_PULT_RS485 ] = 0 ;
//////////////////////////////////////////////////////////////////
// svu CAN, svu RS485, zadatchik CAN, mpu CAN, mpu RS485
//////////////////////////////////////////////////////////////////
if ( edrk . from_ing1 . bits . LOCAL_REMOUTE = = 0 ) //REMOUTE on INGETEAM ON
{
////////////////////////////
// svu CAN RS485
////////////////////////////
2025-01-15 13:39:33 +03:00
if ( edrk . from_shema . bits . SVU ) // <20> <> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2024-12-27 10:50:32 +03:00
{
2025-01-15 13:39:33 +03:00
if ( edrk . from_vpu . bits . ACTIVE = = 1 ) // <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2024-12-27 10:50:32 +03:00
{
if ( control_station . alive_control_station [ CONTROL_STATION_VPU_CAN ] )
{
control_station . active_control_station [ CONTROL_STATION_VPU_CAN ] = 1 ;
}
else
control_station . active_control_station [ CONTROL_STATION_VPU_CAN ] = 0 ;
control_station . active_control_station [ CONTROL_STATION_MPU_KEY_CAN ] = 0 ;
control_station . active_control_station [ CONTROL_STATION_MPU_KEY_RS485 ] = 0 ;
control_station . active_control_station [ CONTROL_STATION_MPU_SVU_CAN ] = 0 ;
control_station . active_control_station [ CONTROL_STATION_MPU_SVU_RS485 ] = 0 ;
control_station . active_control_station [ CONTROL_STATION_ZADATCHIK_CAN ] = 0 ;
if ( control_station . active_control_station [ CONTROL_STATION_VPU_CAN ] = = 0 )
return 1 ; // <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> . <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> !!!
}
else // <20> <> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
if ( control_station . alive_control_station [ CONTROL_STATION_MPU_SVU_CAN ] )
{
control_station . active_control_station [ CONTROL_STATION_MPU_SVU_CAN ] = 1 ; // <20> CAN <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> RS485
control_station . active_control_station [ CONTROL_STATION_MPU_SVU_RS485 ] = 0 ;
}
else
{
control_station . active_control_station [ CONTROL_STATION_MPU_SVU_CAN ] = 0 ;
if ( control_station . alive_control_station [ CONTROL_STATION_MPU_SVU_RS485 ] )
control_station . active_control_station [ CONTROL_STATION_MPU_SVU_RS485 ] = 1 ;
else
control_station . active_control_station [ CONTROL_STATION_MPU_SVU_RS485 ] = 0 ;
}
control_station . active_control_station [ CONTROL_STATION_MPU_KEY_CAN ] = 0 ;
control_station . active_control_station [ CONTROL_STATION_MPU_KEY_RS485 ] = 0 ;
control_station . active_control_station [ CONTROL_STATION_ZADATCHIK_CAN ] = 0 ;
control_station . active_control_station [ CONTROL_STATION_VPU_CAN ] = 0 ;
if ( control_station . active_control_station [ CONTROL_STATION_MPU_SVU_CAN ] = = 0 & &
control_station . active_control_station [ CONTROL_STATION_MPU_SVU_RS485 ] = = 0 )
return 1 ; // <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> . <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> !!!
}
}
else // <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
////////////////////////////
// zadatchik can
////////////////////////////
2025-01-15 13:39:33 +03:00
if ( edrk . from_shema . bits . ZADA_DISPLAY = = 0 ) // <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2024-12-27 10:50:32 +03:00
{
if ( control_station . alive_control_station [ CONTROL_STATION_ZADATCHIK_CAN ] )
{
control_station . active_control_station [ CONTROL_STATION_ZADATCHIK_CAN ] = 1 ;
}
else
control_station . active_control_station [ CONTROL_STATION_ZADATCHIK_CAN ] = 0 ;
control_station . active_control_station [ CONTROL_STATION_MPU_KEY_CAN ] = 0 ;
control_station . active_control_station [ CONTROL_STATION_MPU_KEY_RS485 ] = 0 ;
control_station . active_control_station [ CONTROL_STATION_MPU_SVU_CAN ] = 0 ;
control_station . active_control_station [ CONTROL_STATION_MPU_SVU_RS485 ] = 0 ;
control_station . active_control_station [ CONTROL_STATION_VPU_CAN ] = 0 ;
if ( control_station . active_control_station [ CONTROL_STATION_ZADATCHIK_CAN ] = = 0 )
return 1 ; // <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> . <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> !!!
}
else // <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , KEY
{
////////////////////////////
// mpu CAN RS485
////////////////////////////
if ( control_station . alive_control_station [ CONTROL_STATION_MPU_KEY_CAN ] )
{
control_station . active_control_station [ CONTROL_STATION_MPU_KEY_CAN ] = 1 ; // <20> CAN <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> RS485
control_station . active_control_station [ CONTROL_STATION_MPU_KEY_RS485 ] = 0 ;
}
else
{
control_station . active_control_station [ CONTROL_STATION_MPU_KEY_CAN ] = 0 ;
if ( control_station . alive_control_station [ CONTROL_STATION_MPU_KEY_RS485 ] )
control_station . active_control_station [ CONTROL_STATION_MPU_KEY_RS485 ] = 1 ;
else
control_station . active_control_station [ CONTROL_STATION_MPU_KEY_RS485 ] = 0 ;
}
control_station . active_control_station [ CONTROL_STATION_MPU_SVU_CAN ] = 0 ;
control_station . active_control_station [ CONTROL_STATION_MPU_SVU_RS485 ] = 0 ;
control_station . active_control_station [ CONTROL_STATION_ZADATCHIK_CAN ] = 0 ;
control_station . active_control_station [ CONTROL_STATION_VPU_CAN ] = 0 ;
if ( control_station . active_control_station [ CONTROL_STATION_MPU_KEY_CAN ] = = 0 & &
control_station . active_control_station [ CONTROL_STATION_MPU_KEY_RS485 ] = = 0 )
return 1 ; // <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> . <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> !!!
} // end if <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , KEY
} // end if // <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
}
else
{
// <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
// <20> <> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> .<2E> . (edrk.from_ing.bits.LOCAL_REMOUTE == 1) <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD>
control_station . active_control_station [ CONTROL_STATION_MPU_KEY_CAN ] = 0 ;
control_station . active_control_station [ CONTROL_STATION_MPU_KEY_RS485 ] = 0 ;
control_station . active_control_station [ CONTROL_STATION_MPU_SVU_CAN ] = 0 ;
control_station . active_control_station [ CONTROL_STATION_MPU_SVU_RS485 ] = 0 ;
control_station . active_control_station [ CONTROL_STATION_ZADATCHIK_CAN ] = 0 ;
control_station . active_control_station [ CONTROL_STATION_VPU_CAN ] = 0 ;
} // end if REMOUTE on INGETEAM ON
return 0 ;
}