Skip to main content

Industrial Protocol Integration

Industrial routes enable direct communication between your Coreflux MQTT broker and industrial automation equipment. Read data from PLCs, write setpoints, and bridge the gap between IT and OT systems - all through standardized LoT syntax.
Industrial routes use a common TAG-based configuration pattern. Learn it once, and you can configure any supported protocol.

Supported Protocols


Protocol Comparison

ProtocolTransportUse CaseVendor
Modbus TCPTCP/IPUniversal PLC communicationMulti-vendor
Modbus SerialRS-232/485Legacy devices, long distancesMulti-vendor
Siemens S7TCP/IPSiemens automation systemsSiemens
OPC UATCP/IPCross-platform, secure IIoTMulti-vendor
ADSTCP/IPBeckhoff TwinCAT systemsBeckhoff
Allen-BradleyTCP/IPRockwell AutomationRockwell
EtherNet/IPTCP/IPCIP devices, explicit messagingMulti-vendor
FINSTCP/UDPOmron PLCsOmron

Common Architecture

All industrial routes share a common architecture with three key components:

1. Connection Configuration

Each protocol has specific connection parameters:
ADD <PROTOCOL>_CONFIG
    WITH HOST "192.168.1.100"
    WITH PORT '502'
    // Protocol-specific options...

2. TAG Definitions

TAGs define individual data points to read or write:
ADD TAG Temperature
    WITH ADDRESS "100"
    WITH DATA_TYPE "FLOAT"
    WITH SOURCE_TOPIC "plc/temperature"
    WITH SCALING "0.1"
    WITH UNIT "°C"

3. MAPPING with Polling

MAPPINGs group TAGs and define polling intervals:
ADD MAPPING SensorGroup
    WITH EVERY 500 MILLISECONDS
    ADD TAG Temperature
        // TAG config...
    ADD TAG Pressure
        // TAG config...

Common TAG Parameters

These parameters are available across all industrial protocols:
ADDRESS
string
required
Protocol-specific address (register number, variable path, NodeId, etc.).
ADDRESS_TYPE
string
Address type varies by protocol (e.g., HOLDING_REGISTER, DATABLOCK, SYMBOL).
DATA_TYPE
string
required
Data type for the value. Common types: BOOL, INT16, UINT16, INT32, UINT32, FLOAT, DOUBLE, STRING.
SOURCE_TOPIC
string
MQTT topic to publish read values to.
DESTINATION_TOPIC
string
MQTT topic to subscribe for write commands (if WRITABLE is true).
SCALING
double
Multiplier applied to raw value. Formula: published_value = (raw_value * SCALING) + OFFSET. Default: 1.0.
OFFSET
double
Value added after scaling. Default: 0.0.
DECIMAL_PLACES
integer
Number of decimal places in published value. Default: 2.
MIN_VALUE
double
Minimum allowed value. Values below this are filtered out.
MAX_VALUE
double
Maximum allowed value. Values above this are filtered out.
DEADBAND
double
Minimum change required to publish a new value. Reduces network traffic for slowly changing values. Default: 0.0.
PUBLISH_MODE
string
Output format: VALUE_ONLY (just the value) or JSON (structured object with metadata). Default: VALUE_ONLY.
UNIT
string
Engineering unit for documentation and JSON output (e.g., °C, bar, RPM).
DESCRIPTION
string
Human-readable description of the TAG.
WRITABLE
boolean
Allow writing to this TAG via DESTINATION_TOPIC. Default: false.
BYTE_ORDER
string
Byte order for multi-byte values: BIGENDIAN or LITTLEENDIAN. Default: BIGENDIAN.
WORD_ORDER
string
Word order for 32-bit values: BIGENDIAN or LITTLEENDIAN. Default: BIGENDIAN.

Basic Example Pattern

This pattern works across all industrial protocols:
DEFINE ROUTE MyPLCConnection WITH TYPE <PROTOCOL_TYPE>
    ADD <PROTOCOL>_CONFIG
        WITH HOST "192.168.1.100"
        // Connection parameters...
    
    ADD MAPPING CriticalSensors
        WITH EVERY 100 MILLISECONDS
        ADD TAG Temperature
            WITH ADDRESS "<protocol_specific_address>"
            WITH DATA_TYPE "FLOAT"
            WITH SOURCE_TOPIC "plc/sensors/temperature"
            WITH SCALING "0.1"
            WITH OFFSET "0"
            WITH UNIT "°C"
            WITH DEADBAND "0.5"
        ADD TAG Pressure
            WITH ADDRESS "<protocol_specific_address>"
            WITH DATA_TYPE "FLOAT"
            WITH SOURCE_TOPIC "plc/sensors/pressure"
            WITH UNIT "bar"
    
    ADD MAPPING SlowChangingData
        WITH EVERY 5 SECONDS
        ADD TAG ProductCount
            WITH ADDRESS "<protocol_specific_address>"
            WITH DATA_TYPE "INT32"
            WITH SOURCE_TOPIC "plc/production/count"
            WITH WRITABLE "true"
            WITH DESTINATION_TOPIC "plc/production/count/set"

Best Practices

Group TAGs by update frequency:
  • Fast (50-100ms): Safety signals, real-time control
  • Medium (500ms-1s): Process values, sensor readings
  • Slow (5-30s): Configuration, counters, status
ADD MAPPING FastLoop
    WITH EVERY 100 MILLISECONDS
    // Critical TAGs only

ADD MAPPING SlowLoop
    WITH EVERY 5 SECONDS
    // Non-critical TAGs
Reduce network traffic for slowly changing values:
ADD TAG Temperature
    WITH DEADBAND "0.5"  // Only publish if change > 0.5
Transform raw PLC values to engineering units in the route:
ADD TAG Temperature
    WITH SCALING "0.1"   // Raw 245 becomes 24.5
    WITH OFFSET "-40"    // Apply offset if needed
    WITH UNIT "°C"
Include metadata in published messages:
ADD TAG Temperature
    WITH PUBLISH_MODE "JSON"
    WITH UNIT "°C"
    WITH DESCRIPTION "Main reactor temperature"
Output:
{
  "value": 24.5,
  "unit": "°C",
  "description": "Main reactor temperature",
  "timestamp": "2024-01-15T10:30:00Z"
}
Only enable WRITABLE for TAGs that need it, and use specific topics:
ADD TAG Setpoint
    WITH WRITABLE "true"
    WITH DESTINATION_TOPIC "plc/setpoints/temperature/write"
    WITH MIN_VALUE "0"
    WITH MAX_VALUE "100"

Next Steps

Choose the protocol that matches your equipment: