Beckhoff / ADS

Beckhoff protocol to communicate with TwinCAT devices.
MIT License
493 stars 194 forks source link

Send program to the automate through Ads connection? #171

Closed Capacites closed 1 year ago

Capacites commented 1 year ago

Hi, We have an application wish must ensure program traceability. So we have PLC program made with twincat3 XAE on offline PC. Is-it possible to get the binaries, backup it and distribute it to multiple automate through Ads connection ?? Or we need absolutely use twincat3 XAE to program automate ?

Thanks for the answer .

pbruenn commented 1 year ago

You can use ADS to access files.
This is a wrapper for that functionality:
https://github.com/Beckhoff/ADS/blob/master/AdsLib/AdsFile.cpp

We use it in our adstool example: https://github.com/Beckhoff/ADS/blob/master/AdsTool/main.cpp#L247-L287 https://github.com/Beckhoff/ADS/blob/master/doc/source/adstool.rst

The filepath provided to OpenFile -> SYSTEMSERVICE_FOPEN supports placeholdes like %TC_INSTALLPATH% or %TC_TARGETPATH% I don't have a list of these placeholders,
maybe you find more in InfoSys. These placeholders are replaced by the SystemService
on the target system.

If you have a pure PLC project I think you have to copy from and into: %TC_INSTALLPATH%/Boot/

EDIT: make sure to have TwinCAT in CONFIG mode, when you read or write into these directories!

Capacites commented 1 year ago

Thanks !