JSON Configuration
JSON configuration is useful for field delivery: ports, unit ids, point maps, and acquisition intervals live in a file that can be changed without recompiling.
Minimal File
zeus.json:
{
"acquisition": {
"intervalMilliseconds": 500,
"pollImmediately": true
},
"channels": [
{
"name": "bus",
"type": "serial",
"portName": "COM3",
"baudRate": 9600
}
],
"devices": [
{
"name": "oven",
"channel": "bus",
"type": "modbus-rtu",
"unitId": 1,
"points": [
{ "name": "temperature", "table": "holding", "address": 0, "scale": 0.1, "lowAlarmLimit": 10, "highAlarmLimit": 80 },
{ "name": "setpoint", "table": "holding", "address": 1, "scale": 0.1, "writable": true }
]
}
]
}
Load it:
await using var app = ZeusHost.Create(builder => builder.AddJsonFile("zeus.json"));
await app.StartAsync();
var temperature = app.Points.Get<double>("temperature");
Sections
| Section | Meaning |
|---|---|
acquisition | Polling interval and whether to poll immediately after startup |
channels | Communication lines such as serial, TCP, UDP, and virtual channels |
devices | Devices such as Modbus, Mitsubishi MC, Siemens S7, Omron FINS, Omron Host Link, or EtherNet/IP |
points | Business points on a device, such as temperature, setpoint, or running state |
Each device channel must reference an already declared channel name.
Virtual Configuration Without Hardware
Replace a serial channel with a virtual Modbus slave:
{
"name": "bus",
"type": "virtual",
"responder": "modbus",
"unitId": 1,
"transport": "rtu"
}
When the field device is ready, switch back to serial:
{
"name": "bus",
"type": "serial",
"portName": "COM3",
"baudRate": 9600
}
Channel Fields
| Field | Applies to | Meaning |
|---|---|---|
name | all | Zeus channel name |
type | all | virtual, serial, tcp, tcp-server, udp, or udp-server |
portName / baudRate | serial | COM port and baud rate |
host / port | tcp / udp | Remote host and port |
localAddress / localPort | server channels | Local bind/listen settings |
responder | virtual | modbus, mc, s7, fins, host-link, or ethernet-ip |
Device Fields
| Field | Meaning |
|---|---|
name | Zeus device name |
channel | Channel name to bind |
type | modbus-rtu, modbus-tcp, mitsubishi-mc, siemens-s7, omron-fins-udp, omron-fins-tcp, omron-host-link, or ethernet-ip |
unitId | Modbus unit id or Host Link unit number; Host Link uses 0-31 |
frameType / encoding | Mitsubishi MC frame and encoding |
rack / slot | Siemens S7 rack and slot |
| FINS node/network fields | FINS destination/source addressing |
wordOrder | FINS / Host Link 32-bit value word order |
points | Periodically acquired points and writable declarations |
Point Fields
| Field | Meaning |
|---|---|
name | Point name |
table | Modbus table: holding, input, coil, or discrete |
deviceCode | Mitsubishi MC device code: D, M, X, Y, W, R, ZR |
area | S7/FINS/Host Link area |
tag / tagName | EtherNet/IP tag path |
dataType | Protocol-specific point type |
address | 0-based address; strings such as "0x10" are accepted where applicable |
bit | Bit offset for bit points |
scale | Engineering scale for numeric points |
lowAlarmLimit / highAlarmLimit | Alarm thresholds after scaling |
writable | Enables write-back by point name |
Host Link Example
{
"channels": [
{ "name": "host-link", "type": "serial", "portName": "COM3", "baudRate": 9600 }
],
"devices": [
{
"name": "plc",
"channel": "host-link",
"type": "omron-host-link",
"unitId": 0,
"points": [
{ "name": "temperature", "area": "dm", "address": 100, "dataType": "word", "scale": 0.1, "writable": true },
{ "name": "running", "area": "cio", "address": 10, "bit": 0, "dataType": "bit", "writable": true }
]
}
]
}
Virtual Host Link PLC:
{ "name": "host-link", "type": "virtual", "responder": "host-link", "unitId": 0 }
Sample JSON files live under samples/Zeus.Samples.Console.Config.