siemens/tia-portal-ai-extensions/plc-data-types

Claude Code and agent skill by siemens/tia-portal-ai-extensions

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

TIA Portal PLC Data Types (UDTs / PlcType) — TypeGroup navigation, recursive search, UDT XML export structure (Section Name="None"), and Member attribute formats. Use when writing or reviewing C# code that accesses, searches, creates, or parses UDTs in PlcSoftware.TypeGroup.

Install

npx vskill@latest install siemens/tia-portal-ai-extensions/plc-data-types

SKILL.md

PLC Data Types (UDTs)

Overview

PLC Data Types (UDTs) live in PlcSoftware.TypeGroup as PlcType objects. They are completely separate from blocks (PlcSoftware.BlockGroup) and from library types (GlobalLibrary.TypeFolder). This skill covers TypeGroup navigation, recursive search, and the XML export structure for UDTs.

Required Namespaces

csharp
using Siemens.Engineering.SW;
using Siemens.Engineering.SW.Types;

Required Assemblies

  • Siemens.Engineering.Base.dll
  • Siemens.Engineering.Step7.dll

1. TypeGroup Structure

PlcSoftware
└── TypeGroup ← PlcTypeSystemGroup (root for all UDTs)
├── Types ← PlcTypeComposition
└── Groups ← PlcTypeUserGroupComposition
└── PlcTypeUserGroup
├── Types
└── Groups ← can nest arbitrarily deep

PlcTypeUserGroup sub-folders are purely organizational — they are NOT SW-Units.


2. Finding a UDT

Types.Find(name) searches only the current group level. For deep search, recurse into Groups:

csharp
PlcType FindTypeRecursive(PlcTypeGroup group, string name)
{
var result = group.Types.Find(name);
if (result != null) return result;
foreach (var sub in group.Groups)
{
result = FindTypeRecursive(sub, name);
if (result != null) return result;
}
return null;
}

To search across the entire PLC (root and all SW-Units), see `sw-units`.


3. Creating and Navigating Sub-Groups

csharp
var group = plcSoftware.TypeGroup.Groups.Find("FolderA")
?? plcSoftware.TypeGroup.Groups.Create("FolderA");

Group nesting is unlimited. Always use Find before Create to avoid duplicates.


4. UDT XML Export — Section Name Rule

When a PLC Data Type (SW.Types.PlcStruct) is exported via Openness, its members are always inside <Section Name="None">.

xml
<SW.Types.PlcStruct>
<AttributeList>
<Interface>
<Sections xmlns="http://www.siemens.com/automation/Openness/SW/Interface/v5">
<Section Name="None"> <!-- ALWAYS "None" for UDTs — never "Static" -->
<Member Name="SetPoint" Datatype="Real" />
<Member Name="Enable" Datatype="Bool" />
<Member Name="Config" Datatype="&quot;MyNamespace.ConfigUDT&quot;" />
<Member Name="Buffer" Datatype="Array[0..9] of Real" />
</Section>
</Sections>
</Interface>
<Name>MyUDT</Name>
</AttributeList>
</SW.Types.PlcStruct>

Critical rule: Never look for <Section Name="Static"> when parsing UDT exports — that section name belongs exclusively to Global DBs (SW.Blocks.GlobalDB). UDTs always use "None".


5. Member Attribute Formats

Each <Member> element carries:

AttributeFormatExample
Primitive typePlain type nameDatatype="Real", Datatype="Bool", Datatype="Int"
UDT referenceXML-escaped quoted nameDatatype="&quot;MyNamespace.MyUDT&quot;"
ArrayArray declarationDatatype="Array[0..9] of Real"
Array of UDTCombinedDatatype="Array[0..3] of &quot;MyUDT&quot;"

When parsing member data types programmatically, unescape &quot; → " before processing.


Quick Reference

GoalAPI
Find UDT by name (one level)PlcTypeGroup.Types.Find(name)
Find UDT recursivelyRecurse into group.Groups manually
Create type sub-groupgroup.Groups.Find(name) ?? group.Groups.Create(name)
Place UDT from LibraryTypetypeGroup.Types.CreateFrom(udtVersion, UpdatePathsMode.UpdatePathsInTarget)
Place UDT from MasterCopytypeGroup.Types.CreateFrom(mc, MasterCopyMode.ThrowIfExists)
UDT XML section name<Section Name="None"> — always, never "Static"

Common Failure Modes

SymptomRoot CauseFix
UDT not foundSearching only one group levelRecurse into Groups
No members extracted from XMLParsing Section Name="Static" instead of "None"Look for Section Name="None" for UDTs
Duplicate type sub-groupCreate called without Find firstAlways Find before Create

Related Files

  • `sw-units` — PLC-wide UDT search across root and all SW-Unit TypeGroups
  • `global-library` — placing UDTs from library (MasterCopy or LibraryType path)
  • `blocks` — blocks live in BlockGroup, not TypeGroup

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

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/siemens/tia-portal-ai-extensions/plc-data-types/badge)](https://verified-skill.com/skills/siemens/tia-portal-ai-extensions/plc-data-types)

Something wrong with this skill or its page? Tell us.