Jump to content

Wanted: Ideas and guidance! Plus an offer of dinner!


Recommended Posts

Hi all!

Disclaimer: This is a hobby! I'm not an expert, nor do I pretend to be. Bearing that in mind, please use a judicious amount of rigor with explanations. All of what I've taught myself came from example code, tutorials or from forums.

I've written code to gather data from the serial port and log it before. It was always a quick and dirty method based on reading a specified number of bytes from the serial buffer, parsing the resulting strings and logging the data.

This time, I'd like to do it right. Somehow the code needs to select the correct parsing routine by header and verify the string using the checksum.

My code will work like this:

Write the setup string to the gps board to keep the overhead in the buffer down.

Then read the buffer, select the proper routine, check, parse and log the data.

I do understand that to calculate the checksum, I've got to go (input) string to byte array and loop with an XOR to get the number. Not sure how to implement that solution, though.

Microwave Dave posted some code, unfortunately it's in LV 8.6 (I'm using LV 8.0), which I don't have.

Pointers, guidance and ideas are much appreciated.

BTW: This endgame for this code is logging visible satellites by time along with their c/no, az, el and satellite health. I'm thinking 32 individual .txt files would probably be the way to go. Each file can be imported into excel and sorted that way.

Any ideas here? I'd like to log the data by day (0000-2400utc).

Offer of dinner: If you are local to Binghamton, NY (within 100 miles) I'll spring for dinner in exchange for being able to pick your brain about LV and writing code..

Thanks for your time!

Norm M.

And Hey to the OTHER Norm! If you'd like to be Norm and can fix it with the admin, let me know..

Link to comment

QUOTE (Norm @ May 15 2009, 04:16 PM)

Offer of dinner: If you are local to Binghamton, NY (within 100 miles) I'll spring for dinner in exchange for being able to pick your brain about LV...

That's totally what LAVA needs more of - members offering to buy other members dinner! I would be more than happy to lend my mind to members for a free dinner and some stimulating conversation (not that there's anything wrong with that). Pity I'm outside the 100mile radius :(

Link to comment

QUOTE (Norm @ May 15 2009, 10:16 PM)

Hi all!

This time, I'd like to do it right. Somehow the code needs to select the correct parsing routine by header and verify the string using the checksum.

Does the data always start with the header?

Is the header always the same size?

If both answers are true your code is quite easy: Read the header and use that as the selector for a case structure, for every possible header you have a different case that reads the correct amount of bytes.

QUOTE

I do understand that to calculate the checksum, I've got to go (input) string to byte array and loop with an XOR to get the number. Not sure how to implement that solution, though.

Microwave Dave posted some code, unfortunately it's in
LV
8.6 (I'm using
LV
8.0), which I don't have.

I think there are several checksum VIs available, where is Microwave Dave's post?

QUOTE

BTW: This endgame for this code is logging visible satellites by time along with their c/no, az, el and satellite health. I'm thinking 32 individual .txt files would probably be the way to go. Each file can be imported into excel and sorted that way.

Any ideas here? I'd like to log the data by day (0000-2400utc).

I advise you to use TDMS or TDM data, this can be opened by excel with a plugin but makes sure that the data is correct, you will lose no significance data.

QUOTE

Offer of dinner: If you are local to Binghamton, NY (within 100 miles) I'll spring for dinner in exchange for being able to pick your brain about
LV
and writing code..

Maybe a donation to LAVA is a good idea to keep things running!

Ton (or if you come to the Netherlands we could have dinner)

Link to comment

QUOTE (Ton @ May 16 2009, 01:16 AM)

Ton, Thanks for the response.

>>Does the data always start with the header?

Yes it does.

>>Is the header always the same size?

It is. This approach will work.

>>If both answers are true your code is quite easy: Read the header and use that as the selector for a case structure, for every possible header you have a different case that reads the correct amount of bytes.

The only rub here is that the messages are different sizes. Will need to read to the termination character.

>>I think there are several checksum VIs available, where is Microwave Dave's post?

http://decibel.ni.com/content/groups/rf-de...g-nmea-183-data

Dave's post is a utility that does most of what I want to do. Would like to take a peek at it and see how he approached the problem. Unfortunately, it's written with LV 8.6 :-( . I've only got LV 8.0.

Would you be so kind as to point me at the checksum vi's? I'd like to write my own but a look at someone else's approach is always good.

>>I advise you to use TDMS or TDM data, this can be opened by excel with a plugin but makes sure that the data is correct, you will lose no significance data.

Need to do some research here. One of my rules is to use the most general tools possible. Your solution sounds like it fits.

>>Maybe a donation to LAVA is a good idea to keep things running!

Did this. These forums has been a gold mine of information.

Ton (or if you come to the Netherlands we could have dinner)

I'd love to! Too bad it's so far. Love to geek out with other geeks.

Link to comment

QUOTE (Ton @ May 15 2009, 10:16 PM)

I advise you to use TDMS or TDM data, this can be opened by excel with a plugin but makes sure that the data is correct, you will lose no significance data.

I would also recommend TMDS files. They will be much faster and more compact than text files, and the excel plugin seems to work pretty well if you want to use excel. You can individually configure multiple channels to handle the various satellites and only have to manage a single file.

Link to comment

Toby and Ton:

Thanks for your guidance.

Ton, the NMEA routine is pretty much what I'm looking for. Do want to play with it a bit so that I understand what's going on. Where did you find it?

Toby: You are suggesting that I create separate channels (string outputs) for each satellite? Planned on doing that, but how do you get only one spreadsheet? Need to find out more about the TDMS data. Sounds like I'll have a nice evening with a cup of coffee, google and the LV help file!

Will have time to play on Thursday.

Norm

Link to comment

<offtopic>

QUOTE (crelf @ May 15 2009, 07:58 PM)

That's totally what LAVA needs more of - members offering to buy other members dinner! I would be more than happy to lend my mind to members for a free dinner and some stimulating conversation

Ring me up next time you're in the Seattle area. I know VI Engineering did some manufacturing test equipment for a project I was working on 1-2 years ago and had 2-3 developers here for several months.

</offtopic>

Link to comment

QUOTE (Daklu @ May 19 2009, 03:06 PM)

Ring me up next time you're in the Seattle area. I know VI Engineering did some manufacturing test equipment for a project I was working on 1-2 years ago and had 2-3 developers here for several months.

I shall do - I'm pretty sure I know the project you're talking about (I designed one of the test systems :) )

Link to comment

Once the data is in excel, you can easily create charts or crunch numbers if you need to. We were using plain text files and after switching to tdms, we have never looked back. There is a bit of a learning curve, but making the switch has greatly simplified our lives.

post-8758-1242757796.png?width=400

post-8758-1242757806.png?width=400

Toby,

I can see why it's much easier. Need to play with the LV help file so that I can learn more about setup of TDMS. It sounds like this will make the data collection end of my life MUCH easier. It's most of what I do, really.

I've been using .txt files formatted csv. Parse the input strings, rearrange, time stamp and write! A little work to post process in Excel if it's needed, of course..

Drop me a note if you're ever in Binghamton, NY!!

Thanks,

Norm

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.