Troubleshooting of electromagnetic flowmeter