From 2b7b5d960312dd04048aec45e5781bd7158b7a10 Mon Sep 17 00:00:00 2001 From: Emmanuel HC Date: Wed, 1 Oct 2025 11:21:57 -0500 Subject: [PATCH] Susol Smart MCCB TCP modbus map fixed --- platformio.ini | 2 +- .../Susol_Smart_MCCB_TCP/State_Running.cpp | 12 ++++-- .../Breaker/Susol_Smart_MCCB_TCP/config.h | 38 +++++++++---------- 3 files changed, 28 insertions(+), 24 deletions(-) diff --git a/platformio.ini b/platformio.ini index 7c8e53d..2b2f592 100644 --- a/platformio.ini +++ b/platformio.ini @@ -9,7 +9,7 @@ ; https://docs.platformio.org/page/projectconf.html [platformio] -default_envs = PQM_PM9000_TCP ; Select here the name of the configuration you want to download +default_envs = Susol_Smart_MCCB_TCP ; Select here the name of the configuration you want to download [env] upload_port = COM15 diff --git a/src/EPMS/Breaker/Susol_Smart_MCCB_TCP/State_Running.cpp b/src/EPMS/Breaker/Susol_Smart_MCCB_TCP/State_Running.cpp index 9b74838..387ac71 100644 --- a/src/EPMS/Breaker/Susol_Smart_MCCB_TCP/State_Running.cpp +++ b/src/EPMS/Breaker/Susol_Smart_MCCB_TCP/State_Running.cpp @@ -86,9 +86,13 @@ State* RunningState::update(Equipment* equipment) float load = static_cast(I_load); float rating = static_cast(I_rating); float real_load = rating * (load/100.0f); - setPointValue(equipment, "Amps A", real_load); - setPointValue(equipment, "Amps B", real_load); - setPointValue(equipment, "Amps C", real_load); + Strategy_Behavior* ampsA_svs = getStrategy("Amps A"); + Strategy_Behavior* ampsB_svs = getStrategy("Amps B"); + Strategy_Behavior* ampsC_svs = getStrategy("Amps C"); + + static_cast(ampsA_svs)->setSetpoint(real_load); + static_cast(ampsB_svs)->setSetpoint(real_load); + static_cast(ampsC_svs)->setSetpoint(real_load); float pf = getPointValue(equipment, "PF"); @@ -112,7 +116,7 @@ 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 - setPointValue(equipment, "CB Position", 2048); + setPointValue(equipment, "CB Position", 4096); } diff --git a/src/EPMS/Breaker/Susol_Smart_MCCB_TCP/config.h b/src/EPMS/Breaker/Susol_Smart_MCCB_TCP/config.h index 3847027..07b7b0b 100644 --- a/src/EPMS/Breaker/Susol_Smart_MCCB_TCP/config.h +++ b/src/EPMS/Breaker/Susol_Smart_MCCB_TCP/config.h @@ -23,8 +23,8 @@ #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, 30, 241); /**< @brief The static IP address for the device. */ - IPAddress gateway(172, 17, 30, 1); /**< @brief The gateway IP address. */ + IPAddress local_IP(172, 17, 33, 132); /**< @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. */ ModbusIP mb; @@ -64,23 +64,23 @@ modbusMap mb_map[] = {HR, 10, 0, "Load"}, {HR, 11, 0, "Rating"}, - {IR, 206, 0, "CB Position"}, - {IR_FLOAT, 214, 0, "Amps A"}, - {IR_FLOAT, 216, 0, "Amps B"}, - {IR_FLOAT, 218, 0, "Amps C"}, - {IR_FLOAT, 220, 0, "Amps N"}, - {IR_FLOAT, 222, 0, "Amps G"}, - {IR_FLOAT, 230, 0, "Volts AN"}, - {IR_FLOAT, 231, 0, "Volts BN"}, - {IR_FLOAT, 234, 0, "Volts CN"}, - {IR_FLOAT, 236, 0, "Volts AB"}, - {IR_FLOAT, 238, 0, "Volts BC"}, - {IR_FLOAT, 240, 0, "Volts CA"}, - {IR_FLOAT, 248, 0, "PF"}, - {IR_FLOAT, 250, 0, "kW"}, - {IR_FLOAT, 254, 0, "kVA"}, - {IR_FLOAT, 264, 0, "kWh reg1"}, - {IR_FLOAT, 266, 0, "kWh reg2"}, + {IR, 207, 0, "CB Position"}, + {IR_FLOAT, 215, 0, "Amps A"}, + {IR_FLOAT, 217, 0, "Amps B"}, + {IR_FLOAT, 219, 0, "Amps C"}, + {IR_FLOAT, 221, 0, "Amps N"}, + {IR_FLOAT, 223, 0, "Amps G"}, + {IR_FLOAT, 231, 0, "Volts AN"}, + {IR_FLOAT, 233, 0, "Volts BN"}, + {IR_FLOAT, 235, 0, "Volts CN"}, + {IR_FLOAT, 237, 0, "Volts AB"}, + {IR_FLOAT, 239, 0, "Volts BC"}, + {IR_FLOAT, 241, 0, "Volts CA"}, + {IR_FLOAT, 249, 0, "PF"}, + {IR_FLOAT, 251, 0, "kW"}, + {IR_FLOAT, 255, 0, "kVA"}, + {IR_FLOAT, 265, 0, "kWh reg1"}, + {IR_FLOAT, 267, 0, "kWh reg2"}, }; //Size of modbus map used in FOR cycles, automatically calculated.