|
@@ -0,0 +1,547 @@
|
|
1
|
+/*
|
|
2
|
+ * Author: Jon Trulson <jtrulson@ics.com>
|
|
3
|
+ * Copyright (c) 2016 Intel Corporation.
|
|
4
|
+ *
|
|
5
|
+ * Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+ * a copy of this software and associated documentation files (the
|
|
7
|
+ * "Software"), to deal in the Software without restriction, including
|
|
8
|
+ * without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+ * distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+ * permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+ * the following conditions:
|
|
12
|
+ *
|
|
13
|
+ * The above copyright notice and this permission notice shall be
|
|
14
|
+ * included in all copies or substantial portions of the Software.
|
|
15
|
+ *
|
|
16
|
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
|
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
23
|
+ */
|
|
24
|
+#pragma once
|
|
25
|
+
|
|
26
|
+#include <string>
|
|
27
|
+
|
|
28
|
+#include <modbus/modbus.h>
|
|
29
|
+
|
|
30
|
+namespace upm {
|
|
31
|
+
|
|
32
|
+ /**
|
|
33
|
+ * @brief H803X Energy Meter
|
|
34
|
+ * @defgroup h803x libupm-h803x
|
|
35
|
+ * @ingroup uart electric
|
|
36
|
+ */
|
|
37
|
+
|
|
38
|
+ /**
|
|
39
|
+ * @library h803x
|
|
40
|
+ * @sensor h803x
|
|
41
|
+ * @comname UPM API for the Veris H803X Energy Meter
|
|
42
|
+ * @type electic
|
|
43
|
+ * @man veris
|
|
44
|
+ * @con uart
|
|
45
|
+ * @web http://www.veris.com/Item/H8035-0100-2.aspx
|
|
46
|
+ *
|
|
47
|
+ * @brief UPM API for the Veris H803X Energy Meter
|
|
48
|
+ *
|
|
49
|
+ * This module implements support for the Veris H8035 and H8036
|
|
50
|
+ * Energy Meters.
|
|
51
|
+ *
|
|
52
|
+ * The H8036 is similar to the H8035, but provides much more data.
|
|
53
|
+ *
|
|
54
|
+ * The Enercept H8035/H8036 is an innovative three-phase networked
|
|
55
|
+ * (Modbus RTU) power transducer that combines electronics and high
|
|
56
|
+ * accuracy industrial grade CTs in a single package. The need for
|
|
57
|
+ * external electrical enclosures is eliminated, greatly reducing
|
|
58
|
+ * installation time and cost. Color-coordination between voltage
|
|
59
|
+ * leads and CTs makes phase matching easy. Additionally, these
|
|
60
|
+ * transducers automatically detect and compensate for phase
|
|
61
|
+ * reversal, eliminating the concern of CT load orientation. Up to
|
|
62
|
+ * 63 Transducers can be daisy-chained on a single RS-485 network.
|
|
63
|
+ *
|
|
64
|
+ * This module was developed using libmodbus 3.1.2, and the H8035.
|
|
65
|
+ * The H8036 has not been tested. libmodbus 3.1.2 must be present
|
|
66
|
+ * for this module to build.
|
|
67
|
+ *
|
|
68
|
+ * It was developed using an RS232->RS485 interface. You cannot use
|
|
69
|
+ * the built in MCU TTL UART pins for accessing this device -- you
|
|
70
|
+ * must use a full Serial RS232->RS485 or USB-RS485 interface
|
|
71
|
+ * connected via USB.
|
|
72
|
+ *
|
|
73
|
+ * @snippet h803x.cxx Interesting
|
|
74
|
+ */
|
|
75
|
+
|
|
76
|
+ class H803X {
|
|
77
|
+ public:
|
|
78
|
+
|
|
79
|
+ // MODBUS holding registers. These offsets are for the MSW only.
|
|
80
|
+ // The LSW always follows, though they are not enumerated here.
|
|
81
|
+ // These are all 2 register (32-bit total (16b HSW + 16b LSW))
|
|
82
|
+ // quantities, in IEEE 754 floating point format.
|
|
83
|
+ typedef enum {
|
|
84
|
+ // these two registers are used only for presetConsumption()
|
|
85
|
+ HOLDING_CONSUMPTION_KWH_INT_L = 0, // preset use only
|
|
86
|
+ HOLDING_CONSUMPTION_KWH_INT_H = 1, // preset use only
|
|
87
|
+
|
|
88
|
+ // H8035/H8036
|
|
89
|
+ HOLDING_CONSUMPTION_KWH = 258, // floating point data
|
|
90
|
+
|
|
91
|
+ HOLDING_REAL_POWER_KW = 260,
|
|
92
|
+
|
|
93
|
+ // H8036 only
|
|
94
|
+ HOLDING_REACTIVE_POWER_KVAR = 262,
|
|
95
|
+ HOLDING_APPARENT_POWER_KVA = 264,
|
|
96
|
+ HOLDING_POWER_FACTOR = 266,
|
|
97
|
+ HOLDING_VOLTS_LINE_TO_LINE = 268,
|
|
98
|
+ HOLDING_VOLTS_LINE_TO_NEUTRAL = 270,
|
|
99
|
+ HOLDING_CURRENT = 272,
|
|
100
|
+ HOLDING_REAL_POWER_PHASE_A_KWH = 274,
|
|
101
|
+ HOLDING_REAL_POWER_PHASE_B_KWH = 276,
|
|
102
|
+ HOLDING_REAL_POWER_PHASE_C_KWH = 278,
|
|
103
|
+ HOLDING_POWER_FACTOR_PHASE_A = 280,
|
|
104
|
+ HOLDING_POWER_FACTOR_PHASE_B = 282,
|
|
105
|
+ HOLDING_POWER_FACTOR_PHASE_C = 284,
|
|
106
|
+ HOLDING_VOLTS_PHASE_AB = 286,
|
|
107
|
+ HOLDING_VOLTS_PHASE_BC = 288,
|
|
108
|
+ HOLDING_VOLTS_PHASE_AC = 290,
|
|
109
|
+ HOLDING_VOLTS_PHASE_AN = 292,
|
|
110
|
+ HOLDING_VOLTS_PHASE_BN = 294,
|
|
111
|
+ HOLDING_VOLTS_PHASE_CN = 296,
|
|
112
|
+ HOLDING_CURRENT_PHASE_A = 298,
|
|
113
|
+ HOLDING_CURRENT_PHASE_B = 300,
|
|
114
|
+ HOLDING_CURRENT_PHASE_C = 302,
|
|
115
|
+ HOLDING_AVG_REAL_POWER_KW = 304,
|
|
116
|
+ HOLDING_MIN_REAL_POWER_KW = 306,
|
|
117
|
+ HOLDING_MAX_REAL_POWER_KW = 308
|
|
118
|
+ } HOLDING_REGS_T;
|
|
119
|
+
|
|
120
|
+ // these enums are used by presetConsumption() to scale the value
|
|
121
|
+ // properly depending on the devices' current capacity.
|
|
122
|
+ typedef enum {
|
|
123
|
+ MULT_100A = 128, // 100A devices
|
|
124
|
+ MULT_300A_400A = 32,
|
|
125
|
+ MULT_800A = 16,
|
|
126
|
+ MULT_1600A = 8,
|
|
127
|
+ MULT_2400A = 4
|
|
128
|
+ } MULTIPLIERS_T;
|
|
129
|
+
|
|
130
|
+ /**
|
|
131
|
+ * H803X constructor
|
|
132
|
+ *
|
|
133
|
+ * @param device Path to the serial device
|
|
134
|
+ * @param address The MODBUS slave address
|
|
135
|
+ * @param baud The baudrate of the device. Default: 9600
|
|
136
|
+ * @param bits The number of bits per byte. Default: 8
|
|
137
|
+ * @param parity The parity of the connection, 'N' for None, 'E'
|
|
138
|
+ * for Even, 'O' for Odd. Default: 'N'
|
|
139
|
+ * @param stopBits The number of stop bits. Default: 2
|
|
140
|
+ */
|
|
141
|
+ H803X(std::string device, int address, int baud=9600, int bits=8,
|
|
142
|
+ char parity='N', int stopBits=2);
|
|
143
|
+
|
|
144
|
+ /**
|
|
145
|
+ * H803X Destructor
|
|
146
|
+ */
|
|
147
|
+ ~H803X();
|
|
148
|
+
|
|
149
|
+ /**
|
|
150
|
+ * Read current values from the sensor and update internal stored
|
|
151
|
+ * values. This method must be called prior to querying any
|
|
152
|
+ * values.
|
|
153
|
+ */
|
|
154
|
+ void update();
|
|
155
|
+
|
|
156
|
+ /**
|
|
157
|
+ * Return a string corresponding the the device's MODBUS slave ID.
|
|
158
|
+ *
|
|
159
|
+ * @return string represnting the MODBUS slave ID
|
|
160
|
+ */
|
|
161
|
+ std::string getSlaveID();
|
|
162
|
+
|
|
163
|
+ /**
|
|
164
|
+ * Set a new MODBUS slave address. This is useful if you have
|
|
165
|
+ * multiple H803X devices on a single bus. When this method is
|
|
166
|
+ * called, the current stored data is cleared, and a new attempt
|
|
167
|
+ * is made to determine whether the target device is an H8035 or
|
|
168
|
+ * H8036.
|
|
169
|
+ *
|
|
170
|
+ * @param addr The new slave address to set
|
|
171
|
+ */
|
|
172
|
+ void setSlaveAddress(int addr);
|
|
173
|
+
|
|
174
|
+ /**
|
|
175
|
+ * Preset the kWh accumulated Consumption registers to a
|
|
176
|
+ * predefined value. This is generally not advised, but is
|
|
177
|
+ * provided for those installations that might require it. The
|
|
178
|
+ * multiplier depends on the current range of your device. Be
|
|
179
|
+ * sure to select the right multiplier for your devices'
|
|
180
|
+ * supported current capacity.
|
|
181
|
+ *
|
|
182
|
+ * @param value The desired value for the consumption accumulator
|
|
183
|
+ * registers in kWh.
|
|
184
|
+ * @param multiplier The correct MULTIPLIERS_T value for your device.
|
|
185
|
+ */
|
|
186
|
+ void presetConsumption(float value, MULTIPLIERS_T multiplier);
|
|
187
|
+
|
|
188
|
+ /**
|
|
189
|
+ * Return the accumulated consumption value, in kWh. update() must
|
|
190
|
+ * have been called prior to calling this method.
|
|
191
|
+ *
|
|
192
|
+ * @return The accumulated consumption.
|
|
193
|
+ */
|
|
194
|
+ float getConsumption()
|
|
195
|
+ {
|
|
196
|
+ return m_consumptionkWh;
|
|
197
|
+ };
|
|
198
|
+
|
|
199
|
+ /**
|
|
200
|
+ * Return the real power value in kW. update() must have been
|
|
201
|
+ * called prior to calling this method.
|
|
202
|
+ *
|
|
203
|
+ * @return The real power value in kW.
|
|
204
|
+ */
|
|
205
|
+ float getRealPower()
|
|
206
|
+ {
|
|
207
|
+ return m_realPowerkW;
|
|
208
|
+ };
|
|
209
|
+
|
|
210
|
+ /**
|
|
211
|
+ * Return the reactive power value in kVAR (kilo-volt Amperes
|
|
212
|
+ * Reactive). update() must have been called prior to calling this
|
|
213
|
+ * method.
|
|
214
|
+ *
|
|
215
|
+ * @return The reactive power value in kVAR.
|
|
216
|
+ */
|
|
217
|
+ float getReactivePower()
|
|
218
|
+ {
|
|
219
|
+ return m_reactivePowerkVAR;
|
|
220
|
+ };
|
|
221
|
+
|
|
222
|
+ /**
|
|
223
|
+ * Return the apparent power value in kVA. update() must have been
|
|
224
|
+ * called prior to calling this method.
|
|
225
|
+ *
|
|
226
|
+ * @return The apparent power value in kVA.
|
|
227
|
+ */
|
|
228
|
+ float getApparentPower()
|
|
229
|
+ {
|
|
230
|
+ return m_apparentPowerkVA;
|
|
231
|
+ };
|
|
232
|
+
|
|
233
|
+ /**
|
|
234
|
+ * Return the power factor value. update() must have been called
|
|
235
|
+ * prior to calling this method.
|
|
236
|
+ *
|
|
237
|
+ * @return The power factor.
|
|
238
|
+ */
|
|
239
|
+ float getPowerFactor()
|
|
240
|
+ {
|
|
241
|
+ return m_powerFactor;
|
|
242
|
+ };
|
|
243
|
+
|
|
244
|
+ /**
|
|
245
|
+ * Return the voltage line to line value. update() must have been
|
|
246
|
+ * called prior to calling this method.
|
|
247
|
+ *
|
|
248
|
+ * @return The voltage, line to line.
|
|
249
|
+ */
|
|
250
|
+ float getVoltsLineToLine()
|
|
251
|
+ {
|
|
252
|
+ return m_voltsLineToLine;
|
|
253
|
+ };
|
|
254
|
+
|
|
255
|
+ /**
|
|
256
|
+ * Return the voltage line to neutral. update() must have been
|
|
257
|
+ * called prior to calling this method.
|
|
258
|
+ *
|
|
259
|
+ * @return The voltage, line to neutral.
|
|
260
|
+ */
|
|
261
|
+ float getVoltsLineToNeutral()
|
|
262
|
+ {
|
|
263
|
+ return m_voltsLineToNeutral;
|
|
264
|
+ };
|
|
265
|
+
|
|
266
|
+ /**
|
|
267
|
+ * Return the current value in amps. update() must have been
|
|
268
|
+ * called prior to calling this method.
|
|
269
|
+ *
|
|
270
|
+ * @return The current value in amps.
|
|
271
|
+ */
|
|
272
|
+ float getCurrent()
|
|
273
|
+ {
|
|
274
|
+ return m_current;
|
|
275
|
+ };
|
|
276
|
+
|
|
277
|
+ /**
|
|
278
|
+ * Return the real power for phase A. update() must have been
|
|
279
|
+ * called prior to calling this method.
|
|
280
|
+ *
|
|
281
|
+ * @return The real power for phase A.
|
|
282
|
+ */
|
|
283
|
+ float getRealPowerPhaseA()
|
|
284
|
+ {
|
|
285
|
+ return m_realPowerPhaseAkW;
|
|
286
|
+ };
|
|
287
|
+
|
|
288
|
+ /**
|
|
289
|
+ * Return the real power for phase B. update() must have been
|
|
290
|
+ * called prior to calling this method.
|
|
291
|
+ *
|
|
292
|
+ * @return The real power for phase B.
|
|
293
|
+ */
|
|
294
|
+ float getRealPowerPhaseB()
|
|
295
|
+ {
|
|
296
|
+ return m_realPowerPhaseBkW;
|
|
297
|
+ };
|
|
298
|
+
|
|
299
|
+ /**
|
|
300
|
+ * Return the real power for phase C. update() must have been
|
|
301
|
+ * called prior to calling this method.
|
|
302
|
+ *
|
|
303
|
+ * @return The real power for phase C.
|
|
304
|
+ */
|
|
305
|
+ float getRealPowerPhaseC()
|
|
306
|
+ {
|
|
307
|
+ return m_realPowerPhaseCkW;
|
|
308
|
+ };
|
|
309
|
+
|
|
310
|
+ /**
|
|
311
|
+ * Return the power factor for phase A. update() must have been
|
|
312
|
+ * called prior to calling this method.
|
|
313
|
+ *
|
|
314
|
+ * @return The power factor for phase A.
|
|
315
|
+ */
|
|
316
|
+ float getPowerFactorPhaseA()
|
|
317
|
+ {
|
|
318
|
+ return m_powerFactorPhaseA;
|
|
319
|
+ };
|
|
320
|
+
|
|
321
|
+ /**
|
|
322
|
+ * Return the power factor for phase B. update() must have been
|
|
323
|
+ * called prior to calling this method.
|
|
324
|
+ *
|
|
325
|
+ * @return The power factor for phase B.
|
|
326
|
+ */
|
|
327
|
+ float getPowerFactorPhaseB()
|
|
328
|
+ {
|
|
329
|
+ return m_powerFactorPhaseB;
|
|
330
|
+ };
|
|
331
|
+
|
|
332
|
+ /**
|
|
333
|
+ * Return the power factor for phase C. update() must have been
|
|
334
|
+ * called prior to calling this method.
|
|
335
|
+ *
|
|
336
|
+ * @return The power factor for phase C.
|
|
337
|
+ */
|
|
338
|
+ float getPowerFactorPhaseC()
|
|
339
|
+ {
|
|
340
|
+ return m_powerFactorPhaseC;
|
|
341
|
+ };
|
|
342
|
+
|
|
343
|
+ /**
|
|
344
|
+ * Return the voltage for phase A to B. update() must have been
|
|
345
|
+ * called prior to calling this method.
|
|
346
|
+ *
|
|
347
|
+ * @return The voltage for phase A to B.
|
|
348
|
+ */
|
|
349
|
+ float getVoltsPhaseAToB()
|
|
350
|
+ {
|
|
351
|
+ return m_voltsPhaseAB;
|
|
352
|
+ };
|
|
353
|
+
|
|
354
|
+ /**
|
|
355
|
+ * Return the voltage for phase B to C. update() must have been
|
|
356
|
+ * called prior to calling this method.
|
|
357
|
+ *
|
|
358
|
+ * @return The voltage for phase B to C.
|
|
359
|
+ */
|
|
360
|
+ float getVoltsPhaseBToC()
|
|
361
|
+ {
|
|
362
|
+ return m_voltsPhaseBC;
|
|
363
|
+ };
|
|
364
|
+
|
|
365
|
+ /**
|
|
366
|
+ * Return the voltage for phase A to B. update() must have been
|
|
367
|
+ * called prior to calling this method.
|
|
368
|
+ *
|
|
369
|
+ * @return The voltage for phase A to B.
|
|
370
|
+ */
|
|
371
|
+ float getVoltsPhaseAToC()
|
|
372
|
+ {
|
|
373
|
+ return m_voltsPhaseAC;
|
|
374
|
+ };
|
|
375
|
+
|
|
376
|
+ /**
|
|
377
|
+ * Return the voltage for phase A to neutral. update() must have
|
|
378
|
+ * been called prior to calling this method.
|
|
379
|
+ *
|
|
380
|
+ * @return The voltage for phase A to neutral.
|
|
381
|
+ */
|
|
382
|
+ float getVoltsPhaseAToNeutral()
|
|
383
|
+ {
|
|
384
|
+ return m_voltsPhaseAN;
|
|
385
|
+ };
|
|
386
|
+
|
|
387
|
+ /**
|
|
388
|
+ * Return the voltage for phase B to neutral. update() must have
|
|
389
|
+ * been called prior to calling this method.
|
|
390
|
+ *
|
|
391
|
+ * @return The voltage for phase B to neutral.
|
|
392
|
+ */
|
|
393
|
+ float getVoltsPhaseBToNeutral()
|
|
394
|
+ {
|
|
395
|
+ return m_voltsPhaseBN;
|
|
396
|
+ };
|
|
397
|
+
|
|
398
|
+ /**
|
|
399
|
+ * Return the voltage for phase C to neutral. update() must have
|
|
400
|
+ * been called prior to calling this method.
|
|
401
|
+ *
|
|
402
|
+ * @return The voltage for phase C to neutral.
|
|
403
|
+ */
|
|
404
|
+ float getVoltsPhaseCToNeutral()
|
|
405
|
+ {
|
|
406
|
+ return m_voltsPhaseCN;
|
|
407
|
+ };
|
|
408
|
+
|
|
409
|
+ /**
|
|
410
|
+ * Return the current for phase A. update() must have been called
|
|
411
|
+ * prior to calling this method.
|
|
412
|
+ *
|
|
413
|
+ * @return The current for phase A.
|
|
414
|
+ */
|
|
415
|
+ float getCurrentPhaseA()
|
|
416
|
+ {
|
|
417
|
+ return m_currentPhaseA;
|
|
418
|
+ };
|
|
419
|
+
|
|
420
|
+ /**
|
|
421
|
+ * Return the current for phase B. update() must have been called
|
|
422
|
+ * prior to calling this method.
|
|
423
|
+ *
|
|
424
|
+ * @return The current for phase B.
|
|
425
|
+ */
|
|
426
|
+ float getCurrentPhaseB()
|
|
427
|
+ {
|
|
428
|
+ return m_currentPhaseB;
|
|
429
|
+ };
|
|
430
|
+
|
|
431
|
+ /**
|
|
432
|
+ * Return the current for phase C. update() must have been called
|
|
433
|
+ * prior to calling this method.
|
|
434
|
+ *
|
|
435
|
+ * @return The current for phase C.
|
|
436
|
+ */
|
|
437
|
+ float getCurrentPhaseC()
|
|
438
|
+ {
|
|
439
|
+ return m_currentPhaseC;
|
|
440
|
+ };
|
|
441
|
+
|
|
442
|
+ /**
|
|
443
|
+ * Return the average real power. update() must have been called
|
|
444
|
+ * prior to calling this method.
|
|
445
|
+ *
|
|
446
|
+ * @return The average real power.
|
|
447
|
+ */
|
|
448
|
+ float getAvgRealPower()
|
|
449
|
+ {
|
|
450
|
+ return m_avgRealPowerkW;
|
|
451
|
+ };
|
|
452
|
+
|
|
453
|
+ /**
|
|
454
|
+ * Return the minimum real power. update() must have been called
|
|
455
|
+ * prior to calling this method.
|
|
456
|
+ *
|
|
457
|
+ * @return The minimum real power.
|
|
458
|
+ */
|
|
459
|
+ float getMinRealPower()
|
|
460
|
+ {
|
|
461
|
+ return m_minRealPowerkW;
|
|
462
|
+ };
|
|
463
|
+
|
|
464
|
+ /**
|
|
465
|
+ * Return the maximum real power. update() must have been called
|
|
466
|
+ * prior to calling this method.
|
|
467
|
+ *
|
|
468
|
+ * @return The maximum real power.
|
|
469
|
+ */
|
|
470
|
+ float getMaxRealPower()
|
|
471
|
+ {
|
|
472
|
+ return m_maxRealPowerkW;
|
|
473
|
+ };
|
|
474
|
+
|
|
475
|
+ /**
|
|
476
|
+ * Enable or disable debugging output. This primarily enables and
|
|
477
|
+ * disables libmodbus debugging output.
|
|
478
|
+ *
|
|
479
|
+ * @param enable true to enable debugging, false otherwise
|
|
480
|
+ */
|
|
481
|
+ void setDebug(bool enable);
|
|
482
|
+
|
|
483
|
+ /**
|
|
484
|
+ * Indicate whether the connected device is an H8035 or an H8036.
|
|
485
|
+ * The H8036 provides many more data registers.
|
|
486
|
+ *
|
|
487
|
+ * @return true if we are using an H8036, false otherwise.
|
|
488
|
+ */
|
|
489
|
+ bool isH8036()
|
|
490
|
+ {
|
|
491
|
+ return m_isH8036;
|
|
492
|
+ };
|
|
493
|
+
|
|
494
|
+ protected:
|
|
495
|
+ // holding registers
|
|
496
|
+ int readHoldingRegs(HOLDING_REGS_T reg, int len, uint16_t *buf);
|
|
497
|
+ void writeHoldingReg(HOLDING_REGS_T reg, int value);
|
|
498
|
+
|
|
499
|
+ // clear out all stored data
|
|
500
|
+ void clearData();
|
|
501
|
+
|
|
502
|
+ // MODBUS context
|
|
503
|
+ modbus_t *m_mbContext;
|
|
504
|
+
|
|
505
|
+ // test to see if the connected device is an H8036, and set
|
|
506
|
+ // m_isH8036 appropriately
|
|
507
|
+ void testH8036();
|
|
508
|
+
|
|
509
|
+ // Is this an H8036 (has extended registers)
|
|
510
|
+ bool m_isH8036;
|
|
511
|
+
|
|
512
|
+ private:
|
|
513
|
+ bool m_debugging;
|
|
514
|
+
|
|
515
|
+ // data
|
|
516
|
+
|
|
517
|
+ // H8035 / H8036
|
|
518
|
+ float m_consumptionkWh;
|
|
519
|
+ float m_realPowerkW;
|
|
520
|
+
|
|
521
|
+ // H8036 only
|
|
522
|
+ float m_reactivePowerkVAR;
|
|
523
|
+ float m_apparentPowerkVA;
|
|
524
|
+ float m_powerFactor;
|
|
525
|
+ float m_voltsLineToLine;
|
|
526
|
+ float m_voltsLineToNeutral;
|
|
527
|
+ float m_current; // in amps
|
|
528
|
+ float m_realPowerPhaseAkW;
|
|
529
|
+ float m_realPowerPhaseBkW;
|
|
530
|
+ float m_realPowerPhaseCkW;
|
|
531
|
+ float m_powerFactorPhaseA;
|
|
532
|
+ float m_powerFactorPhaseB;
|
|
533
|
+ float m_powerFactorPhaseC;
|
|
534
|
+ float m_voltsPhaseAB;
|
|
535
|
+ float m_voltsPhaseBC;
|
|
536
|
+ float m_voltsPhaseAC;
|
|
537
|
+ float m_voltsPhaseAN;
|
|
538
|
+ float m_voltsPhaseBN;
|
|
539
|
+ float m_voltsPhaseCN;
|
|
540
|
+ float m_currentPhaseA;
|
|
541
|
+ float m_currentPhaseB;
|
|
542
|
+ float m_currentPhaseC;
|
|
543
|
+ float m_avgRealPowerkW;
|
|
544
|
+ float m_minRealPowerkW;
|
|
545
|
+ float m_maxRealPowerkW;
|
|
546
|
+ };
|
|
547
|
+}
|