From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
05-27-2008 12:43 PM
Hello Altenbach:
If the exponent is 14, then yes, the we have (2^14)*FractionY = 16384 * FractionY = FloatY.
No, I don't need to read as fixed point, any way to read is fine as long as I can get the answer. So the next question is how to get FractionY so I can determine FloatY. I thought to do that we would need to read in the fixed point format so that FractionY could be extracted somehow.
The other possibillity was to read in the file data as I32 as you did and find the ratio between the 0th value (367487552) and the known 0th value (63010.019) and then use this as the scaling factor for the data values. The problem with this is 1) it does not work to give the precisely same numbers as I show in the .xls file and 2) it is no guarantee to work for the next set of data down the road.
Sincerely,
Don
05-27-2008 12:48 PM
05-27-2008 12:56 PM - edited 05-27-2008 12:59 PM
Don,
My formula shows 2 being raised to the ( -2 ) power. In fact all the exponents in my examples are negative. That is because of where the binary point is. Binary point is to the left of this digit, Therefore exponent is negative. This scheme is similar to what is used in DSP IC's. I suspect that in this case it was personallized a bit.
All these negative exponents are only used to calculate float version of the FRACTION.
Is the EXPONENT used for scaling in the header?
05-27-2008 01:17 PM
I'm still not getting it - can you lay it out further with his examples using step-by-step and binary notation, and show me what you did. Yes, the exponent is at byte offset 3 and labeled as char (although I read it in as U8) and gives 14.
The only header values I am concerned with (and am reading in fine) are:
Byte Position Format Name
3 char fexp
4 DWORD fnpts
8 double ffirst
16 double flast
Then the data starts at byte offset 544 as Altenbach stated. There are fnpts number of data points.
05-27-2008 01:45 PM
There is abviously something we are missing because it is the correct way to read it as little endian I32, and multiply by 2^(exponent-32) to get the scaled value. Everything else makes no sense. I don't know why the excel file would be different. Are you sure they are both based on the same raw data?
DonRoth wrote:
The other possibillity was to read in the file data as I32 as you did and find the ratio between the 0th value (367487552) and the known 0th value (63010.019) and then use this as the scaling factor for the data values. The problem with this is 1) it does not work to give the precisely same numbers as I show in the .xls file and 2) it is no guarantee to work for the next set of data down the road.
05-27-2008 02:08 PM - edited 05-27-2008 02:09 PM
DonRoth wrote:
The other possibillity was to read in the file data as I32 as you did and find the ratio between the 0th value (367487552) and the known 0th value (63010.019) and then use this as the scaling factor for the data values.
05-27-2008 02:26 PM
05-27-2008 02:36 PM - edited 05-27-2008 02:37 PM
05-27-2008 03:14 PM - edited 05-27-2008 03:15 PM
05-27-2008 03:55 PM