diff --git a/platformio.ini b/platformio.ini index a11d920..8d5873a 100644 --- a/platformio.ini +++ b/platformio.ini @@ -11,7 +11,7 @@ [platformio] -default_envs = PDU_Maverick_Power_TCP ; Select here the name of the configuration you want to download +default_envs = ATS_Eaton_ATC900_RPD_TCP ; Select here the name of the configuration you want to download [env] upload_port = COM50 diff --git a/src/EPMS/ATS/ATS_Eaton_ATC900_RPD_TCP/config.h b/src/EPMS/ATS/ATS_Eaton_ATC900_RPD_TCP/config.h index 867ffca..d5a84a6 100644 --- a/src/EPMS/ATS/ATS_Eaton_ATC900_RPD_TCP/config.h +++ b/src/EPMS/ATS/ATS_Eaton_ATC900_RPD_TCP/config.h @@ -21,10 +21,10 @@ * @{ */ #include - const char *ssid = "wifi_ssid"; /**< @brief The SSID of the WiFi network. */ - const char *password = "wifi_password"; /**< @brief The password for the WiFi network. */ - IPAddress local_IP(192, 168, 1, 15); /**< @brief The static IP address for the device. */ - IPAddress gateway(192, 168, 1, 1); /**< @brief The gateway IP address. */ + 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, 169); /**< @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; diff --git a/src/EPMS/ATS/ATS_Woodward_DTSC200A_TCP/State_Running.cpp b/src/EPMS/ATS/ATS_Woodward_DTSC200A_TCP/State_Running.cpp index 1ea1b5f..1378e38 100644 --- a/src/EPMS/ATS/ATS_Woodward_DTSC200A_TCP/State_Running.cpp +++ b/src/EPMS/ATS/ATS_Woodward_DTSC200A_TCP/State_Running.cpp @@ -39,9 +39,9 @@ template<> RunningState::RunningState() { - addStrategy("S2 Volts AB", new SingleValueStrategy(480.0F, 2.0f, 1000)); - addStrategy("S2 Volts BC", new SingleValueStrategy(480.0F, 2.0f, 1000)); - addStrategy("S2 Volts CA", new SingleValueStrategy(480.0F, 2.0f, 1000)); + addStrategy("S2 Volts AB", new SingleValueStrategy(4800.0F, 2.0f, 1000)); + addStrategy("S2 Volts BC", new SingleValueStrategy(4800.0F, 2.0f, 1000)); + addStrategy("S2 Volts CA", new SingleValueStrategy(4800.0F, 2.0f, 1000)); addStrategy("PF", new SingleValueStrategy(90.0f, 2.0f, 1000)); @@ -76,9 +76,9 @@ State* RunningState::update(Equipment* equipment) float volts_BC = getPointValue(equipment, "S2 Volts BC"); float volts_AC = getPointValue(equipment, "S2 Volts CA"); - setPointValue(equipment, "S2 Volts AN", volts_AB/1.732); - setPointValue(equipment, "S2 Volts BN", volts_BC/1.732); - setPointValue(equipment, "S2 Volts CN", volts_AC/1.732); + setPointValue(equipment, "S2 Volts AN", volts_AB/17.32); + setPointValue(equipment, "S2 Volts BN", volts_BC/17.32); + setPointValue(equipment, "S2 Volts CN", volts_AC/17.32); int I_load = getPointValue(equipment, "ATS_Load"); int I_rating = getPointValue(equipment, "ATS_Rating"); @@ -129,6 +129,8 @@ void RunningState::enterState(Equipment* equipment) { setPointValue(equipment, "S1 Amps A", 0.0f); setPointValue(equipment, "S1 Amps B", 0.0f); setPointValue(equipment, "S1 Amps C", 0.0f); + setBitValue(equipment, "Source Active", 3, true); + setBitValue(equipment, "Source Active", 4, false); } /** diff --git a/src/EPMS/ATS/ATS_Woodward_DTSC200A_TCP/State_Standby.cpp b/src/EPMS/ATS/ATS_Woodward_DTSC200A_TCP/State_Standby.cpp index eadd167..f57063c 100644 --- a/src/EPMS/ATS/ATS_Woodward_DTSC200A_TCP/State_Standby.cpp +++ b/src/EPMS/ATS/ATS_Woodward_DTSC200A_TCP/State_Standby.cpp @@ -121,6 +121,9 @@ void StandbyState::enterState(Equipment* equipment) { setPointValue(equipment, "S2 Amps A", 0.0f); setPointValue(equipment, "S2 Amps B", 0.0f); setPointValue(equipment, "S2 Amps C", 0.0f); + + setBitValue(equipment, "Source Active", 3, false); + setBitValue(equipment, "Source Active", 4, true); } /** diff --git a/src/EPMS/ATS/ATS_Woodward_DTSC200A_TCP/config.h b/src/EPMS/ATS/ATS_Woodward_DTSC200A_TCP/config.h index 88f51c0..6a14e99 100644 --- a/src/EPMS/ATS/ATS_Woodward_DTSC200A_TCP/config.h +++ b/src/EPMS/ATS/ATS_Woodward_DTSC200A_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, 241); /**< @brief The static IP address for the device. */ + IPAddress local_IP(172, 17, 33, 173); /**< @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. */ diff --git a/src/EPMS/PDU/PDU_Maverick_Power_TCP/State_Running.cpp b/src/EPMS/PDU/PDU_Maverick_Power_TCP/State_Running.cpp index df33296..fe6aa68 100644 --- a/src/EPMS/PDU/PDU_Maverick_Power_TCP/State_Running.cpp +++ b/src/EPMS/PDU/PDU_Maverick_Power_TCP/State_Running.cpp @@ -224,8 +224,15 @@ State* RunningState::update(Equipment* equipment) tag = ""; tag = cb + "_L3KVar"; setPointValue(equipment, tag, total_load * 1715.0f * 0.9f); - - + tag = ""; + tag = cb + "_L1KVA"; + setPointValue(equipment, tag, total_load * 1715.0f); + tag = ""; + tag = cb + "_L2KVA"; + setPointValue(equipment, tag, total_load * 1715.0f); + tag = ""; + tag = cb + "_L3KVA"; + setPointValue(equipment, tag, total_load * 1715.0f); } else{ if (cb_status == 2.0f){ @@ -295,9 +302,49 @@ State* RunningState::update(Equipment* equipment) tag = ""; tag = cb + "_L3KVar"; setPointValue(equipment, tag, total_load*0.0f); + tag = ""; + tag = cb + "_L1KVA"; + setPointValue(equipment, tag, 0.0f); + tag = ""; + tag = cb + "_L2KVA"; + setPointValue(equipment, tag, 0.0f); + tag = ""; + tag = cb + "_L3KVA"; + setPointValue(equipment, tag, 0.0f); } cb_num++; + + float kw1 = getPointValue(equipment, cb + "_L1KW"); + float kw2 = getPointValue(equipment, cb + "_L2KW"); + float kw3 = getPointValue(equipment, cb + "_L3KW"); + tag = ""; + tag = cb + "_TotalKW"; + setPointValue(equipment, tag, kw1 + kw2 + kw3); + + float kvar1 = getPointValue(equipment, cb + "_L1KVar"); + float kvar2 = getPointValue(equipment, cb + "_L2KVar"); + float kvar3 = getPointValue(equipment, cb + "_L3KVar"); + tag = ""; + tag = cb + "_TotalKVar"; + setPointValue(equipment, tag, kvar1 + kvar2 + kvar3); + + float kva1 = getPointValue(equipment, cb + "_L1KVA"); + float kva2 = getPointValue(equipment, cb + "_L2KVA"); + float kva3 = getPointValue(equipment, cb + "_L3KVA"); + tag = ""; + tag = cb + "_TotalKVA"; + setPointValue(equipment, tag, kvar1 + kva2 + kva3); + + float pf1 = getPointValue(equipment, cb + "_L1PF"); + float pf2 = getPointValue(equipment, cb + "_L2PF"); + float pf3 = getPointValue(equipment, cb + "_L3PF"); + float total_pf = (pf1 + pf2 + pf3) / 3.0f; + tag = ""; + tag = cb + "_TotalPF"; + setPointValue(equipment, tag, total_pf); } + + // Apply any strategies defined for the standby state _applyStrategies(equipment); return nullptr; diff --git a/src/EPMS/PDU/PDU_Maverick_Power_TCP/config.h b/src/EPMS/PDU/PDU_Maverick_Power_TCP/config.h index 3bb5f0c..57a6fce 100644 --- a/src/EPMS/PDU/PDU_Maverick_Power_TCP/config.h +++ b/src/EPMS/PDU/PDU_Maverick_Power_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, 181); /**< @brief The static IP address for the device. */ + IPAddress local_IP(172, 17, 33, 178); /**< @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. */ @@ -113,7 +113,7 @@ modbusMap mb_map[] = { {IR_LONG, 64, 0, "CB0_V31" }, {IR_LONG, 66, 0, "CB0_TotalKW" }, {IR_LONG, 68, 0, "CB0_TotalKVar" }, - {IR_LONG, 70, 0, "CB0_TotalKVA" }, + {IR_LONG, 70, 0, "CB0_TotalKVA" }, // {IR_LONG, 72, 0, "CB0_TotalPF" }, {IR_LONG, 74, 0, "CB0_TotalPFLag" }, {IR_LONG, 76, 0, "CB0_TotalPFLead" }, @@ -563,8 +563,8 @@ modbusMap mb_map[] = { {IR_FLOAT, 1087, 0, "kWh" }, {IR_FLOAT, 1091, 0, "PF" }, - {IR, 1150, 0, "CB_Status" }, - {IR, 1151, 0, "CB_Tripped" }, + {IR, 1550, 0, "CB_Status" }, + {IR, 1551, 0, "CB_Tripped" }, }; //Size of modbus map used in FOR cycles, automatically calculated.