|
|
@ -17,18 +17,18 @@ union serial_u { |
|
|
|
|
|
|
|
|
|
|
|
// units
|
|
|
|
enum {UNIT_V = 0, UNIT_A, UNIT_W, UNIT_WH, UNIT_KWH, UNIT_HZ, UNIT_C, UNIT_PCT, UNIT_VA, UNIT_NONE}; |
|
|
|
const char* const units[] = {"V", "A", "W", "Wh", "kWh", "Hz", "°C", "%","VAr",""}; |
|
|
|
enum {UNIT_V = 0, UNIT_A, UNIT_W, UNIT_WH, UNIT_KWH, UNIT_HZ, UNIT_C, UNIT_PCT, UNIT_VAR, UNIT_NONE}; |
|
|
|
const char* const units[] = {"V", "A", "W", "Wh", "kWh", "Hz", "°C", "%", "var", ""}; |
|
|
|
|
|
|
|
|
|
|
|
// field types
|
|
|
|
enum {FLD_UDC = 0, FLD_IDC, FLD_PDC, FLD_YD, FLD_YW, FLD_YT, |
|
|
|
FLD_UAC, FLD_IAC, FLD_PAC, FLD_F, FLD_T, FLD_PFC, FLD_EFF, |
|
|
|
FLD_IRR, FLD_PRA,FLD_ALARM_MES_ID,FLD_FW_VERSION,FLD_FW_BUILD_YEAR, |
|
|
|
FLD_UAC, FLD_IAC, FLD_PAC, FLD_F, FLD_T, FLD_PF, FLD_EFF, |
|
|
|
FLD_IRR, FLD_Q,FLD_ALARM_MES_ID,FLD_FW_VERSION,FLD_FW_BUILD_YEAR, |
|
|
|
FLD_FW_BUILD_MONTH_DAY,FLD_HW_ID,FLD_ACT_PWR_LIMIT,FLD_LAST_ALARM_CODE}; |
|
|
|
|
|
|
|
const char* const fields[] = {"U_DC", "I_DC", "P_DC", "YieldDay", "YieldWeek", "YieldTotal", |
|
|
|
"U_AC", "I_AC", "P_AC", "Freq", "Temp", "PFC", "Efficiency", "Irradiation","P_ACr", |
|
|
|
"U_AC", "I_AC", "P_AC", "F_AC", "Temp", "PF_AC", "Efficiency", "Irradiation","Q_AC", |
|
|
|
"ALARM_MES_ID","FWVersion","FWBuildYear","FWBuildMonthDay","HWPartId","PowerLimit","LastAlarmCode"}; |
|
|
|
const char* const notAvail = "n/a"; |
|
|
|
|
|
|
@ -54,7 +54,7 @@ const byteAssign_fieldDeviceClass deviceFieldAssignment[] = { |
|
|
|
{FLD_PAC, DEVICE_CLS_PWR, STATE_CLS_MEASUREMENT}, |
|
|
|
{FLD_F, DEVICE_CLS_FREQ, STATE_CLS_NONE}, |
|
|
|
{FLD_T, DEVICE_CLS_TEMP, STATE_CLS_MEASUREMENT}, |
|
|
|
{FLD_PFC, DEVICE_CLS_NONE, STATE_CLS_NONE}, |
|
|
|
{FLD_PF, DEVICE_CLS_NONE, STATE_CLS_NONE}, |
|
|
|
{FLD_EFF, DEVICE_CLS_NONE, STATE_CLS_NONE}, |
|
|
|
{FLD_IRR, DEVICE_CLS_NONE, STATE_CLS_NONE} |
|
|
|
}; |
|
|
@ -123,10 +123,11 @@ const byteAssign_t hm1chAssignment[] = { |
|
|
|
{ FLD_UAC, UNIT_V, CH0, 14, 2, 10 }, |
|
|
|
{ FLD_IAC, UNIT_A, CH0, 22, 2, 100 }, |
|
|
|
{ FLD_PAC, UNIT_W, CH0, 18, 2, 10 }, |
|
|
|
{ FLD_PRA, UNIT_VA, CH0, 20, 2, 10 }, |
|
|
|
{ FLD_Q, UNIT_VAR, CH0, 20, 2, 10 }, |
|
|
|
{ FLD_F, UNIT_HZ, CH0, 16, 2, 100 }, |
|
|
|
{ FLD_PF, UNIT_NONE,CH0, 24, 2, 1000 }, |
|
|
|
{ FLD_T, UNIT_C, CH0, 26, 2, 10 }, |
|
|
|
{ FLD_ALARM_MES_ID, UNIT_NONE, CH0, 24, 2, 1 }, |
|
|
|
{ FLD_ALARM_MES_ID, UNIT_NONE, CH0, 28, 2, 1 }, |
|
|
|
{ FLD_YD, UNIT_WH, CH0, CALC_YD_CH0, 0, CMD_CALC }, |
|
|
|
{ FLD_YT, UNIT_KWH, CH0, CALC_YT_CH0, 0, CMD_CALC }, |
|
|
|
{ FLD_PDC, UNIT_W, CH0, CALC_PDC_CH0, 0, CMD_CALC }, |
|
|
@ -156,8 +157,9 @@ const byteAssign_t hm2chAssignment[] = { |
|
|
|
{ FLD_UAC, UNIT_V, CH0, 26, 2, 10 }, |
|
|
|
{ FLD_IAC, UNIT_A, CH0, 34, 2, 100 }, |
|
|
|
{ FLD_PAC, UNIT_W, CH0, 30, 2, 10 }, |
|
|
|
{ FLD_PRA, UNIT_VA, CH0, 32, 2, 10 }, |
|
|
|
{ FLD_Q, UNIT_VAR, CH0, 32, 2, 10 }, |
|
|
|
{ FLD_F, UNIT_HZ, CH0, 28, 2, 100 }, |
|
|
|
{ FLD_PF, UNIT_NONE,CH0, 36, 2, 1000 }, |
|
|
|
{ FLD_T, UNIT_C, CH0, 38, 2, 10 }, |
|
|
|
{ FLD_ALARM_MES_ID, UNIT_NONE, CH0, 40, 2, 1 }, |
|
|
|
{ FLD_YD, UNIT_WH, CH0, CALC_YD_CH0, 0, CMD_CALC }, |
|
|
@ -204,9 +206,9 @@ const byteAssign_t hm4chAssignment[] = { |
|
|
|
{ FLD_UAC, UNIT_V, CH0, 46, 2, 10 }, |
|
|
|
{ FLD_IAC, UNIT_A, CH0, 54, 2, 100 }, |
|
|
|
{ FLD_PAC, UNIT_W, CH0, 50, 2, 10 }, |
|
|
|
{ FLD_PRA, UNIT_VA, CH0, 52, 2, 10 }, |
|
|
|
{ FLD_Q, UNIT_VAR, CH0, 52, 2, 10 }, |
|
|
|
{ FLD_F, UNIT_HZ, CH0, 48, 2, 100 }, |
|
|
|
{ FLD_PFC, UNIT_PCT, CH0, 56, 2, 10 }, |
|
|
|
{ FLD_PF, UNIT_NONE,CH0, 56, 2, 1000 }, |
|
|
|
{ FLD_T, UNIT_C, CH0, 58, 2, 10 }, |
|
|
|
{ FLD_ALARM_MES_ID, UNIT_NONE, CH0, 60, 2, 1 }, |
|
|
|
{ FLD_YD, UNIT_WH, CH0, CALC_YD_CH0, 0, CMD_CALC }, |
|
|
|