function DischargeTimerCallBack(obj,event,ljudObj,ljhandle,LowLD_sp,HighLD_sp,DischargeCurrent)

global fid;
global Capacity_Low Capacity_High;

[VmonLow, ImonLow, err_Low] = BK_ReadVandI(LowLD_sp);
[VmonHigh, ImonHigh, err_High] = BK_ReadVandI(HighLD_sp);

if((err_Low == 0) && (err_High == 0))   %If there was a timeout or other error, do nothing and wait until next time.
  txt1 = 'Callback event: ';
  event_type = event.Type;
  event_time = datestr(event.Data.time);
  msg = [event_type txt1 event_time  ' VmonLow = ' num2str(VmonLow) 'V  ImonLow = '  num2str(ImonLow) ' A   VmonHigh = ' num2str(VmonHigh) 'V   ImonHigh = '  num2str(ImonHigh) ' A'];
  disp(msg)

  msg = [event_time '   ' num2str(VmonLow) '  '  num2str(ImonLow) '      ' num2str(VmonHigh) '  ' num2str(ImonHigh)];
  fprintf(fid,'%s\n',msg);

  if((ImonLow < DischargeCurrent/4) && (Capacity_Low == 0))
    ElapsedTime = toc;
    Capacity_Low = DischargeCurrent*ElapsedTime/3600;  %Capacity in A-hrs.
  end

  if((ImonHigh < DischargeCurrent/4) && (Capacity_High == 0))
    ElapsedTime = toc;
    Capacity_High = DischargeCurrent*ElapsedTime/3600;  %Capacity in A-hrs.
  end

  if((Capacity_Low > 0) && (Capacity_High > 0))
    disp('Done Discharging.  Stopping Timer.');
    stop(obj);
  end
end

end