From 0eaa0232e959a6e003136957bfda5ddcf852ec7c Mon Sep 17 00:00:00 2001 From: Emmanuel HC Date: Mon, 27 Oct 2025 18:26:08 -0500 Subject: [PATCH] s --- src/EPMS/Breaker/BKR_ABB_XT_TCP/State_Running.cpp | 12 ++++++------ src/EPMS/Breaker/BKR_ABB_XT_TCP/State_Standby.cpp | 6 +++--- src/EPMS/Breaker/BKR_ABB_XT_TCP/config.h | 4 ++-- src/EPMS/Breaker/BKR_Susol_ACB_TCP/config.h | 3 ++- src/EPMS/Breaker/Susol_Smart_MCCB_TCP/config.h | 2 +- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/EPMS/Breaker/BKR_ABB_XT_TCP/State_Running.cpp b/src/EPMS/Breaker/BKR_ABB_XT_TCP/State_Running.cpp index 54fbf46..e044cb4 100644 --- a/src/EPMS/Breaker/BKR_ABB_XT_TCP/State_Running.cpp +++ b/src/EPMS/Breaker/BKR_ABB_XT_TCP/State_Running.cpp @@ -66,12 +66,11 @@ template<> State* RunningState::update(Equipment* equipment) { // STATE control, add conditions if change to a different state is needed Serial.println("Running update function"); - Serial.println("Running update function"); float State_Ctrl = getPointValue(equipment, "State Control"); - if (State_Ctrl == 0){ + if (State_Ctrl == 0.0f){ return new StandbyState(); } - if (State_Ctrl == 2){ + if (State_Ctrl == 2.0f){ return new StandbyState(); } // Apply any strategies defined for the standby state @@ -98,8 +97,8 @@ State* RunningState::update(Equipment* equipment) float pf = getPointValue(equipment, "PF"); - float kva = (1.732f * ((volts_AB + volts_BC + volts_AC)/4.0f) * real_load * (pf/100.0f))/100.0f; - float kw = (1.732f * ((volts_AB + volts_BC + volts_AC)/4.0f) * real_load )/100.0f; + float kva = (1.732f * ((volts_AB + volts_BC + volts_AC)/4.0f) * real_load * (pf/100.0f))/100000.0f; + float kw = (1.732f * ((volts_AB + volts_BC + volts_AC)/4.0f) * real_load )/10000.0f; setPointValue(equipment, "kW", kw); setPointValue(equipment, "kVA", kva); @@ -119,7 +118,8 @@ void RunningState::enterState(Equipment* equipment) { // Logic to run when the equipment enters this state Serial.println("Enter Running State..."); // You could also update a Modbus register to show the "standby" state - setBitValue(equipment, "CB Position", 1, true); + setBitValue(equipment, "CB Position", 0, true); + setBitValue(equipment, "CB Position", 12, false); } /** diff --git a/src/EPMS/Breaker/BKR_ABB_XT_TCP/State_Standby.cpp b/src/EPMS/Breaker/BKR_ABB_XT_TCP/State_Standby.cpp index ab732df..7d19437 100644 --- a/src/EPMS/Breaker/BKR_ABB_XT_TCP/State_Standby.cpp +++ b/src/EPMS/Breaker/BKR_ABB_XT_TCP/State_Standby.cpp @@ -57,14 +57,14 @@ State* StandbyState::update(Equipment* equipment) // STATE control, add conditions if change to a different state is needed Serial.println("Standby update function"); float State_Ctrl = getPointValue(equipment, "State Control"); - if (State_Ctrl == 1){ + if (State_Ctrl == 1.0f){ return new RunningState(); } - if (State_Ctrl == 0){ + if (State_Ctrl == 0.0f){ setBitValue(equipment, "CB Position", 12, false); } - if (State_Ctrl == 2){ + if (State_Ctrl == 2.0f){ setBitValue(equipment, "CB Position", 12, true); } // Apply any strategies defined for the standby state diff --git a/src/EPMS/Breaker/BKR_ABB_XT_TCP/config.h b/src/EPMS/Breaker/BKR_ABB_XT_TCP/config.h index 018a5ed..b77bc05 100644 --- a/src/EPMS/Breaker/BKR_ABB_XT_TCP/config.h +++ b/src/EPMS/Breaker/BKR_ABB_XT_TCP/config.h @@ -23,7 +23,7 @@ #include const char *ssid = "QTS_CDR_Arduino"; /**< @brief The SSID of the WiFi network. */ const char *password = "123abc456"; /**< @brief The password for the WiFi network. */ - IPAddress local_IP(172, 17, 33, 150); /**< @brief The static IP address for the device. */ + IPAddress local_IP(172, 17, 33, 154); /**< @brief The static IP address for the device. */ IPAddress gateway(172, 17, 33, 1); /**< @brief The gateway IP address. */ IPAddress subnet(255, 255, 255, 0); /**< @brief The subnet mask. */ @@ -63,7 +63,7 @@ modbusMap mb_map[] = {HR, 9, 0, "State Control"}, //Open-Close Cmd {HR, 10, 0, "Load"}, //Adjustble Load {HR, 11, 0, "Rating"}, //Max amp to calculate kw, kVA, etc - {IR_LONG, 41, 0, "CB Position"}, //b0 close open b12 tripped + {IR, 41, 0, "CB Position"}, //b0 close open b12 tripped {IR_LONG, 101, 0, "Amps A"}, {IR_LONG, 103, 0, "Amps B"}, {IR_LONG, 105, 0, "Amps C"}, diff --git a/src/EPMS/Breaker/BKR_Susol_ACB_TCP/config.h b/src/EPMS/Breaker/BKR_Susol_ACB_TCP/config.h index 2ee81ea..89915d8 100644 --- a/src/EPMS/Breaker/BKR_Susol_ACB_TCP/config.h +++ b/src/EPMS/Breaker/BKR_Susol_ACB_TCP/config.h @@ -64,11 +64,12 @@ modbusMap mb_map[] = {HR, 10, 0, "Load"}, {HR, 11, 0, "Rating"}, - {IR, 2, 0, "Status"}, + {IR, 2, 0, "Status"}, //bit 2 open-close, {IR, 3, 0, "Amps A"}, {IR, 5, 0, "Amps B"}, {IR, 7, 0, "Amps C"}, {IR, 9, 0, "Amps N"}, + {IR, 13, 0, "Tripped"}, //bit 0 tripped }; //Size of modbus map used in FOR cycles, automatically calculated. diff --git a/src/EPMS/Breaker/Susol_Smart_MCCB_TCP/config.h b/src/EPMS/Breaker/Susol_Smart_MCCB_TCP/config.h index 07b7b0b..5d19823 100644 --- a/src/EPMS/Breaker/Susol_Smart_MCCB_TCP/config.h +++ b/src/EPMS/Breaker/Susol_Smart_MCCB_TCP/config.h @@ -64,7 +64,7 @@ modbusMap mb_map[] = {HR, 10, 0, "Load"}, {HR, 11, 0, "Rating"}, - {IR, 207, 0, "CB Position"}, + {IR, 207, 0, "CB Position"}, //bit 9 tripp bit 12 open closed {IR_FLOAT, 215, 0, "Amps A"}, {IR_FLOAT, 217, 0, "Amps B"}, {IR_FLOAT, 219, 0, "Amps C"},