I am looking into running a “warm reset” + “start” operations on PFC200 PLC trough an API/remote connection.
The main use case is that in our project the controller will read some configuration data at the startup from a separate database. When we are changing the configuration on the DB it would make sense to send “warm reset” command to the PLC to make sure that all previous configurations have been wiped.
One solution would be to just send reboot command to the PLC trough SSL connection. But it is a bit inconvenient to wait for the full bootup process every time the config has been changed.
There are methods in WagoAppControl library for this functionality, but after testing it looks like it is impossible to start the program after a warm reset. Since we are running only 1 application, when the app has been stopped by the reset command it cannot restart itself. There was also note about this in the docs.
Any tips what would be best approach to this?
Have you tried restarting the runtime ?
/etc/init.d/runtime stop && /etc/init.d/runtime start
I guess it should have the same effect as warm reset.
Very obvious and very simple. Can even run this straight from the PLC runtime with FuExecuteCommand.
Thank you very much.
Hi, here you can find an example.
Automatic Restart of the Application after Resetting from IEC Code:
Thank you for the example. I think this is the official way to add this functionality.
Still have to say quenorha’s suggestion is pretty tempting, since it does not require any additional configuration to the project.
What do you think Patrik, is there any downsides in restarting the runtime compared to the official solution here? One thing I noticed is, that after restart Codesys will loose the log in credentials and requires username/password on next log in, but that is very minor thing for our use case.
And thank you very much for all the help!