Skip to main content

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

SectionMeaning
acquisitionPolling interval and whether to poll immediately after startup
channelsCommunication lines such as serial, TCP, UDP, and virtual channels
devicesDevices such as Modbus, Mitsubishi MC, Siemens S7, Omron FINS, Omron Host Link, or EtherNet/IP
pointsBusiness 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

FieldApplies toMeaning
nameallZeus channel name
typeallvirtual, serial, tcp, tcp-server, udp, or udp-server
portName / baudRateserialCOM port and baud rate
host / porttcp / udpRemote host and port
localAddress / localPortserver channelsLocal bind/listen settings
respondervirtualmodbus, mc, s7, fins, host-link, or ethernet-ip

Device Fields

FieldMeaning
nameZeus device name
channelChannel name to bind
typemodbus-rtu, modbus-tcp, mitsubishi-mc, siemens-s7, omron-fins-udp, omron-fins-tcp, omron-host-link, or ethernet-ip
unitIdModbus unit id or Host Link unit number; Host Link uses 0-31
frameType / encodingMitsubishi MC frame and encoding
rack / slotSiemens S7 rack and slot
FINS node/network fieldsFINS destination/source addressing
wordOrderFINS / Host Link 32-bit value word order
pointsPeriodically acquired points and writable declarations

Point Fields

FieldMeaning
namePoint name
tableModbus table: holding, input, coil, or discrete
deviceCodeMitsubishi MC device code: D, M, X, Y, W, R, ZR
areaS7/FINS/Host Link area
tag / tagNameEtherNet/IP tag path
dataTypeProtocol-specific point type
address0-based address; strings such as "0x10" are accepted where applicable
bitBit offset for bit points
scaleEngineering scale for numeric points
lowAlarmLimit / highAlarmLimitAlarm thresholds after scaling
writableEnables write-back by point name
{
"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.