0

math error

MScottM 3 weeks ago in IQANdesign updated 1 week ago 1

Hello,  

I have an MD4-7 that I'm working with.  On one of my screens I display GPS coordinates in decimal degrees and D.M.S.  Sensor is external NMEA2000 device. While working on this screen I noticed that my Minutes display of Longitude did not correlate with the decimal display.

I've verified the GPS position I'm using as a sample against two other GPS receivers so I know what the correct position should be to within a few meters.

The incoming decoded decimal portion of the longitude position is x.56, and when multiplied by 60 should give me Minutes of 33 and change.  The MD4 is displaying Minutes at 26

I've tried a couple different variants of the basic formula:

Result := (Longitude - floor(longitude)) * 60 

Variant uses integer value from int math channel to subtract the integer part of the number.

The Latitude calculation is giving what seem to be correct results at first glance (the number displayed is "more" correct in terms of actual position), however, 0.42 * 60 = 25.2.

Am I doing something wrong with the number types?  Is there some truncation/resolution issue in the background?

CALC - LON = raw decoded float value (NOT SHOWN)

CALC - LON-DEGREE-FLOAT (alternate math channel - troubleshooting)

CALC - LON-DEGREE (INT math channel - troubleshooting)

CALC - LON-MINUTES (longitude decimal minutes)

CALC - LON-SECONDS (longitude decimal seconds)

Image 4809

Image 4810

Just wondering if this is just so blindingly obvious that I'm missing it?