Combining two 16 bit data streams into one 32 bit stream?

pavlo
Zen Performance
Posts: 410
Joined: Mon Aug 04, 2008 10:18 am

Re: Combining two 16 bit data streams into one 32 bit stream?

Post 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.
Chris Wilson
Posts: 59
Joined: Wed Jan 21, 2009 1:05 pm

Re: Combining two 16 bit data streams into one 32 bit stream?

Post 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.
TimH
JT Innovations
Posts: 719
Joined: Wed Sep 01, 2010 3:51 pm

Re: Combining two 16 bit data streams into one 32 bit stream?

Post 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 :)
Charlie
Syvecs Staff- Tea Boy
Posts: 114
Joined: Thu May 22, 2008 1:28 pm

Re: Combining two 16 bit data streams into one 32 bit stream?

Post by Charlie »

We have no probs at all with it Chris.
Chris Wilson
Posts: 59
Joined: Wed Jan 21, 2009 1:05 pm

Re: Combining two 16 bit data streams into one 32 bit stream?

Post 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...... ;)
TimH
JT Innovations
Posts: 719
Joined: Wed Sep 01, 2010 3:51 pm

Re: Combining two 16 bit data streams into one 32 bit stream?

Post by TimH »

No sympathy whatsoever :P :lol:
Chris Wilson
Posts: 59
Joined: Wed Jan 21, 2009 1:05 pm

Re: Combining two 16 bit data streams into one 32 bit stream?

Post 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:

Image

Image
Chris Wilson
Posts: 59
Joined: Wed Jan 21, 2009 1:05 pm

Re: Combining two 16 bit data streams into one 32 bit stream?

Post 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.

Image
Chris Wilson
Posts: 59
Joined: Wed Jan 21, 2009 1:05 pm

Re: Combining two 16 bit data streams into one 32 bit stream?

Post 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'))))

Image


Motec map in red, GEMS in white, exported using their internal mechanisms to Google Earth

Image
Post Reply