function [err] = BK_StartBatteryTest(sp,I,Vmin)

PACKET_LENGTH = 26;
I = uint32(I*10000);  %Convert to 0.1 milliamps units

LoadCmdPacket = zeros(1,PACKET_LENGTH);
LoadCmdPacket(1:3)  = [ hex2dec('aa') 00 hex2dec('2a')];
LoadCmdPacket(4) = uint8(bitand(I,255,'uint32'));
LoadCmdPacket(5) = uint8(bitand(bitshift(I,-8),255,'uint32'));
LoadCmdPacket(6) = uint8(bitand(bitshift(I,-16),255,'uint32'));
LoadCmdPacket(7) = uint8(bitand(bitshift(I,-24),255,'uint32'));

LoadCmdPacket(end) = rem(sum(LoadCmdPacket(1:end-1)),256);  %Compute checksum
fwrite(sp,LoadCmdPacket);
 A = fread(sp,PACKET_LENGTH);
 if(A(4) == hex2dec('80'))
     err = 0;
 else
     err = 1;
 end
 
 
 Vmin = uint32(Vmin*1000);  %Convert to millivot units

LoadCmdPacket = zeros(1,PACKET_LENGTH);
LoadCmdPacket(1:3)  = [ hex2dec('aa') 00 hex2dec('4e')];
LoadCmdPacket(4) = uint8(bitand(Vmin,255,'uint32'));
LoadCmdPacket(5) = uint8(bitand(bitshift(Vmin,-8),255,'uint32'));
LoadCmdPacket(6) = uint8(bitand(bitshift(Vmin,-16),255,'uint32'));
LoadCmdPacket(7) = uint8(bitand(bitshift(Vmin,-24),255,'uint32'));

LoadCmdPacket(end) = rem(sum(LoadCmdPacket(1:end-1)),256);  %Compute checksum
fwrite(sp,LoadCmdPacket);
 A = fread(sp,PACKET_LENGTH);
 if(A(4) == hex2dec('80'))
     err = 0;
 else
     err = 1;
 end
 
 
 

LoadCmdPacket = zeros(1,PACKET_LENGTH);
LoadCmdPacket(1:4)  = [ hex2dec('aa') 00 hex2dec('5d') 04];

LoadCmdPacket(end) = rem(sum(LoadCmdPacket(1:end-1)),256);  %Compute checksum
fwrite(sp,LoadCmdPacket);
 A = fread(sp,PACKET_LENGTH);
 if(A(4) == hex2dec('80'))
     err = 0;
 else
     err = 1;
 end
 
 
 
 
 
end
