Fixed MODBUS and seneca drivers, added partial counter reset
This commit is contained in:
@@ -11,24 +11,28 @@ namespace drivers
|
||||
private:
|
||||
const uint8_t maxRetries = 5;
|
||||
const uint8_t dataWords = 2;
|
||||
const uint16_t minDelay = 500;
|
||||
|
||||
const uint16_t REG_V = 0x100C;
|
||||
const uint16_t REG_A = 0x1016;
|
||||
const uint16_t REG_Pact = 0x1026;
|
||||
const uint16_t REG_Papp = 0x102E;
|
||||
const uint16_t REG_Prea = 0x1036;
|
||||
const uint16_t REG_Freq = 0x1036;
|
||||
const uint16_t REG_Freq = 0x1038;
|
||||
const uint16_t REG_WhTot = 0x1106;
|
||||
const uint16_t REG_WhPart = 0x1400;
|
||||
const uint16_t REG_Serial = 0x0500;
|
||||
const uint16_t REG_Regset = 0x0538;
|
||||
const uint16_t REG_TotCount = 0x0516;
|
||||
const uint16_t REG_PartCount = 0x0517;
|
||||
const uint16_t REG_PartCount = 0x0526;
|
||||
|
||||
typedef union
|
||||
{
|
||||
float_t f;
|
||||
uint16_t hi;
|
||||
uint16_t lo;
|
||||
struct
|
||||
{
|
||||
uint16_t hi;
|
||||
uint16_t lo;
|
||||
} words;
|
||||
} floatval_t;
|
||||
|
||||
public:
|
||||
@@ -59,14 +63,18 @@ namespace drivers
|
||||
const float_t getWhTot();
|
||||
const float_t getWhPar();
|
||||
|
||||
void resetTotalCounters();
|
||||
const uint8_t getRegset();
|
||||
const uint16_t getCounterStatus();
|
||||
|
||||
void resetPartialCounters();
|
||||
|
||||
private:
|
||||
void delayRequest();
|
||||
float_t readFloatReg(const uint16_t reg);
|
||||
|
||||
private:
|
||||
const uint8_t m_address;
|
||||
drivers::MODBUS &m_bus;
|
||||
uint64_t m_lastRequest = 0;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user