 #include <Average.h>
 
 //Global definitions
-#define VERSION F("0.39")
+#define VERSION F("0.39b")
 #define DATALENGTH 440
 #define CELLCOUNT 93
 #define SPACER F("-----------------------------------------")

//--------------------------------------------------------------------------------
// ED BMSdiag, v0.39
// Retrieve battery diagnostic data from your smart electric drive EV.
//
// (c) 2016 by MyLab-odyssey

    BMS.Ccap_As.max = CellCapacity.maximum(&BMS.CAP_max_at);
    BMS.Ccap_As.mean = CellCapacity.mean();

    BMS.HVoff_time = (unsigned long) data[5] * 65535 + (unsigned int) data[6] * 256 + data[7];
    BMS.HV_lowcurrent = (unsigned long) data[9] * 65535 + (unsigned int) data[10] * 256 + data[11];
    BMS.OCVtimer = (unsigned int) data[12] * 256 + data[13];
    ReadDiagWord(&BMS.Cap_As.min,data,21,1);
    ReadDiagWord(&BMS.Cap_As.mean,data,23,1);
