Table of Contents

zkbindings

One of Zeugwerk’s CI/CD tools for TwinCAT. Integrating PLCs with C# or C++ apps usually means string-based ADS and runtime surprises when the PLC changes. zkbindings produces type-safe C# or C++ bindings from your PLC so external apps get compile-time errors instead of runtime failures. Use zkbindings-action in GitHub (30 runs/month for public repos) or contact us for more runs, private repos, or on-premises licensing.


What you get

  • C# - Enums, structs, and wrapper classes that mirror your PLC types and use Beckhoff.TwinCAT.Ads. Change the PLC layout and your C# project gets compile errors instead of runtime failures.
  • C++ - Headers and classes (e.g. with QAds) for Qt or other C++ stacks.

Quick start

  1. Register - Register here. Store username and password in GitHub Secrets (e.g. ACTIONS_ZGWK_USERNAME, ACTIONS_ZGWK_PASSWORD).
  2. Add a workflow - Example .github/workflows/bindings.yml:
name: Bindings
on:
  workflow_dispatch:
jobs:
  Build:
    name: Bindings
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Build
        uses: Zeugwerk/zkbindings-action@1.0.0
        with:
          username: ${{ secrets.ACTIONS_ZGWK_USERNAME }}
          password: ${{ secrets.ACTIONS_ZGWK_PASSWORD }}
          project: 'Untitled1'
          tmc: 'Untitled1/Untitled1.tmc'
          filter: ''
      - name: Upload
        uses: actions/upload-artifact@v3
        with:
          name: Bindings
          path: archive/**/*
  1. Set inputs - Point tmc to an up-to-date .tmc file from your PLC project. Use project for the generated class/file names. Optionally set filter and languages (see below).

Inputs

Input Required Description
username Yes Zeugwerk account username
password Yes Zeugwerk account password
project No Project name used for generated files/classes
tmc Yes Path to the .tmc file (must match your PLC)
filter No Space-separated list of datatypes to generate bindings for; if empty, all are generated
languages No Space-separated list: cs and/or cpp
version No PLC version string written into the generated version file

Store username and password in GitHub Secrets; do not commit them.

Generated output

C#

  • *_Enums.cs - Enumerations from the PLC (directly in filter or used by them).
  • *_Structs.cs - Binary-compatible DUTs/structs.
  • *_Classes.cs - Wrapper classes that mirror PLC types and use Beckhoff.TwinCAT.Ads.
  • *_Version.cs - Version info to compare bindings to the running PLC.
  • *_Unittest.cs - Unit tests for the generated code (Microsoft.VisualStudio.TestTools.UnitTesting).

C++

  • *_Enums.h, *_Structs.h, *_Classes.h - Same idea as C#; classes use QAds.
  • *_Version.h - Version comparison.
  • *_Unittest.cpp - QtTest-based tests.

(Replace * with your project name.)

Example (C#)

From the zkbindings-action example:

_ads = new TcAdsClient();
_ads.Connect(851);

_quickstart = new PLC.Mirror.QuickstartCom("ZGlobal.Com.Unit.Quickstart", _ads);

_quickstart.Subscribe.Equipment.LimitSwitchLeft.Sync = new PLC.Types.ZApplication_DigitalComSubscribe { Enable = 0, Write = 1 };

Access is type-safe; if PLC symbols change, the C# build fails at compile time.

Pricing and licensing

  • Free - 30 runs/month for public repositories (via the GitHub Action).
  • Commercial - More builds, private repos, or Zeugwerk Bindings on your own CI/CD (GitHub or on-premises). contact us.