How to detect the flow direction of the medium in an electromagnetic flowmeter?