LIBSUNSPEC  v0.1.6
A C++ library for the SunSpec protocol
InverterModel Class Reference

Class to manipulate Inverter Model registers. More...

#include <InverterModel.h>

Inheritance diagram for InverterModel:
SunSpec StateEvents FroniusInverter

Public Member Functions

bool IsInverterRegisterMap (void)
 
bool GetAcCurrent (double &res)
 
bool GetAcCurrentPhase (double &res, const char &ph= 'A')
 
bool GetAcVoltage (double &res, const char &ph= 'A')
 
bool GetAcVoltagePhaseToPhase (double &res, const std::string &ph_pair)
 
bool GetAcPower (double &res)
 
bool GetAcFrequency (double &res)
 
bool GetAcPowerApparent (double &res)
 
bool GetAcPowerReactive (double &res)
 
bool GetAcPowerFactor (double &res)
 
bool GetAcEnergyLifetime (double &res)
 
bool GetStateEvtFlags (StateEvt_t &state_evt)
 
- Public Member Functions inherited from SunSpec
 SunSpec (void)
 
virtual ~SunSpec (void)
 
std::string GetErrorMessage (void) const
 
bool ConnectModbusTcp (const std::string &node, const std::string &service="502")
 
bool ConnectModbusRtu (const std::string &device, const int &baud_rate=9600)
 
void SetModbusDebug (const bool &debug)
 
bool SetModbusAddress (const int &slave_id=1)
 
bool GetModbusAddress (int &slave_id)
 
bool SetResponseTimeout (const int &millis=500)
 
bool GetResponseTimeout (int &millis)
 
bool SetByteTimeout (const int &millis=500)
 
bool GetByteTimeout (int &millis)
 
bool SetIndicationTimeout (const int &millis=0)
 
bool GetIndicationTimeout (int &millis)
 
bool SetErrorRecovery (const bool recovery)
 
template<>
std::string ConvertRegister (const uint16_t *tab_reg, const uint16_t &size)
 
template<>
float ConvertRegister (const uint16_t *tab_reg, const uint16_t &size)
 

Private Member Functions

bool ReadState (uint16_t &state)
 
bool ReadStateVendor (uint16_t &state)
 
bool ReadEventFlags (uint32_t &flag1, uint32_t &flag2)
 
bool ReadEventFlagsVendor (uint32_t &flag1, uint32_t &flag2, uint32_t &flag3, uint32_t &flag4)
 

Additional Inherited Members

- Protected Member Functions inherited from SunSpec
template<typename T >
bool GetRegister (T &res, const uint16_t &reg_addr, const uint16_t &size)
 
bool SetRegister (const uint16_t &value, const uint16_t &reg_addr)
 
- Protected Member Functions inherited from StateEvents
bool SetStateEventsStr (StateEvt_t &state_evt)
 
- Protected Attributes inherited from SunSpec
std::string ErrorMessage
 
- Protected Attributes inherited from StateEvents
std::string ErrorStr
 

Detailed Description

Class to manipulate Inverter Model registers.

Author
Alexander Pohl alex@.nosp@m.ahpo.nosp@m.hl.co.nosp@m.m

Member Function Documentation

bool InverterModel::GetAcCurrent ( double &  res)

AC total current [A]

bool InverterModel::GetAcCurrentPhase ( double &  res,
const char &  ph = 'A' 
)

AC phase current

param res current [A] param ph phase A, B or C (default A)

bool InverterModel::GetAcEnergyLifetime ( double &  res)

AC lifetime energy production [Wh]

bool InverterModel::GetAcFrequency ( double &  res)

AC frequency value [Hz]

bool InverterModel::GetAcPower ( double &  res)

AC power value [W]

bool InverterModel::GetAcPowerApparent ( double &  res)

Apparent power [VA]

bool InverterModel::GetAcPowerFactor ( double &  res)

Power factor [%]

bool InverterModel::GetAcPowerReactive ( double &  res)

Reactive power [VAr]

bool InverterModel::GetAcVoltage ( double &  res,
const char &  ph = 'A' 
)

AC voltage phase-to-neutral

param res voltage [V] param ph phase A, B or C (default A)

bool InverterModel::GetAcVoltagePhaseToPhase ( double &  res,
const std::string &  ph_pair 
)

AC phase-to-phase voltage

param res voltage [V] param ph_pair phase AB, BC or CA

bool InverterModel::GetStateEvtFlags ( StateEvt_t state_evt)

Read all state and event flags

bool InverterModel::IsInverterRegisterMap ( void  )

Checks if device has a SunSpec inverter register map

bool InverterModel::ReadEventFlags ( uint32_t &  flag1,
uint32_t &  flag2 
)
private

Read inverter event flags

bool InverterModel::ReadEventFlagsVendor ( uint32_t &  flag1,
uint32_t &  flag2,
uint32_t &  flag3,
uint32_t &  flag4 
)
private

Read vendor inverter event flags

bool InverterModel::ReadState ( uint16_t &  state)
private

Read inverter operating state

bool InverterModel::ReadStateVendor ( uint16_t &  state)
private

Read vendor inverter operating state


The documentation for this class was generated from the following file: