I have a Beckhoff PLC that's running a software developed with TwinCat3. Is there a way to retrieve the running software using C# application ? The TwinCAT.Ads library does not seem to offer such functionality.
The plan is to be able to compare what is online with a backup stored locally to detect any unplanned code changes made by Service Technician.
It would be enough for me if I could for example retrieve a hash code from the PLC and generate hash from a local backup and see if they match.
Is there perhaps a better way to detect such changes ?
I am new to Beckhoff PLC / TwinCat3 so all information regarding this matter is much appreciated.
EDIT: I should add that the C# application will automate the process of checking for unplanned code changes and only flag it so that an engineer can approve or reject the changes.
The first thing that comes in my mind is the TwinCAT automation interface. It's basically an API that allows you to access certain parts of what you normally do in Visual Studio/TwinCAT. The TwinCAT automation interface libraries are installed together with your TwinCAT installation, and there are several ways to access these. The documentation and examples for the API is mostly in C#/.NET.
See the documentation here: http://download.beckhoff.com/download/document/automation/twincat3/AutomationInterface_pdf_EN.pdf
More specifically for your case I think this would be interesting: https://infosys.beckhoff.com/english.php?content=../content/1033/tc3_automationinterface/2488994571.html&id=155511204171430517
With this you could do a comparison of the local project (which you would also open through the automation interface).