Quick start: install the gateway, open http://localhost:5000, set the password, add your Modbus device on Devices, map its values on Mappings, and connect your SCADA master to port 2404 with CA 1 (chapter 16). Every change applies immediately.
1. Introduction
Max IEC Gateway is a protocol converter. It reads values from Modbus devices and gives them to a SCADA system that speaks IEC 60870-5-104 (over TCP/IP) or IEC 60870-5-101 (over a serial line). Commands from the SCADA system go back to the Modbus devices.
The gateway runs as a service on a Windows or Linux computer. There is no desktop program: you configure everything in a web browser, in the dashboard.
What the gateway can do
- Read Modbus TCP, Modbus RTU (RS-485/RS-232) and Modbus RTU over TCP devices. Several devices can share one serial line.
- Serve the data as an IEC 60870-5-104 server (several masters at the same time) and/or an IEC 60870-5-101 outstation.
- Single and double points (also from bits inside a register), step positions, 32-bit bitstrings, measured values (normalized, scaled, float) and energy counters (integrated totals), with or without CP56 time tags.
- Commands: single, double, set-points (normalized, scaled, float) and bitstrings, written back to coils or holding registers. Select-before-operate or direct execute.
- Deadbands, cyclic transmission, event buffering while no master is connected, clock synchronization.
- 9 device templates, CSV import/export, a traffic monitor, trends and a historian.
- Every change applies immediately. You never need to restart the service to apply a setting.
Words used in this manual
The glossary at the end explains every term. The most important ones:
| Term | Meaning |
|---|---|
| Master (controlling station) | The SCADA system or test tool that asks for data and sends commands. |
| IOA | Information object address: the number of one data point in IEC 60870-5. |
| CA | Common address (ASDU address): the number of the station. Most systems use CA 1. |
| Type ID | The IEC data type of a point, for example M_ME_NC_1 = measured value, float. |
| Mapping | One line in the gateway that links a Modbus address to an IEC point. |
2. Requirements
| Item | Requirement |
|---|---|
| Operating system | Windows 10 or 11 (64-bit), or Linux x64 with systemd |
| Hardware | 1 GHz CPU, 512 MB RAM, 100 MB disk plus history data |
| Runtime | Included. You do not need to install .NET. |
| Browser | Chrome, Edge or Firefox, on the gateway computer or on another computer in the network |
| Serial port | Only for Modbus RTU devices or IEC 101: a COM port (Windows) or /dev/tty… port (Linux), for example a USB-to-RS-485 adapter |
| Internet | Only for license activation, the online license check and the update check (HTTPS to iec.maxenergic.com) |
Network ports
| Port | Direction | Used for |
|---|---|---|
| 2404/TCP | In | IEC 60870-5-104 masters (you can change the port) |
| 5000/TCP | In | Web dashboard (you can change the port) |
| 502/TCP (or the device's port) | Out | Modbus TCP and RTU-over-TCP devices |
| 443/TCP | Out | License and update check (iec.maxenergic.com) |
3. Installation
Windows: installer (recommended)
- Download
MaxIECGateway_Setup_1.1.1.exefrom the download page. - Run the file. Windows asks for administrator rights: click Yes.
- Follow the wizard. On the Select Additional Tasks page you can choose:
- Allow the web dashboard (TCP 5000) from the local network: tick it if you want to open the dashboard from other computers. Without it, the dashboard works only on the gateway computer.
- Allow IEC 60870-5-104 (TCP 2404) from the network: tick it so SCADA masters on other computers can connect.
- Create a desktop shortcut (web dashboard): optional.
- Click Install. The installer creates and starts the Windows service Max IEC Gateway (service name
MaxIECGateway). - At the end, leave Open the web dashboard ticked and click Finish. Continue with First start.
Note: The service starts automatically with Windows (delayed start) and restarts itself after a crash. You find it in Services (services.msc) as Max IEC Gateway. The Start menu has shortcuts to the dashboard and to the Gateway data folder.
Important: If the installer reports that the service could not be created or started, it shows an error code. Run the installer again as administrator, or send the code to support@maxenergic.com.
Windows: portable ZIP
- Download
MaxIECGateway_Portable_1.1.1.zipand unzip it to a folder, for exampleC:\MaxIECGateway. - Double-click
MaxIEC.Gateway.exe. A console window opens and shows the log. - Open
http://localhost:5000. The gateway runs as long as the window is open.
Important: The portable version does not install a service and does not open firewall ports. Do not run it on a computer where the installed service is running: both use ports 5000 and 2404.
Linux (x64, systemd)
- Download
maxiec-gateway_1.1.1_linux-x64.tar.gzto the Linux computer. - Unpack it and run the installer as root:
tar -xzf maxiec-gateway_1.1.1_linux-x64.tar.gz cd maxiec-gateway-1.1.1 sudo ./install-linux.sh - The script installs the program to
/opt/maxiec-gateway, creates the service usermaxiec, gives it access to serial ports (groupdialoutoruucp) and starts the systemd servicemaxiec-gateway. - Open
http://<linux-host>:5000in a browser. From another computer you need the setup code:sudo cat /var/lib/maxiec-gateway/setup-token.txt.
sudo systemctl status maxiec-gateway # is it running?
sudo systemctl restart maxiec-gateway # restart
sudo journalctl -u maxiec-gateway -f # live logUpgrading from version 1.0
- Run the new installer over the old version. You do not need to uninstall first.
- The gateway now runs as a Windows service. The old autostart at logon is removed.
- Your database, license key and trial record are copied to the new data folder
C:\ProgramData\MaxIECGateway(Linux:/var/lib/maxiec-gateway). The original files are not deleted. - The dashboard now needs a password. Set it on the first visit (see First start).
- Your license key keeps working.
Uninstalling
Windows: Settings → Apps → Max IEC Gateway → Uninstall. The service and the program files are removed. Your data folder C:\ProgramData\MaxIECGateway (database, license, trial record, password) is kept, so a later installation continues with the same configuration and license. Delete the folder by hand if you want to remove everything.
Linux: stop and disable the service (sudo systemctl disable --now maxiec-gateway), then delete /opt/maxiec-gateway and /etc/systemd/system/maxiec-gateway.service. The data in /var/lib/maxiec-gateway stays until you delete it.
4. First start: set the password
The dashboard is protected by a password for the user admin. On the first visit you choose this password.
- On the gateway computer, open
http://localhost:5000in your browser. - The page Set the dashboard password opens.
- Type a password with at least 10 characters in both fields.
- Click Set password and log in. The dashboard opens.
- 1. New password (at least 10 characters).
- 2. Repeat the password.
- 3. Set the password and log in.
Setting up from another computer
If you open the dashboard from another computer for the first time, the page also asks for a Setup code. This protects a new gateway on the network. The code is in the file setup-token.txt in the data folder (Windows: C:\ProgramData\MaxIECGateway, Linux: /var/lib/maxiec-gateway) and in the gateway log. Or simply open http://localhost:5000 on the gateway itself.
Logging in
- 1. User name: always admin.
- 2. Your password.
- 3. Log in.
- A login stays valid for 60 minutes without activity. Then you must log in again.
- After 5 wrong passwords within 15 minutes, logins from that address are blocked for 15 minutes.
Changing the password
Click Change password at the top right of any page. Enter the current password and the new one twice. Other browsers that are logged in are signed out.
Forgot the password?
- On the gateway computer, stop the service (Windows: Services → Max IEC Gateway → Stop; Linux:
sudo systemctl stop maxiec-gateway). - Delete the file
admin.jsonfrom the data folder. - Start the service again and set a new password on the first-start page.
Tip: Deleting admin.json only resets the password. Devices, mappings and the license are not changed.
5. Dashboard tour
After login you see the Dashboard. It shows the state of the IEC servers, the Modbus devices and every data point.
- 1. Menu: Dashboard, Devices, Mappings, Traffic, Trends, Settings, License.
- 2. Status bar: license state and whether the gateway is bridging (shown on every page).
- 3. Change password and Log out.
- 4. IEC 104 and IEC 101 server state, and a summary of devices and data points.
- 5. Device Connections: each enabled device, its address, Connected/Disconnected and the last communication. Disable/Enable switches polling off and on.
- 6. Live Data Points: every mapped point with its Modbus address, IEC type, IOA, raw value, scaled value, quality and age.
The status bar
| Colour and text | Meaning |
|---|---|
| Bridging (green) | Licensed. The gateway reads Modbus and serves IEC without a time limit. |
| Trial · Bridging stops in mm:ss (amber) | Trial. Data flows until the 15-minute session ends. See License. |
| Bridging stopped (red) | Trial session over, trial expired or license not valid. The IEC servers and Modbus polling are stopped. The dashboard still works. |
| ⚠ IEC server problem | An IEC server could not start, for example because its port is already in use. |
Quality column
| Quality | Meaning |
|---|---|
| Good | The last read was successful. |
| Invalid | The device does not answer (or was never read). The master receives the point with the IV (invalid) bit. |
| Overflow | The value did not fit the IEC type (for example a scaled value above 32767). The master receives the OV bit. |
6. Modbus devices
A device is one Modbus slave (one unit ID) that the gateway polls. Open the Devices page.
- 1. Add from template: create a device with all its points from a ready-made template.
- 2. Add Device: create an empty device.
- 3. Per device: Edit, Mappings (opens its point list) and Delete (also deletes its mappings).
Add a Modbus TCP device
- Click Add Device.
- Enter a Name, for example Energy meter feeder 2.
- Keep Transport = Modbus TCP.
- Enter the IP address / host name and the TCP port (normally 502).
- Enter the Unit ID (slave address) of the device.
- Check poll interval, timeout and retries (see the table below).
- Click Save. Polling starts at once.
- 1. Name of the device (shown everywhere in the dashboard).
- 2. Transport: Modbus TCP, Modbus RTU over TCP or Modbus RTU (serial).
- 3. IP address or host name.
- 4. TCP port (default 502).
- 5. Unit ID (slave address).
- 6. Poll interval in milliseconds.
- 7. Timeout for one request.
- 8. Retries before the device counts as not answering.
- 9. Enabled: untick to stop polling this device.
| Field | Default | Allowed | Explanation |
|---|---|---|---|
| Unit ID | 1 | 0-247, 255 | The Modbus slave address. Many Modbus TCP devices use 1 or 255. |
| Poll interval (ms) | 1000 | 100 and more | How often all points of the device are read. |
| Timeout (ms) | 3000 | 100-60000 | How long to wait for an answer. |
| Retries | 3 | 0-10 | How many times a failed read is repeated. Writes are never repeated. |
| Inter-frame delay (ms) | 0 | 0-1000 | Serial only. Extra pause between frames; 0 = automatic (3.5 characters). |
Add a Modbus RTU (serial) device
- Click Add Device and choose Transport = Modbus RTU (serial).
- Choose the Serial port from the list or type it, for example
COM3or/dev/ttyUSB0. - Set Baud rate, Parity, Data bits and Stop bits exactly as on the device.
- Enter the device's Unit ID and click Save.
- 1. Transport: Modbus RTU (serial).
- 2. Serial port (COM3, /dev/ttyUSB0 …).
- 3. Baud rate.
- 4. Parity: None, Odd or Even.
- 5. Stop bits: 1 or 2.
- 6. Unit ID: must be different for every device on the same port.
- 7. Inter-frame delay: 0 = automatic.
Note: Several devices on one RS-485 line: add one device per unit ID with the same serial port. The gateway sends one request at a time on the line. All devices on one port share its line settings: if you change the baud rate, parity or stop bits of one device, they change for every device on that port. Two devices on the same port cannot have the same unit ID.
Add a Modbus RTU over TCP device
Use this for a serial device server (Ethernet-to-RS-485 converter) that passes raw RTU frames over TCP. Choose Transport = Modbus RTU over TCP and enter the converter's IP address and port. Devices with the same address and port share one connection, and requests are sent one at a time.
- 1. Transport: Modbus RTU over TCP.
- 2. IP address of the serial device server.
- 3. Its TCP port (often 4001 or 502).
- 4. Hint: devices behind the same converter share one connection.
Tip: If your converter translates Modbus TCP to RTU itself (a "Modbus gateway"), use Modbus TCP instead. Ask the converter's manual which mode it uses.
Add a device from a template
A template creates the device and all its mappings in one step. Templates included:
| Template | Points | Factory communication setting |
|---|---|---|
| Eastron SDM120-Modbus | 14 | RTU 2400 8N1, unit 1 |
| Eastron SDM630-Modbus | 36 | RTU 9600 8N1, unit 1 |
| Carlo Gavazzi EM24 (DIN / Ethernet) | 31 | RTU 9600 8N1, unit 1 (or Modbus TCP) |
| Schneider Electric PowerLogic PM5000 series | 24 | RTU 19200 8E1 or Modbus TCP, unit 1 |
| Schneider Electric Altivar (ATV3xx / ATV6xx) | 9 | RTU 19200 8E1, address 1 |
| ABB ACS580 drive (ABB Drives profile) | 13 | RTU 19200 8E1, node address 1 |
| SMA Sunny Boy / Sunny Tripower | 10 | Modbus TCP port 502, unit 3 |
| SunSpec Common Model (Model 1) | 4 | Modbus TCP port 502 |
| Growatt PV inverter (protocol V1.20) | 17 | RTU 9600 8N1, unit 1 |
- Click Add from template.
- Choose the Device type. Read the yellow notes: they tell you the factory settings and what to check.
- Enter the device name, transport and address, and the unit ID.
- Check Common address and First IOA. The points get consecutive IOAs starting at the first IOA. The gateway suggests the next free IOA.
- Click Create device.
- 1. Device type (template).
- 2. Notes: factory settings and what to verify.
- 3. Transport.
- 4. Address of the device.
- 5. Common address of the points.
- 6. First IOA: the points are numbered from here.
- 7. Create the device with all mappings.
Important: Templates are a starting point. Check every address, data type, scaling and byte order against the manual of your device and its firmware version.
7. Point mappings
A mapping connects one Modbus value to one IEC point. Open Mappings. Choose a device at the top to see only its points.
- 1. Device filter.
- 2. Add Mapping.
- 3. Export CSV: download the mappings as a CSV file.
- 4. Import CSV: import many mappings at once (chapter CSV import and export).
- 5. Report: the deadband (±) and the cyclic time of the point.
- 6. Per mapping: Edit and Delete.
Note: In the Address column, a bit point shows as 40.0 (register 40, bit 0), a double point from two bits as 20.0/1.
The mapping dialog
Click Add Mapping (or Edit). The dialog has four parts: Modbus, IEC 60870, Scaling and Reporting.
- 1. Device the value is read from.
- 2. Description (shown in the dashboard and the traffic monitor).
- 3. Modbus Data Type: Coil, DiscreteInput, InputRegister or HoldingRegister.
- 4. Modbus Address, 0-based (see below).
- 5. Register Type: how the register(s) are decoded.
- 6. Byte Order for 32- and 64-bit values.
- 7. IEC Type ID.
- 8. IOA of the point.
- 9. Common Address (CA).
- 10. Scale Factor (and Offset).
- 11. Deadband mode.
- 12. Deadband Size.
- 13. Cyclic every (s).
Modbus data type and address
| Data Type | Function code | Read/write | Typical use |
|---|---|---|---|
| Coil | FC01 read, FC05 write | Read and write | Breaker or relay outputs, commands |
| DiscreteInput | FC02 | Read only | Contacts, alarms |
| InputRegister | FC04 | Read only | Measurements |
| HoldingRegister | FC03 read, FC06/FC16 write | Read and write | Measurements, set-points, status words |
Important: Addresses are 0-based protocol addresses. If the device manual says register 30001 or 40001, enter address 0; 40101 is address 100. If a value looks wrong, try the address one lower or one higher.
Register type and byte order
| Register Type | Registers | Range / use |
|---|---|---|
| UInt16 | 1 | 0 to 65535 |
| Int16 | 1 | -32768 to 32767 |
| UInt32 | 2 | 0 to 4,294,967,295 |
| Int32 | 2 | ±2,147,483,647 |
| Float32 | 2 | IEEE 754 single precision |
| Float64 | 4 | IEEE 754 double precision |
| Int64 | 4 | Signed 64-bit, e.g. energy counters |
| UInt64 | 4 | Unsigned 64-bit |
The Register Count is set automatically to what the register type needs. The Signed box is only for old 1.0 mappings: for new ones choose Int16 instead.
A 32-bit value uses two registers with 4 bytes, called A B C D from the most significant byte. Devices send them in different orders:
| Byte Order | Registers in address order | Common name |
|---|---|---|
| ABCD | AB, CD | Big-endian (Modbus standard). Most meters. |
| CDAB | CD, AB | Word swap ("little-endian word order"). Many PLCs. |
| BADC | BA, DC | Byte swap inside each register. |
| DCBA | DC, BA | Little-endian. |
For 64-bit values the same rule applies to all four registers (CDAB reverses the register order). 16-bit values ignore the byte order. If a float shows nonsense like 1.4E-41 or -2.6E+38, try CDAB. More help: Modbus float byte order guide.
Which IEC Type ID for what?
| You have | Use Type ID | Notes |
|---|---|---|
| On/off status (coil, discrete input, register bit) | M_SP_NA_1 (1), or M_SP_TB_1 (30) with time tag | Any value other than 0 is ON. |
| Position with two contacts (breaker, disconnector) | M_DP_NA_1 (3) or M_DP_TB_1 (31) | Two register bits: ON bit and OFF bit. See below. |
| Tap position −64…63 | M_ST_NA_1 (5) or M_ST_TB_1 (32) | Larger values are limited and get the OV bit. |
| Status word (16 or 32 bits) | M_BO_NA_1 (7) or M_BO_TB_1 (33) | Sent unscaled as 32 bits. |
| Measurement, best accuracy | M_ME_NC_1 (13) or M_ME_TF_1 (36) | Short float. Recommended for most analog values. |
| Measurement as integer | M_ME_NB_1 (11) or M_ME_TE_1 (35) | Scaled value −32768…32767 after scaling. |
| Measurement as fraction of full scale | M_ME_NA_1 (9) or M_ME_TD_1 (34) | Normalized: sent value = (raw × scale + offset) ÷ 32767, range −1…+1. |
| Energy counter (kWh, pulses) | M_IT_NA_1 (15) or M_IT_TB_1 (37) | Read by counter interrogation. See Energy counters. |
Tip: Types with time tag CP56 (30-37) are the usual choice for IEC 104. M_SP_TA_1 (2) and M_DP_TA_1 (4) use the short CP24 time tag, which is only allowed in IEC 101.
IOA must be unique within a common address. Its maximum depends on the IOA size in Settings (3 bytes: 1-16,777,215). The Common Address is normally 1 (1-65534 with a 2-byte CA).
Scaling
The gateway calculates: value sent = raw value × Scale Factor + Offset. For commands it calculates the other way round.
| Example | Raw value | Scale Factor | Offset | Sent value |
|---|---|---|---|---|
| Voltage in 0.1 V | 2305 | 0.1 | 0 | 230.5 |
| Current in mA, shown in A | 12500 | 0.001 | 0 | 12.5 |
| Temperature with offset (raw 0 = −40 °C) | 650 | 0.1 | −40 | 25.0 |
Points from register bits
Many devices pack alarms and states into one status register. Use Bit (ON) and Bit (OFF) (0 = least significant bit, −1 = not used):
- 1. Data Type: HoldingRegister or InputRegister (bits are only possible from registers).
- 2. Register Type: UInt16 (bits 0-15) or a 32/64-bit type (bits 0-31 / 0-63).
- 3. Bit (ON): the bit number. Bit (OFF) stays −1.
- 4. Type ID: a single point (M_SP_*).
- 1. Bit (ON): the bit that means ON (closed).
- 2. Bit (OFF): the bit that means OFF (open).
- 3. Type ID: a double point (M_DP_*).
| ON bit | OFF bit | Double point state |
|---|---|---|
| 1 | 0 | ON |
| 0 | 1 | OFF |
| 0 | 0 | Intermediate (moving) |
| 1 | 1 | Faulty (indeterminate) |
Interrogation group
Interr. Group 0 means the point is sent only in a station interrogation (QOI 20). With 1-16 the point is also sent when the master asks for that group (QOI 21-36). For energy counters, groups 1-4 are the counter groups.
Deadband and cyclic transmission
Measured values (M_ME_*) are sent spontaneously (cause 3) when they change. The deadband reduces traffic for values that change all the time:
| Deadband | When is a change sent? |
|---|---|
| None (every change) | Every change of the value. |
| Absolute (engineering units) | When the value differs from the last sent value by more than Size. Example: Size 0.5 for a voltage = only changes larger than 0.5 V. |
| Percent of last reported value | When it differs by more than Size % of the last sent value (0-100). Near zero, the gateway uses at least 10 % of the largest value sent so far, so a value around 0 is not sent on every tiny change. |
- A general interrogation always returns the current value, whatever the deadband.
- Cyclic every (s): also send the point every n seconds with cause 1 (periodic). 0 = off. Allowed: 0-86400.
Note: Changes on the Mappings page apply immediately. Only the device whose mappings changed restarts its polling; other devices and the IEC connections keep running.
8. Commands from SCADA
A command point lets the SCADA master write to a coil or holding register. To create one, make a mapping and tick Command.
- 1. Data Type: Coil or HoldingRegister (inputs are read-only).
- 2. Register Type and byte order of the target register.
- 3. Type ID that matches the command (see table).
- 4. The IOA the master sends the command to.
- 5. Command ticked.
| Master sends | Map the command point as | Writes to Modbus |
|---|---|---|
| C_SC_NA_1 (45) single command | M_SP_NA_1, Coil (or HoldingRegister) | ON = 1, OFF = 0 |
| C_DC_NA_1 (46) double command | M_DP_NA_1, Coil (or HoldingRegister) | ON (state 2) = 1, OFF (state 1) = 0. States 0 and 3 are rejected. |
| C_SE_NA_1 (48) set-point, normalized | M_ME_NA_1, HoldingRegister | value × 32767, then reverse scaling |
| C_SE_NB_1 (49) set-point, scaled | M_ME_NB_1, HoldingRegister | value, then reverse scaling: (value − offset) ÷ scale |
| C_SE_NC_1 (50) set-point, float | M_ME_NC_1, HoldingRegister | value, then reverse scaling |
| C_BO_NA_1 (51) bitstring | M_BO_NA_1, HoldingRegister | 32 bits unscaled (a 16-bit register takes values up to 0xFFFF) |
- The time-tagged versions (C_SC_TA_1 … C_BO_TA_1, types 58-64) are accepted and handled like the plain ones.
- A command point is also read and reported like a normal point, so the master sees the current value.
- Set-points that do not fit the register type are rejected, never cut off.
- Regulating step commands (C_RC_NA_1) are not supported and are rejected.
Select-before-operate and direct execute
Choose the command mode in Settings → Command Options:
| Command Mode | How the master must send a command |
|---|---|
| Direct Execute | One execute (S/E = 0) operates the output. |
| Select Before Execute | First a select (S/E = 1), then an execute (S/E = 0) with the same value, from the same connection, within the Select timeout. An execute without select is rejected. |
The Select timeout (s) is 10 s by default (1-60 s). A deactivation (cause 8) cancels a pending select. Bitstring commands have no select bit and always execute directly.
- 1. Command Mode: Direct Execute or Select Before Execute.
- 2. CMD Act. Termination: send ACT_TERM after single/double commands.
- 3. CSE Act. Termination: send ACT_TERM after set-points.
- 4. Select timeout (s).
What the master sees
| Step | Master sends | Gateway answers |
|---|---|---|
| Select | Command, COT 6 (activation), S/E = 1 | COT 7 activation confirmation (positive). Nothing is written yet. |
| Execute | Same command, COT 6, S/E = 0 | Writes to Modbus, then COT 7 (positive) and COT 10 activation termination |
| Cancel | Same command, COT 8 (deactivation) | COT 9 deactivation confirmation; the select is cancelled |
Why was my command rejected?
A rejected command gets a negative confirmation (P/N bit set). The Traffic page shows the reason.
| Reason in the traffic monitor | Cause / fix |
|---|---|
| execute … without select (select-before-operate) | Send a select first, or switch to Direct Execute. |
| select for IOA … expired | The execute came after the select timeout. Send it faster or raise the timeout. |
| execute … does not match its select | Value or type of the execute differs from the select. |
| IOA … is not a command point | Tick Command on that mapping. |
| unknown IOA (COT 47) / unknown common address (COT 46) | No mapping with that CA and IOA. Check the numbers. |
| unsupported type (COT 44) | The master sent a type the gateway does not know. |
| regulating step commands are not supported | C_RC_NA_1 is not supported. Use a single or double command, or a set-point. |
| double command state 0/3 not permitted | Use state 1 (OFF) or 2 (ON). |
| Command FAILED (negative ACT_CON) | The Modbus write failed: device offline, exception from the device, or the value does not fit the register. |
9. IEC 104 settings
Open Settings. All settings apply as soon as you click Save Configuration. A change that makes connected masters reconnect (for example a new port) asks you first.
- 1. Enabled: switch the IEC 104 server on or off.
- 2. TCP Port (default 2404).
- 3. Max Connections: masters at the same time (1-64, default 10).
- 4. Allowed masters: IP addresses or networks that may connect.
- Allowed masters: for example
10.0.0.5, 192.168.1.0/24. Empty = any address. It applies at once: connected masters that are no longer allowed are disconnected. This computer (localhost) is always allowed. - Several masters can be connected at the same time. Each gets all data and can send commands.
| Field | IEC 104 standard | Explanation |
|---|---|---|
| COT Size | 2 bytes | Cause of transmission field. 2 bytes includes the originator address. |
| ASDU Addr Size | 2 bytes | Size of the common address (CA). |
| IOA Size | 3 bytes | Size of the information object address. |
| Originator Addr | 0 | Originator address the gateway puts in its messages (0-255). |
Important: For IEC 104 keep 2/2/3 bytes. Your master must use the same sizes, otherwise it cannot read the messages.
Timers and windows (APCI)
| Parameter | Default | Allowed | What it does (simply) |
|---|---|---|---|
| t0 – Connect | 10 s | 1-255 | Time allowed to open a TCP connection. |
| t1 – Send | 15 s | 1-255 | If the master does not confirm sent data within t1, the connection is closed. |
| t2 – Ack | 10 s | 1-255, less than t1 | The gateway confirms received data at the latest after t2. |
| t3 – Test idle | 20 s | 1-172800 | If nothing is sent for t3, a test frame checks the link. |
| k – Max I-frames | 12 | 1-32767 | Messages the gateway may send before it must wait for a confirmation. |
| w – Ack after | 8 | 1-32767, not more than k | The gateway confirms after w received messages. |
Tip: Keep the defaults unless your SCADA specification asks for other values. k, w and t0-t3 apply to open connections without a restart. More help: IEC 104 timers guide.
10. IEC 101 settings
IEC 60870-5-101 uses a serial line (RS-232 or RS-485). Tick Enabled in the IEC 101 card and set the line exactly like the master.
- 1. COM Port, e.g. COM1 or /dev/ttyS0.
- 2. Baud Rate (default 9600).
- 3. Link Address of the gateway.
- 4. Link Mode: Unbalanced (master polls) or Balanced (both sides may send).
- 5. Link Addr Size: 0, 1 or 2 bytes.
- 6. Master link address (balanced mode only).
- 7. Parity: Even is the FT 1.2 standard.
| Field | Default | Explanation |
|---|---|---|
| Link Mode | Unbalanced | Unbalanced: the master polls the gateway (most common, also for several outstations on one line). Balanced: point-to-point, the gateway may send by itself. |
| Link Address | 1 | Address of the gateway on the line (0-255 with 1 byte). |
| Link Addr Size | 1 byte | Must match the master. |
| Parity / Stop bits | Even / 1 | FT 1.2 standard: 8 data bits, even parity, 1 stop bit. |
- The ASDU sizes (COT, CA, IOA) from the ASDU card are used for IEC 101 too. Many IEC 101 systems use COT 1 byte, CA 1 byte, IOA 2 bytes: check your master.
- The Event buffer size applies to IEC 101 too; changing it restarts only the IEC 101 link.
- Changing the port or any line setting restarts only the IEC 101 link. IEC 104 keeps running.
Note: IEC 101 and IEC 104 can run at the same time with the same points.
11. Time tags and clock synchronization
- 1. Time tags in local time (the SU bit is set in summer time). Off = UTC (default).
- 2. Mark time tags invalid (IV) until a master has synchronized the clock.
- 3. What a clock synchronization command (C_CS_NA_1) does.
| Clock synchronization | Effect |
|---|---|
| Confirm and log the offset (default) | The gateway confirms the command and writes the time difference to the log. The computer clock is not changed. |
| Also set this computer's clock | The gateway also sets the Windows/Linux clock. Needs administrator rights (Windows service: yes) or CAP_SYS_TIME on Linux. |
Tip: If the computer uses NTP (internet time or a time server), keep the default. Two time sources fighting each other give jumping time stamps.
12. Energy counters and counter interrogation
Energy registers (kWh, kvarh, pulse counts) are mapped as integrated totals: Type ID M_IT_NA_1 (15) or M_IT_TB_1 (37).
- 1. Register Type of the counter, e.g. UInt32, Int64 or Float32.
- 2. Type ID M_IT_NA_1 or M_IT_TB_1.
- 3. Interr. Group: counter group 1-4 (0 = general only).
- Counters are not sent in a general interrogation and not on every change. The master reads them with a counter interrogation (C_CI_NA_1, type 101).
- The value sent is a 32-bit integer (−2,147,483,648 … 2,147,483,647) after scaling. Choose the scale factor so the value fits, e.g. Wh → kWh with scale 0.001.
- Each reading carries a sequence number, a carry bit (the counter went backwards, e.g. after a rollover), an adjusted bit and an invalid bit.
| Counter interrogation (QCC) | Effect |
|---|---|
| Read (FRZ 0) | Sends the frozen values (the current values if never frozen), cause 37 (general) or 38-41 (group 1-4). |
| Freeze (FRZ 1) | Stores the current values. Read them with a following Read. |
| Freeze and reset (FRZ 2) | Stores the values and starts counting from 0 again. |
| Reset (FRZ 3) | Counting starts from 0 again. |
Note: Reset happens inside the gateway: it remembers the value at the reset and sends the difference. The counter in the Modbus device is not changed.
- 1. Event buffer: events kept while no master is connected (10-100000, default 1000). When it is full, the oldest are dropped.
- 2. Periodic counter report (s): freeze and send all counters every n seconds (0 = only on counter interrogation).
13. CSV import and export
With CSV files you can prepare hundreds of points in Excel and import them in one step.
- On Mappings, click Export CSV to get a file in the right format (or start from the example below).
- Edit the file in Excel or a text editor. Comma or semicolon separated; a decimal comma is accepted.
- Click Import CSV and choose the file.
- Optional: choose one device (all rows go to it) and/or tick Replace the devices' mappings.
- Click Check file. The gateway checks every row and shows a preview. Nothing is saved yet.
- If there are errors, fix them in the file and check again. When the file is valid, click Import.
- 1. Choose the CSV file.
- 2. Target: the devices named in the file, or one device.
- 3. Replace: delete the devices' current mappings first.
- 4. Check file: validate and preview.
- 5. Result of the check.
- 6. Import: saves all rows (only active when the file is valid).
Tip: The import is all-or-nothing: if one row is wrong, nothing is imported.
Columns
| Column | Required | Values |
|---|---|---|
| device | If no device is chosen in the dialog | Device name exactly as on the Devices page |
| description | No | Free text, up to 200 characters |
| modbusType | Yes | Coil, DiscreteInput, InputRegister, HoldingRegister (also: CO/0x/FC01, DI/1x/FC02, IR/3x/FC04, HR/4x/FC03) |
| address | Yes | 0-65535, 0-based |
| registerCount | No | Set automatically from registerType |
| registerType | No (UInt16) | UInt16, Int16, UInt32, Int32, Float32, Float64, Int64, UInt64 |
| byteOrder | No (ABCD) | ABCD, CDAB, BADC, DCBA |
| bit, bit2 | No (−1) | Bit numbers for single/double points from register bits |
| iecType | Yes | Name or number, e.g. M_ME_NC_1 or 13 |
| ioa | Yes | Information object address |
| ca | No (1) | Common address |
| scale, offset | No (1, 0) | Numbers |
| signed, command | No (false) | true/false, yes/no, 1/0, x |
| group | No (0) | Interrogation group 0-16 |
| deadbandMode | No (None) | None, Absolute, Percent (also Abs, %) |
| deadband | No (0) | Number |
| cycleSeconds | No (0) | 0-86400 |
Example file
device,description,modbusType,address,registerType,byteOrder,iecType,ioa,ca,scale,deadbandMode,deadband
Meter feeder 2,Feeder 2 current [A],InputRegister,10,Float32,ABCD,M_ME_NC_1,120,1,1,Absolute,0.5
Meter feeder 2,Feeder 2 voltage [V],InputRegister,12,Float32,ABCD,M_ME_NC_1,121,1,1,Percent,1
Meter feeder 2,Feeder 2 breaker,Coil,8,UInt16,ABCD,M_SP_TB_1,122,1,1,None,0
Meter feeder 2,Feeder 2 energy [kWh],HoldingRegister,80,UInt32,ABCD,M_IT_NA_1,123,1,1,None,0Note: Export CSV protects text cells against Excel formula injection. A complete backup of devices, mappings and settings is the JSON export in Settings (chapter Backup and restore).
14. Traffic monitor, trends and history
Traffic monitor
The Traffic page shows what happens on both sides of the gateway. It is the first place to look when something does not work.
- 1. Tabs: Commands, Connections, Modbus, IEC; the badge shows the number of entries.
- 2. Auto-refresh every 3 s (switch off to read calmly).
- 3. Clear the list.
| Tab | Shows |
|---|---|
| Commands | Every command received (IN) and the answer (OUT): select confirmed, command OK, rejected with the reason. |
| Connections | IEC masters connecting and disconnecting, with their IP address. |
| Modbus | The last Modbus requests and results per device. |
| IEC | The last IEC messages sent and received. |
Note: The lists keep the latest 200 entries each. They are cleared when the service restarts.
Trends
- 1. Choose one or more data points (hold Ctrl to select several).
- 2. Time range: 1 h, 6 h, 24 h or 7 days.
- 3. Load Chart.
- 4. Export CSV: the history of all selected points for the chosen time range, in one file (one row per stored value, with columns for time, IOA, device, point, value and quality).
Historian settings
- Historian Enabled: record the values of all points.
- Recording Interval: 1 s to 1 h (default 2 s). Values are stored when they change, and at least every 5 minutes.
- Retention Period (hours): 1-8760 (default 72 h = 3 days). Older data is deleted.
15. Live changes: what restarts what
You never need to restart the gateway to apply a change. Only the part that is affected restarts:
| You change | What happens |
|---|---|
| A device or its mappings | Only that device restarts its polling. Unchanged points keep their value and quality. |
| Add from template, CSV import, delete | Same: only the affected devices restart. |
| Command mode, select timeout, time options, clock sync mode, counter report period | Applied at once, nothing restarts. |
| IEC 104 allowed masters | Applied at once. Masters that are no longer allowed are disconnected. |
| IEC 104 k, w, t0-t3, max connections, event buffer | Applied to the running server and its open connections. |
| IEC 104 enabled, port, COT/CA/IOA sizes, originator address | Only the IEC 104 server restarts. Masters reconnect. You are asked first. |
| Any IEC 101 setting, or the event buffer size | Only the IEC 101 link restarts. |
| Dashboard port, HTTPS, allowed networks | The web server moves inside the running service. Your browser is sent to the new address. |
| License activation | Bridging starts at once. |
Tip: If a restarted server cannot start (for example the new port is used by another program), the gateway goes back to the previous settings and shows the reason.
16. Connecting a SCADA master or test tool
Any IEC 60870-5-104 master can connect: a SCADA system, an RTU, or a test tool. Use these settings in the master:
| Setting in the master | Value |
|---|---|
| Protocol | IEC 60870-5-104 (T104). Not T101 over TCP. |
| IP address / port | IP address of the gateway computer, port 2404 (or the port in Settings) |
| Common address (CASDU / ASDU address) | 1 (or what you used in the mappings) |
| CASDU / ASDU address size | 2 bytes |
| IOA size | 3 bytes |
| COT size | 2 bytes ("COT with originator") |
| k / w / t0 / t1 / t2 / t3 | 12 / 8 / 10 s / 15 s / 10 s / 20 s |
- Make sure the gateway shows IEC 60870-5-104 Running on the Dashboard and the status bar is not red.
- On a different computer, the Windows firewall must allow port 2404 (installer option) and the master's IP address must be allowed in Allowed masters (or the list must be empty).
- Connect the master. It sends STARTDT; the gateway confirms.
- Send a general interrogation (C_IC_NA_1, CA 1, QOI 20). You receive all points, then the activation termination.
- Watch the Traffic page: the Connections tab shows the master's IP address.
Important: If the connection opens and closes again at once, the master probably uses T101 frames over TCP instead of T104 (in the master's log you see short frames such as 10 49 01 4A 16). Switch the master to IEC 104 / T104.
Example: switching IOA 201 with select-before-operate
Assume IOA 201 is a command point on a coil (M_SP_NA_1 + Command) and the command mode is Select Before Execute.
| Step 1: Select | Step 2: Execute (within 10 s) | |
|---|---|---|
| Type ID | 45 (C_SC_NA_1) | 45 (C_SC_NA_1) |
| COT | 6 (activation) | 6 (activation) |
| CA | 1 | 1 |
| IOA | 201 | 201 |
| SCS (state) | 1 = ON | 1 = ON |
| S/E | 1 = select | 0 = execute |
| QU | 0 | 0 |
| Gateway answers | COT 7 positive | COT 7 positive, then COT 10 |
If your tool asks for raw ASDU bytes (type, VSQ, COT 2 bytes, CA 2 bytes, IOA 3 bytes, SCO):
Select ON: 2D 01 06 00 01 00 C9 00 00 81
Execute ON: 2D 01 06 00 01 00 C9 00 00 01
Select OFF: 2D 01 06 00 01 00 C9 00 00 80
Execute OFF: 2D 01 06 00 01 00 C9 00 00 00(201 = C9 00 00; the last byte is the SCO: bit 7 = S/E, bit 0 = state.)
Testing without hardware
Use the slave simulator of ModbusBB as a Modbus device and any IEC 104 test tool as the master. This is how the screenshots in this manual were made.
17. License
- 1. License Status: trial or licensed, licensed to, device name, machine ID, last online check, and the trial days and session time.
- 2. Enter the license key (XXXXX-XXXXX-XXXXX-XXXXX).
- 3. Activate License (needs internet).
- 4. Check Now: check the license online now.
Trial
- The trial has every feature for 30 days, without registration.
- During the trial, the gateway bridges data in sessions of 15 minutes. When a session ends, the IEC servers and Modbus polling stop; the dashboard keeps working.
- A new session starts only when the service restarts: Windows
Restart-Service MaxIECGateway(administrator PowerShell) or Services → Max IEC Gateway → Restart; Linuxsudo systemctl restart maxiec-gateway. Saving settings does not start a new session. - When the 30 days are over, bridging stays stopped until you enter a license key.
Buying and activating
- Buy a license on the pricing page ($150 one-time, lifetime license, lifetime free updates). The key arrives by e-mail.
- Open License in the dashboard, type the key, optionally a device name, and click Activate License.
- The status bar turns green: Bridging. No restart is needed.
- A license is for one computer. Activating on a second computer gives: This license is already active on another computer.
- The gateway checks the license online about once a day. Without internet it keeps working for up to 30 days after the last successful check; the License page shows the last online check.
- If the license server says the key is invalid, revoked or used elsewhere, the key is removed and the gateway returns to trial mode.
Moving the license to another computer
- On the old gateway, open License and click Deactivate License (shown when a license is active). This frees the license on the license server; bridging stops on that computer.
- On the new computer, activate the key as above.
If the old computer no longer works, release it in the license portal with your key and purchase e-mail (up to 5 times in 30 days), or write to support@maxenergic.com. Lost the key? Request it again on the resend page.
18. Updates
- The Dashboard shows a blue banner Update Available! when a new version exists. Or click Check for Updates in Settings → About.
- Download the new installer from the download page (the page lists SHA-256 checksums) and run it over the installed version. Configuration, license and password are kept.
- Linux: unpack the new tar.gz and run
sudo ./install-linux.shagain. - Updates are free for life for licensed customers.
19. Security
The gateway is often installed in an operational network. Use these protections:
| Protection | Where | Recommendation |
|---|---|---|
| Dashboard password | Change password (top right) | At least 10 characters; do not reuse other passwords. |
| Allowed networks for the dashboard | Settings → Dashboard address | Enter the engineering network, e.g. 192.168.10.0/24. Localhost is always allowed. |
| HTTPS | Settings → Dashboard address | Use a certificate (.pfx) when the dashboard is opened over the network. |
| IEC 104 allowed masters | Settings → IEC 104 | List only the SCADA masters' IP addresses. |
| Windows Firewall | Installer options | Open 5000 (local subnet) and 2404 only if needed. |
| Select-before-operate | Settings → Command Options | Recommended for switching commands. |
- 1. HTTP port (default 5000).
- 2. HTTP only from this computer: other computers must use HTTPS.
- 3. HTTPS on/off.
- 4. Certificate file (.pfx) on the gateway computer, and its password.
- 5. Allowed networks for the dashboard.
Important: Click Save dashboard address. The change applies without a restart and your browser is sent to the new address. If you lock yourself out, open the dashboard on the gateway computer itself (http://localhost:5000): localhost is always allowed.
20. Backup and restore
- 1. Export Configuration: downloads
gateway_config_<date>.jsonwith all devices, mappings and the gateway settings. - 2. Choose an exported file to import.
- 3. Clear existing devices & mappings before import (otherwise the file is added).
- 4. Also import the IEC/gateway settings from the file.
- 5. Import Configuration.
- The import checks the whole file first and then applies it in one step: all or nothing.
- Export files of version 1.0 can be imported.
- The dashboard password and the license are not part of the export.
The data folder
| File | Content |
|---|---|
| gateway.db | Devices, mappings, settings and history (SQLite) |
| logs\gateway-<date>.log | Log files, 7 days |
| license.key, .activation_cache, .trial | License and trial state |
| admin.json | Dashboard password (hashed) |
| web-settings.json | Dashboard address, HTTPS and allowed networks |
| setup-token.txt | One-time setup code (first start only) |
Windows: C:\ProgramData\MaxIECGateway (Start menu: Gateway data folder). Linux: /var/lib/maxiec-gateway. To make a full copy, stop the service and copy the whole folder.
21. Troubleshooting
| Problem | Possible cause | What to do |
|---|---|---|
| Dashboard does not open | Service not running; wrong port; firewall; address not in Allowed networks | Open http://localhost:5000 on the gateway computer. Check the service. Check the firewall option and Settings → Dashboard address. |
| Service is missing or does not start | Installation was not run as administrator; port 5000 or 2404 used by another program | Run the installer again as administrator. Look at the log in the data folder. Stop the portable version if it is running. |
| IEC master connects and disconnects at once | Master uses T101 frames over TCP; wrong ASDU sizes; master not in Allowed masters | Set the master to IEC 104 (T104), CA 2 bytes, IOA 3 bytes, COT 2 bytes. Check the Connections tab. |
| Master gets no data / status bar is red | Trial session ended or license not valid | Restart the service (new trial session) or activate a license. |
| All points of a device are Invalid | Device offline, wrong IP/port/unit ID, wrong serial settings, cable | Check the Device Connections table and the Modbus tab of the Traffic page. Test the device with ModbusBB. |
| Some points Invalid, others Good | Address does not exist in the device (Modbus exception) | Check the addresses: 0-based, try ±1. |
| Values are wrong (very large or tiny) | Wrong register type, byte order or address | Try CDAB for floats; check Int vs UInt; check scaling. |
| Value changes are not sent | Deadband too large | Reduce the deadband or set it to None. |
| Command rejected | No select, select expired, not a command point, wrong IOA | See Why was my command rejected? |
| Command confirmed but nothing changes | Device ignores the write; wrong address | Check the Modbus tab and the device manual (write function, address). |
| Serial port busy / cannot open COM port | Another program uses the port; Linux user not in dialout group | Close the other program. On Linux run the installer again or add the user maxiec to dialout. |
| IEC server problem: port in use | Another program listens on 2404 | Change the IEC 104 port or stop the other program. |
| "This license is already active on another computer" | The license is used on another computer | Deactivate it there, or release it in the license portal. |
| License stays "pending" | No internet access to iec.maxenergic.com (HTTPS) | Allow outgoing HTTPS, then click Check Now. |
The log file is in the logs folder of the data folder (Linux: sudo journalctl -u maxiec-gateway). Send it with your question to support@maxenergic.com.
22. Frequently asked questions
Do I need to restart the gateway after changing a setting?
No. Every change applies immediately. Only the part that is affected restarts, see chapter 15.
Can several SCADA masters connect at the same time?
Yes, up to the Max Connections setting (default 10). Each master receives all data and can send commands.
Can IEC 104 and IEC 101 run at the same time?
Yes. Both serve the same points.
Does it support Modbus RTU?
Yes: Modbus RTU on a serial port (several devices per line) and Modbus RTU over TCP.
Are Modbus addresses 0-based or 1-based?
0-based. Register 40001 is address 0 with data type HoldingRegister.
Why do I get no energy counters in a general interrogation?
That is correct per IEC 60870-5: integrated totals are read with a counter interrogation (C_CI_NA_1).
Is select-before-operate supported?
Yes. Choose Select Before Execute in Settings → Command Options and set the select timeout (1-60 s).
Does the gateway change the computer clock?
Only if you choose "Also set this computer's clock". By default it only confirms and logs the offset.
What happens when the trial session ends?
The IEC servers and Modbus polling stop. Restart the service for a new 15-minute session, or activate a license.
How many computers can use one license?
One. You can move it to another computer at any time.
Appendix A. Supported ASDU types
Monitor direction (gateway → master):
| Type | Name | Description |
|---|---|---|
| 1 | M_SP_NA_1 | Single point |
| 2 | M_SP_TA_1 | Single point, CP24 time (IEC 101) |
| 3 | M_DP_NA_1 | Double point |
| 4 | M_DP_TA_1 | Double point, CP24 time (IEC 101) |
| 5 | M_ST_NA_1 | Step position |
| 7 | M_BO_NA_1 | Bitstring of 32 bits |
| 9 | M_ME_NA_1 | Measured value, normalized |
| 11 | M_ME_NB_1 | Measured value, scaled |
| 13 | M_ME_NC_1 | Measured value, short float |
| 15 | M_IT_NA_1 | Integrated totals |
| 30 | M_SP_TB_1 | Single point, CP56 time |
| 31 | M_DP_TB_1 | Double point, CP56 time |
| 32 | M_ST_TB_1 | Step position, CP56 time |
| 33 | M_BO_TB_1 | Bitstring, CP56 time |
| 34 | M_ME_TD_1 | Normalized, CP56 time |
| 35 | M_ME_TE_1 | Scaled, CP56 time |
| 36 | M_ME_TF_1 | Short float, CP56 time |
| 37 | M_IT_TB_1 | Integrated totals, CP56 time |
Control direction (master → gateway):
| Type | Name | Description |
|---|---|---|
| 45 / 58 | C_SC_NA_1 / C_SC_TA_1 | Single command |
| 46 / 59 | C_DC_NA_1 / C_DC_TA_1 | Double command |
| 48 / 61 | C_SE_NA_1 / C_SE_TA_1 | Set-point, normalized |
| 49 / 62 | C_SE_NB_1 / C_SE_TB_1 | Set-point, scaled |
| 50 / 63 | C_SE_NC_1 / C_SE_TC_1 | Set-point, short float |
| 51 / 64 | C_BO_NA_1 / C_BO_TA_1 | Bitstring command (always direct) |
| 100 | C_IC_NA_1 | General and group interrogation |
| 101 | C_CI_NA_1 | Counter interrogation |
| 102 | C_RD_NA_1 | Read command |
| 103 | C_CS_NA_1 | Clock synchronization |
| 104 / 107 | C_TS_NA_1 / C_TS_TA_1 | Test command |
Not supported: the regulating step command C_RC_NA_1 (47) and the reset process command C_RP_NA_1 (105) get a negative confirmation. Parameter (P_*), file transfer and protection-equipment types are answered with COT 44 (unknown type).
Appendix B. Cause of transmission (COT) codes
| COT | Name | Used for |
|---|---|---|
| 1 | Periodic / cyclic | Cyclic transmission of a point |
| 3 | Spontaneous | Value changes |
| 5 | Requested | Answer to a read command |
| 6 | Activation | Commands and interrogations from the master |
| 7 | Activation confirmation | Positive or negative answer to an activation |
| 8 | Deactivation | Cancel a select |
| 9 | Deactivation confirmation | Answer to a deactivation |
| 10 | Activation termination | Command or interrogation finished |
| 20 | Interrogated by station | Data in a general interrogation |
| 21-36 | Interrogated by group 1-16 | Data in a group interrogation |
| 37 | Requested by general counter request | Counters in a counter interrogation |
| 38-41 | Requested by counter group 1-4 | Counters of one group |
| 44 | Unknown type identification | Type not supported |
| 45 | Unknown cause of transmission | COT not allowed for this type |
| 46 | Unknown common address | No points with this CA |
| 47 | Unknown information object address | No point with this IOA |
Appendix C. appsettings.json reference
Most settings are made in the dashboard. A few start-up options are in appsettings.json in the program folder (Windows: C:\Program Files\Max IEC Gateway, Linux: /opt/maxiec-gateway). Edit it with administrator rights and restart the service. The installer keeps your file on updates.
| Key | Default | Meaning |
|---|---|---|
| Gateway:DataDirectory | (not set) | Other data folder. Default: C:\ProgramData\MaxIECGateway or /var/lib/maxiec-gateway. |
| Gateway:DatabasePath | gateway.db | Database file, relative to the data folder. |
| Gateway:SeedSampleDevice | true | Create a disabled example device in a new database. |
| Gateway:Iec104:BindAddress | (all addresses) | Listen for IEC 104 on one network card only, e.g. 192.168.10.5. |
| Gateway:Web:AllowedNetworks | [] | Addresses allowed to open the dashboard (also editable in Settings). |
| Gateway:Web:SessionTimeoutMinutes | 60 | Minutes of inactivity before a login expires. |
| Kestrel:Endpoints:Http:Url | http://0.0.0.0:5000 | Dashboard address. An Https endpoint with a .pfx certificate can be added. |
| Serilog:MinimumLevel:Default | Information | Log detail: Debug, Information, Warning, Error. |
Note: The environment variable MAXIEC_DATA_DIR overrides the data folder.
Appendix D. Service and command-line reference
| Task | Windows (administrator PowerShell) | Linux |
|---|---|---|
| Status | Get-Service MaxIECGateway | sudo systemctl status maxiec-gateway |
| Start | Start-Service MaxIECGateway | sudo systemctl start maxiec-gateway |
| Stop | Stop-Service MaxIECGateway | sudo systemctl stop maxiec-gateway |
| Restart (new trial session) | Restart-Service MaxIECGateway | sudo systemctl restart maxiec-gateway |
| Live log | Open the newest file in C:\ProgramData\MaxIECGateway\logs | sudo journalctl -u maxiec-gateway -f |
| Setup code | type C:\ProgramData\MaxIECGateway\setup-token.txt | sudo cat /var/lib/maxiec-gateway/setup-token.txt |
| Open the dashboard | http://localhost:5000 | http://<host>:5000 |
Appendix E. Glossary
- ACT_CON / ACT_TERM
- Activation confirmation (COT 7) and activation termination (COT 10): the outstation's answers to a command.
- APCI
- The IEC 104 frame header with sequence numbers; controlled by k, w and t0-t3.
- ASDU
- Application service data unit: one IEC message with type, cause, common address and objects.
- Byte order
- The order of the bytes of a 32/64-bit value in Modbus registers (ABCD, CDAB, BADC, DCBA).
- CA (common address)
- Station address in an ASDU; usually 1.
- COT
- Cause of transmission: why a message is sent (spontaneous, interrogation, activation …).
- CP56Time2a
- 7-byte time tag with date and time to the millisecond (types 30-37).
- Deadband
- Minimum change before a measured value is sent again.
- Double point
- A position with two bits: OFF, ON, intermediate or faulty.
- General interrogation (GI)
- Request from the master for all current values (C_IC_NA_1, QOI 20).
- Integrated totals
- Counters such as energy (M_IT_*), read by counter interrogation.
- IOA
- Information object address: number of a data point.
- IV / OV
- Quality bits: invalid, overflow.
- Master / outstation
- The SCADA side (controlling station) and the gateway (controlled station).
- Modbus RTU / TCP
- Modbus on a serial line (RTU) or over Ethernet (TCP).
- Select-before-operate (SBO)
- Two-step command: select, then execute within the select timeout.
- STARTDT / STOPDT
- IEC 104 messages that start and stop data transfer on a connection.
- Unit ID
- Modbus slave address.