Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>truSTNew to Visual Studio Code? Get it now.
truST

truST

trust-platform

|
591 installs
| (0) | Free
truST — IEC 61131-3 Structured Text language support
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

truST LSP for VS Code

truST LSP brings IEC 61131-3 Structured Text productivity to VS Code:

  • Fast diagnostics and semantic highlighting
  • Go to definition/references, rename, and formatting
  • Live Values with runtime I/O and imported ADS quality
  • HMI preview panel with live schema + value updates
  • Debugging with breakpoints, step, continue, and runtime values
  • ST test workflow with CodeLens + Test Explorer

Quick Start (1 minute)

  1. Install truST LSP from the Marketplace.
  2. Open a folder with .st / .pou files.
  3. Start editing. Language features start automatically.

Command line install:

code --install-extension trust-platform.trust-lsp

Run on the Simulator

  1. Open the truST view.
  2. Keep Simulator (this computer) selected in the Run card.
  3. Press Start.
  4. Wait for Running. The Run card, status bar, and Simulator node in Devices & Connections show the same state.
  5. Open Live Values yourself when you want to inspect I/O. Start does not open or focus it automatically.

Discover ADS Devices

  1. Open Devices & Connections.
  2. Select Discover ADS devices.
  3. truST searches this computer and the local network, then shows each found ADS device and its responding logical services (851–854, 301, and 501).
  4. Use Advanced only when you need a known Host/IP, AMS Net ID, or custom logical ADS service port.

On Windows, an ADS runtime on the same computer uses the installed native ADS router and does not need a static route back to itself. After importing ADS variables, open Live Values and expand Connected variables → ADS to see their current value, IEC type, and quality.


What You Can Do

  • Catch issues early with IEC-aware diagnostics
  • Refactor safely: rename symbols and move namespaces
  • Debug real logic with breakpoints + runtime state
  • Drive and observe process I/O directly in the panel
  • Run ST tests from CodeLens (TEST_PROGRAM / TEST_FUNCTION_BLOCK) and Test Explorer

Example Projects

examples/ are not bundled inside the Marketplace extension package.

Use the GitHub repo examples instead:

  • Guided tutorial index: https://github.com/johannesPettersson80/trust-platform/tree/main/examples/README.md
  • Filling line demo: https://github.com/johannesPettersson80/trust-platform/tree/main/examples/filling_line
  • Plant demo: https://github.com/johannesPettersson80/trust-platform/tree/main/examples/plant_demo

Open it in VS Code:

  1. Clone the repo
  2. File -> Open Folder...
  3. Select trust-platform/examples/filling_line
  4. Open the truST view and press Start on the Run card

Screenshots

Debug + Runtime in one view

Debug + Runtime

Runtime I/O panel

Runtime I/O panel

Rename across files

Rename across files


Commands You’ll Use Most

  • Structured Text: New Project
  • Structured Text: Import PLCopen XML
  • Structured Text: Open Live Values
  • Structured Text: Open Devices & Connections
  • Structured Text: Open HMI Preview
  • Structured Text: Start Debugging
  • Structured Text: Attach Debugger
  • Structured Text: Run All Tests
  • Structured Text: Run Test
  • Structured Text: Move Namespace
  • Structured Text: Create/Select Configuration

PLCopen XML Import (UI Flow)

Use this when you want to create a truST project from an existing PLCopen XML file.

  1. Press Ctrl+Shift+P.
  2. Run Structured Text: Import PLCopen XML.
  3. Pick the input XML file.
  4. Pick the target project folder.
  5. Confirm overwrite when importing into a non-empty folder.

The command runs trust-runtime plcopen import --json in the background and lets you open the imported project and migration report after completion.

HMI Descriptor + LM Workflow

Use the HMI descriptor workflow when building hmi/ pages and process SVG layouts:

  1. Run Structured Text: Initialize HMI Descriptor.
  2. Open Structured Text: Open HMI Preview.
  3. In LM-driven flows, use deterministic tool order:
    • trust_hmi_init -> trust_hmi_get_bindings -> trust_hmi_get_layout
    • trust_hmi_apply_patch (dry_run=true first, then apply)
    • trust_hmi_validate / trust_hmi_run_journey for evidence checks

Detailed guide:

  • docs/guides/HMI_DIRECTORY_WORKFLOW.md

Language Model Tool Contract (Contributor Note)

When adding or renaming a VS Code LM tool, keep the name in sync in exactly three places:

  1. package.json -> activationEvents entries using onLanguageModelTool:<name>
  2. package.json -> contributes.languageModelTools[].name
  3. src/lm-tools.ts -> registerLanguageModelTools(...)

The extension test suite now checks this contract in src/test/suite/lm-tools-contract.test.ts. If one of the three surfaces drifts, tool discovery will silently break for Copilot/LM clients and the test should fail.


Advanced Setup (optional)

Set custom binary paths if needed:

  • trust-lsp.server.path
  • trust-lsp.debug.adapter.path
  • trust-lsp.runtime.cli.path

Full docs: https://github.com/johannesPettersson80/trust-platform/tree/main/docs

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft