LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Nmea format- In Port

Hola a todos, tengo el siguiente problema:

 

Tengo un GPS que es parte del stack de una PC-104 y no dispone de un puerto de comunicaciones COM, pero si dipsone de una direccion de Registro, entonces usando la funcion In Port del Labview he podido capturar la trama en HEX, pero lo que necesito es presentar esta informacion en el formato NMEA como este:

 

$GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47  y  sus demas sentencias

 

He adjuntado una simalacion que recrea como el registro va entregando los datos, en esta simulacion el dato del registro leido que esta en HEX a sido convertido a String. Alguien me podria decir como puedo hacer para obtener una presentacion en formato NMEA?

 

  

 

 

 

0 Kudos
Message 1 of 5
(3,496 Views)
Mil disculpas, ocurrio un error con el archivo adjunto, aqui esta nuevamente el archivo.
0 Kudos
Message 2 of 5
(3,493 Views)

Hi,

 

I have the following problem: I have a GPS that is part of a stack of PC-104 and it does not have a port COM communications , but it have an Data Register, then using the function In Port of LabVIEW I have been able to read the data in HEX, but  I need to present this Data in NMEA format like this:

 

 $ GPGGA, 123519,4807.038, N, 01131.000, E, 1,08,0.9,545.4, M, 46.9, M,, * 47 and its other formats

 

 I have attached a simalacion that recreates the how the Dara Register deliver the data,  in this simulation the data  read in HEX has been converted to a String. Someone I could say as I do for a presentation in NMEA format?

0 Kudos
Message 3 of 5
(3,457 Views)
For the most of the data, this is very easy!

The data seems to be hex codes of the ascii characters. So, grab 2 character
(like you do in the simulation), and convert it to a byte, with Scan from
String (use %2x as format, wire an u8 to it's default value). Convert this
u8 to string, with a type cast, or build an array of u8's and convert this
array all in once with byte array to string function.

For a lot of the data, this gives expected NMEA 183C strings (there are
other nmea standards). I think the rest of your data is corrupted somehow,
since it begins to fail somewhere in the middle of a message.

You should pay a little attention to the following. When you put the scanned
string into scan from string, make sure there are two characters! The
function will probably give an error... If you have only one character, keep
attaching data to it untill you have at least two bytes.

Regards,

Wiebe.


0 Kudos
Message 4 of 5
(3,442 Views)

Hi WSalas,

 

Using the same idea of Wiebe, I did little changes in your code and I found some NMEA information and some corrupted data as Wiebe found.

 

I replaced "$" and "Ú" by Line feed and Carriage Return, to highlight the NMEA Information. See attached the VI, I hope it may help you.

 

Regards,

Message Edited by Osvaldo Santos on 12-17-2008 05:56 PM
Osvaldo Santos
0 Kudos
Message 5 of 5
(3,429 Views)