11-07-2014 02:10 PM
Hi All,
I am reading a string from a Oscope through TestStand 2010 that has 600 data points where the string looks like this:
"-1.040000E+00, -1.040000E+00, -1.040000E+00,.... -1.040000E+00, -1.040000E+00, -1.040000E+00, -1.040000E+00, -1.040000E+00, -1.040000E+00, -1.040000E+00, -1.040000E+00, -1.040000E+00, -1.040000E+00, -1.040000E+00, -1.040000E+00"
I used the scan function but it returns:
array[0] = 1.398048557154e-076
array[1] = 2.400441566266e-310
array[2] = 0
until (all zeros)
array[599] = 0
My format string is "%s>%600f[x]"
What am I doing wrong?
11-08-2014 07:01 AM
As 2.400441566266e-310, when held in memory as a double is "-E+00, " in ASCII, I suggest you check your pointers.
If you convert a single value, does it behave as expected?
Do you mean double, rather than "real float"?
11-10-2014 01:55 AM - edited 11-10-2014 02:00 AM
As far as I can understand, those strange values in the output array are simply the result of uninitialized variables: you could try initializing the array with Set1D (array, 600, 0.0); before scanning the string.
On the other hand, the scanning command appears to be correct. You can address this situation by verifying the return code from Scan () function: if it returns -1 then you can call GetFmtIOErrorString to get a meaningful string describing the error; if it returns -1 you can use GetFmtErrNdx to find the position in the format string where an error has been found.
11-10-2014 07:58 AM
Thanks for your solutions! I will try them out.