An engineer traces a conveyor station through a PLC cabinet, edge computer and operations workstation.

PLC MQTT Tag Naming and Schema Versioning Guide for Edge Gateways

共有:
An engineer traces a conveyor station through a PLC cabinet, edge computer and operations workstation.

The Robustel EG5120 Edge Computing Gateway can acquire selected industrial data and publish MQTT through verified applications, but stable PLC tag naming must be designed as a contract for dashboards, historians and analytics rather than copied from one controller’s address table. Keep asset identity, measurement name, unit, timestamp, quality and schema version explicit so a gateway or PLC change does not silently change meaning.

The guiding rule is that a consumer should understand a record without knowing the source register address. Preserve that raw identity in metadata for traceability, while exposing a durable operational name.

Separate physical identity from the controller address

Use a stable hierarchy such as organisation/site/area/asset/measurement, with a documented character set and case convention. Do not embed credentials, personal names or sensitive plant labels in public broker paths.

FieldExamplePurpose
site_idde01stable deployment identity
area_idutilitiesoperational grouping
asset_idpump_07maintainable equipment identity
measurementdischarge_pressurehuman-readable meaning
source_refplc2.db14.dbd20traceability to raw controller mapping
schema_version2.1consumer contract

Avoid encoding unit or data type only in the topic. Those properties can change and belong in a versioned payload or registry.

The Robustel video “How to Collect PLC Data for SCADA, MES & Cloud with an Edge Gateway” shows the source-to-northbound path. Topic and payload design must then be agreed with the actual consumers.

Define a payload that carries meaning and health

A minimal industrial record normally needs value, engineering unit, measurement time, quality and source identity. Add gateway receipt time when it helps diagnose latency or replay. For counters, include rollover or reset semantics in the schema documentation.

FieldRequired question
valuewhat type and scale is valid?
unitwhich canonical engineering unit is used?
ts_sourcedid the source provide a trusted measurement time?
ts_gatewaywhen did the gateway acquire the value?
qualitygood, stale, bad, substituted or uncertain?
source_refwhich raw PLC identity produced it?
schema_versionwhich consumer contract applies?

Robustel’s smart-parking application example illustrates several asset types feeding a common platform. The same principle applies in a plant: common governance should not erase source-specific meaning.

Version breaking and non-breaking changes differently

Adding an optional field with a default interpretation may be backward compatible. Renaming a field, changing units, changing type, altering topic hierarchy or redefining quality values is breaking. Use a new major schema version or a parallel topic and give consumers a migration window.

Do not overwrite raw register identity when a PLC programme changes. Maintain a mapping history that links old and new addresses to the stable asset measurement, with effective dates and approval.

ChangeVersion actionMigration evidence
add optional diagnostic fieldminor versionold consumer ignores it safely
change °C to Kmajor version or explicit new fieldboth units verified during overlap
rename assetidentity-governance decisionalias and historical continuity tested
change integer to floating pointmajor versionparser and historian validation
move PLC registermapping revision, not public renamesource comparison before cutover

How Robustel EG5120 Edge Computing Gateway supports a governed data contract

The Robustel EG5120 Edge Computing Gateway provides serial/Ethernet interfaces, native Modbus paths, MQTT-to-cloud capability, RobustOS Pro, containers and local storage. It can host the mapping and publishing layer close to the PLC, allowing source references and operational names to be managed separately.

For compatible EG5120 deployments, Robustel E2C Factory supplies documented data collection, management, local operations and northbound forwarding. The combined value is a verified gateway boundary plus an operational data layer; exact drivers, payloads and version rules remain project configuration.

Governance painVerified roleOperating effectAcceptance evidence
PLC addresses changelocal mapping applicationstable northbound identity can remainbefore/after source comparison
WAN interruptionslocal processing/storagepreserve timestamped records for replaysequence and duplicate test
many gateways driftRCMS-managed operationsdeploy approved gateway/application versionsaudit and version inventory

Run contract tests before every schema change

Maintain golden sample messages for good, stale, bad, missing, high/low limit and counter-reset cases. Validate them against every critical consumer: broker rules, dashboard, historian, alerting and analytics. A broker accepting JSON proves syntax, not semantic compatibility.

Robustel’s secure remote access to industrial robots application example illustrates why a maintainable service path matters when deployed equipment changes. Apply the same discipline to data: record who approved the mapping and which consumer versions were tested.

During rollout, publish the old and new schema in parallel where practical, compare values and quality, then retire the old path only after consumer owners sign off. Keep rollback until retention and replay have passed.

Protect names, ownership and long-term meaning

Create a naming authority and change board proportionate to the estate. The PLC engineer owns source identity, the asset owner approves operational names, the data owner approves schema meaning, and platform owners validate consumers. Avoid letting one dashboard developer rename the plant contract unilaterally.

Store the schema, examples, mapping and compatibility policy in version control. The gateway configuration should reference that approved version so an incident can trace a published value back to its source and rule set.

よくある質問

Q1. What are the restrictions on MQTT topic names?

MQTT topics are case-sensitive UTF-8 strings and use / as a hierarchy separator. Avoid wildcard characters in published topic names, leading/trailing ambiguity, empty levels and sensitive information.

Q2. What are tags in PLC programming?

Tags are named references to controller variables such as inputs, states, setpoints and measurements. Their controller names are useful source references but may not be stable or meaningful enough for enterprise consumers.

Q3. Is MQTT still relevant for industrial data?

Yes. It is widely used for lightweight publish/subscribe integration, but it does not define the business meaning, quality or schema of the payload. Those require an agreed contract.

Q4. Is MQTT TCP or UDP?

Standard MQTT runs over TCP. Other transports or related protocols may exist, so document the broker endpoint, TLS and client behaviour used by the project.

Q5. How does the Robustel EG5120 Edge Computing Gateway support PLC-to-MQTT naming?

It provides industrial interfaces, Modbus and MQTT capabilities plus a Linux application environment for mapping and publishing. A compatible E2C Factory deployment can add a documented data layer, while naming and schema governance remain project responsibilities.

結論

The Robustel EG5120 Edge Computing Gateway is best suited to PLC-to-MQTT architectures that need local mapping, processing and managed deployment close to the source. The gateway can implement the contract, but asset and data owners must define its meaning.

Stabilise identity, preserve raw source references, carry units/time/quality explicitly and version breaking changes. Test every critical consumer before cutover so a neat topic tree does not hide a broken operational record.

著者について

Robustel Editorial Team

The Robustel Editorial Team publishes practical articles on industrial connectivity, edge computing, LoRaWAN and device management, focusing on deployment considerations, technical limitations and long-term operation.