Tool/software: Code Composer Studio
Hi,
Im traying to develop a software in C# to create the ggfile... mostly looks well however i have problem get the CCGain...
im getting these values in the Offset 0; 239, 3,34,5
Any idea?
It is my code:
EV23K.WriteSMBusWord(short.Parse("0077", System.Globalization.NumberStyles.HexNumber), short.Parse(104, System.Globalization.NumberStyles.HexNumber), 0X17);
EV23K.ReadSMBusBlock(short.Parse(0078, System.Globalization.NumberStyles.HexNumber), ref nBlock, ref nLen, 0X17);
double Exp = short.Parse(Block[0].ToString());
Exp = Math.Pow(2, (Exp - 128 - 24));
var nBlock = new List<byte>(Block);
nBlock.RemoveAt(0);
Block = nBlock.ToArray();
Block[0] = Convert.ToByte(short.Parse(Block[0].ToString()) + 128);
StringBuilder Hex = new StringBuilder(Block.Length * 2);
foreach (var Byts in Block)
Hex.AppendFormat("{0:X2}", Byts);
double x = (Convert.ToDouble(Int32.Parse(Hex.ToString(), System.Globalization.NumberStyles.HexNumber)));
Result = (9.418869838535785675048828125 / (x * Exp)).ToString();