You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 25, 2019. It is now read-only.
Currently, a lot of code is used to define meter opcodes (query snips). This could be greatly reduced by specifying standard "opcodes" and define its mapping register per meter. The approach could use e.g. simple structures like this:
iec61850 := map[string]string{
"VolLocPhsA": "L1 Voltage (V)",
"VolLocPhsB": "L2 Voltage (V)",
"VolLocPhsC": "L3 Voltage (V)",
"AmpLocPhsA": "L1 Current (A)",
"AmpLocPhsB": "L2 Current (A)",
"AmpLocPhsC": "L3 Current (A)",
"WLocPhsA": "L1 Power (W)",
"WLocPhsB": "L2 Power (W)",
"WLocPhsC": "L3 Power (W)",
"AngLocPhsA": "L1 Cosphi",
"AngLocPhsB": "L2 Cosphi",
"AngLocPhsC": "L3 Cosphi",
"TotkWhImportPhsA": "L1 Import (kWh)",
"TotkWhImportPhsB": "L2 Import (kWh)",
"TotkWhImportPhsC": "L3 Import (kWh)",
"TotkWhImport": "Total Import (kWh)",
"TotkWhExportPhsA": "L1 Export (kWh)",
"TotkWhExportPhsB": "L2 Export (kWh)",
"TotkWhExportPhsC": "L3 Export (kWh)",
"TotkWhExport": "Total Export (kWh)",
"ThdVolPhsA": "L1 Voltage to neutral THD (%)",
"ThdVolPhsB": "L2 Voltage to neutral THD (%)",
"ThdVolPhsC": "L3 Voltage to neutral THD (%)",
"ThdVol": "Average voltage to neutral THD (%)",
"Freq": "Frequency of supply voltages",
}
fmt.Println(iec61850)
Defining all QuerySnips per meter (Produce())would then be a simple matter of iterating over the struct.
I'd prefer to combine this with a single naming regime for opcodes. UI and APIs currently use IEC61850 (e.g. VolLocPhsA ), code internally relies on more speaking names like L1Voltage. My preference would be the latter for UI, API and source code.
If this is only applied to the new sdm630 daemon this could be considered a non-breaking change. Opinions welcome.
The text was updated successfully, but these errors were encountered:
Currently, a lot of code is used to define meter opcodes (query snips). This could be greatly reduced by specifying standard "opcodes" and define its mapping register per meter. The approach could use e.g. simple structures like this:
Meter definitions would look like this:
Defining all
QuerySnips
per meter (Produce()
)would then be a simple matter of iterating over the struct.I'd prefer to combine this with a single naming regime for opcodes. UI and APIs currently use IEC61850 (e.g.
VolLocPhsA
), code internally relies on more speaking names likeL1Voltage
. My preference would be the latter for UI, API and source code.If this is only applied to the new
sdm630
daemon this could be considered a non-breaking change. Opinions welcome.The text was updated successfully, but these errors were encountered: