pcdshub / lcls-twincat-general

A PLC code toolkit for LCLS TwinCAT PLC projects
https://pcdshub.github.io/lcls-twincat-general/
Other
16 stars 20 forks source link

PLC Restart and Related Utils #38

Open ZLLentz opened 4 years ago

ZLLentz commented 4 years ago

It may be useful to have some PLC PVs sourced from the general library that can be used to reboot the PLC, restart TwinCAT, etc:

To reboot the whole OS: https://infosys.beckhoff.com/english.php?content=../content/1033/tcplclibutilities/html/tcplclibutilities_nt_reboot.htm To restart just the TwinCAT process: https://infosys.beckhoff.com/english.php?content=../content/1033/tcplclibutilities/html/tcplclibutilities_tc_restart.htm There are also blocks like https://infosys.beckhoff.com/english.php?content=../content/1033/tcplclibutilities/html/tcplclibutilities_plc_reset.htm but these should probably be called from a separate PLC instance if they are to be useful... since once you reset the PLC it can't start itself again, since it isn't running any code.

I started investigating this for some ads-ioc debugging over here: https://github.com/ZLLentz/lcls-twincat-motion/blob/d7353562c81fb4f06a7b252a95992099d83a38b8/lcls-twincat-motion/Example/POUs/Main.TcPOU#L37