Intelligent distributed measurement and control system with a flexible architecture