Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

GPS Conversion ETSI LIP

Solved!
Go to solution

I am writing a program where I am receiving an ETSI LIP string and need to convert it to decimal. I currently don't understand how it is converted.

 

I receive the following in HEX, which coverted to binary for ease, but can't figure out the conversion.

 

LONG:0110011100110110010011000  or in hex: 67 36 4C 00    (25 bits)

LAT:110010100001100101011001 or in hex: CA 19 59      (24 bits)

 

The above converts into this somehow (Taken from a logging program);

 

0110011100110110010011000 Longitude = 0x0CE6C98 (145.142012)

110010100001100101011001 Latitude = 0xCA1959 (-37.899131)

 

 

 

Does anyone have any idea how I go about converting the binary/hex to decimal using ETSI LIP?

0 Kudos
Message 1 of 8
(13,068 Views)

Hi JayPinder

Seems that your question is more of a protocol question instead of a Measurement Studio question, is there a specific issue you are having with measurement studio?

Still I hope this links helps you:

http://www.etsi.org/deliver/etsi_ts/100300_100399/1003921801/01.03.01_60/ts_1003921801v010301p.pdf.

http://stackoverflow.com/questions/5122383/how-to-convert-my-binary-hex-data-to-latitude-and-longitu...

http://www.springfrog.com/converter/decimal-degrees/

regards

Chris S.
0 Kudos
Message 2 of 8
(13,050 Views)

I guess it is a protocol question - I seen another user post http://forums.ni.com/t5/LabVIEW/GPS-Position/td-p/1863217 but was old so thought I'd start my own, and seeing as I am using VB, thought I'd give it a shot, as I'm sure I'll have plenty more questions.

 

The first document is the one I've been referencing - In there it states;

Longitude
Longitude information element shall indicate longitude of the location point in steps of 360/2^25 degrees in range
-180 degrees to +(180 - 360/2^25) degrees using two's complement presentation. Negative values shall be west of zero
meridian and positive values shall be east of zero meridian.
Latitude
Latitude information element shall indicate latitude of the location point in units of 180/2^24 degrees in range
-90 degrees to +(90 - 180 / 2^24) degrees using two's complement presentation. Negative values shall be south of equator
and positive values shall be north of equator.

 

Now I know the following is correct;

0110011100110110010011000   Longitude                       = 0x0CE6C98   (145.142012)
110010100001100101011001    Latitude                        = 0xCA1959    (-37.899131) 

I just need to find how they got the decimal lat/long

 

I can use the following for the Long (Although, referencing the above, this is the Lat formula)                   

0x0CE6C98 = 13528216

(180/(2^24))* 13528216=145.142011642

 

Do you know how I can find -37.899131 with Hex:CA1959/Dec:13244761?

0 Kudos
Message 3 of 8
(13,045 Views)

Hi Jay,

 

see p. 65 of the first link given by Chris on the protocol description:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 8
(13,036 Views)

Thanks GirdW - Can you write what the logic diagram is doing? Then I manipulate it and feed it into VB to get the correct answers.

0 Kudos
Message 5 of 8
(13,024 Views)

Hi Jay,

 

it's applying the formula given in the specs of that standard. Just read the page I told you in the post above.

It's just some multplication/divison - the symbols should be quite clear…

 

As you were asking the same question in the LabVIEW discussion forum too I expected you be able the "read" LabVIEW.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 8
(13,017 Views)
Solution
Accepted by topic author JayPinder

Hello Jay,

 

I recreated the code again here with some comments. I also made it a VI Snippet so you can drag and drop the PNG file into LabVIEW. I made the code by looking at the posted code and p. 65 of the PDF that Chris posted. Hope this helps.

 

ETSI LIP conversion.png

Taylor B.
National Instruments
0 Kudos
Message 7 of 8
(13,009 Views)

You beauty - Thank you for all your assistance. My first exposure to LabView and I like it.

 

0 Kudos
Message 8 of 8
(13,000 Views)