Intelligent electromagnetic flowmeter