← Articles
Tags/7 min read/— views

SCADA Tag Naming Conventions That Survive the Historian and the MQTT Bridge

Your tag name is a key in systems you don't own: PostgreSQL's 63-byte identifier limit, SQL Server's case-insensitive default collation, MQTT's reserved / + # $, and IEC 61131-3 identifier rules.

Tag NamingSCADAStandardsProject Notes

A historian import died on a duplicate key. The table had one row for PUMP_201_RUNFB; the SCADA tag list had two entries, Pump_201_RunFb and PUMP_201_RUNFB, because one screen had been built by copy-paste and typed in caps. The SCADA treated them as different tags. SQL Server treated them as the same key, because its default collations ignore case — the CI in SQL_Latin1_General_CP1_CI_AS is case-insensitive.

Most tag naming guides open with "make the name meaningful". That part is easy. What actually breaks is the name leaving the SCADA. It becomes a key in historian tables, MQTT topics, report queries, and sometimes PLC variable names. Those systems already have their rules, and they are not waiting for your convention.

The route one tag name travels from the SCADA to a report. Each hop does something different to the name, and at the historian's SQL hop the case folds and the name truncates at 63 bytes ONE NAME'S ROUTE — WHAT EACH HOP DOES TO IT SCADAtag list Screens · alarmstrends MQTTbridge ReportsMES link HistorianSQL verbatim display only / + # $ aretopic syntax JOIN key case foldscut at 63 bytes where the name becomes a key

Characters other systems have already banned

Narrow the legal alphabet before you decide what the name means. None of the following is my guideline; all of it is someone else's standard.

MQTT. In OASIS MQTT 5.0 §4.7, / is the topic level separator and + and # are wildcards. Topics beginning with $ are reserved for the server. A tag name containing / silently becomes two topic levels at the bridge. A topic is a UTF-8 encoded string capped at 65,535 bytes (§1.5.4) — length is never the problem here; characters are.

Sparkplug B. Eclipse Sparkplug 3.0 fixes the topic as spBv1.0/<group_id>/<message_type>/<edge_node_id>/<device_id>, and group_id and edge_node_id must not contain /, + or #. The tag name itself rides in the payload as a Metric name, so it escapes the topic rules — as long as you don't wire it into the topic.

IEC 61131-3. If the name is also going to be a PLC variable, it has to satisfy the identifier rules: first character a letter or _, then letters, digits and _ only, no consecutive underscores, and comparison is case-insensitive. - and . are out before you start.

OPC UA. A BrowseName is a QualifiedName — NamespaceIndex plus Name (Part 3) — so uniqueness holds only within a namespace. The textual RelativePath form in Part 4 uses / and . as path separators and & as the escape character, so a . inside a name has to be escaped there.

ISA-5.1. Instrument tags already exist on the P&ID. ISA-5.1 puts the measured variable in the first letter, the function in the letters after it, then a loop number: TI-101, FIC-205. It is tempting to carry that straight into the SCADA, but that - is the character two of the rules above just rejected. I keep the P&ID tag as a separate field. It's a column, not the name.

What's left in the intersection is narrow: letters, digits, _. That is the whole safe set.

It truncates at 63 bytes

The length limit is set by the store, not by your document.

SystemIdentifier limit
PostgreSQL (TimescaleDB included)63 bytes — NAMEDATALEN 64 minus the null terminator
SQL Serversysname = nvarchar(128), so 128 characters
MQTT topic65,535 bytes (the UTF-8 string cap)

PostgreSQL does not raise an error when you go over. It truncates. Two names that become identical at 63 bytes collide there.

A site using Korean names has to redo this arithmetic: one Hangul syllable is 3 bytes in UTF-8, so 63 bytes is 21 characters. 1라인_컨베이어101_운전피드백 is 17 characters and 51 bytes — it fits, and one more prefix would not.

My own cap is 48 ASCII characters. Not because that leaves comfortable headroom, but because the number belongs in the export lint rather than in a document. Length limits written into a naming guide are not enforced.

Case folds

The duplicate key at the top of this page is this problem. The SCADA is case-sensitive; SQL Server's default collation is not. Uniqueness has to hold after lowercasing.

The check against your tag export is one line:

cut -d, -f1 tags.csv | tr 'A-Z' 'a-z' | sort | uniq -d

Empty output is the pass. Any line at all is a row the historian will eventually stop on. Cheaper to run before the next thousand tags arrive.

Then the meaning

Now put meaning into the characters that survived. Go from wide to narrow.

L1_CV101_RUN_FB
└┬┘ └─┬─┘ └┬┘ └┬┘
 │    │    │   └ qualifier: CMD · FB · PV · SP · FLT · ALM
 │    │    └──── signal
 │    └───────── equipment number
 └────────────── area or line

The separator is _, not .. A . is an object qualifier in SQL and a path separator in an OPC UA RelativePath — both places you'd have to escape it.

Always split command from feedback. Pump201_START_CMD and Pump201_RUN_FB are different values. On a system that merged them, "the start command went out and it didn't run" is not a distinction the screen can make, and when the screen can't make it you end up adding another alarm to cover the gap.

Freeze the abbreviations as a list. PV, SP, CMD, FB, FLT, ALM is about the whole of it, and anything not on the list doesn't get in. M1, TEMP2, DATA_17 are fast to produce and mean nothing in an alarm message.

Keep units and data types out of the name. Tank101_LEVEL_PCT earns its place; Tank101_LEVEL_REAL costs you. Change the type and you have to change the name, and renaming leaves the historian's existing data behind under the old one.

The name is only the entry point

A tag also carries a description, units, data type, scaling, quality behaviour, alarm limits, a historian deadband, and an owner. ISA-18.2 requires alarms to be identified in a master alarm database — the tag name is the JOIN key between that database and the SCADA. A key, not a sentence. That is why it should stay short and regular, and why anything a human reads belongs in the description field.

Next thing to check: run the lowercase-duplicate check and the length check against the tag export you have right now. Pass both and you can start arguing about the convention.

For what a tag holds in the first place, see What is a SCADA tag?; for how the name is used downstream, Historian basics. Status tags shared across screens have their own failure mode in why two SCADA screens disagree about the same pump, and the topic side is covered in designing Sparkplug B topics you won't have to rename later. The cost of renaming late is in five project decisions that are expensive to undo.