siemens/tia-portal-ai-extensions/tags-and-tagtables
Claude Code and agent skill by siemens/tia-portal-ai-extensions
- community
Checking that the SKILL.md file is still in the repository.
Tags and tag tables management in TIA Portal. Use when accessing, creating, renaming PLC tags, exporting/importing tag tables to XML, and finding tags by name.
Install
npx vskill@latest install siemens/tia-portal-ai-extensions/tags-and-tagtablesSKILL.md
Tags and TagTables
Overview
Tags and TagTables provide the mechanism for defining and managing PLC variables in TIA Portal. A PlcSoftware contains a TagTableGroup which organizes PlcTagTable instances (e.g., default tag tables, HW tags). Each tag table holds a collection of PlcTag objects that represent individual variables accessible from blocks. Tags can be accessed by name, edited in-place, exported to XML for bulk modification, and re-imported.
Required Namespaces
Required Assemblies
Siemens.Engineering.Base.dllSiemens.Engineering.Step7.dll
Common Patterns
Access TagTable and PlcTag from PlcSoftware
Description: Navigate from PlcSoftware to its tag tables and individual tags. The TagTableGroup exposes all tag tables associated with the PLC software. Tags are accessed via the Tags property of a specific tag table.
Example:
Key Types and Methods:
PlcSoftware.TagTableGroup— the root container for all tag tablesTagTableCollection— enumerable collection of tag tablesPlcTagTable.Tags— collection of tags within a tag table
Edit Tag Name In-Place
Description: Modify the name of an existing PlcTag directly by setting its Name property. This is an in-place mutation on the engineering object.
Example:
Key Types and Methods:
PlcTag.Name— settable property for the tag's symbolic name
Export TagTable to XML and Re-Import
Description: Export an entire tag table to XML, modify the XML using standard .NET XML APIs (e.g., XDocument), then re-import the modified XML back into the project. Useful for bulk tag transformations or migration scenarios.
Example:
Key Types and Methods:
PlcTagTable.Export(FileInfo, ExportOptions)— writes tag table to XML fileTagTableCollection.Import(FileInfo, ImportOptions)— imports tag table from XML file
Find Tag by Name via Collection.Find
Description: Use the Find(string) method on a PlcTagCollection to locate a specific tag by its name. This is more efficient than iterating manually and handles name lookup internally.
Example:
Key Types and Methods:
PlcTagCollection.Find(string)— returns the tag with the specified name ornull
Create Tag Tables and Tags Idempotently
Key points:
PlcTagComposition.Create(name, dataTypeName, logicalAddress). The address format is%<area><byte>[.<bit>], for example%I187.0,%Q10.0,%MW100,%M50.3.- Tag names are unique per PLC across all tag tables.
Tags.Createthrows "An attempt was made to create an object that already exists" on a clash in any table, so include the table name in diagnostics. - To find a table anywhere below a
PlcTagTableGroup, recurse throughgroup.Groups. Search one scope only (PLC root or a SW-Unit's tag-table group), because SW-Units have isolated groups (see `sw-units`). - Not every tag attribute applies to every tag. Wrap optional per-attribute
SetAttributecalls in try/catch, log the failure and continue, rather than aborting a whole table.
Create and Manage User Constants
Description: User constants are named values stored in tag tables, usable in PLC code and array bounds. Use Find before Create to avoid duplicates.
Example:
Key Types and Methods:
PlcTagTable.UserConstants— collection of user constants in the tag tableUserConstants.Find(name)— returnsnullif not foundUserConstants.Create(name, dataType, value)— creates and returns the new constantPlcUserConstant.Value— settable property for the constant's current value
User constants are referenced in array bounds and PLC code as "CONST_NAME" (with quotes).
Quick Reference
| Method/Pattern | Purpose | |
|---|---|---|
plcSoftware.TagTableGroup.TagTables | Access all tag tables in the PLC software | |
PlcTagTable.Tags.FirstOrDefault() | Get the first tag from a tag table | |
PlcTag.Name = "..." | Rename an existing tag in-place | |
PlcTagTable.Export(path, ExportOptions) | Export tag table to XML file | |
TagTableCollection.Import(path, ImportOptions) | Import tag table from XML file | |
PlcTagCollection.Find(name) | Find a tag by its symbolic name | |
PlcTagTable.UserConstants.Find(name) | Find a user constant by name | |
PlcTagTable.UserConstants.Create(name, dataType, value) | Create a new user constant | |
PlcUserConstant.Value | Read or update the constant's value |
Related Files
- `blocks` — blocks reference tags through their interface members
- `devices-and-hardware` — hardware tags are auto-generated from device configuration
Exception Handling
EngineeringExceptionmay be thrown when exporting/importing tag tables if the file path is invalid or the XML is malformed- Null checks should be performed after
Find()calls since they returnnullwhen the tag is not found
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingopenness_development/skills/tags-and-tagtables/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/siemens/tia-portal-ai-extensions/tags-and-tagtables)