Sign Up

LabVIEW TwinCAT ADS by FisoThemes - Toolkit for LabVIEW Download

Unofficial LabVIEW TwinCAT API for communicating with Beckhoff PLCs via ADS

D Discussion Watch * 1 ↓392
ReleasedOct 29, 2023
Publisher FisoThemes
License MIT
LabVIEW VersionLabVIEW>=18.0
Operating System Windows
Project links Homepage   Repository   Discussion


Easy to use Unofficial LabVIEW TwinCAT API for communicating with Beckhoff PLCs via ADS. Features include Invoking Rpc Methods, Reading/Writing of PLC variables (including all Standard types, Pointers, References, Time, Strings, WStrings, Structs composed of the aforementioned, Nested STRUCTs and Multi-dimensional Arrays of the aforementioned datatypes), introspective capabilities (get the symbol and type information), the ability to build your own low-level VIs via Extensions and more.

Minimum Requirements
+ LabVIEW 2018 (32/64 bit) or above
+ .NET Framework 4.6.2 (installed by default with LabVIEW)
+ TwinCAT 3.1.4024.10 and above (haven't tested below 4024.10 might work with lower versions)

Important Notes
1. You may notice that the `` is slow in connection. This is normal.
The VI is simply caching the symbols and types in LabVIEW rather than keeping them in a .NET collection. The reason for this is that lookup times on the .NET Ads-XYZ-Collection are very slow. The further I moved away from making calls to any of Beckhoff's .NET libraries the faster operations became. The penalty for doing this is a slow connection.

2. Because of the caching system, online changes are currently not supported.

3. You do not need to disconnect before disposal. `` VI will disconnect for you.

Read, Write and Invoke Method

1. Operations involving `UNION`s and `INTERFACE`s types are not yet supported.

2. To read and write to pointers simply add the dereferencing symbol to your symbol name e.g. `pValue^`.

3. First calls to an operation (Reading/Writing a symbol or Invoking a Method) will be slow due to caching. Subsequent calls to read/write/method invoking operations will be faster.

4. When sending numbers, arrays of numbers or structs with numbers, enums, etc. The numbers will be coerced to the type defined in the PLC for that variable/parameter. This is by design. LabVIEW is a graphical language so switching between Single Precision Float and Doubles is an absolute pain.

5. LabVIEW Arrays don't need to be the same size as the PLC arrays to write them. Write what you need, the rest will be filled in with defaults.


1. Online change is not supported. However, you can update variables on the PLC without needing to disconnect on the LabVIEW side via `Login with Download`, `Restart TwinCAT System` and `Activate TwinCAT Configuration`. All symbols will automatically be reloaded into memory.

NOTE: Any reads or writes running during this process will produce errors, just ignore these errors until reconnection is complete. They will stop once that happens.

2. Don't forget to close the Registration Refnum after you're done. User Events references are automatically closed on disposal.

1. When using extensions. Please only close the .NET references with an asterisk (*) on their label at the connector pane. The ones without an asterisk are managed for you.

Please feel free to contact me if you have questions, issues or suggestions.

Release Notes (Oct 29, 2023)

+ Preparation for release.

New Features:
+ Added VI for adding multiple symbol notifications.
+ Added VI for deleting multiple symbol notifications.
+ Added VI for clearing all symbol notifications.
+ Added VI for getting the names and cycle times for all symbol notifications.
+ Added extension VI for getting notification handle.
+ Added extension VI for deleting notification handle.
+ Added extension VI for getting symbol handle.
+ Added extension VI for removing symbol handle.

+ Fixed failure in application build due to Flatten .NET Symbol
+ Fixed nested function blocks not being read properly.
+ Fixed premature closure of cached .NET Symbol Information references by LabVIEW's garbage collector when calling the API's VIs in an Asynchronous VI.
+ Fixed cases where characters after the null character in strings would show.
+ Fixed case where you couldn't use the event registration refnum as a control, indicator or constant.

+ Read.vim automatically changes to read multiple when connecting an array of symbol names.

fisothemes was a contributor to this release

Download Package

All Contributors

  Post an Idea   Post a Resource

Recent Posts