TcForms 1.0.3

dotnet add package TcForms --version 1.0.3
                    
NuGet\Install-Package TcForms -Version 1.0.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TcForms" Version="1.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TcForms" Version="1.0.3" />
                    
Directory.Packages.props
<PackageReference Include="TcForms" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TcForms --version 1.0.3
                    
#r "nuget: TcForms, 1.0.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package TcForms@1.0.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TcForms&version=1.0.3
                    
Install as a Cake Addin
#tool nuget:?package=TcForms&version=1.0.3
                    
Install as a Cake Tool

Description

The package 'TcForms' simplifies the development of functional WinForms applications for TwinCAT PLCs. It manages the ADS communication with PLC variables and links UI controls with minimal programming effort.

Requirements

  • .NET 8.0
  • A TwinCAT 3.1.4024.10 Build (XAE, XAR or ADS Setup) or later.

First Steps

Add Tc3_TcForms PLC-Library (from Sample Project) to your TwinCAT PLC project and call the FB_License function block to validate the CLIENT license. No license key is required on a development PC (see Licences and Pricing).

PROGRAM MAIN
VAR
	fbTcFormsLicense	: Tc3_TcForms.FB_License;
END_VAR

----

// TcForms License
fbTcFormsLicense(bExecute:=TRUE);

Create a Windows Forms App project with .NET 8.0. Add a file called config.ini to the project. Navigate to the properties of this file and select 'Build Action': Content and 'Copy to output': Copy if newer. Copy the following content into the config.ini file

[License]
Type=CLIENT
Key=
SymbolName=MAIN.fbTcFormsLicense
[TwinCAT]
AmsNetID=127.0.0.1.1.1
CycleTime=100

Add a TcControl (e.g. TcButton) to your Form and set the name of the variable to be linked under Properties->TwinCAT->PlcVariable. Add the following code to your Form class to link all TcControls of the form to the TwinCAT PLC.

using System.Windows.Forms;
using TcForms;

namespace WinFormsApp1
{
    public partial class Form1 : Form
    {
        private TcControlLink tcControlLink = new();
        public Form1()
        {
            InitializeComponent();
            this.Load += Form1_Load;
            this.FormClosing += Form1_FormClosing;
        }

        private void Form1_Load(object? sender, EventArgs e)
        {
            foreach (Control control in this.Controls)
            {
                if (control is ITcControl)
                {
                    tcControlLink.Add(control);
                }
            }
        }
        private void Form1_FormClosing(object? sender, FormClosingEventArgs e)
        {
            foreach (Control control in this.Controls)
            {
                if (control is ITcControl)
                {
                    tcControlLink.Remove(control);
                }
            }
        }        
    }
}

Build and start the project to check the connection.

Sample Project

GitHub Sample Project 'TwinCAT-GUI'

Licences and Pricing

There are two license types: CLIENT and HOST. TcForms requires either a CLIENT OR a HOST license. The HOST license is applied to the PC running the WinForms application. The CLIENT license is applied to the PC running the TwinCAT PLC. On PCs without a Beckhoff serial number, the CLIENT license can be used without a license key as a trial license.

License Type Description Price
CLIENT Applied on the PC that runs the TwinCAT PLC. Allows connection to multiple host PCs. Can be used without a license key as a trial license on non-Beckhoff PCs. 75€
HOST Applied on the PC that runs the WinForms application. Allows connection to mutliple client PCs. 75€

To request a quote or place an order, contact tcforms@kloetzer-automation.de.

Product Compatible and additional computed target framework versions.
.NET net8.0-windows7.0 is compatible.  net9.0-windows was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.3 145 6/2/2025