An electrocardiogram is used to detect the proper function of the heart. When an exam indicates cardiac changes an ECG may be recommended to determine whether or not your pet has heart disease.