From 7dd7a2ba85d56af3f11728d257dca93ab522af91 Mon Sep 17 00:00:00 2001 From: "Alexander Pohl (via Travis CI)" Date: Sun, 20 Oct 2024 15:33:55 +0000 Subject: [PATCH] Deploy ahpohl/libabbaurora to github.com/ahpohl/libabbaurora.git:gh-pages --- _a_b_b_aurora_8h_source.html | 114 +++++++++--------- _a_b_b_aurora_enums_8h_source.html | 10 +- _a_b_b_aurora_serial_8h_source.html | 20 +-- _a_b_b_aurora_strings_8h_source.html | 16 +-- annotated.html | 4 +- class_a_b_b_aurora.html | 2 - example_alarms_8cpp-example.html | 2 +- example_cumulated_8cpp-example.html | 2 +- example_daemon_8cpp-example.html | 2 +- example_dsp_8cpp-example.html | 2 +- example_inverter_8cpp-example.html | 4 +- example_state_8cpp-example.html | 2 +- struct_a_b_b_aurora_1_1_firmware_release.html | 5 +- ...t_a_b_b_aurora_1_1_manufacturing_date.html | 5 +- 14 files changed, 91 insertions(+), 99 deletions(-) diff --git a/_a_b_b_aurora_8h_source.html b/_a_b_b_aurora_8h_source.html index 24048ac..3fa6ad6 100644 --- a/_a_b_b_aurora_8h_source.html +++ b/_a_b_b_aurora_8h_source.html @@ -95,68 +95,68 @@
ABBAurora.h
-
1 #ifndef ABBAurora_h
2 #define ABBAurora_h
3 #include "ABBAuroraEnums.h"
4 #include "ABBAuroraSerial.h"
5 
19 class ABBAurora
20 {
21  static const int SendBufferSize;
22  static const int ReceiveBufferSize;
23  static const time_t InverterEpoch;
24 
25 private:
27  unsigned char Address;
28  unsigned char Log;
29  uint8_t *ReceiveData;
30  std::string ErrorMessage;
31 
38  bool Send(SendCommandEnum cmd, uint8_t b2, uint8_t b3, uint8_t b4, uint8_t b5, uint8_t b6, uint8_t b7);
43  long int GetGmtOffset(void);
44 
45 public:
50  ABBAurora(void);
57  ABBAurora(const unsigned char &addr);
62  ~ABBAurora(void);
69  void SetLogLevel(const unsigned char &log_level);
83  bool Setup(const std::string &device, const speed_t baudrate = B19200);
90  void SetAddress(const unsigned char &addr);
95  unsigned char GetAddress(void) const;
100  std::string GetErrorMessage(void) const;
101 
104 
106  struct State
107  {
108  std::string GlobalState;
109  std::string InverterState;
110  std::string Channel1State;
111  std::string Channel2State;
112  std::string AlarmState;
113  };
120  bool ReadState(State &state);
127  bool ReadPartNumber(std::string &pn);
128 
129  struct Version
130  {
131  std::string GlobalState;
132  std::string Par1;
133  std::string Par2;
134  std::string Par3;
135  std::string Par4;
136  };
143  bool ReadVersion(Version &version);
144 
153  bool ReadDspValue(float &value, const DspValueEnum &type, const DspGlobalEnum &global = DspGlobalEnum::MODULE_MEASUREMENT);
160  bool ReadSerialNumber(std::string &sn);
161 
163  {
164  std::string GlobalState;
165  std::string Week;
166  std::string Year;
167  };
175 
176  struct TimeDate
177  {
178  std::string GlobalState;
179  time_t InverterTime;
180  time_t EpochTime;
181  std::string TimeDate;
182  };
189  bool ReadTimeDate(TimeDate &date);
190 
192  {
193  std::string GlobalState;
194  std::string Release;
195  };
202  bool ReadFirmwareRelease(FirmwareRelease &firmware);
203 
211  bool ReadCumulatedEnergy(float &cum_energy, const CumulatedEnergyEnum &period);
212 
214  {
215  std::string GlobalState;
216  std::string Alarm1;
217  std::string Alarm2;
218  std::string Alarm3;
219  std::string Alarm4;
220  };
227  bool ReadLastFourAlarms(LastFourAlarms &alarms);
228 };
229 
230 #endif
std::string Week
Manufacturing week.
Definition: ABBAurora.h:165
-
std::string GlobalState
Global state.
Definition: ABBAurora.h:131
+
1 #ifndef ABBAurora_h
2 #define ABBAurora_h
3 #include "ABBAuroraEnums.h"
4 #include "ABBAuroraSerial.h"
5 
20 class ABBAurora {
21  static const int SendBufferSize;
22  static const int ReceiveBufferSize;
23  static const time_t
25 
26 private:
29  unsigned char Address;
30  unsigned char Log;
31  uint8_t *ReceiveData;
32  std::string ErrorMessage;
33 
43  bool Send(SendCommandEnum cmd, uint8_t b2, uint8_t b3, uint8_t b4, uint8_t b5,
44  uint8_t b6, uint8_t b7);
49  long int GetGmtOffset(void);
50 
51 public:
56  ABBAurora(void);
63  ABBAurora(const unsigned char &addr);
68  ~ABBAurora(void);
75  void SetLogLevel(const unsigned char &log_level);
89  bool Setup(const std::string &device, const speed_t baudrate = B19200);
96  void SetAddress(const unsigned char &addr);
101  unsigned char GetAddress(void) const;
106  std::string GetErrorMessage(void) const;
107 
110 
112  struct State
113  {
114  std::string GlobalState;
115  std::string InverterState;
116  std::string Channel1State;
117  std::string Channel2State;
118  std::string AlarmState;
119  };
126  bool ReadState(State &state);
134  bool ReadPartNumber(std::string &pn);
135 
136  struct Version
137  {
138  std::string GlobalState;
139  std::string Par1;
140  std::string Par2;
141  std::string Par3;
142  std::string Par4;
143  };
151  bool ReadVersion(Version &version);
152 
161  bool
162  ReadDspValue(float &value, const DspValueEnum &type,
163  const DspGlobalEnum &global = DspGlobalEnum::MODULE_MEASUREMENT);
171  bool ReadSerialNumber(std::string &sn);
172 
174  {
176  std::string GlobalState;
177  std::string Week;
178  std::string Year;
179  };
187 
188  struct TimeDate
189  {
190  std::string GlobalState;
191  time_t InverterTime;
192  time_t EpochTime;
193  std::string TimeDate;
194  };
201  bool ReadTimeDate(TimeDate &date);
202 
204  {
206  std::string GlobalState;
207  std::string Release;
208  };
216  bool ReadFirmwareRelease(FirmwareRelease &firmware);
217 
225  bool ReadCumulatedEnergy(float &cum_energy,
226  const CumulatedEnergyEnum &period);
227 
229  {
230  std::string GlobalState;
231  std::string Alarm1;
232  std::string Alarm2;
233  std::string Alarm3;
234  std::string Alarm4;
235  };
244  bool ReadLastFourAlarms(LastFourAlarms &alarms);
245 };
246 
247 #endif
std::string Week
Manufacturing week.
Definition: ABBAurora.h:177
+
std::string GlobalState
Global state.
Definition: ABBAurora.h:138
ABBAurora(void)
Default class constructor.
Definition: ABBAurora.cpp:12
-
bool ReadState(State &state)
Read system state.
Definition: ABBAurora.cpp:116
-
std::string GlobalState
Global state.
Definition: ABBAurora.h:108
-
bool ReadManufacturingDate(ManufacturingDate &date)
Read manufacturing date.
Definition: ABBAurora.cpp:189
-
std::string ErrorMessage
String which holds the possible error message.
Definition: ABBAurora.h:30
-
std::string GlobalState
Global state.
Definition: ABBAurora.h:164
-
std::string GlobalState
Global state.
Definition: ABBAurora.h:193
-
bool ReadCumulatedEnergy(float &cum_energy, const CumulatedEnergyEnum &period)
Read cumulated energy.
Definition: ABBAurora.cpp:244
-
Data structure for the read firmware release command.
Definition: ABBAurora.h:191
-
~ABBAurora(void)
Default class destructor.
Definition: ABBAurora.cpp:20
-
std::string Par1
Version part 1.
Definition: ABBAurora.h:132
-
DspValueEnum
Measure request to the DSP enum.
Definition: ABBAuroraEnums.h:16
-
Communication protocol between host and supervisor microprocessor.
Definition: ABBAurora.h:19
-
bool Send(SendCommandEnum cmd, uint8_t b2, uint8_t b3, uint8_t b4, uint8_t b5, uint8_t b6, uint8_t b7)
Send command.
Definition: ABBAurora.cpp:58
-
time_t EpochTime
Seconds since unix epoch.
Definition: ABBAurora.h:180
-
unsigned char Log
Log level.
Definition: ABBAurora.h:28
-
bool ReadLastFourAlarms(LastFourAlarms &alarms)
Read last four alarms.
Definition: ABBAurora.cpp:262
-
std::string InverterState
Inverter state.
Definition: ABBAurora.h:109
-
Data structure for ReadState()
Definition: ABBAurora.h:106
-
void SetAddress(const unsigned char &addr)
Set serial device address.
Definition: ABBAurora.cpp:43
-
std::string Release
Firmware release.
Definition: ABBAurora.h:194
-
std::string Par4
Version part 4.
Definition: ABBAurora.h:135
-
uint8_t * ReceiveData
Array to hold the answer from the device.
Definition: ABBAurora.h:29
-
unsigned char Address
Address of the serial device.
Definition: ABBAurora.h:27
-
bool ReadFirmwareRelease(FirmwareRelease &firmware)
Read firmware release.
Definition: ABBAurora.cpp:224
-
Data structure for last four alarms command.
Definition: ABBAurora.h:213
-
std::string Alarm2
Alarm 2.
Definition: ABBAurora.h:217
-
std::string TimeDate
Human readable time and date.
Definition: ABBAurora.h:181
-
bool ReadDspValue(float &value, const DspValueEnum &type, const DspGlobalEnum &global=DspGlobalEnum::MODULE_MEASUREMENT)
Measure request to the DSP.
Definition: ABBAurora.cpp:159
-
void SetLogLevel(const unsigned char &log_level)
Set log level.
Definition: ABBAurora.cpp:26
-
static const time_t InverterEpoch
Seconds since midnight of January 1, 2000.
Definition: ABBAurora.h:23
-
long int GetGmtOffset(void)
Get GMT offset.
Definition: ABBAurora.cpp:103
-
unsigned char GetAddress(void) const
Get serial device address.
Definition: ABBAurora.cpp:48
-
bool ReadPartNumber(std::string &pn)
Read system P/N.
Definition: ABBAurora.cpp:130
-
SendCommandEnum
Send command enum.
Definition: ABBAuroraEnums.h:148
-
std::string GlobalState
Global state.
Definition: ABBAurora.h:178
-
std::string GetErrorMessage(void) const
Get error message.
Definition: ABBAurora.cpp:53
-
bool ReadSerialNumber(std::string &sn)
Read serial number.
Definition: ABBAurora.cpp:175
-
Data structure for version reading command.
Definition: ABBAurora.h:129
-
time_t InverterTime
Seconds since 1st January 2000.
Definition: ABBAurora.h:179
-
std::string Channel2State
Channel 2 state.
Definition: ABBAurora.h:111
-
std::string Channel1State
Channel 1 state.
Definition: ABBAurora.h:110
-
bool ReadTimeDate(TimeDate &date)
Read inverter date.
Definition: ABBAurora.cpp:205
-
bool ReadVersion(Version &version)
Read version.
Definition: ABBAurora.cpp:145
-
std::string Alarm4
Alarm 4.
Definition: ABBAurora.h:219
+
bool ReadState(State &state)
Read system state.
Definition: ABBAurora.cpp:102
+
std::string GlobalState
Global state.
Definition: ABBAurora.h:114
+
bool ReadManufacturingDate(ManufacturingDate &date)
Read manufacturing date.
Definition: ABBAurora.cpp:170
+
std::string ErrorMessage
String which holds the possible error message.
Definition: ABBAurora.h:32
+
std::string GlobalState
Global state.
Definition: ABBAurora.h:176
+
std::string GlobalState
Global state.
Definition: ABBAurora.h:206
+
bool ReadCumulatedEnergy(float &cum_energy, const CumulatedEnergyEnum &period)
Read cumulated energy.
Definition: ABBAurora.cpp:218
+
Definition: ABBAurora.h:203
+
~ABBAurora(void)
Default class destructor.
Definition: ABBAurora.cpp:16
+
std::string Par1
Version part 1.
Definition: ABBAurora.h:139
+
DspValueEnum
Measure request to the DSP enum.
Definition: ABBAuroraEnums.h:17
+
Communication protocol between host and supervisor microprocessor.
Definition: ABBAurora.h:20
+
bool Send(SendCommandEnum cmd, uint8_t b2, uint8_t b3, uint8_t b4, uint8_t b5, uint8_t b6, uint8_t b7)
Send command.
Definition: ABBAurora.cpp:43
+
time_t EpochTime
Seconds since unix epoch.
Definition: ABBAurora.h:192
+
unsigned char Log
Log level.
Definition: ABBAurora.h:30
+
bool ReadLastFourAlarms(LastFourAlarms &alarms)
Read last four alarms.
Definition: ABBAurora.cpp:240
+
std::string InverterState
Inverter state.
Definition: ABBAurora.h:115
+
Data structure for ReadState()
Definition: ABBAurora.h:112
+
void SetAddress(const unsigned char &addr)
Set serial device address.
Definition: ABBAurora.cpp:37
+
std::string Release
Firmware release.
Definition: ABBAurora.h:207
+
std::string Par4
Version part 4.
Definition: ABBAurora.h:142
+
uint8_t * ReceiveData
Array to hold the answer from the device.
Definition: ABBAurora.h:31
+
unsigned char Address
Address of the serial device.
Definition: ABBAurora.h:29
+
bool ReadFirmwareRelease(FirmwareRelease &firmware)
Read firmware release.
Definition: ABBAurora.cpp:202
+
Data structure for last four alarms command.
Definition: ABBAurora.h:228
+
std::string Alarm2
Alarm 2.
Definition: ABBAurora.h:232
+
std::string TimeDate
Human readable time and date.
Definition: ABBAurora.h:193
+
bool ReadDspValue(float &value, const DspValueEnum &type, const DspGlobalEnum &global=DspGlobalEnum::MODULE_MEASUREMENT)
Measure request to the DSP.
Definition: ABBAurora.cpp:138
+
void SetLogLevel(const unsigned char &log_level)
Set log level.
Definition: ABBAurora.cpp:25
+
static const time_t InverterEpoch
Seconds since midnight of January 1, 2000.
Definition: ABBAurora.h:24
+
long int GetGmtOffset(void)
Get GMT offset.
Definition: ABBAurora.cpp:90
+
unsigned char GetAddress(void) const
Get serial device address.
Definition: ABBAurora.cpp:39
+
bool ReadPartNumber(std::string &pn)
Read system P/N.
Definition: ABBAurora.cpp:114
+
SendCommandEnum
Send command enum.
Definition: ABBAuroraEnums.h:147
+
std::string GlobalState
Global state.
Definition: ABBAurora.h:190
+
std::string GetErrorMessage(void) const
Get error message.
Definition: ABBAurora.cpp:41
+
bool ReadSerialNumber(std::string &sn)
Read serial number.
Definition: ABBAurora.cpp:158
+
Data structure for version reading command.
Definition: ABBAurora.h:136
+
time_t InverterTime
Seconds since 1st January 2000.
Definition: ABBAurora.h:191
+
std::string Channel2State
Channel 2 state.
Definition: ABBAurora.h:117
+
std::string Channel1State
Channel 1 state.
Definition: ABBAurora.h:116
+
bool ReadTimeDate(TimeDate &date)
Read inverter date.
Definition: ABBAurora.cpp:184
+
bool ReadVersion(Version &version)
Read version.
Definition: ABBAurora.cpp:126
+
std::string Alarm4
Alarm 4.
Definition: ABBAurora.h:234
-
std::string Alarm1
Alarm 1.
Definition: ABBAurora.h:216
-
std::string AlarmState
Alarm state.
Definition: ABBAurora.h:112
-
std::string Year
Manufacturing year.
Definition: ABBAurora.h:166
-
std::string GlobalState
Global state.
Definition: ABBAurora.h:215
-
std::string Par3
Version part 3.
Definition: ABBAurora.h:134
+
std::string Alarm1
Alarm 1.
Definition: ABBAurora.h:231
+
std::string AlarmState
Alarm state.
Definition: ABBAurora.h:118
+
std::string Year
Manufacturing year.
Definition: ABBAurora.h:178
+
std::string GlobalState
Global state.
Definition: ABBAurora.h:230
+
std::string Par3
Version part 3.
Definition: ABBAurora.h:141
static const int ReceiveBufferSize
Fixed receive buffer size (10 bytes)
Definition: ABBAurora.h:22
-
Data structure for time/date reading command.
Definition: ABBAurora.h:176
-
ABBAuroraSerial * Serial
Serial object which handles the communication with the device.
Definition: ABBAurora.h:26
-
std::string Alarm3
Alarm 3.
Definition: ABBAurora.h:218
+
Data structure for time/date reading command.
Definition: ABBAurora.h:188
+
ABBAuroraSerial * Serial
Serial object which handles the communication with the device.
Definition: ABBAurora.h:28
+
std::string Alarm3
Alarm 3.
Definition: ABBAurora.h:233
DspGlobalEnum
Dsp global enum.
Definition: ABBAuroraEnums.h:125
-
Data structure for the read manufacturing date command.
Definition: ABBAurora.h:162
-
bool Setup(const std::string &device, const speed_t baudrate=B19200)
Setup serial device communication.
Definition: ABBAurora.cpp:31
+
Definition: ABBAurora.h:173
+
bool Setup(const std::string &device, const speed_t baudrate=B19200)
Setup serial device communication.
Definition: ABBAurora.cpp:27
CumulatedEnergyEnum
Cumulated energy enum.
Definition: ABBAuroraEnums.h:131
-
std::string Par2
Version part 2.
Definition: ABBAurora.h:133
+
std::string Par2
Version part 2.
Definition: ABBAurora.h:140
static const int SendBufferSize
Fixed send buffer size (8 bytes)
Definition: ABBAurora.h:21
Low level serial methods.
Definition: ABBAuroraSerial.h:11
diff --git a/_a_b_b_aurora_enums_8h_source.html b/_a_b_b_aurora_enums_8h_source.html index 6dc2769..533360f 100644 --- a/_a_b_b_aurora_enums_8h_source.html +++ b/_a_b_b_aurora_enums_8h_source.html @@ -95,7 +95,7 @@
ABBAuroraEnums.h
-Go to the documentation of this file.
1 #ifndef ABBAuroraEnums_h
2 #define ABBAuroraEnums_h
3 
16 enum class DspValueEnum : unsigned char
17 {
19  GRID_VOLTAGE = 1,
21  GRID_CURRENT = 2,
23  GRID_POWER = 3,
25  FREQUENCY = 4,
27  V_BULK = 5,
29  I_LEAK_DC_DC = 6,
31  I_LEAK_INVERTER = 7,
33  POWER_IN_1 = 8,
35  POWER_IN_2 = 9,
41  V_IN_1 = 23,
43  I_IN_1 = 25,
45  V_IN_2 = 26,
47  I_IN_2 = 27,
49  DC_DC_GRID_VOLTAGE = 28,
55  DC_DC_V_BULK = 31,
59  V_BULK_MID = 33,
61  POWER_PEAK = 34,
63  POWER_PEAK_TODAY = 35,
77  FREQUENCY_PHASE_R = 42,
79  FREQUENCY_PHASE_S = 43,
81  FREQUENCY_PHASE_T = 44,
83  V_BULK_POSITIVE = 45,
85  V_BULK_NEGATIVE = 46,
89  TEMPERATURE_ALIM = 48,
93  TEMPERATURE_1 = 50,
95  TEMPERATURE_2 = 51,
97  TEMPERATURE_3 = 52,
99  FAN_SPEED_1 = 53,
101  FAN_SPEED_2 = 54,
103  FAN_SPEED_3 = 55,
105  FAN_SPEED_4 = 56,
107  FAN_SPEED_5 = 57,
111  V_PANEL_MICRO = 60,
118 };
119 
125 enum class DspGlobalEnum : unsigned char
126 {
127  MODULE_MEASUREMENT = 0, GLOBAL_MEASUREMENT = 1
128 };
129 
131 enum class CumulatedEnergyEnum : unsigned char
132 {
134  CURRENT_DAY = 0,
136  CURRENT_WEEK = 1,
138  CURRENT_MONTH = 3,
140  CURRENT_YEAR = 4,
142  LIFETIME_TOTAL = 5,
144  SINCE_RESET = 6
145 };
146 
148 enum class SendCommandEnum : unsigned char
149 {
151  STATE_REQUEST = 50,
153  PN_READING = 52,
155  VERSION_READING = 58,
157  MEASURE_REQUEST_DSP = 59,
161  MANUFACTURING_DATE = 65,
163  TIME_DATE_READING = 70,
169  LAST_FOUR_ALARMS = 86,
171  NOT_IMPLEMENTED = 255
172 };
173 
175 enum class LogLevelEnum : unsigned char
176 {
177  CONFIG = 0x01,
178  JSON = 0x02,
179  MQTT = 0x04,
180  SERIAL = 0x08
181 };
182 
183 #endif
+Go to the documentation of this file.
1 #ifndef ABBAuroraEnums_h
2 #define ABBAuroraEnums_h
3 
17 enum class DspValueEnum : unsigned char {
19  GRID_VOLTAGE = 1,
21  GRID_CURRENT = 2,
23  GRID_POWER = 3,
25  FREQUENCY = 4,
27  V_BULK = 5,
29  I_LEAK_DC_DC = 6,
31  I_LEAK_INVERTER = 7,
33  POWER_IN_1 = 8,
35  POWER_IN_2 = 9,
41  V_IN_1 = 23,
43  I_IN_1 = 25,
45  V_IN_2 = 26,
47  I_IN_2 = 27,
49  DC_DC_GRID_VOLTAGE = 28,
55  DC_DC_V_BULK = 31,
59  V_BULK_MID = 33,
61  POWER_PEAK = 34,
63  POWER_PEAK_TODAY = 35,
77  FREQUENCY_PHASE_R = 42,
79  FREQUENCY_PHASE_S = 43,
81  FREQUENCY_PHASE_T = 44,
83  V_BULK_POSITIVE = 45,
85  V_BULK_NEGATIVE = 46,
89  TEMPERATURE_ALIM = 48,
93  TEMPERATURE_1 = 50,
95  TEMPERATURE_2 = 51,
97  TEMPERATURE_3 = 52,
99  FAN_SPEED_1 = 53,
101  FAN_SPEED_2 = 54,
103  FAN_SPEED_3 = 55,
105  FAN_SPEED_4 = 56,
107  FAN_SPEED_5 = 57,
111  V_PANEL_MICRO = 60,
118 };
119 
125 enum class DspGlobalEnum : unsigned char {
126  MODULE_MEASUREMENT = 0,
127  GLOBAL_MEASUREMENT = 1
128 };
129 
131 enum class CumulatedEnergyEnum : unsigned char {
133  CURRENT_DAY = 0,
135  CURRENT_WEEK = 1,
137  CURRENT_MONTH = 3,
139  CURRENT_YEAR = 4,
141  LIFETIME_TOTAL = 5,
143  SINCE_RESET = 6
144 };
145 
147 enum class SendCommandEnum : unsigned char {
149  STATE_REQUEST = 50,
151  PN_READING = 52,
154  VERSION_READING = 58,
156  MEASURE_REQUEST_DSP = 59,
160  MANUFACTURING_DATE = 65,
162  TIME_DATE_READING = 70,
168  LAST_FOUR_ALARMS = 86,
170  NOT_IMPLEMENTED = 255
171 };
172 
174 enum class LogLevelEnum : unsigned char {
175  CONFIG = 0x01,
176  JSON = 0x02,
177  MQTT = 0x04,
178  SERIAL = 0x08
179 };
180 
181 #endif
Grid frequency (DC/DC)
Wind generator frequency.
@@ -110,7 +110,7 @@
Month energy (energy from the first day of the current calendar month)
P/N reading (Aurora inverters)
-
DspValueEnum
Measure request to the DSP enum.
Definition: ABBAuroraEnums.h:16
+
DspValueEnum
Measure request to the DSP enum.
Definition: ABBAuroraEnums.h:17
@@ -125,7 +125,7 @@
Input 2 current.
Partial energy (cumulated since reset)
-
LogLevelEnum
Log level enum.
Definition: ABBAuroraEnums.h:175
+
LogLevelEnum
Log level enum.
Definition: ABBAuroraEnums.h:174
@@ -144,9 +144,9 @@
Serial number reading (Aurora inverters)
-
SendCommandEnum
Send command enum.
Definition: ABBAuroraEnums.h:148
+
SendCommandEnum
Send command enum.
Definition: ABBAuroraEnums.h:147
-
Version reading (indoor/outdoor, Europe/America, available only in FW version 1.0.9 and following)
+ diff --git a/_a_b_b_aurora_serial_8h_source.html b/_a_b_b_aurora_serial_8h_source.html index 92c9010..d3b5f89 100644 --- a/_a_b_b_aurora_serial_8h_source.html +++ b/_a_b_b_aurora_serial_8h_source.html @@ -95,20 +95,20 @@
ABBAuroraSerial.h
-
1 #ifndef ABBAuroraSerial_h
2 #define ABBAuroraSerial_h
3 #include <string>
4 #include <termios.h>
5 
12 {
13 public:
20  ABBAuroraSerial(const unsigned char &log);
26  ~ABBAuroraSerial(void);
34  bool Begin(const std::string &device, const speed_t &baudrate);
42  int ReadBytes(uint8_t *buffer, const int &length);
50  int WriteBytes(uint8_t const *buffer, const int &length);
56  void Flush(void) const;
64  uint16_t Word(const uint8_t &msb, const uint8_t &lsb) const;
73  uint16_t Crc16(uint8_t *data, const int &offset, const int &count) const;
80  uint8_t LowByte(const uint16_t &bytes) const;
87  uint8_t HighByte(const uint16_t &bytes) const;
93  std::string GetErrorMessage(void);
94 
95 private:
96  int SerialPort;
97  std::string ErrorMessage;
98  unsigned char Log;
99 };
100 
101 #endif
bool Begin(const std::string &device, const speed_t &baudrate)
Begin communication.
Definition: ABBAuroraSerial.cpp:22
+
1 #ifndef ABBAuroraSerial_h
2 #define ABBAuroraSerial_h
3 #include <string>
4 #include <termios.h>
5 
12 public:
19  ABBAuroraSerial(const unsigned char &log);
25  ~ABBAuroraSerial(void);
33  bool Begin(const std::string &device, const speed_t &baudrate);
41  int ReadBytes(uint8_t *buffer, const int &length);
49  int WriteBytes(uint8_t const *buffer, const int &length);
56  void Flush(void) const;
64  uint16_t Word(const uint8_t &msb, const uint8_t &lsb) const;
73  uint16_t Crc16(uint8_t *data, const int &offset, const int &count) const;
80  uint8_t LowByte(const uint16_t &bytes) const;
87  uint8_t HighByte(const uint16_t &bytes) const;
93  std::string GetErrorMessage(void);
94 
95 private:
96  int SerialPort;
97  std::string ErrorMessage;
98  unsigned char Log;
99 };
100 
101 #endif
bool Begin(const std::string &device, const speed_t &baudrate)
Begin communication.
Definition: ABBAuroraSerial.cpp:19
ABBAuroraSerial(const unsigned char &log)
Default constructor.
Definition: ABBAuroraSerial.cpp:11
-
int ReadBytes(uint8_t *buffer, const int &length)
Read bytes.
Definition: ABBAuroraSerial.cpp:77
-
~ABBAuroraSerial(void)
Default destructor.
Definition: ABBAuroraSerial.cpp:15
+
int ReadBytes(uint8_t *buffer, const int &length)
Read bytes.
Definition: ABBAuroraSerial.cpp:74
+
~ABBAuroraSerial(void)
Default destructor.
Definition: ABBAuroraSerial.cpp:13
unsigned char Log
Log level.
Definition: ABBAuroraSerial.h:98
-
uint16_t Word(const uint8_t &msb, const uint8_t &lsb) const
Return word.
Definition: ABBAuroraSerial.cpp:154
+
uint16_t Word(const uint8_t &msb, const uint8_t &lsb) const
Return word.
Definition: ABBAuroraSerial.cpp:146
std::string ErrorMessage
Error message string.
Definition: ABBAuroraSerial.h:97
-
std::string GetErrorMessage(void)
Get error message.
Definition: ABBAuroraSerial.cpp:191
+
std::string GetErrorMessage(void)
Get error message.
Definition: ABBAuroraSerial.cpp:179
int SerialPort
Serial port number.
Definition: ABBAuroraSerial.h:96
-
uint8_t HighByte(const uint16_t &bytes) const
Return high byte.
Definition: ABBAuroraSerial.cpp:186
-
uint8_t LowByte(const uint16_t &bytes) const
Return low byte.
Definition: ABBAuroraSerial.cpp:181
-
uint16_t Crc16(uint8_t *data, const int &offset, const int &count) const
Calculate checksum.
Definition: ABBAuroraSerial.cpp:159
-
void Flush(void) const
Flush buffers.
Definition: ABBAuroraSerial.cpp:149
-
int WriteBytes(uint8_t const *buffer, const int &length)
Write bytes.
Definition: ABBAuroraSerial.cpp:125
+
uint8_t HighByte(const uint16_t &bytes) const
Return high byte.
Definition: ABBAuroraSerial.cpp:175
+
uint8_t LowByte(const uint16_t &bytes) const
Return low byte.
Definition: ABBAuroraSerial.cpp:171
+
uint16_t Crc16(uint8_t *data, const int &offset, const int &count) const
Calculate checksum.
Definition: ABBAuroraSerial.cpp:150
+
void Flush(void) const
Flush buffers.
Definition: ABBAuroraSerial.cpp:144
+
int WriteBytes(uint8_t const *buffer, const int &length)
Write bytes.
Definition: ABBAuroraSerial.cpp:122
Low level serial methods.
Definition: ABBAuroraSerial.h:11
diff --git a/_a_b_b_aurora_strings_8h_source.html b/_a_b_b_aurora_strings_8h_source.html index 053d8da..7874fba 100644 --- a/_a_b_b_aurora_strings_8h_source.html +++ b/_a_b_b_aurora_strings_8h_source.html @@ -95,15 +95,15 @@
ABBAuroraStrings.h
-Go to the documentation of this file.
1 #ifndef ABBAuroraStrings_h
2 #define ABBAuroraStrings_h
3 
6 class ABBAuroraStrings {
8  private:
9 
10  public:
12  static std::string TransmissionState(unsigned char id);
14  static std::string GlobalState(unsigned char id);
16  static std::string DcDcState(unsigned char id);
18  static std::string InverterState(unsigned char id);
20  static std::string AlarmState(unsigned char id);
22  static std::string VersionPart1(char id);
24  static std::string VersionPart2(char id);
26  static std::string VersionPart3(char id);
28  static std::string VersionPart4(char id);
29 };
30 
31 #endif
static std::string VersionPart4(char id)
Version reading 4: Wind/PV.
Definition: ABBAuroraStrings.cpp:470
-
static std::string DcDcState(unsigned char id)
State of the DC/DC converter.
Definition: ABBAuroraStrings.cpp:122
-
static std::string GlobalState(unsigned char id)
State of the addressed device.
Definition: ABBAuroraStrings.cpp:31
+Go to the documentation of this file.
1 #ifndef ABBAuroraStrings_h
2 #define ABBAuroraStrings_h
3 
6 class ABBAuroraStrings {
8 private:
9 public:
11  static std::string TransmissionState(unsigned char id);
13  static std::string GlobalState(unsigned char id);
15  static std::string DcDcState(unsigned char id);
17  static std::string InverterState(unsigned char id);
19  static std::string AlarmState(unsigned char id);
21  static std::string VersionPart1(char id);
23  static std::string VersionPart2(char id);
25  static std::string VersionPart3(char id);
27  static std::string VersionPart4(char id);
28 };
29 
30 #endif
static std::string VersionPart4(char id)
Version reading 4: Wind/PV.
Definition: ABBAuroraStrings.cpp:454
+
static std::string DcDcState(unsigned char id)
State of the DC/DC converter.
Definition: ABBAuroraStrings.cpp:118
+
static std::string GlobalState(unsigned char id)
State of the addressed device.
Definition: ABBAuroraStrings.cpp:29
Aurora strings.
Definition: ABBAuroraStrings.h:7
-
static std::string VersionPart2(char id)
Version reading 2: Grid standard.
Definition: ABBAuroraStrings.cpp:436
-
static std::string VersionPart3(char id)
Version reading 3: Trafo/Non Trafo.
Definition: ABBAuroraStrings.cpp:457
-
static std::string AlarmState(unsigned char id)
Alarm states (alarm codes are shown only on Aurora display)
Definition: ABBAuroraStrings.cpp:260
-
static std::string InverterState(unsigned char id)
State of the inverter.
Definition: ABBAuroraStrings.cpp:171
-
static std::string VersionPart1(char id)
Version reading 1: Indoor/Outdoor and type.
Definition: ABBAuroraStrings.cpp:399
+
static std::string VersionPart2(char id)
Version reading 2: Grid standard.
Definition: ABBAuroraStrings.cpp:424
+
static std::string VersionPart3(char id)
Version reading 3: Trafo/Non Trafo.
Definition: ABBAuroraStrings.cpp:443
+
static std::string AlarmState(unsigned char id)
Alarm states (alarm codes are shown only on Aurora display)
Definition: ABBAuroraStrings.cpp:252
+
static std::string InverterState(unsigned char id)
State of the inverter.
Definition: ABBAuroraStrings.cpp:165
+
static std::string VersionPart1(char id)
Version reading 1: Indoor/Outdoor and type.
Definition: ABBAuroraStrings.cpp:389
static std::string TransmissionState(unsigned char id)
Transmission state after receiving a command.
Definition: ABBAuroraStrings.cpp:4
diff --git a/annotated.html b/annotated.html index 7ff067c..12e5a67 100644 --- a/annotated.html +++ b/annotated.html @@ -98,9 +98,9 @@
Here are the data structures with brief descriptions:
[detail level 12]
- + - + diff --git a/class_a_b_b_aurora.html b/class_a_b_b_aurora.html index 7fbb79f..694b152 100644 --- a/class_a_b_b_aurora.html +++ b/class_a_b_b_aurora.html @@ -110,13 +110,11 @@ - - diff --git a/example_alarms_8cpp-example.html b/example_alarms_8cpp-example.html index ac44974..536dc12 100644 --- a/example_alarms_8cpp-example.html +++ b/example_alarms_8cpp-example.html @@ -96,7 +96,7 @@

This example reads the last four alarms.

Global state: Run
Alarm 1: No Alarm
Alarm 2: No Alarm
Alarm 3: No Alarm
Alarm 4: No Alarm

The output is equivalent to "aurora -a 2 -A /dev/ttyUSB0"

-
#include <iostream>
#include <memory>
#include "ABBAurora.h"
int main(int argc, char *argv[])
{
const std::string device = "/dev/ttyUSB0";
std::unique_ptr<ABBAurora> inverter(new ABBAurora());
if (!inverter->Setup(device))
{
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
if (!inverter->ReadLastFourAlarms(alarms))
{
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Global state: " << alarms.GlobalState << std::endl;
std::cout << "Alarm 1: " << alarms.Alarm1 << std::endl;
std::cout << "Alarm 2: " << alarms.Alarm2 << std::endl;
std::cout << "Alarm 3: " << alarms.Alarm3 << std::endl;
std::cout << "Alarm 4: " << alarms.Alarm4 << std::endl;
return EXIT_SUCCESS;
}
+
#include "ABBAurora.h"
#include <iostream>
#include <memory>
int main(int argc, char *argv[]) {
const std::string device = "/dev/ttyUSB0";
std::unique_ptr<ABBAurora> inverter(new ABBAurora());
if (!inverter->Setup(device)) {
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
if (!inverter->ReadLastFourAlarms(alarms)) {
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Global state: " << alarms.GlobalState << std::endl;
std::cout << "Alarm 1: " << alarms.Alarm1 << std::endl;
std::cout << "Alarm 2: " << alarms.Alarm2 << std::endl;
std::cout << "Alarm 3: " << alarms.Alarm3 << std::endl;
std::cout << "Alarm 4: " << alarms.Alarm4 << std::endl;
return EXIT_SUCCESS;
}

This example shows cumulated energy readings.

Current day: 27.82 kWh
Current week: 111.54 kWh
Current month: 225.99 kWh
Current year: 1912.22 kWh
Lifetime total: 47435.21 kWh
Since reset: 47435.11 kWh

The output is equivalent to "aurora -a 2 -e /dev/ttyUSB0"

-
#include <iostream>
#include <memory>
#include "ABBAurora.h"
#include "ABBAuroraEnums.h"
int main(int argc, char *argv[])
{
const std::string device = "/dev/ttyUSB0";
std::unique_ptr<ABBAurora> inverter(new ABBAurora());
if (!inverter->Setup(device))
{
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::ios::fmtflags old_settings = std::cout.flags();
std::cout.precision(2);
std::cout.setf(std::ios::fixed, std::ios::floatfield);
float current_day;
if (!inverter->ReadCumulatedEnergy(current_day, CumulatedEnergyEnum::CURRENT_DAY))
{
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Current day: " << current_day << " kWh" << std::endl;
float current_week;
if (!inverter->ReadCumulatedEnergy(current_week, CumulatedEnergyEnum::CURRENT_WEEK))
{
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Current week: " << current_week << " kWh" << std::endl;
float current_month;
if (!inverter->ReadCumulatedEnergy(current_month, CumulatedEnergyEnum::CURRENT_MONTH))
{
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Current month: " << current_month << " kWh" << std::endl;
float current_year;
if (!inverter->ReadCumulatedEnergy(current_year, CumulatedEnergyEnum::CURRENT_YEAR))
{
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Current year: " << current_year << " kWh" << std::endl;
float lifetime_total;
if (!inverter->ReadCumulatedEnergy(lifetime_total, CumulatedEnergyEnum::LIFETIME_TOTAL))
{
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Lifetime total: " << lifetime_total << " kWh" << std::endl;
float since_reset;
if (!inverter->ReadCumulatedEnergy(since_reset, CumulatedEnergyEnum::SINCE_RESET))
{
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Since reset: " << since_reset << " kWh" << std::endl;
std::cout.flags(old_settings);
return EXIT_SUCCESS;
}
+
#include "ABBAurora.h"
#include "ABBAuroraEnums.h"
#include <iostream>
#include <memory>
int main(int argc, char *argv[]) {
const std::string device = "/dev/ttyUSB0";
std::unique_ptr<ABBAurora> inverter(new ABBAurora());
if (!inverter->Setup(device)) {
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::ios::fmtflags old_settings = std::cout.flags();
std::cout.precision(2);
std::cout.setf(std::ios::fixed, std::ios::floatfield);
float current_day;
if (!inverter->ReadCumulatedEnergy(current_day,
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Current day: " << current_day << " kWh" << std::endl;
float current_week;
if (!inverter->ReadCumulatedEnergy(current_week,
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Current week: " << current_week << " kWh" << std::endl;
float current_month;
if (!inverter->ReadCumulatedEnergy(current_month,
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Current month: " << current_month << " kWh" << std::endl;
float current_year;
if (!inverter->ReadCumulatedEnergy(current_year,
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Current year: " << current_year << " kWh" << std::endl;
float lifetime_total;
if (!inverter->ReadCumulatedEnergy(lifetime_total,
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Lifetime total: " << lifetime_total << " kWh" << std::endl;
float since_reset;
if (!inverter->ReadCumulatedEnergy(since_reset,
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Since reset: " << since_reset << " kWh" << std::endl;
std::cout.flags(old_settings);
return EXIT_SUCCESS;
}

This example shows how to create a simple daemon.

-
#include <iostream>
#include <memory>
#include <csignal>
#include <thread>
#include <chrono>
#include "ABBAurora.h"
volatile sig_atomic_t shutdown = false;
void sig_handler(int)
{
shutdown = true;
}
int main(int argc, char* argv[])
{
struct sigaction action;
action.sa_handler = sig_handler;
sigemptyset(&action.sa_mask);
action.sa_flags = SA_RESTART;
sigaction(SIGINT, &action, NULL);
sigaction(SIGTERM, &action, NULL);
const std::string device = "/dev/ttyUSB0";
std::unique_ptr<ABBAurora> inverter(new ABBAurora());
if (!inverter->Setup(device))
{
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::ios::fmtflags old_settings = std::cout.flags();
std::cout.precision(2);
std::cout.setf(std::ios::fixed, std::ios::floatfield);
while (shutdown == false)
{
float grid_power;
if (!inverter->ReadDspValue(grid_power, DspValueEnum::GRID_POWER))
{
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Grid Power Reading: " << grid_power << " W" << std::endl;
std::this_thread::sleep_for(std::chrono::seconds(1));
}
std::cout.flags(old_settings);
return EXIT_SUCCESS;
}
+
#include "ABBAurora.h"
#include <chrono>
#include <csignal>
#include <iostream>
#include <memory>
#include <thread>
volatile sig_atomic_t shutdown = false;
void sig_handler(int) { shutdown = true; }
int main(int argc, char *argv[]) {
struct sigaction action;
action.sa_handler = sig_handler;
sigemptyset(&action.sa_mask);
action.sa_flags = SA_RESTART;
sigaction(SIGINT, &action, NULL);
sigaction(SIGTERM, &action, NULL);
const std::string device = "/dev/ttyUSB0";
std::unique_ptr<ABBAurora> inverter(new ABBAurora());
if (!inverter->Setup(device)) {
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::ios::fmtflags old_settings = std::cout.flags();
std::cout.precision(2);
std::cout.setf(std::ios::fixed, std::ios::floatfield);
while (shutdown == false) {
float grid_power;
if (!inverter->ReadDspValue(grid_power, DspValueEnum::GRID_POWER)) {
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Grid Power Reading: " << grid_power << " W" << std::endl;
std::this_thread::sleep_for(std::chrono::seconds(1));
}
std::cout.flags(old_settings);
return EXIT_SUCCESS;
}

This example reads both DSPs to get voltage, current, power and grid data.

put 1 Current: 3.67 A
Input 1 Power: 976.95 W
Input 2 Voltage: 269.17 V
Input 2 Current: 3.71 A
Input 2 Power: 996.11 W
Grid Voltage Reading: 236.19 V
Grid Current Reading: 8.14 A
Grid Power Reading: 1909.63 W
Frequency Reading: 50.00 Hz
DC/AC Conversion Efficiency: 96.79 %
Inverter Temperature: 48.75 °C
Booster Temperature: 45.75 °C

The output is equivalent to "aurora -a 2 -d 0 /dev/ttyUSB0"

-
#include <iostream>
#include <iomanip>
#include <memory>
#include "ABBAurora.h"
int main(int argc, char *argv[])
{
const std::string device = "/dev/ttyUSB0";
std::unique_ptr<ABBAurora> inverter(new ABBAurora());
if (!inverter->Setup(device))
{
std::cout << "Inverter setup failed: " << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::ios::fmtflags old_settings = std::cout.flags();
std::cout.precision(2);
std::cout.setf(std::ios::fixed, std::ios::floatfield);
float voltage_in_1;
if (!inverter->ReadDspValue(voltage_in_1, DspValueEnum::V_IN_1))
{
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Input 1 Voltage: " << voltage_in_1 << " V" << std::endl;
float current_in_1;
if (!inverter->ReadDspValue(current_in_1, DspValueEnum::I_IN_1))
{
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Input 1 Current: " << current_in_1 << " A" << std::endl;
float power_in_1;
if (!inverter->ReadDspValue(power_in_1, DspValueEnum::POWER_IN_1))
{
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Input 1 Power: " << power_in_1 << " W" << std::endl;
std::cout << std::endl;
float voltage_in_2;
if (!inverter->ReadDspValue(voltage_in_2, DspValueEnum::V_IN_2))
{
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Input 2 Voltage: " << voltage_in_2 << " V" << std::endl;
float current_in_2;
if (!inverter->ReadDspValue(current_in_2, DspValueEnum::I_IN_2))
{
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Input 2 Current: " << current_in_2 << " A" << std::endl;
float power_in_2;
if (!inverter->ReadDspValue(power_in_2, DspValueEnum::POWER_IN_2))
{
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Input 2 Power: " << power_in_2 << " W" << std::endl;
std::cout << std::endl;
float grid_voltage;
if (!inverter->ReadDspValue(grid_voltage, DspValueEnum::GRID_VOLTAGE))
{
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Grid Voltage Reading: " << grid_voltage << " V" << std::endl;
float grid_current;
if (!inverter->ReadDspValue(grid_current, DspValueEnum::GRID_CURRENT))
{
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Grid Current Reading: " << grid_current << " A" << std::endl;
float grid_power;
if (!inverter->ReadDspValue(grid_power, DspValueEnum::GRID_POWER))
{
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Grid Power Reading: " << grid_power << " W" << std::endl;
float freq;
if (!inverter->ReadDspValue(freq, DspValueEnum::FREQUENCY))
{
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Frequency Reading: " << freq << " Hz" << std::endl;
std::cout << std::endl;
std::cout << "DC/AC Conversion Efficiency: " << (grid_power / (power_in_1 + power_in_2) * 100) << " %" << std::endl;
float inverter_temp;
if (!inverter->ReadDspValue(inverter_temp, DspValueEnum::TEMPERATURE_INVERTER))
{
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Inverter Temperature: " << inverter_temp << " °C" << std::endl;
float booster_temp;
if (!inverter->ReadDspValue(booster_temp, DspValueEnum::TEMPERATURE_BOOSTER))
{
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Booster Temperature: " << booster_temp << " °C" << std::endl;
std::cout << std::endl;
std::cout.flags(old_settings);
return EXIT_SUCCESS;
}
+
#include "ABBAurora.h"
#include <iomanip>
#include <iostream>
#include <memory>
int main(int argc, char *argv[]) {
const std::string device = "/dev/ttyUSB0";
std::unique_ptr<ABBAurora> inverter(new ABBAurora());
if (!inverter->Setup(device)) {
std::cout << "Inverter setup failed: " << inverter->GetErrorMessage()
<< std::endl;
return EXIT_FAILURE;
}
std::ios::fmtflags old_settings = std::cout.flags();
std::cout.precision(2);
std::cout.setf(std::ios::fixed, std::ios::floatfield);
float voltage_in_1;
if (!inverter->ReadDspValue(voltage_in_1, DspValueEnum::V_IN_1)) {
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Input 1 Voltage: " << voltage_in_1 << " V" << std::endl;
float current_in_1;
if (!inverter->ReadDspValue(current_in_1, DspValueEnum::I_IN_1)) {
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Input 1 Current: " << current_in_1 << " A" << std::endl;
float power_in_1;
if (!inverter->ReadDspValue(power_in_1, DspValueEnum::POWER_IN_1)) {
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Input 1 Power: " << power_in_1 << " W" << std::endl;
std::cout << std::endl;
float voltage_in_2;
if (!inverter->ReadDspValue(voltage_in_2, DspValueEnum::V_IN_2)) {
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Input 2 Voltage: " << voltage_in_2 << " V" << std::endl;
float current_in_2;
if (!inverter->ReadDspValue(current_in_2, DspValueEnum::I_IN_2)) {
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Input 2 Current: " << current_in_2 << " A" << std::endl;
float power_in_2;
if (!inverter->ReadDspValue(power_in_2, DspValueEnum::POWER_IN_2)) {
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Input 2 Power: " << power_in_2 << " W" << std::endl;
std::cout << std::endl;
float grid_voltage;
if (!inverter->ReadDspValue(grid_voltage, DspValueEnum::GRID_VOLTAGE)) {
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Grid Voltage Reading: " << grid_voltage << " V" << std::endl;
float grid_current;
if (!inverter->ReadDspValue(grid_current, DspValueEnum::GRID_CURRENT)) {
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Grid Current Reading: " << grid_current << " A" << std::endl;
float grid_power;
if (!inverter->ReadDspValue(grid_power, DspValueEnum::GRID_POWER)) {
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Grid Power Reading: " << grid_power << " W" << std::endl;
float freq;
if (!inverter->ReadDspValue(freq, DspValueEnum::FREQUENCY)) {
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Frequency Reading: " << freq << " Hz" << std::endl;
std::cout << std::endl;
std::cout << "DC/AC Conversion Efficiency: "
<< (grid_power / (power_in_1 + power_in_2) * 100) << " %"
<< std::endl;
float inverter_temp;
if (!inverter->ReadDspValue(inverter_temp,
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Inverter Temperature: " << inverter_temp << " °C" << std::endl;
float booster_temp;
if (!inverter->ReadDspValue(booster_temp,
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Booster Temperature: " << booster_temp << " °C" << std::endl;
std::cout << std::endl;
std::cout.flags(old_settings);
return EXIT_SUCCESS;
}
-

This example shows basic information about the Aurora device.

Current inverter date/time: 06-Jun-2021 11:15:11
Part number: -3G79-
Serial number: 126014
Firmware: C.0.2.2
Manufacturing Date: Year 10 Week 20
Version: -- Aurora 4.2kW new -- VDE0126 -- Transformerless Version -- PV version --

The output is equivalent to "aurora -a 2 -f -g -n -p -v -t /dev/ttyUSB0"

-
#include <iostream>
#include <memory>
#include "ABBAurora.h"
int main(int argc, char *argv[])
{
const std::string device = "/dev/ttyUSB0";
std::unique_ptr<ABBAurora> inverter(new ABBAurora());
if (!inverter->Setup(device))
{
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
if (!inverter->ReadTimeDate(date))
{
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Current inverter date/time: " << date.TimeDate << std::endl;
std::string part_number;
if (!inverter->ReadPartNumber(part_number))
{
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Part number: " << part_number << std::endl;
std::string serial_number;
if (!inverter->ReadSerialNumber(serial_number))
{
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Serial number: " << serial_number << std::endl;
if (!inverter->ReadFirmwareRelease(firmware))
{
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Firmware: " << firmware.Release << std::endl;
if (!inverter->ReadManufacturingDate(mfg_date))
{
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Manufacturing Date: Year " << mfg_date.Year << " Week " << mfg_date.Week << std::endl;
if (!inverter->ReadVersion(version))
{
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Version: -- "
<< version.Par1 << " -- "
<< version.Par2 << " -- "
<< version.Par3 << " -- "
<< version.Par4 << " -- " << std::endl;
return EXIT_SUCCESS;
}
+

This example shows basic information about the Aurora device.

Current inverter date/time: 06-Jun-2021 11:15:11
Part number: -3G79-
Serial number: 126014
Firmware: C.0.2.2
Manufacturing Date: Year 10 Week 20
Version: -- Aurora 4.2kW new -- VDE0126 -- Transformerless Version -- PV
version --

The output is equivalent to "aurora -a 2 -f -g -n -p -v -t /dev/ttyUSB0"

+
#include "ABBAurora.h"
#include <iostream>
#include <memory>
int main(int argc, char *argv[]) {
const std::string device = "/dev/ttyUSB0";
std::unique_ptr<ABBAurora> inverter(new ABBAurora());
if (!inverter->Setup(device)) {
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
if (!inverter->ReadTimeDate(date)) {
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Current inverter date/time: " << date.TimeDate << std::endl;
std::string part_number;
if (!inverter->ReadPartNumber(part_number)) {
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Part number: " << part_number << std::endl;
std::string serial_number;
if (!inverter->ReadSerialNumber(serial_number)) {
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Serial number: " << serial_number << std::endl;
if (!inverter->ReadFirmwareRelease(firmware)) {
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Firmware: " << firmware.Release << std::endl;
if (!inverter->ReadManufacturingDate(mfg_date)) {
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Manufacturing Date: Year " << mfg_date.Year << " Week "
<< mfg_date.Week << std::endl;
if (!inverter->ReadVersion(version)) {
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Version: -- " << version.Par1 << " -- " << version.Par2
<< " -- " << version.Par3 << " -- " << version.Par4 << " -- "
<< std::endl;
return EXIT_SUCCESS;
}

This example shows the inverter state.

Transmission State: Everything is OK.
Global State: Run
Inverter State: Run
Channel 1 State: MPPT
Channel 2 State: MPPT
Alarm State: No Alarm

The output is equivalent to "aurora -a 2 -s /dev/ttyUSB0"

-
#include <iostream>
#include <memory>
#include "ABBAurora.h"
int main(int argc, char *argv[])
{
const std::string device = "/dev/ttyUSB0";
std::unique_ptr<ABBAurora> inverter(new ABBAurora());
if (!inverter->Setup(device))
{
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
if (!inverter->ReadState(state))
{
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Global State: " << state.GlobalState << std::endl;
std::cout << "Inverter State: " << state.InverterState << std::endl;
std::cout << "Channel 1 State: " << state.Channel1State << std::endl;
std::cout << "Channel 2 State: " << state.Channel2State << std::endl;
std::cout << "Alarm State: " << state.AlarmState << std::endl;
return EXIT_SUCCESS;
}
+
#include "ABBAurora.h"
#include <iostream>
#include <memory>
int main(int argc, char *argv[]) {
const std::string device = "/dev/ttyUSB0";
std::unique_ptr<ABBAurora> inverter(new ABBAurora());
if (!inverter->Setup(device)) {
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
if (!inverter->ReadState(state)) {
std::cout << inverter->GetErrorMessage() << std::endl;
return EXIT_FAILURE;
}
std::cout << "Global State: " << state.GlobalState << std::endl;
std::cout << "Inverter State: " << state.InverterState << std::endl;
std::cout << "Channel 1 State: " << state.Channel1State << std::endl;
std::cout << "Channel 2 State: " << state.Channel2State << std::endl;
std::cout << "Alarm State: " << state.AlarmState << std::endl;
return EXIT_SUCCESS;
}
-

Data structure for the read firmware release command. - More...

-

#include <ABBAurora.h>

 CABBAuroraCommunication protocol between host and supervisor microprocessor
 CFirmwareReleaseData structure for the read firmware release command
 CFirmwareRelease
 CLastFourAlarmsData structure for last four alarms command
 CManufacturingDateData structure for the read manufacturing date command
 CManufacturingDate
 CStateData structure for ReadState()
 CTimeDateData structure for time/date reading command
 CVersionData structure for version reading command

Data Structures

struct  FirmwareRelease
 Data structure for the read firmware release command. More...
 
struct  LastFourAlarms
 Data structure for last four alarms command. More...
 
struct  ManufacturingDate
 Data structure for the read manufacturing date command. More...
 
struct  State
 Data structure for ReadState() More...

@@ -115,7 +112,7 @@

 

Detailed Description

-

Data structure for the read firmware release command.

+

Data structure for the read firmware release command

Examples:
example_inverter.cpp.

The documentation for this struct was generated from the following file:
  • include/ABBAurora.h
  • diff --git a/struct_a_b_b_aurora_1_1_manufacturing_date.html b/struct_a_b_b_aurora_1_1_manufacturing_date.html index 8fe5867..587cb5f 100644 --- a/struct_a_b_b_aurora_1_1_manufacturing_date.html +++ b/struct_a_b_b_aurora_1_1_manufacturing_date.html @@ -98,9 +98,6 @@
-

Data structure for the read manufacturing date command. - More...

-

#include <ABBAurora.h>

@@ -119,7 +116,7 @@

 

Detailed Description

-

Data structure for the read manufacturing date command.

+

Data structure for the read manufacturing date command

Examples:
example_inverter.cpp.

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