I am communicating with a measurement isntrument and it returns the data in a single string. The output is like:
string result = "-3.546714E-10A,+0.000000E+00,+5.120000E+02\n";
So what I am interested to get in this string is first and second part. First part is Current in Ampere, and second is TimeStamp (measurement time).
I am trying this code but it does not work:
temp = result.Split(',');
tipair = new Results.TIPair();
tipair.Current = float.Parse(temp[0]);
tipair.Time = float.Parse(temp[1]);
Ideally I want it to be -3.546714E-10
for current and 0
for time (time be any positive number).
UPDATE: I tried to do like below but I get very bad numbers (much bigger than they should be!)
temp = result.Split(',');
tipair = new Results.TIPair();
tipair.Current = float.Parse(temp[0].Substring(0, temp[0].Length - 1));
tipair.Time = float.Parse(temp[1]);