Prerequisites
To make full use of this guide, ensure you have the following installed and configured:
-
The Beckhoff TwinCAT XAE (eXtended Automation Engineering) or XAR (eXtended Automation Runtime) – Essential for configuring and deploying PLC applications. Both can be downloaded from the Beckhoff download finder webpage.
-
Microsoft .NET SDK 8.0 – Provides the tools and libraries for developing and running .NET applications. To install it via
winget
, run:winget install Microsoft.DotNet.SDK.8
-
An IDE for C# Development – For this book, I used Visual Studio Code with the C# extension and the .NET CLI. If you’re new to this setup, please refer to the Visual Studio Code .NET documentation for additional guidance.
To get started with the .NET CLI in your chosen directory, you can create a new console application with:
dotnet new console -n <ProjectName>
Use the following command to explore additional project templates:
dotnet new list
To build and run your project, use:
dotnet run
A comprehensive guide to the .NET CLI can be found here.
-
Beckhoff TwinCAT ADS NuGet Package – This package allows you to establish an ADS connection to your device.
Install it by running this command in your project’s root directory:
dotnet add package Beckhoff.TwinCAT.Ads
-
Newtonsoft.Json NuGet Package – This package is used for JSON serialisation of dynamic objects, which is particularly helpful for displaying complex symbol values in a structured format.
Install it by running this command in your project’s root directory:
dotnet add package Newtonsoft.Json