{"id":"4a02feea-b84a-438b-bb08-b7983dd03229","shortId":"beXfPa","kind":"skill","title":"tia-python","tagline":"Reference routed skill. Do NOT load directly unless user says so.","description":"# TIA Scripting Python – Skill\n\nLibrary: `siemens_tia_scripting` (v1.1.0)  \nRequires: Python 3.12.x, TIA Portal V15.1+, TIA Portal Openness V15.1+\n\n---\n\n## Setup Boilerplate\n\n```python\nimport os\nimport sys\n\n# Option A – environment variable (file import method)\nsys.path.append(os.getenv('TIA_SCRIPTING'))\nimport siemens_tia_scripting as ts\n\n# Option B – installed as pip package\nimport siemens_tia_scripting as ts\n```\n\n---\n\n## Object Hierarchy\n\n```\nsiemens_tia_scripting (Global functions)\n└── Portal\n    └── Project\n        ├── Plc\n        │   ├── ProgramBlock / SystemBlock\n        │   ├── PlcTagTable → PlcTag / UserConstant\n        │   ├── UserDataType\n        │   ├── ExternalSource\n        │   ├── ForceTable / WatchTable\n        │   ├── TechnologyObject\n        │   ├── SoftwareUnit (contains same sub-objects as Plc)\n        │   └── SafetyAdministration\n        ├── Hmi\n        │   ├── HmiTagTable → HmiTag\n        │   ├── HmiScreen / HmiScript / HmiCycle\n        │   ├── HmiAlarm / HmiAlarmClass\n        │   ├── HmiConnection\n        │   ├── HmiGraphicList / HmiTextList\n        └── ProjectLibrary\n            └── LibraryType → LibraryTypeVersion\n\nPortal\n└── GlobalLibrary\n    └── LibraryTypeFolder → LibraryType → LibraryTypeVersion\n```\n\nAccessing any object requires: Portal open → Project open → device retrieved.\n\n---\n\n## Shared Traits (apply to most classes)\n\nThese methods behave identically across all classes that have them. Do NOT repeat their full docs in reference files — refer here instead.\n\n### get_name() → str\n\nReturns the name of the object.\n\n### get_property(name: str) → str\n\nReturns a single property value as string. Non-string values are auto-converted.\n\n```python\nval = obj.get_property(name=\"CreationDate\")\n```\n\n### get_properties() → List[str]\n\nReturns all property names of the object.\n\n### set_property(name: str, value: str) → int\n\nSets a property. Value must be passed as string regardless of underlying type:\n\n- bool → `\"True\"` / `\"False\"`\n- int → `\"42\"`\n- float → `\"3.14\"`\n- enum → index string `\"0\"` or name string `\"OptionA\"`\n\n```python\nobj.set_property(name=\"Name\", value=\"MyNewName\")\n```\n\n### get_identifier() → str\n\nReturns a unique identifier string for the object.\n\n### export(target_directory_path, export_options=None, export_format=None, keep_folder_structure=None)\n\nExports the object. Shared signature across PLC/HMI data objects.\n\n- `export_options`: `Enums.ExportOptions` (WithDefaults=0, Nan=1, WithReadOnly=2)\n- `export_format`: `Enums.ExportFormats` (SimaticML=0, ExternalSource=1, SimaticSD=2)\n- `keep_folder_structure`: bool — if True, folder hierarchy is preserved\n\n```python\nobj.export(target_directory_path=\"C:\\\\ws\\\\export\",\n           export_options=ts.Enums.ExportOptions.WithDefaults)\n```\n\n### delete()\n\nDeletes the object from TIA Portal.\n\n### get_path() → str / get_path_full() → str\n\n- `get_path()` → path up to the parent system folder\n- `get_path_full()` → full path up to project root\n\n### get_fingerprints() → List[str]\n\nReturns fingerprint data for the object.\n\n### get_supported_export_format() → List[str]\n\nReturns a list of export format strings supported by the object.\n\n### show_in_editor()\n\nOpens the object in the TIA Portal editor UI.\n\n### is_consistent() → bool\n\nReturns True if the object is consistent (compiled, no errors).\n\n---\n\n## Enums Reference\n\n```python\nts.Enums.PortalMode          # WithGraphicalUserInterface=0, WithoutGraphicalUserInterface=1, AnyUserInterface=2\nts.Enums.UmacUserMode        # Project=0, Global=1\nts.Enums.ExportFormats       # SimaticML=0, ExternalSource=1, SimaticSD=2\nts.Enums.ExportOptions       # WithDefaults=0, Nan=1, WithReadOnly=2\nts.Enums.CleanUpMode         # PreserveDefaultVersionOfUnusedTypes=0, DeleteUnusedTypes=1\nts.Enums.LibraryExportOptions # Nan=0, WithLibraryVersionInfoFile=1, OnlyLibraryVersionInfoFile=2\nts.Enums.HarmonizeOptions    # HarmonizePathsAndNames=0, HarmonizePaths=1, HarmonizeNames=2\nts.Enums.DependenciesMode    # DoNotAutomaticallyCreateOrReleaseDependencies=0, AutomaticallyCreateOrReleaseDependenciesIfRequired=1\n```\n\n---\n\n## Logging\n\n```python\nts.set_logging(path=\"C:\\\\ws\\\\tiascripting.log\", console=True)\n```\n\nCall early in the script, before opening a portal.\n\n---\n\n## Reference Files\n\nLoad only the file(s) relevant to the task at hand:\n\n| File | When to load |\n|------|-------------|\n| `skills/tia-python/references/global_portal.md` | Opening/attaching portal, project management, UMAC, credentials |\n| `skills/tia-python/references/plc.md` | Working with PLC devices, blocks, tags, UDTs, technology objects, software units |\n| `skills/tia-python/references/hmi.md` | Working with HMI devices, screens, tags, scripts, alarms, connections |\n| `skills/tia-python/references/library.md` | Working with GlobalLibrary, ProjectLibrary, LibraryTypes and versions |\n| `skills/tia-python/references/project.md` | Project-level operations, ProjectServer, transactions, TestSuite |\n\nFor pipelines that span multiple domains, load all relevant files before generating code.\n\n---\n\n## General Coding Guidance\n\n- **One function per device type** — keep PLC logic and HMI logic in separate functions.\n- **Always check compile/download return values** — `compile_hardware()` and `compile_software()` return `True` if there are errors.\n- **Use `folder_path` parameters** — most `get_*` methods accept an optional `folder_path: str` using `\"group1/group2\"` syntax to scope retrieval.\n- **`import_*` methods take a directory path**, not a file path — point to the folder containing exported XML files.\n- **Transactions** — use `project.start_transaction()` / `project.end_transaction()` for bulk changes that should be undoable.\n- **`set_property` values are always strings** — even for booleans and numbers.","tags":["tia","python","totally","integrated","claude","czarnak","agent-skills","claude-code","claude-code-plugin","claude-skills","codex","codex-cli"],"capabilities":["skill","source-czarnak","skill-tia-python","topic-agent-skills","topic-claude-code","topic-claude-code-plugin","topic-claude-skills","topic-codex","topic-codex-cli","topic-codex-plugin","topic-gemini","topic-gemini-cli","topic-gemini-cli-extension","topic-gemini-extension","topic-mcp"],"categories":["totally-integrated-claude"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/Czarnak/totally-integrated-claude/tia-python","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add Czarnak/totally-integrated-claude","source_repo":"https://github.com/Czarnak/totally-integrated-claude","install_from":"skills.sh"}},"qualityScore":"0.454","qualityRationale":"deterministic score 0.45 from registry signals: · indexed on github topic:agent-skills · 9 github stars · SKILL.md body (5,747 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T19:08:30.629Z","embedding":null,"createdAt":"2026-05-18T13:13:58.858Z","updatedAt":"2026-05-18T19:08:30.629Z","lastSeenAt":"2026-05-18T19:08:30.629Z","tsv":"'0':233,283,292,407,414,419,426,433,438,445,452 '1':285,294,409,416,421,428,435,440,447,454 '2':287,296,411,423,430,442,449 '3.12':26 '3.14':229 '42':227 'accept':589 'access':119 'across':139,275 'alarm':518 'alway':566,636 'anyuserinterfac':410 'appli':131 'auto':184 'auto-convert':183 'automaticallycreateorreleasedependenciesifrequir':453 'b':60 'behav':137 'block':503 'boilerpl':36 'bool':223,300,391 'boolean':640 'bulk':626 'c':312,460 'call':465 'chang':627 'check':567 'class':134,141 'code':548,550 'compil':399,571,574 'compile/download':568 'connect':519 'consist':390,398 'consol':463 'contain':92,615 'convert':185 'creationd':191 'credenti':497 'data':277,356 'delet':318,319 'deleteunusedtyp':434 'devic':127,502,514,555 'direct':10 'directori':258,310,605 'doc':150 'domain':541 'donotautomaticallycreateorreleasedepend':451 'earli':466 'editor':379,387 'enum':230,402 'enums.exportformats':290 'enums.exportoptions':281 'environ':44 'error':401,581 'even':638 'export':256,260,263,270,279,288,314,315,362,370,616 'externalsourc':87,293,420 'fals':225 'file':46,153,475,479,487,545,609,618 'fingerprint':351,355 'float':228 'folder':267,298,303,340,583,592,614 'forcet':88 'format':264,289,363,371 'full':149,330,343,344 'function':77,553,565 'general':549 'generat':547 'get':157,166,192,245,325,328,332,341,350,360,587 'global':76,415 'globallibrari':115,523 'group1/group2':596 'guidanc':551 'hand':486 'hardwar':572 'harmonizenam':448 'harmonizepath':446 'harmonizepathsandnam':444 'hierarchi':72,304 'hmi':100,513,561 'hmialarm':106 'hmialarmclass':107 'hmiconnect':108 'hmicycl':105 'hmigraphiclist':109 'hmiscreen':103 'hmiscript':104 'hmitag':102 'hmitagt':101 'hmitextlist':110 'ident':138 'identifi':246,251 'import':38,40,47,53,65,601 'index':231 'instal':61 'instead':156 'int':209,226 'keep':266,297,557 'level':531 'librari':19 'librarytyp':112,117,525 'librarytypefold':116 'librarytypevers':113,118 'list':194,352,364,368 'load':9,476,490,542 'log':455,458 'logic':559,562 'manag':495 'method':48,136,588,602 'multipl':540 'must':214 'mynewnam':244 'name':158,162,168,190,199,205,235,241,242 'nan':284,427,437 'non':179 'non-str':178 'none':262,265,269 'number':642 'obj.export':308 'obj.get':188 'obj.set':239 'object':71,96,121,165,202,255,272,278,321,359,376,382,396,507 'one':552 'onlylibraryversioninfofil':441 'open':33,124,126,380,471 'opening/attaching':492 'oper':532 'option':42,59,261,280,316,591 'optiona':237 'os':39 'os.getenv':50 'packag':64 'paramet':585 'parent':338 'pass':216 'path':259,311,326,329,333,334,342,345,459,584,593,606,610 'per':554 'pip':63 'pipelin':537 'plc':80,98,501,558 'plc/hmi':276 'plctag':84 'plctagtabl':83 'point':611 'portal':29,32,78,114,123,324,386,473,493 'preserv':306 'preservedefaultversionofunusedtyp':432 'programblock':81 'project':79,125,348,413,494,530 'project-level':529 'project.end':623 'project.start':621 'projectlibrari':111,524 'projectserv':533 'properti':167,174,189,193,198,204,212,240,633 'python':3,17,25,37,186,238,307,404,456 'refer':4,152,154,403,474 'regardless':219 'relev':481,544 'repeat':147 'requir':24,122 'retriev':128,600 'return':160,171,196,248,354,366,392,569,576 'root':349 'rout':5 'safetyadministr':99 'say':13 'scope':599 'screen':515 'script':16,22,52,56,68,75,469,517 'separ':564 'set':203,210,632 'setup':35 'share':129,273 'show':377 'siemen':20,54,66,73 'signatur':274 'simaticml':291,418 'simaticsd':295,422 'singl':173 'skill':6,18 'skill-tia-python' 'skills/tia-python/references/global_portal.md':491 'skills/tia-python/references/hmi.md':510 'skills/tia-python/references/library.md':520 'skills/tia-python/references/plc.md':498 'skills/tia-python/references/project.md':528 'softwar':508,575 'softwareunit':91 'source-czarnak' 'span':539 'str':159,169,170,195,206,208,247,327,331,353,365,594 'string':177,180,218,232,236,252,372,637 'structur':268,299 'sub':95 'sub-object':94 'support':361,373 'syntax':597 'sys':41 'sys.path.append':49 'system':339 'systemblock':82 'tag':504,516 'take':603 'target':257,309 'task':484 'technolog':506 'technologyobject':90 'testsuit':535 'tia':2,15,21,28,31,51,55,67,74,323,385 'tia-python':1 'tiascripting.log':462 'topic-agent-skills' 'topic-claude-code' 'topic-claude-code-plugin' 'topic-claude-skills' 'topic-codex' 'topic-codex-cli' 'topic-codex-plugin' 'topic-gemini' 'topic-gemini-cli' 'topic-gemini-cli-extension' 'topic-gemini-extension' 'topic-mcp' 'trait':130 'transact':534,619,622,624 'true':224,302,393,464,577 'ts':58,70 'ts.enums.cleanupmode':431 'ts.enums.dependenciesmode':450 'ts.enums.exportformats':417 'ts.enums.exportoptions':424 'ts.enums.exportoptions.withdefaults':317 'ts.enums.harmonizeoptions':443 'ts.enums.libraryexportoptions':436 'ts.enums.portalmode':405 'ts.enums.umacusermode':412 'ts.set':457 'type':222,556 'udt':505 'ui':388 'umac':496 'under':221 'undoabl':631 'uniqu':250 'unit':509 'unless':11 'use':582,595,620 'user':12 'userconst':85 'userdatatyp':86 'v1.1.0':23 'v15.1':30,34 'val':187 'valu':175,181,207,213,243,570,634 'variabl':45 'version':527 'watchtabl':89 'withdefault':282,425 'withgraphicaluserinterfac':406 'withlibraryversioninfofil':439 'withoutgraphicaluserinterfac':408 'withreadon':286,429 'work':499,511,521 'ws':313,461 'x':27 'xml':617","prices":[{"id":"0bcb7ec9-40af-41c2-b328-cd851a0d21e6","listingId":"4a02feea-b84a-438b-bb08-b7983dd03229","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"Czarnak","category":"totally-integrated-claude","install_from":"skills.sh"},"createdAt":"2026-05-18T13:13:58.858Z"}],"sources":[{"listingId":"4a02feea-b84a-438b-bb08-b7983dd03229","source":"github","sourceId":"Czarnak/totally-integrated-claude/tia-python","sourceUrl":"https://github.com/Czarnak/totally-integrated-claude/tree/main/skills/tia-python","isPrimary":false,"firstSeenAt":"2026-05-18T13:13:58.858Z","lastSeenAt":"2026-05-18T19:08:30.629Z"}],"details":{"listingId":"4a02feea-b84a-438b-bb08-b7983dd03229","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"Czarnak","slug":"tia-python","github":{"repo":"Czarnak/totally-integrated-claude","stars":9,"topics":["agent-skills","claude-code","claude-code-plugin","claude-skills","codex","codex-cli","codex-plugin","gemini","gemini-cli","gemini-cli-extension","gemini-extension","mcp","mcp-server","siemens","skills","tia-openness","tia-portal"],"license":"mit","html_url":"https://github.com/Czarnak/totally-integrated-claude","pushed_at":"2026-05-08T03:14:15Z","description":"A Claude Code plugin for Siemens TIA Portal engineering automation.","skill_md_sha":"7ebac4edc175dec2592fdf5677ae1088cf80652f","skill_md_path":"skills/tia-python/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/Czarnak/totally-integrated-claude/tree/main/skills/tia-python"},"layout":"multi","source":"github","category":"totally-integrated-claude","frontmatter":{"name":"tia-python","description":"Reference routed skill. Do NOT load directly unless user says so."},"skills_sh_url":"https://skills.sh/Czarnak/totally-integrated-claude/tia-python"},"updatedAt":"2026-05-18T19:08:30.629Z"}}