Skip to content

Windows Setup (2): PCS Tool Bootstrap

This page continues after Windows Setup (1) and Git and Repository Setup. At this point the engineer should have Git configured, repository access accepted, and the PCS repository cloned locally.

Shared PCS Tool Bootstrap

Open a normal Windows Terminal as Administrator, go to the repository root, and run the project bootstrap command:

cd $env:USERPROFILE\source\pcs
.\pcs.cmd install tools

Use the Administrator Windows Terminal only for this first machine setup step. After setup and restart, run normal pcs ... commands from non-elevated VS Code terminals.

It handles:

  • adding the repository root to the user PATH,
  • setting the CurrentUser PowerShell execution policy to RemoteSigned,
  • checking Python for the repo-local virtual environment,
  • checking Java for PlantUML,
  • checking Graphviz dot for PlantUML layout,
  • checking membership in the local Siemens TIA Openness group,
  • installing missing Python, Java, and Graphviz with winget after confirmation,
  • installing the PlantUML CLI wrapper below %LOCALAPPDATA%\PCS\PlantUML after confirmation.

Use a dry check when you only want to inspect the workstation:

.\pcs.cmd install tools --check-only

Use non-interactive installation only when the workstation policy allows winget automation:

.\pcs.cmd install tools --yes

PowerShell Execution Policy

.\pcs.cmd install tools sets the CurrentUser PowerShell execution policy to RemoteSigned automatically. If a company or domain policy blocks this setting, the command prints a warning and the manual command to use with the workstation administrator.

Follow the next steps printed by install tools. The command checks whether the Siemens TIA Openness group is already active in the current Windows session. If it is active, close the Administrator terminal and continue in VS Code. If it is not active yet, sign out and sign back in or restart Windows first.

Then open the repository in VS Code, open a VS Code terminal, and run:

pcs init

This creates .venv, installs requirements.txt, verifies pcs.config.json, and runs a MkDocs build.

If execution policy is blocked by workstation policy, use the wrapper form:

.\pcs.cmd init

Do not casually upgrade MkDocs packages

The documentation stack is pinned in requirements.txt. Upgrade intentionally and verify with pcs init or a docs build.

TIA Portal And Openness

For native host installations, install TIA Portal V20 and the matching Openness package manually before this page. In the pre-configured VM, both are already installed.

Expected V20 API path:

Test-Path "C:\Program Files\Siemens\Automation\Portal V20\PublicAPI\V20\Siemens.Engineering.dll"

Info

The PCS deployment wrapper infers the Openness version from the TIA project extension, for example .ap20.

Openness User Group

After installing TIA Openness, your Windows user must be a member of the local Openness group. .\pcs.cmd install tools and pcs init check this automatically. Adding the user requires administrator privileges, so the first .\pcs.cmd install tools run should be done from a Windows Terminal opened as Administrator.

Check membership:

whoami
Get-LocalGroupMember "Siemens TIA Openness"

If your user is missing and the bootstrap command could not add it automatically, add it from an elevated PowerShell:

Add-LocalGroupMember -Group "Siemens TIA Openness" -Member "$env:USERDOMAIN\$env:USERNAME"

Log out after group changes

Windows group membership is loaded at login. install tools checks the current session. If it says the current session does not include Siemens TIA Openness, log out and back in or restart Windows.

PlantUML And Graphviz

Graphviz and the PlantUML CLI wrapper can be installed by .\pcs.cmd install tools. Java is still required because the local PlantUML wrapper runs plantuml.jar.

Avoid the Microsoft Store WinPlantUml app

It does not provide the plantuml command used by the repository docs workflow. Use .\pcs.cmd install tools instead.

Verify both commands after setup:

plantuml -version
dot -V

Configure TIA Project Path

Customize the TIA Portal project path in pcs.config.json before the first real deployment:

"projectPath": "%USERPROFILE%\\Documents\\TIA-Projekte\\PCS\\PCS.ap20"

Then verify the resolved value:

pcs config show

The path may be absolute or use environment-variable templates such as %USERPROFILE%.

Configure PCS Author Name

Generated block headers use the author variable configured in pcs.config.json.

Set it once for your Windows user:

[Environment]::SetEnvironmentVariable("PCS_AUTHOR", "Max Mustermann", "User")

Open a new VS Code terminal and check:

$env:PCS_AUTHOR
Fallback variables

If PCS_AUTHOR is not set, the CLI tries fallback variables from pcs.config.json, such as GIT_AUTHOR_NAME, USERNAME, and USER.

First Openness Run

The first deployment may trigger:

  • Windows Firewall prompt
  • TIA Portal Openness process authorization
  • TIA Portal trust prompt for the generated CLI executable

Tip

Open the TIA project manually before the first deployment if prompts need approval, then run a focused no-compile deploy:

pcs deploy plcs=PLC_1 blocks=FB_AlarmRouting no-compile

Final Check

After setup, open a new terminal and verify:

git --version
python --version
pcs config show
pcs list blocks
pcs docs build
plantuml -version
dot -V

Expected result

pcs config show should print the resolved TIA project path, exports root, PLC list, author variable, and author value. pcs list blocks should list source files from tia\exports. pcs docs build should complete without errors.

Next Step

Continue with the First Smoke Test. That page builds the local Openness tooling and performs the first safe deployment preview.