I'm sure this is a very basic question, but what is the preferred method to execute something all of the time, no matter what form is open? Example, if I have code that looks at the PLC for a condition then logs to SQL/mySQL database. I don't want to have this on all forms, and I really don't like putting code in headers or footers (nav bars), but curious as the best course of action.
Thanks,
James