cnc and plc block diagram and operation