Tags and data types

A tag is a named value, like StartPB or StartDelay. Rungs read and write tags, and every tag has one data type.

Where tags live

Tags live in three places: Global Tags, Program Tags, and tags made by a Link. The name you type shows where the tag lives.Global TagsEvery program can use themExplorer › Global TagsGlobal.StartPBProgram TagsOnly their own program can use themExplorer › MainProgram › Program TagsFillStepLink tagsA Link makes them for youExplorer › I/O Links › your LinkIO::MyBroker.Mqtt.Temp
The Labs Tags table with names, data types and current values

The Tags table. Online values change while the project runs.

Data types

TypeHoldsExample
BOOLOn or offStartPB = 1
SINTA whole number from -128 to 127Mode = 2
INTA whole number from -32,768 to 32,767Setpoint = 1500
DINTA whole numberSequenceStep = 3
LINTA very large whole numberTotalParts = 4000000000
REALA number with decimalsSpeedRef = 42.5
TIMERPRE, ACC, EN, TT and DNStartDelay.ACC = 760
COUNTERPRE, ACC, CU, CD and DNParts.ACC = 12
STRINGText within its declared capacityRecipe = "Bottle A"
CHAROne characterGrade = 'B'
MQTTA topic to publish toCountMQTT
ARRAYA numbered list or grid of BOOL, DINT or REALLevels[2] = 19
UDTThe members its structure listsPump1.Speed = 40

Add a tag

  1. Stop the PLC. Tags can only be added while it is stopped.
  2. In the bottom panel, open Tags and click + Tag.
  3. Type a name and pick a data type.
  4. Select a contact on a rung and pick the tag in the Inspector.

Good to know

  • With Click to toggle bits on, click a BOOL value to flip it.
  • A force holds a value whatever the logic writes. Clear forces removes them all.
  • Right-click a tag and choose Find References to see every rung that uses it.
  • Tags marked System belong to Labs and cannot be changed.
  • For a list of values under one name, see Arrays. To group related values, see User-defined types.

Learn it in a lesson

Related