Text this: Architectures and design patterns for functional design of logic control and diagnostics in industrial automation