Sharing the Hardware#
While a PLC program runs, the OpenPLC Runtime scans the backplane continuously and controls the T/F toggle switch and the RGB LED. The synergy_logic and Synergy libraries access the same hardware. Running both simultaneously produces bus faults on the runtime and invalid readings in the user application.
Stop the PLC or stop the runtime before running any Python or C++ program that accesses the backplane, the toggle switch or the RGB LED.
Stop the PLC or stop the runtime#
Both release the backplane, the toggle switch and the RGB LED. They differ in what remains running:
Stop the PLC |
Stop the runtime |
|
|---|---|---|
How |
Press Stop in OpenPLC Editor |
|
PLC program |
Stopped |
Stopped |
OpenPLC Runtime |
Running |
Not running |
Editor connection |
Available; Run resumes the program |
Unavailable until the runtime is started again |
Both last until the next reboot.
The bootloader supervises the runtime, so stop it first. To start the runtime again without rebooting:
sudo docker start openplc-bootloader
Permanent disable#
To run a Python or C++ program on the backplane at boot, prevent the OpenPLC Runtime from starting automatically. The openplc-bootloader container starts and supervises openplc-runtime, so only the bootloader’s restart policy changes:
sudo docker update --restart=no openplc-bootloader
sudo docker stop openplc-bootloader openplc-runtime
Restore the factory setting with:
sudo docker update --restart=unless-stopped openplc-bootloader
sudo docker start openplc-bootloader
See Running on Boot for configuring the user program to start automatically.