Development Environment¶
This page describes the day-to-day engineering environment after Windows tools, repository setup, and the first smoke test are complete.
Best workflow
Open the repository folder in VS Code, accept the recommended extensions, use the integrated terminal, and run project tasks through pcs ....
Daily Workflow¶
Open repo in VS Code
-> use recommended extensions
-> edit PLC sources in tia/exports
-> create new blocks with pcs new block ...
-> preview deploys with dry-run
-> deploy with pcs deploy ...
-> document changes in MkDocs
VS Code Workspace Setup¶
The repository contains shared VS Code workspace settings in .vscode/settings.json and extension recommendations in .vscode/extensions.json.
VS Code should prompt to install recommended extensions when the workspace is opened. You can also open Extensions and search:
@recommended
Recommended extensions include:
- Dynamic Siemens Language Support by Dynamic Engineering
- PowerShell
- Markdown All in One
- Python
- GitLens
- PlantUML
The workspace maps Siemens source files to Siemens language mode:
{
"files.associations": {
"*.scl": "siemens",
"*.udt": "siemens",
"*.db": "siemens"
}
}
.\pcs.cmd install tools adds the repository root to the user PATH, so new terminals can run:
pcs config show
pcs new block 06_ALARMS/FB_MyBlock
.db files are PLC data blocks
.db files in this repository are Siemens PLC data block sources. The workspace forces .db files to open in the default text editor so database-related VS Code extensions do not take over.
Expected protection:
{
"workbench.editorAssociations": {
"*.db": "default"
}
}
PCS CLI¶
The pcs command is the main developer interface. Use it for creating blocks, listing sources, building tooling, deploying to TIA, and serving the docs.
Command reference
Detailed command examples are documented in Terminal Commands (CLI).
After cloning, bootstrap the machine once through:
.\pcs.cmd install tools
Then restart the terminal and initialize the repository:
pcs init
Author variable for generated headers
New block headers use the author resolved from pcs.config.json. By default, set this once:
[Environment]::SetEnvironmentVariable("PCS_AUTHOR", "Max Mustermann", "User")
Restart VS Code or open a new terminal after changing user environment variables.
Python Environment¶
The Python virtual environment is repo-local and created by pcs init.
pcs init
Info
PlantUML rendering is handled by the external plantuml command and Graphviz. Do not install or rely on the legacy plantuml-markdown Python package for this repository.
Manual commands are mainly useful for troubleshooting:
.\.venv\Scripts\Activate.ps1
python -m pip install -r requirements.txt
python -m mkdocs build
TIA Openness CLI Build¶
The TIA Openness CLI builds with the .NET Framework C# compiler included with Windows:
$env:WINDIR\Microsoft.NET\Framework64\v4.0.30319\csc.exe
A separate .NET SDK is not required for the current tooling.
Daily usage is documented in Terminal Commands (CLI). The direct build command is:
pcs build
Repository Areas¶
| Path | Purpose |
|---|---|
tia/exports/ |
PLC sources grouped by subsystem |
pcs.config.json |
Project path, backup path, exports root, PLC targets, author settings |
tools/tia-openness/ |
Openness CLI source and PowerShell wrappers |
tools/tia-deployment-gui/ |
Lightweight deployment GUI |
tools/pcs-tia-sync-tool/ |
Focused GUI for Repo <-> TIA synchronization |
docs/development/ |
Development workflow documentation |
Path Templates¶
PowerShell wrappers support absolute paths, repo-relative paths, and environment-variable templates.
%USERPROFILE%\Documents\TIA-Projekte\PCS\PCS.ap20
$USERPROFILE\Documents\TIA-Projekte\PCS\PCS.ap20
$env:USERPROFILE\Documents\TIA-Projekte\PCS\PCS.ap20
Use these templates in documentation and config files instead of engineer-specific paths.
TIA version detection
The Openness wrappers infer the TIA version from the project extension, for example .ap19 or .ap20.