Skip to content

Commit ab099ef

Browse files
committed
example of config.jaon
1 parent ba548cf commit ab099ef

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

cmd/modbus-poller/main.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,27 @@ import (
1313
"time"
1414
)
1515

16+
/*
17+
Example `config.json` content to poll "Victron Energy Meter VM-3P75CT" over UDP
18+
19+
{
20+
"defaults": {
21+
"server_address": "udp://192.168.0.200:502",
22+
"function_code": 3,
23+
"unit_id": 1,
24+
"protocol": "tcp",
25+
"interval": "1s"
26+
},
27+
"fields": [
28+
{"name": "AcL1Voltage", "address": 12352, "type": "Int16", "scale": 0.01},
29+
{"name": "AcL1Current", "address": 12353, "type": "Int16", "scale": 0.01},
30+
{"name": "AcL1EnergyForward", "address": 12354, "type": "Uint32", "scale": 0.01},
31+
{"name": "AcL1EnergyReverse", "address": 12356, "type": "Uint32", "scale": 0.01},
32+
{"name": "AcL1ErrorCode", "address": 12358, "type": "Uint16"},
33+
]
34+
}
35+
*/
36+
1637
type config struct {
1738
Defaults modbus.BuilderDefaults `json:"defaults" mapstructure:"defaults"`
1839
Fields []field `json:"fields" mapstructure:"fields"`

0 commit comments

Comments
 (0)