Tag Validation and Error Handling with Synchronous Device Reads and the TOP Server Beckhoff TwinCAT Driver
My OPC Client is performing synchronous device reads to the TOP Server V5.x Beckhoff TwinCAT Ethernet driver. Communications work normally until I start receiving error messages in TOP Server, indicating a Beckhoff ADS Error 1809 (Symbol Version Invalid). Communications hang and I receive no further updates from TOP Server for the tags receiving this error until TOP Server restarted. What is causing this issue?
The TwinCAT ADS Error 1809 is being caused because of tag handles changing due to one of the following:
- A PLC Restart
- A hot download of PLC logic cause the symbol-table to change
When this occurs, the Beckhoff TwinCAT Ethernet driver releases and renews these handles in order to continue successful communications. However, a driver bug has been identified when an OPC Client is requesting updates for such tags using the Synchronous Device Read method (Asynchronous and Subscription methods were behaving normally).
When an OPC Client is using Synchronous Device Reads and this error is received, the tags are not being invalidated by TOP Server until the read times out, causing the OPC Client application to hang until all tags in a read transaction have timed out.
It is still important to understand that, with the patch or latest version of TOP Server, even though the tags with invalid handles will be properly invalidated and the handles will be renewed now, it is still necessary for the OPC Client to send another request for these tags in order to get updates, as the driver will not automatically retry the failed requests caused by the ADS Error. That is why is recommend to use Subscription methods for reading tags from your OPC Client application wherever possible.
Best solution
We recommend you upgrade to Version 5.2 or higher of TOP Server as the best way to resolve this issue.
Alternate Solution to Patch a 5.1 installation
If you must stick with Version 5.1 and wish to patch your Version 5.1 install, the following instructions will allow you to apply this patch if you are experiencing this issue.
The attached driver patch is for TOP Server V5.1 and resolves this issue. You must have TOP Server V5.1 installed to apply this patch. If you do not have V5.1 installed, please reach out to request the installer.
The patch can be applied as follows:
- Make sure the TOP Server runtime service is stopped.
- Browse to C:\Program Files\Software Toolbox\TOP Server 5\Drivers.
- Replace the existing file "beckhoff_twincat_u.dll" with the replacement patch in the zip file.
- Start the TOP Server runtime service.