Susol Smart MCCB TCP modbus map fixed
This commit is contained in:
@@ -86,9 +86,13 @@ State<ModbusIP>* RunningState<ModbusIP>::update(Equipment<ModbusIP>* equipment)
|
||||
float load = static_cast<float>(I_load);
|
||||
float rating = static_cast<float>(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<SingleValueStrategy*>(ampsA_svs)->setSetpoint(real_load);
|
||||
static_cast<SingleValueStrategy*>(ampsB_svs)->setSetpoint(real_load);
|
||||
static_cast<SingleValueStrategy*>(ampsC_svs)->setSetpoint(real_load);
|
||||
|
||||
float pf = getPointValue(equipment, "PF");
|
||||
|
||||
@@ -112,7 +116,7 @@ void RunningState<ModbusIP>::enterState(Equipment<ModbusIP>* 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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
#include <ModbusIP_ESP8266.h>
|
||||
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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user