Combining two 16 bit data streams into one 32 bit stream?
Re: Combining two 16 bit data streams into one 32 bit stream?
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.
-
- Posts: 59
- Joined: Wed Jan 21, 2009 1:05 pm
Re: Combining two 16 bit data streams into one 32 bit stream?
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.
(((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?
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?
We have no probs at all with it Chris.
-
- Posts: 59
- Joined: Wed Jan 21, 2009 1:05 pm
Re: Combining two 16 bit data streams into one 32 bit stream?
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?
No sympathy whatsoever



-
- Posts: 59
- Joined: Wed Jan 21, 2009 1:05 pm
Re: Combining two 16 bit data streams into one 32 bit stream?
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:

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:


-
- Posts: 59
- Joined: Wed Jan 21, 2009 1:05 pm
Re: Combining two 16 bit data streams into one 32 bit stream?
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.


-
- Posts: 59
- Joined: Wed Jan 21, 2009 1:05 pm
Re: Combining two 16 bit data streams into one 32 bit stream?
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


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
