Skip to content

Commit b47b7d5

Browse files
committed
Adding udp example
1 parent 5ef2d8a commit b47b7d5

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ Example configuration of pre-defined registers from type "Holding Registers" or
179179
- [src/app/modbus_server.json](https://github.com/cybcon/modbus-server/blob/main/src/app/modbus_server.json)
180180
- [examples/abb_coretec_example.json](https://github.com/cybcon/modbus-server/blob/main/examples/abb_coretec_example.json)
181181
- [examples/test.json](https://github.com/cybcon/modbus-server/blob/main/examples/test.json)
182+
- [examples/udp.json](https://github.com/cybcon/modbus-server/blob/main/examples/udp.json)
182183

183184

184185

examples/udp.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"server": {
3+
"listenerAddress": "0.0.0.0",
4+
"listenerPort": 5020,
5+
"protocol": "UDP",
6+
"tlsParams": {
7+
"description": "path to certificate and private key to enable tls",
8+
"privateKey": null,
9+
"certificate": null
10+
},
11+
"logging": {
12+
"format": "%(asctime)-15s %(threadName)-15s %(levelname)-8s %(module)-15s:%(lineno)-8s %(message)s",
13+
"logLevel": "DEBUG"
14+
}
15+
},
16+
"registers": {
17+
"description": "initial values for the register types",
18+
"zeroMode": false,
19+
"initializeUndefinedRegisters": true,
20+
"discreteInput": {
21+
"1": true,
22+
"2": false,
23+
"3": true,
24+
"4": false
25+
},
26+
"coils": {
27+
"1": false,
28+
"2": true,
29+
"3": true,
30+
"4": false
31+
},
32+
"holdingRegister": {
33+
"1": 52225,
34+
"2": "0xCC02",
35+
"3": 52227,
36+
"4": "0xCC04"
37+
},
38+
"inputRegister": {
39+
"1": "0xDD01",
40+
"2": 56578,
41+
"3": "0xDD03",
42+
"4": 56580
43+
}
44+
}
45+
}

0 commit comments

Comments
 (0)