LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Excel Report - incorrect results when writing floats

Solved!
Go to solution
double d = 5.1;
float f = 9.2;

// (open an Excel worksheet)

// This writes the correct value
ExcelRpt_SetCellValue(worksheet, "A1", ExRConst_dataDouble, d);

// This writes junk -- 1.9E+19 or something similar
ExcelRpt_SetCellValue(worksheet, "A2", ExRConst_dataFloat, f);

 

0 Kudos
Message 1 of 4
(3,173 Views)

Hi richferrara

 

What version of LabWindows™/CVI­™ and Microsoft Excel® are you using?

 

Andy F.
Applications Engineering
National Instruments
0 Kudos
Message 2 of 4
(3,151 Views)

I'm running LabWindows 2015.  I've seen the same result using Excel 2010 and 2013.

0 Kudos
Message 3 of 4
(3,140 Views)
Solution
Accepted by topic author richferrara

Hi richferrara

 

I was able to replicate your behavior and will be looking for any existing Corrective Action Reports on our end to see if we already have this documented. I did find that whenever you set the data type enum for your float write to "ExRConst_dataDouble" that it writes the value correctly. I'll continue looking into this issue and post what I find.

 

Andy F.
Applications Engineering
National Instruments
0 Kudos
Message 4 of 4
(3,121 Views)