This paper describes an infrastructural system designed for applications ill the factory automation, which is named Glue Logic, and a real-time control system with layer structure build oil this system. The Glue Logic provides an environment which supports the programming, controlling and monitoring the production system, and also supports efficient manufacturing programming with high program modularity and re-usability. Furthermore, this system includes event notification message sending and condition monitoring features by means of active database technique. The authors proposed an architecture paradigm for scalable intelligent control systems, and implemented a model train control system on the Glue Logic as a sample, which has layered architecture derived from the subsumption architecture.