# Tia V21 Project

> TIA V21 Project Skill

- Skill: `haoyuesheng1688/tia-v21-project` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx skillmds@latest add haoyuesheng1688/tia-v21-project`
- Raw SKILL.md: https://api.skillmd.com/api/skills/haoyuesheng1688/tia-v21-project/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: haoyuesheng1688 (https://skillmd.com/u/haoyuesheng1688)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/haoyuesheng1688/tia-v21-project

---


# TIA V21 Project Skill

## First Rule

Treat this workspace as the source of truth. Read `knowledge/PROJECT.md` first, then follow its read order. Do not reuse device names, IPs, HMI connection names, tag mappings, or export folders from any other project unless rediscovered in the active TIA project.

## Project Layout

- `knowledge/`: project facts, error ledger, validation checklist, maturity roadmap, and playbooks.
- `tools/`: project-local probes, Add-Ins, Data2Unified helper, and interface practice scripts.
- `exports/`: generated exports and diagnostics. Do not promote customer/project exports into global skills.
- `docs/`: longer design notes.
- `env/`: optional local environment notes and dependency bootstrap.
- `knowledge/repository-policy.md`: GitHub upload boundary for source, skill, framework, and knowledge files.

## Default Workflow

1. Confirm the current working directory is the repository root.
2. Read `knowledge/PROJECT.md`.
3. Use `tools/TiaV21Probe` for active TIA inspection, targeted export, PLC compile checks, and SIMATIC SD document export.
4. Use TIA Add-Ins only for short, repeated in-TIA actions. Keep risky or experimental actions in standalone Add-In packages.
5. Prefer Siemens Data2Unified for supported WinCC-to-Unified modernization, then repair/verify with project-local tools.
6. For PLC block export, separate SimaticML XML from SIMATIC SD document export.
7. For simulation, use S7-PLCSIM V21 for basic PLC logic and PLCSIM Advanced for IP/network/HMI closed-loop work.
8. Record every surprise in `knowledge/error-ledger.md`, add a repeat check to `knowledge/validation-checklist.md`, and update `knowledge/maturity-roadmap.md` when capability changes.
9. Before publishing to GitHub, follow `knowledge/repository-policy.md` and keep generated exports, binaries, and Siemens installation media local.

## Safety Notes

- Avoid rebuilding external Openness probes during active TIA work unless needed; rebuilt executables can retrigger Openness Firewall prompts.
- If TIA Openness returns `EngineeringObjectDisposedException`, stop scripted actions and restart TIA before continuing.
- In Add-In callbacks, avoid file dialogs, `MessageBox`, `explorer.exe`, and long or batch Openness calls until proven stable.
- Current `ExportPlcBlockXmlAddIn` is intentionally single-block only; batch export belongs in external probe/process-isolated workflows.

## Commands

From the repository root:

```powershell
powershell -NoProfile -ExecutionPolicy Bypass -File .\tools\TiaV21Probe\build.ps1
.\tools\TiaV21Probe\bin\TiaV21Probe.exe
.\tools\TiaV21Probe\bin\TiaV21Probe.exe --compile-plc
.\tools\TiaV21Probe\bin\TiaV21Probe.exe --export
.\tools\TiaV21Probe\bin\TiaV21Probe.exe --export-plc-documents --plc-document-blocks "Main"
powershell -NoProfile -ExecutionPolicy Bypass -File .\tools\TiaV21Probe\install-openness-allowlist.ps1
```

## References

Read only what is needed:

- `references/handoff.md`: how to move this workspace to another machine or agent.
- `references/simulation.md`: PLCSIM and HMI closed-loop route.
- `references/addins.md`: Add-In packaging, permissions, and stability guardrails.

