SCADA Manual · Chapter 3

Tag Editor

This screen edits the project's tag table. Open it from Solution Explorer → Data Editor Pages → Tag Editor. It is always listed when a project is open. One row is one tag.

Screen and operations

Tag Editor — the tag table of the TagTutorial sample (the last row has a ⚠ warning because its communication object does not exist)
Tag Editor — the tag table of the TagTutorial sample (the last row has a ⚠ warning because its communication object does not exist)

The top of the screen holds the Find box, the tag count, and the row buttons; the tag table is in the middle; the problem summary and the Reload and Save buttons are at the bottom.

ControlAction
FindFilters by name, source, address, and description, ignoring case.
n tag(s) · External tags n / licensed mThe total number of tags, and the number of external (PLC) tags the license allows. A ⚠ appears in front when the count is exceeded. (License — external tag count)
AddInserts a row after the selection (or at the end). The name is assigned as Tag1, Tag2… and the row starts with ✖ because the address is empty.
DuplicateCopies the selected rows, adding _copy, _copy2… to the names. Handy for a series of consecutive addresses.
DeleteRemoves the selected rows immediately. There is no confirmation. Before saving, Reload brings them back.
Move Up · Move DownChanges row order. Display order is save order. Disabled while Find is filtering.
ReloadReads the file again, asking first if you have edits. Also use it after editing the file outside QMS.
SaveValidates, writes the file, and applies it to the running tags. Ctrl+S and Save All do the same. See 'Saving and file notices' below.
  • Double-click a cell or start typing to edit. Esc cancels and restores the row.
  • Check boxes change on one click. Source, Type, Poll Group, and Write Level are chosen from a list; Source can also be typed.
  • Select several rows with Ctrl or Shift to duplicate, delete, or move them together.
  • Ctrl+C copies rows to paste into Excel and similar. Pasting into the table is not supported. To add many tags at once, edit the file directly and press Reload. (Tag table file format)
  • Sorting is intentionally disabled. The first two columns (problem mark, name) stay fixed when scrolling sideways.

Columns at a glance

ColumnFile keyDefaultMeaning
✖ ⚠Problems in this row. Point at the mark to see them. See 'Problem marks' below.
NameNameTag1…The name used by screens and scripts. Case-sensitive, must be unique, and cannot contain " or \. Dots are fine, as in Tank1.Level.
SourceSourceLOCALWhere the value comes from. See 'Source' below.
AddressAddress(empty)Variable name or PLC address. See 'Address' below.
TypeTypeWordHow memory is interpreted. See 'Type and Length' below.
LengthLength1Words to read for String. Unused by other types. See 'Type and Length' below.
Poll GroupPollGroupNormalHow often to read. See Poll groups and traffic.
Word SwapWordSwapOffWord order of multi-word values. See 'Word Swap' below.
Scale · OffsetScale · Offset1 · 0Value = raw × Scale + Offset. See 'Scale and Offset' below.
UnitUnitUnit text for display. See 'Unit, Format, Min, Max' below.
FormatDisplayFormatNumber format for display. See 'Unit, Format, Min, Max' below.
Min · MaxMin · Max(empty)Allowed write range. See 'Unit, Format, Min, Max' below.
Read OnlyReadOnlyOffBlocks all writes. See 'Option columns' below.
Verify WriteVerifyWriteOffReads back and compares after writing. See 'Option columns' below.
Always PollAlwaysPollOffKeeps reading even if nothing is looking. See 'Option columns' below.
Write LevelWriteLevelOperatorMinimum user level to write from screens. See 'Option columns' below.
DescriptionDescriptionA note, used by Find and the tag diagnostics table.

The decimal point in number cells (Scale, Offset, Min, Max) is always .. 1,5 is a ✖ error.

Source

Sets where the tag's value comes from. The list shows LOCAL, the project's communication objects, and names already used in the table.

ValueMeaningAddress holds
LOCALScript variables and parameters. No communication: reading and writing the tag reads and writes the variable directly. Empty or lowercase becomes LOCAL on save.Variable name
Communication object name (e.g. PLC1)The name registered in the Com Driver Editor. The PLC is read and written through that driver.PLC address

A communication object can be a tag source only with the drivers below. The tag manager picks the right access method automatically.

PLCDriver name (DriverInfo)Address notation
Mitsubishi MELSEC (MC 3E binary)Melsec_TcpClient'MELSEC' below
LS ELECTRIC XGT (FEnet)XDriver_LSFEnetBinary'LS ELECTRIC XGT' below
Panasonic MEWTOCOLTCP_Mewtocol'MEWTOCOL' below
Modbus TCP · RTUModBusTCP, ModBusRTU'Modbus TCP · RTU' below

Caution A registered but unsupported driver gives no warning in the editor. At run time the quality stays NotConnected and the log shows does not support address read/write. If no communication object has that name, you get a ⚠ warning.

Address

LOCAL — variable name

TargetNotationExample
Global variableNameG_Count
Module variableModule::VariableTagDemo::Counter
ParameterGroup.Name (groups: JF · SS · MS · VS · RD)SS.CamX
  • Supported variable types: bool · string · double · int · long · byte · char.
  • Arrays are not supported. Name#3 gives a ⚠ warning and quality Bad at run time. Copy the value to a plain variable and connect that.
  • A misspelled name still saves, but the quality becomes Bad and the log shows variable not found.
  • Match the Type to the variable. New rows default to Word, so a double variable would be rounded and writes limited to −32768 to 32767. Use double → Double, int → DWord, bool → Bit, string → String.

MELSEC

DeviceExampleUnitNumber base
D, RD100, R200WordDecimal
WW1AWordHex
M, LM10, L5BitDecimal
BB1FBitHex
X, YX1F, Y20BitHex (iQ-F and FX use octal — driver property XyOctal = true)
  • Use bit devices for Bit tags and word devices for all other types. A mismatch is rejected by the driver and the quality is Bad.
  • A bit inside a word (D100.F) is not supported. Read the word as a UWord tag and extract the bit in a script. (Example in 'Address layouts that reduce traffic' of Poll groups and traffic)

LS ELECTRIC XGT

NotationExampleMeaning
%AreaW<n>%MW100, %DW0Word. Recommended
%AreaX<n>%MX10Bit. Recommended
Area<n>D7000Short word notation (same as %DW7000)
Area<word>.<bit>M100.5Short bit notation (with the driver default BitNotationStyle = Dotted, same as %MX1605)
%AreaD<n>%MD100Double-word notation (2 words from %MW200)

Area letters: M, P, K, F, T, C, D, S, Q, I, R, W. Different notations for the same memory are read together in batch reads.

MEWTOCOL

TargetExampleNote
Contacts X, Y, R, L (Bit)R070F, Y0010Leading digits are a decimal word, the last digit is a hex bit. After R070F comes R0710. X is an input and cannot be written.
Contacts T, C (Bit)T10, C20Cannot be written, and left out of batch reads.
Data D, L, F (word)D100, F200Decimal. L is a contact for Bit tags and a link register otherwise.

The driver reads at most 19 data words at a time, so keep String tag Length at 19 or less.

Modbus TCP · RTU

The notation is [station:]Modicon number. The number has 5 or 6 digits, and an omitted station means 1. The number minus 1 is the actual protocol address.

First digitAreaExampleTag typeWrite
0Coil00001BitYes
1Discrete input10001, 2:10005BitNo
3Input register30001Non-BitNo
4Holding register40001, 2:400010Non-BitYes
  • If area and type disagree (40001 as Bit), reads fail and the quality is Bad.
  • Station range is 0 to 247. If one station stops responding, other stations on the same line keep being read.
  • Multi-word values usually need Word Swap on.

Type and Length

TypeMeaningRangeWords usedValue in scripts
BitOne bit0, 11 bitbool
Word16-bit signed integer−32768 to 327671Integer
UWord16-bit unsigned integer0 to 655351Integer
DWord32-bit signed integer−2147483648 to 21474836472Integer
UDWord32-bit unsigned integer0 to 42949672952Integer
Float32-bit real2Real
Double64-bit real4Real
StringTextLength × 2 charactersLength columnString
  • Integer types appear as integers when Scale is 1 and Offset is 0, and as reals otherwise.
  • Counters that pass 32767 should be UWord, not Word. As Word they appear negative.
  • Length applies only to String and is in words. One word holds 2 characters, so Length 16 is 32 characters. Other types ignore it, but it must still be a whole number of 1 or more.
  • PLC strings are ASCII only. Non-ASCII text such as Korean is rejected, as is text longer than Length × 2. LOCAL has no such limit.
  • In PLC strings the low byte of a word is the first character, and 0x00 ends the string. There is no option to change this order.
  • Length above 125 gives a ⚠ warning, because it exceeds what many devices read at once.

Word Swap

PLC memory is organised in 16-bit words. A 32-bit value spans 2 words and a 64-bit value spans 4, and which word comes first differs by device. With the wrong order, communication is fine but the value is nonsense.

Word SwapOrderTypical devicesDevice manual wording
Off (default)Low word at the lower addressMitsubishi, LS, PanasonicCDAB, Low Word First
OnHigh word at the lower addressCommon on Modbus devicesABCD, High Word First

Example 1 — UDWord value 100000 (hex 0x000186A0)

Suppose the device stores it like this.

AddressStored word
400010x0001
400020x86A0
Word Swap settingCombinedDisplayed
On (first is high)0x000186A0100000 ← correct
Off (first is low)0x86A000012258632705 (−2036334591 as DWord)

Example 2 — Float value 12.5 (hex 0x41480000)

AddressStored word
400010x4148
400020x0000
Word Swap settingDisplayed
On12.5 ← correct
OffAbout 2.34 × 10⁻⁴¹ (effectively 0)
  • Affected types: DWord, UDWord, Float, Double. Double reverses the order of all 4 words.
  • Not affected: Bit, Word, UWord, String.
  • Applies to both reads and writes. Saving clears the tag's value and rereads it in the new order.
  • How to tell: if a known value looks huge or negative, or a real looks almost 0, toggle this column. Changing the value by 1 on the PLC side shows at once which address holds the low word.
  • Byte order cannot be changed. This column only swaps words. Devices documented as BADC or DCBA (bytes swapped inside each word) cannot be matched with it.

Scale and Offset

These convert the PLC's raw value to the value people see (the engineering value). Screens and scripts see the converted value; writes convert back and send the raw value.

xscript
Read  : value = raw × Scale + Offset
Write : raw = ( value − Offset ) ÷ Scale
CaseScaleOffsetRaw → displayedWrite example
Temperature in 0.1 ℃ steps0.10253 → 25.3Writing 30.0 sends 300
0 to 4000 means −50 to 150 ℃0.05−501500 → 25Writing 30 sends 1600
  • Scale cannot be 0 (✖). Negative values are allowed.
  • Bit and String ignore both.
  • Integer types round on write. Writing 25.34 to a Word with Scale 0.1 gives raw 253.
  • If the converted raw value is outside the type's range, the write is rejected with OutOfRange.

Unit, Format, Min, Max

Unit is only text and is not used in calculations. Format is a .NET numeric format string.

FormatValueShown as
F125.3425.3
N01234512,345
X425500FF (at the width of the tag type)

Unit and Format are used only by the tag diagnostics table (XTagListView). Unit can also be read in scripts with .Unit. XDataLabel ignores them and uses its own DisplayDecimalPoint and DisplayInteger properties. An invalid format string falls back to plain text without an error.

Min and Max are the allowed write range.

  • They apply to the scaled value, not the raw value. Empty means no check.
  • Writes outside the range are rejected with OutOfRange. Screen controls also use them as their input range.
  • Read values are not clipped. A PLC value outside the range is shown as is.
  • Min greater than Max is ✖. Bit and String ignore them.

Option columns

ColumnWhen onWhen to use
Read OnlyRejects writes from screens, remote, and scripts.Values that must not be written, such as sensors and totals
Verify WriteWaits 0.1 s after writing, reads back, and compares. A difference gives Mismatch; a failed readback gives Unverified.Settings a PLC interlock may revert. Do not use on self-resetting command bits — the readback always differs, so good writes look failed.
Always PollKeeps reading with no screen open.Values needed regardless of screens, such as those watched by change events. Increases traffic.

Even with Verify Write off, one readback after a write refreshes the value; it just does not compare.

Write Level is the minimum user level to write this tag from a screen. From lowest: Operator → Maint → Engineer → Master → Developer.

  • If the logged-in level is lower, the write is rejected and the required level is shown.
  • It does not apply to script writes. Scripts are machine logic and run regardless of who is logged in.
  • Web remote writes are blocked by default regardless of level. (Write protection and audit)

Problem marks ✖ ⚠

Rows are checked as you type. Point at the mark to see the explanation; the bottom line summarises the counts and the first problem (for example ✖ 0 error row(s) · ⚠ 1 warning row(s) — first : [5 · Demo.NoPlc] …).

MessageAction
✖Name is empty.Enter a name
✖Name cannot contain " or \.Change it (it must fit inside a script string)
✖Another tag already uses the name.Rename (different case counts as a different name)
✖Address is empty.Enter an address
✖Length must be a whole number of 1 or more.Fix Length
✖Scale, Offset, Min, Max must be numbers.Use . as the decimal point
✖Scale cannot be 0.Enter a non-zero value
✖Min is greater than Max.Fix the range
⚠No communication object with that name in this project — the tag gets no value.Check the Com Driver Editor (saves, but no value arrives)
⚠LOCAL tags cannot use array elements (Name#3).Copy to a plain variable
⚠Length is more than many devices read at once (125).Check the device limit
⚠Beyond the licensed count of n external tags — this tag does not run (quality Unlicensed).See License — external tag count

Rows with ✖ block saving. ⚠ rows save, but may not get a value at run time.

Caution Address format is not checked. Only emptiness is checked, so a typo like D10O saves. Check at run time whether the quality becomes Bad.

Saving and file notices

  • Location: project folder\Tag\TagTable.XDF (JSON). The folder is created if missing.
  • Order: the file is written first, then applied to running tags. Tags with the same name keep their object, so screen connections are not lost.
  • When values reset: changing Source, Address, Type, Length, or Word Swap clears that tag's value and rereads it.
  • The tab's *: there are unsaved edits, or running tags differ from the file.
  • Code helper: saving refreshes the TAG[ autocomplete list at once.
  • Tags created in the designer or script editor: if you are not editing, this screen reloads and shows them at once. If you are, they are added as rows at the end of the table and apply when you save here. ('Creating a missing tag on the spot' in Using tags on screens)

If reading the file had a problem, a notice appears above the table.

NoticeMeaningSaving
File could not be readLocked by another program, or permissionsBlocked. The table becomes read-only. Fix the cause, then Reload
File is brokenJSON error, merge conflict markers, etc.Blocked. Fix the file, then Reload
Saved by a newer QMSNewer format than this versionBlocked. Edit with the newer QMS
Some items could not be readSkipped: missing name, type typo, duplicatesSaves after confirmation. Those items are dropped; the original is kept as TagTable.XDF.bak
Unknown items or commentsKeys this version does not know, // commentsSaves after confirmation. Those are dropped; the original is kept as TagTable.XDF.bak
Text that is not UTF-8Read as ANSISaving converts to UTF-8; the original is kept as TagTable.XDF.bak
Tag table file is missingRunning tags are shown insteadPress Save to create the file
Running tags differ from this fileCould not be read at open, or changed outsideCtrl+S applies it to running tags (the file is not rewritten)

If the file changed outside while you edit (git pull, another editor), saving asks first, and if you proceed the overwritten content is kept as .bak.

Subscribe