NOTICE
AutomationDirect.com has provided this code for convenience.
This sample code is provided "as-is" with no expressed or implied warranty.
If the end user includes any of the sample code (in whole or part),
it is the user's responsibility to completely modify, integrate,
and test any code to ensure it meets all system and safety requirements
for the intended application or system.