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 | |
ABBAuroraSerial * | Serial |
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. | |
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:
If the device has a RS485 interface, the default serial bus address is 2.
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
addr | RS485 device address, range 2-63 |
ABBAurora::~ABBAurora | ( | void | ) |
Default class destructor.
Closes the serial port and destroys the class object.
unsigned char ABBAurora::GetAddress | ( | void | ) | const |
Get serial device address.
std::string ABBAurora::GetErrorMessage | ( | void | ) | const |
Get error message.
|
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)
cum_energy | Cumulated energy |
period | Energy 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.
value | DSP value |
type | The value to read |
global | Optional 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)
firmware | Firmware 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.
alarms | Last four alarms |
bool ABBAurora::ReadManufacturingDate | ( | ABBAurora::ManufacturingDate & | date | ) |
Read manufacturing date.
Reads the Manufacturing week and year (Aurora inverters)
date | Manufacturing 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.
pn | Inverter 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.
sn | Serial number |
bool ABBAurora::ReadState | ( | ABBAurora::State & | state | ) |
bool ABBAurora::ReadTimeDate | ( | ABBAurora::TimeDate & | date | ) |
Read inverter date.
Reads the time and date from the inverter, with one second accuracy
date | Inverter 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)
version | Inverter version |
|
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).
cmd | The command to send |
b2,b3,b4,b5,b6,b7 | Remaining bytes of the transmission message |
void ABBAurora::SetAddress | ( | const unsigned char & | addr | ) |
Set serial device address.
Sets a new RS485 serial device address
addr | RS485 device address, range 2-63 |
void ABBAurora::SetLogLevel | ( | const unsigned char & | log_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:
device | Serial device, i.e. /dev/ttyUSB0 |
baudrate | Optional baud rate |