Software for Automation: Architecture,Integration,and Security