richw
When using the PSM module should your hardware initialization code be before or after the psm.start() or does it even matter?
when the program is stopped I need to free up some GPIO pins and close the GPIO chip, should this code be before or after the psm.stop() because after I stop the OpenPLC runtime from the webserver It will not start up again unless I reboot The RPI.
Reply 0 0
thiagoralves
It doesn't really matter. The psm.start() function is only for starting the communication thread between the Python code and the low-level C driver. As for the psm.stop(), you can try to put your code in there before it and see if it gets called. There is a chance that the webserver is just killing the runtime without waiting for it to properly finish, and if that's the case then until this is fixed you don't have a straightforward way to do cleanup.
Reply 0 0
richw
Where can I look for the code that is doing this and see how the process is terminating?
Reply 0 0
Reply