NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing double property

Solved!
Go to solution

Hello,

 

I am creating a custom log file by reading all numeric values for all tests. The double values as reported by TestStand and viewable in built-in reports look like this:

9.255963134932e+061

 

Here's CVI code that I use to read them:

 

    sprintf(keyName,"Locals.ResultList[%d].Numeric",i);
       tsErrChk(TS_PropertyExists(seqContextCVI, &errorInfo,keyName, 0, &propertyExists));
       if(propertyExists){
           tsErrChk(TS_PropertyGetValNumber(seqContextCVI,&errorInfo,keyName,0,&numproperty));
           sprintf(szBuf,"%.5lf",numproperty);

        }

 

What I get in my report is this:

92559631349317830736831783200707727132248687965119994463780864.00000

 

Any ideas?

Thanks

CT

0 Kudos
Message 1 of 3
(4,389 Views)
Solution
Accepted by topic author Cimteker

Hello Cimteker, 

 

In line, "sprintf(szBuf, "%.5lf".......",you specifiy szBuf should be written with 5 numbers of precision, which is why your report displays 5 zeros. To log the values in scientific notation, you should change the formatting of sprintf to "%e".

 

0 Kudos
Message 2 of 3
(4,349 Views)

Thanks Haley.

 

Actually "%.5g" is even a better choice. If you use "%.5e" than 0 is reported as 0.0000E+00. G makes it all nice.

 

Thanks for help

CT

0 Kudos
Message 3 of 3
(4,342 Views)