-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.example.json
More file actions
66 lines (61 loc) · 2.01 KB
/
Copy pathconfig.example.json
File metadata and controls
66 lines (61 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{
// How often (ms) the server reads every PLC and writes the combined data back.
"operationInterval": 5000,
// Reconnection behaviour for a dropped PLC connection.
"maxReconnectAttempts": 5,
"reconnectInterval": 1000,
// Port the HTTPS server / JSON API listens on.
"httpPort": 3011,
// Base URL + endpoint paths the built-in web GUI uses to reach this server.
"apiConfig": {
"baseUrl": "https://YOUR_SERVER_IP",
"dataEndpoint": "/data",
"manualEndpoint": "/manual",
"guiEndpoint": "/gui"
},
// One entry per PLC.
// dbNumber = the DB this PLC shares (its "share_this_data" block)
// syncDbNumber = the combined sync DB present on every PLC (DB200 convention)
// variables = BOOL -> { type, byte, bit } ; INT/REAL -> { type, offset }
// The server attaches no meaning to variable names; structure the shared data
// however you like. The names below are generic placeholders.
"plcs": [
{
"name": "PLC_1",
"ip": "192.0.2.10",
"rack": 0,
"slot": 1,
"dbNumber": 1,
"syncDbNumber": 200,
"variables": {
"machine_running": { "type": "BOOL", "byte": 0, "bit": 0 },
"current_speed": { "type": "INT", "offset": 2 },
"temperature": { "type": "REAL", "offset": 4 }
}
},
{
"name": "PLC_2",
"ip": "192.0.2.11",
"rack": 0,
"slot": 1,
"dbNumber": 1,
"syncDbNumber": 200,
"variables": {
"setpoint_speed": { "type": "INT", "offset": 0 },
"fault_active": { "type": "BOOL", "byte": 2, "bit": 0 }
}
}
],
// Optional MQTT brokers. Leave as [] if you do not use MQTT.
"mqttConfigs": [
{
"brokerUrl": "mqtt://broker.example.com:1883",
// Incoming topics merged into the shared data set (optional).
"subscribeTopics": {
"plc/setpoint": { "dataType": "INT", "syncVariable": "setpoint_speed" }
},
// Topic the combined PLC data + server heartbeat is published to.
"publishTopic": "plc/data"
}
]
}