Page 2 of 2
Re: Combining two 16 bit data streams into one 32 bit stream?
Posted: Mon Aug 29, 2011 5:03 pm
by pavlo
You got some screenshots then? I think I've looked at the manual for general GEMS canbus setting up, it's quite comprehensive in itself.
Re: Combining two 16 bit data streams into one 32 bit stream?
Posted: Wed Aug 31, 2011 5:18 pm
by Chris Wilson
This is where I am now. The latitude functions work perfectly, but longitude is flawed and doesn't give the correct negative value. I don't know why tyhough. I am using this function t cnvert both HW and LW number sets to degrees.
(((combine16(if('GPS LAT HW'>32767,('GPS LAT HW'-65536),'GPS LAT HW'),'GPS LAT LW')/10000000)-(floor(combine16(if('GPS LAT HW'>32767,('GPS LAT HW'-65536),'GPS LAT HW'),'GPS LAT LW')/10000000)))/0.6)+(floor(combine16(if('GPS LAT HW'>32767,('GPS LAT HW'-65536),'GPS LAT HW'),'GPS LAT LW')/10000000))
Obviously I am replacing LAT with LON in the Longititude function
If the forum owners don't mind me using it none direct Syvecs chat I will continue and post links to screenshots, but I'd like to ask permission first as a courtesy.
Re: Combining two 16 bit data streams into one 32 bit stream?
Posted: Wed Aug 31, 2011 9:32 pm
by TimH
Chris - the traffic here is so light I can't imagine anyone complaining about you continuing this thread - I'm enjoying it anyway

Re: Combining two 16 bit data streams into one 32 bit stream?
Posted: Wed Aug 31, 2011 10:11 pm
by Charlie
We have no probs at all with it Chris.
Re: Combining two 16 bit data streams into one 32 bit stream?
Posted: Wed Aug 31, 2011 11:33 pm
by Chris Wilson
OK, that's very kind of you. Just got back from the pub, it's most definitely a job for tomorrow, a friend is celebrating a forthcoming marriage and I was dragged, (kicking and screaming, of course), into a heavy drinking session

Hope you understand and feel sorry for my inebriation......

Re: Combining two 16 bit data streams into one 32 bit stream?
Posted: Wed Aug 31, 2011 11:35 pm
by TimH
No sympathy whatsoever

Re: Combining two 16 bit data streams into one 32 bit stream?
Posted: Thu Sep 01, 2011 10:58 am
by Chris Wilson
Heres an example of the LON error when using the below function to join the High and Low words to get lomgitude in degrees..
In GEMS
LON HW -60
LON LW 3844
GPS LON 0.0119473
In Motec
LON HW -60
LON LW 3612
GPS LON -0.6547579
OK, the figures for LON LW are slightly different, but it's all but impossible with the scaling on the graphs to get the two to tie up precisely, IYSWIM?
Thanks. Latitude seems to work fine.
Function being used in GEMS for both LAT and LON is:
(((combine16(if('GPS LAT HW'>32767,('GPS LAT HW'-65536),'GPS LAT HW'),'GPS LAT LW')/10000000)-(floor(combine16(if('GPS LAT HW'>32767,('GPS LAT HW'-65536),'GPS LAT HW'),'GPS LAT LW')/10000000)))/0.6)+(floor(combine16(if('GPS LAT HW'>32767,('GPS LAT HW'-65536),'GPS LAT HW'),'GPS LAT LW')/10000000))
Here's a link to screenshots of the available maths functions in GDA:

Re: Combining two 16 bit data streams into one 32 bit stream?
Posted: Thu Sep 01, 2011 11:08 am
by Chris Wilson
These are two apps open side by side, although the coordinates are not exactly the same the LON error is obvious. The Motec data exports to Google Earth with excellent accuracy, the GEMS data is miles away.

Re: Combining two 16 bit data streams into one 32 bit stream?
Posted: Thu Sep 01, 2011 4:01 pm
by Chris Wilson
Right, with some ( well, a lot of, actually...) outside help these functions give correct negative values, but the programme creates maps that look like modern art. My head is starting to reel to be honest
GPS LAT COMBINE = ((if('GPS LAT HW'>32767,('GPS LAT HW'-65536),'GPS LAT HW')*65536)+'GPS LAT LW')/10000000
GPS LON COMBINE = ((if('GPS LON HW'>32767,('GPS LON HW'-65536),'GPS LON HW')*65536)+'GPS LON LW')/10000000
GPS LAT = if(('GPS LAT COMBINE'>0.0),((('GPS LAT COMBINE'-floor('GPS LAT COMBINE'))/0.6)+(floor('GPS LAT COMBINE'))),((('GPS LAT COMBINE'-ceil('GPS LAT COMBINE'))/0.6)+(ceil('GPS LAT COMBINE'))))
GPS LON = if(('GPS LON COMBINE'>0.0),((('GPS LON COMBINE'-floor('GPS LON COMBINE'))/0.6)+(floor('GPS LON COMBINE'))),((('GPS LON COMBINE'-ceil('GPS LON COMBINE'))/0.6)+(ceil('GPS LON COMBINE'))))
Motec map in red, GEMS in white, exported using their internal mechanisms to Google Earth
