LIBABBAURORA  v0.2.2
A C++ library for the ABB Aurora protocol used by inverters and other devices
ABBAurora Class Reference

Communication protocol between host and supervisor microprocessor. More...

#include <ABBAurora.h>

Data Structures

struct  FirmwareRelease
 
struct  LastFourAlarms
 Data structure for last four alarms command. More...
 
struct  ManufacturingDate
 
struct  State
 Data structure for ReadState() More...
 
struct  TimeDate
 Data structure for time/date reading command. More...
 
struct  Version
 Data structure for version reading command. More...
 

Public Member Functions

 ABBAurora (void)
 Default class constructor. More...
 
 ABBAurora (const unsigned char &addr)
 Overloaded class constructor. More...
 
 ~ABBAurora (void)
 Default class destructor. More...
 
void SetLogLevel (const unsigned char &log_level)
 Set log level. More...
 
bool Setup (const std::string &device, const speed_t baudrate=B19200)
 Setup serial device communication. More...
 
void SetAddress (const unsigned char &addr)
 Set serial device address. More...
 
unsigned char GetAddress (void) const
 Get serial device address. More...
 
std::string GetErrorMessage (void) const
 Get error message. More...
 
Inverter commands
bool ReadState (State &state)
 Read system state. More...
 
bool ReadPartNumber (std::string &pn)
 Read system P/N. More...
 
bool ReadVersion (Version &version)
 Read version. More...
 
bool ReadDspValue (float &value, const DspValueEnum &type, const DspGlobalEnum &global=DspGlobalEnum::MODULE_MEASUREMENT)
 Measure request to the DSP. More...
 
bool ReadSerialNumber (std::string &sn)
 Read serial number. More...
 
bool ReadManufacturingDate (ManufacturingDate &date)
 Read manufacturing date. More...
 
bool ReadTimeDate (TimeDate &date)
 Read inverter date. More...
 
bool ReadFirmwareRelease (FirmwareRelease &firmware)
 Read firmware release. More...
 
bool ReadCumulatedEnergy (float &cum_energy, const CumulatedEnergyEnum &period)
 Read cumulated energy. More...
 
bool ReadLastFourAlarms (LastFourAlarms &alarms)
 Read last four alarms. More...
 

Private Member Functions

bool Send (SendCommandEnum cmd, uint8_t b2, uint8_t b3, uint8_t b4, uint8_t b5, uint8_t b6, uint8_t b7)
 Send command. More...
 
long int GetGmtOffset (void)
 Get GMT offset. More...
 

Private Attributes

ABBAuroraSerialSerial
 Serial object which handles the communication with the device.
 
unsigned char Address
 Address of the serial device.
 
unsigned char Log
 Log level.
 
uint8_t * ReceiveData
 Array to hold the answer from the device.
 
std::string ErrorMessage
 String which holds the possible error message.
 

Static Private Attributes

static const int SendBufferSize = 10
 Fixed send buffer size (8 bytes)
 
static const int ReceiveBufferSize = 8
 Fixed receive buffer size (10 bytes)
 
static const time_t InverterEpoch = 946684800
 Seconds since midnight of January 1, 2000.
 

Detailed Description

Communication protocol between host and supervisor microprocessor.

The communication between host and processor works via a serial interface RS485 or RS232.

Configuration parameters in both cases are:

  • 19200 baud (default value)
  • 1 stop bit
  • no parity

If the device has a RS485 interface, the default serial bus address is 2.

Author
Alexander Pohl alex@.nosp@m.ahpo.nosp@m.hl.co.nosp@m.m
Examples:
example_alarms.cpp, example_cumulated.cpp, example_daemon.cpp, example_dsp.cpp, example_inverter.cpp, and example_state.cpp.

Constructor & Destructor Documentation

ABBAurora::ABBAurora ( void  )

Default class constructor.

Initialises the class object with the default bus address

ABBAurora::ABBAurora ( const unsigned char &  addr)

Overloaded class constructor.

Initialises the class object with a custom bus address

Parameters
addrRS485 device address, range 2-63
ABBAurora::~ABBAurora ( void  )

Default class destructor.

Closes the serial port and destroys the class object.

Member Function Documentation

unsigned char ABBAurora::GetAddress ( void  ) const

Get serial device address.

Returns
Current RS485 serial device address
std::string ABBAurora::GetErrorMessage ( void  ) const

Get error message.

Returns
Error message
long int ABBAurora::GetGmtOffset ( void  )
private

Get GMT offset.

Method which returns the current offset to GMT [in seconds]

bool ABBAurora::ReadCumulatedEnergy ( float &  cum_energy,
const CumulatedEnergyEnum period 
)

Read cumulated energy.

Reads the cumumlated energy (Aurora grid-tied inverters only)

Parameters
cum_energyCumulated energy
periodEnergy period
bool ABBAurora::ReadDspValue ( float &  value,
const DspValueEnum type,
const DspGlobalEnum global = DspGlobalEnum::MODULE_MEASUREMENT 
)

Measure request to the DSP.

Sends a request to measure voltage, current, power etc.

Parameters
valueDSP value
typeThe value to read
globalOptional scope parameter
bool ABBAurora::ReadFirmwareRelease ( ABBAurora::FirmwareRelease firmware)

Read firmware release.

Reads the firmware release. For Aurora grid-tied inverters you will read always the MCU firmware version (the field var is not interpreted)

Parameters
firmwareFirmware release
bool ABBAurora::ReadLastFourAlarms ( ABBAurora::LastFourAlarms alarms)

Read last four alarms.

The command returns the codes of the last four alarms in form of a FIFO queue from the first to the last one. When this command is used the queue is emptied.

Parameters
alarmsLast four alarms
bool ABBAurora::ReadManufacturingDate ( ABBAurora::ManufacturingDate date)

Read manufacturing date.

Reads the Manufacturing week and year (Aurora inverters)

Parameters
dateManufacturing date
bool ABBAurora::ReadPartNumber ( std::string &  pn)

Read system P/N.

Reads the part number (only Aurora inverters). No information on transmission and global state is returned.

Parameters
pnInverter part number
bool ABBAurora::ReadSerialNumber ( std::string &  sn)

Read serial number.

Reads the system serial number (Aurora inverters). No information on transmission and global state is returned.

Parameters
snSerial number
bool ABBAurora::ReadState ( ABBAurora::State state)

Read system state.

Ask the state of the system modules

Parameters
stateState of the system
bool ABBAurora::ReadTimeDate ( ABBAurora::TimeDate date)

Read inverter date.

Reads the time and date from the inverter, with one second accuracy

Parameters
dateInverter date
bool ABBAurora::ReadVersion ( ABBAurora::Version version)

Read version.

Reads the version (Indoor/Outdoor, Europe/America, available only for FW version 1.0.9 and following)

Parameters
versionInverter version
bool ABBAurora::Send ( SendCommandEnum  cmd,
uint8_t  b2,
uint8_t  b3,
uint8_t  b4,
uint8_t  b5,
uint8_t  b6,
uint8_t  b7 
)
private

Send command.

Method for sending a command to the device. The communication protocol uses fixed length transmission messages (8 bytes + 2 bytes for checksum). The structure of the answer also has fixed length (6 bytes + 2 bytes for checksum).

Parameters
cmdThe command to send
b2,b3,b4,b5,b6,b7Remaining bytes of the transmission message
void ABBAurora::SetAddress ( const unsigned char &  addr)

Set serial device address.

Sets a new RS485 serial device address

Parameters
addrRS485 device address, range 2-63
void ABBAurora::SetLogLevel ( const unsigned char &  log_level)

Set log level.

Set log level of the ABBAurora class.

Parameters
log_levellog level
bool ABBAurora::Setup ( const std::string &  device,
const speed_t  baudrate = B19200 
)

Setup serial device communication.

Opens the host serial device and sets the communication parameters.

Supported baud rates:

  • 19200 baud (default)
  • 9600 baud
  • 4800 baud
  • 2400 baud
Parameters
deviceSerial device, i.e. /dev/ttyUSB0
baudrateOptional baud rate

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