DASYLab

cancel
Showing results for 
Search instead for 
Did you mean: 

How to record NMEA messages delivered by a GPS via RS232 Input module?

Dear all,

 

I would like to use DASYLAB (v11) to record the signal coming from a GPS.

 

As you probably know, a GPS sends NMEA messages like these hereafter:

 

$PSAT,HPR,170920.60,27.75,-3.31,,N*2C
$PSAT,HPR,170920.80,27.74,-3.57,,N*23
$PSAT,HPR,170921.00,27.75,-3.79,,N*27
$GPGGA,170921.00,5705.00923522,N,00053.46333620,E,2,07,1.2,18.7,M,46.6,M,5.0,0126*7A
$GPZDA,170921.00,26,05,2008,00,00*61
$PSAT,HPR,170921.20,27.75,-3.81,,N*22
$PSAT,HPR,170921.40,27.76,-3.93,,N*24
$PSAT,HPR,170921.60,27.77,-3.18,,N*24

 

The GPS communicates via a RS232 protocol, so I use a RS232 Input module. I well configured the interface (ie baud rate, com port number and so on) and it works well since in the RS232 monitor function, I can see the NMEA messages in continuous mode.

 

My problem is that I don't know how to write these messages to a file.

I would like to make DASYLAB fill a file in continuous mode with the GPS messages it gets...

 

Does somebody know how to do this?

 

I thank you a lot in advance.

 

Nicolas

0 Kudos
Message 1 of 10
(10,180 Views)

Nicolas,

 

Do you want to store the message as you indicated as ASCII string or as the coordinates values?

 

Tom

Tom Rizzo
InSyS Corp.
www.insyscorp.com
Your DASYLab integrator
0 Kudos
Message 2 of 10
(10,179 Views)

Hi Tom,

 

I would like record them if possible as ASCII strings as it is shown.

 

Thanks a lot,

 

Nicolas

0 Kudos
Message 3 of 10
(10,177 Views)

Nicolas,

 

DASYLab is not well suited to handling strings like this. I have several examples for how to PARSE the NMEA strings and extract the numbers into DASYLab.

 

But, to simply log the strings to a file? Nothing that I can think of will handle that fast enough. If that's all that you want to do, you should look at either writing a program, or a simpler serial port device handle. Even HyperTerminal will work better than DASYLab to do this.

Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.
0 Kudos
Message 4 of 10
(10,164 Views)

Cj,

 

thanks for your answer.

 

Yes, I've been using WinComm so far to get the GPS signal (this is a program similar to HyperTerminal).

 

Let me explain the context: This GPS is part of a complete struture behaviour monitoring system set onboard a tanker. While recording the signal from a GPS, I also record signals from strain gages, extensometers, accelerometers... and I need to synchronise signals from sensors with GPS signal.

We record in continuous mode for months; unfortunately, as you know a PC clock is likely to slip in time, what gives me trouble synchronising GPS data with Dasylab data after several weeks since in files coming from WinComm (containing NMEA messages) I don't have the PC time when a NMEA message was created so I can't overlay GPS time with PC time...

 

That's why I'm looking whether and how I could get the GPS signal with Dasylab, hoping it could cancel this synchronisation issue since I guess I would get the NMEA messages referenced to PC clock...

 

Now, I'm not obliged to record GPS signal absolutely as ascii strings; I would be interested in the way to parse NMEA messages you're talking about Cj. Can you give information about it?

 

Thanks a lot in advance.

 

Nicolas

0 Kudos
Message 5 of 10
(10,153 Views)
Hello Nicolas,

sorry for my english. If I understand correct - Do you have a self designed structure[0...n] which include for every index

GPS signal[0]
strain gages[0]
extensometers[0]
accelerometers[0]

GPS signal[1]
strain gages[1]
extensometers[1]
accelerometers[1]

...

GPS signal[n]
strain gages[n]
extensometers[n]
accelerometers[n]

Is this correct? Based on any ASCII-File? And now you looking for a way to use GPS data to come into DASYLab and handle your

strain gages[0...n]
extensometers[0...n]
accelerometers[0...n]

data? GPS is not usable for time informations, correct? But the coordinates are usable for X/Y plot? What you needs is a Moving Map?

Moving Map is a visualization option to display maps in a line chart. GPS values (measured values of imports or GPS receiver) define the location to be displayed. The maps are downloaded from the map provider of your choice (currently supported: Expedia, Google and OpenStreetMap).
Now you can create demonstrative and impressive visualizations of maps combined with measured data e.g. from trial runs.

 
moving map.PNG






 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Is this what you needs?

Best regards,
MHa

0 Kudos
Message 6 of 10
(10,143 Views)

Here is my V9 example for my little GPS10 Bluetooth logger from Garmin, using straight NMEA sentences.

Basically, search for the appropriate sentence, and then count over to get the right values.

Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.
0 Kudos
Message 7 of 10
(10,138 Views)

Hi Everyone,

 

MHa, it seems you misunderstood the matter.

However, it is very nice from you to have spent time thinking and writing something that is all the same very usefull for others of my applications. I know I will use it, since I had already thought about doing something like that.

 

Cj, I had a look to your program and it seems this is very close to what I'm looking for!

Could you please just send an example of NMEA messages sent by the GPS you used? An example like the one I gave in my first message in this post...

It would allow me to understand how your program handles the messages in order to be able to adapt it to my GPS if necessary, as maybe I won't get the same order in messages or even won't get the same messages (I use a professional DGPS that I configure on my own, ie I decide which messages I want it to deliver...).

 

It is very nice from you also to have taken time to think and do something to help me!

 

Thanks to all of you.

 

Nicolas

Message 8 of 10
(10,134 Views)

i can't find my original notes... too many computers over the years, I guess.

 

Here's what I'm doing...

 

Search for $GPRMC --- typical sentence looks like

$GPRMC,123519,A,4807.038,N,01131.000,E,022.4,084.4,230394,003.1,W*6A 

 

then the a will take the numbers after the string up to the comma (\x2c is the Hex for comma) -- that extracts the UTC time from the sentence.

 

"$GPRMC,"  a \x2c

 

Next, skip the next two characters (the Active or Void, A, or V,) and interpret the next number -- the latitude, up to the comma

 

2x a \x2c

 

Now, a trick... take the next character, the North / South indicator, and store it in a global string. This is relatively static, and safe to be a string

$1 \x2c

 

Do it again for the longitude and e/w

 

a\x2c

$2 \x2c

 

the ground speed... do the same thing

a\x2c

 

And the UTC date

a\x2c

 

 

the next channel skips to a different string, counting to find the number of satellites -- the quoted string anchors, then skip two values, and pick up the satellites.

 

$GPGSV,2,1,08,01,40,083,46,02,17,308,41,12,07,344,39,14,22,228,45*75 

 

 

"GSV," 4x a \x2c

 

then the final channel looks for a different string to get the fix.

 

"GSA,A," a \x2c

 

 

I like this site... http://www.gpsinformation.org/dale/nmea.htm#nmea -- 

 

 

 this is a very general purpose technique... it relies on knowing the FIXED component of the sentence, and then counting over.

Sometimes, you have to take all of the elements, since the number of characters is variable, so you have a bunch of  a\x2c channels... just don't use the ones you don't need.

 

 

 

Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.
0 Kudos
Message 9 of 10
(10,127 Views)

Hi Cj,

 

Thanks a lot for your post!

It is perfect, it really allows me to understand how the program works, and thanks to your explanation I'll be able to adapt it to my GPS.

It will be very helpfull to my application: now I'm going to be able to get sensors AND gps signals with same time reference, without synchrotroubles and so on!

 

It is very nice to have spent time to help and answer me with so much details and efforts.

 

Thanks a lot again.

 

Best regards,

Nicolas

0 Kudos
Message 10 of 10
(10,122 Views)