System Approach to the Design of Generic Software for Real-Time Control of Flexible Manufacturing Systems (FMS)