Introduction

When I first explored TwinCAT ADS for C#/.NET, I quickly realised that the official Infosys documentation lacked coherence and omitted essential use cases. Key topics, like reading complex structs, invoking RPC methods, and handling dynamic symbol values, were either incomplete or presented in ways that made practical application challenging.

This book aims to bridge those gaps through clear, example-driven explanations on:

  • Connecting to TwinCAT ADS in .NET – Establish a reliable client for interfacing with TwinCAT PLCs.

  • Dynamic Symbol Management – Accessing and manipulating PLC symbols with flexibility and ease, leveraging dynamic types to avoid rigid, predefined structures.

  • Event Handling – Setting up event-driven reads to monitor symbol changes, connection states, and ADS states, enabling responsive and efficient data interaction.

  • RPC Invocation – Interact directly with function blocks and interfaces on the PLC through remote procedure calls (RPCs), simplifying PLC automation.

I hope by the end of this book, you'll be able to access, control, and manipulate your PLC data in a straightforward and accessible way, so you can focus on building robust, adaptable, high-performance applications.