I am an experienced UNIX programmer who is successfully using background CPLCs in my DeltaTau application. However, there are some functions I would like to implement that would greatly benefit from an initialization routine (only called once at application startup), and a shutdown routine (only called once when the application is shut down). Specifically, I am using geomacro hardware and would like to open a communication port at initialization and close it as part of shutdown. I have a future requirement to send some position data to a remote system using UDP Ethernet, which will also require initialization and shutdown logic.
I can imagine using multiple PLCs or a stand alone UNIX application to implement this, but am wondering if there is a more elegant way. Thanks!