Page 1 of 1

Netpipes SDK

PostPosted: Sun Feb 23, 2003 10:36 am
by NewbieJack
I am a new C++ programmer and am trying to extract the Lat, Lon, Altitude and Airspeed parameters from the Flight Sim 2002 aircraft and feed it to another application.
I found the Netpipes SDK, which I am sure is sufficient for a good programmer to do the task, but I am having trouble with it.
If this is not the right Forum, please advise where I should go. Be kind javascript:grin()
Grin

I have modified the "Sample" netpipes code so it does not send the data from Flight Sim to another computer on a LAN, but merely writes it to the Netpipes buffer[2048].
I am trying to read the buffer and printf the key data I want in the dos window,
I can find the FRIB records that have the data I want, and am able to printf the ASCII character data. The problem is printing the numerical data. No matter what format I use I can't get the numbers to print correctly. For example, the Latiitude at Melbourne Florida is about 28 degrees, but my printf produces 36 3E 45 FFFFFFC0 33 FFFFFFEE 19 3C 40.    Using the IEEE standard for floating point arithmetic, I can see that the 3C 40 part of my output is around 28, but again I can not get the formats to print it out in decimal. Any guidance concerning the correct way to print this data would be greatly appreciated.

Re: Netpipes SDK

PostPosted: Sun Feb 23, 2003 11:44 am
by FSTipster
Hi Jack and welcome to the forum,

This is a bit above my head (to say the least) but that output looks like Hex format to me. I'd say you might be needing a hex conversion routine at the data capture point to obtain the decimal output.

I could be completely wrong of course - this is a long way from any area I have any expertise in.

Re: Netpipes SDK

PostPosted: Sun Feb 23, 2003 12:05 pm
by NewbieJack
Thank you for the reply.
The array defined within Netpipes is a char type. And I have tried many types of conversions to try to get the numeric data out in floating point format. For example:
printf("Lon:        %lf\n",(double)buffer[j+30]);  but it gives erroneous results.
I will keep trying. Thanks for your guidance.
Jack

Re: Netpipes SDK

PostPosted: Sun Feb 23, 2003 12:08 pm
by JohnP
:)Not knowing exactly what you are trying to do, it is a little difficult to give you any specific answers. I do some designing and the program I use, you can move the plane around to find the latitude and longitude of a building, when you want to place it. You might also check the Microsoft Fs2002 SDK site, to see if they have any info. that may help you. The URL is:
  http://zone.msn.com/flightsim/FS02DevDeskSDK00.asp

Hope this helps. :)

Re: Netpipes SDK

PostPosted: Sun Feb 23, 2003 12:14 pm
by FSTipster
Apologies Jack - I misread your original post.

That hex is the output not the original content isn't it.

Are you sure Floating point is what you want for Lat/Long?

Bearing in mind that the result is Xyy

Re: Netpipes SDK

PostPosted: Sun Feb 23, 2003 12:18 pm
by JohnP
:)You could also post your question on the panel and scenery design forum, since gauge programmers need to get down to the programming level to get the numbers youn are looking for. :)

Re: Netpipes SDK

PostPosted: Sun Feb 23, 2003 12:21 pm
by NewbieJack
JohnP
You are right. That URL is the where I got the Netpipes SDK. It was very helpful in explaining the formats of the data.
My problem is in deciphering the FRIB records.
Did you design the program you use to get the Latitude and Longitude of the aircraft?

Re: Netpipes SDK

PostPosted: Sun Feb 23, 2003 12:27 pm
by JohnP
:)No, the program I use is abacus's FSDS2.0, a commericial program.I myself am trying to learn c++. I am way at the bottom of the learning curve.

Re: Netpipes SDK

PostPosted: Sun Feb 23, 2003 12:30 pm
by NewbieJack
FS2002tipster:

I wrongly assumed the Lat/Lon would be Floating point. I will try your suggestion with the alphanumeric array.

Thank You,
Jack

Re: Netpipes SDK

PostPosted: Sun Feb 23, 2003 12:40 pm
by NewbieJack
JohnP:
Thanks for the suggestion to post my question on the panel and scenery design forum. I was concerned that I was bothering people here that were not interested in this kind of detail. But you and FS2002tipster have given me several good sugestions. I will try them before I bother the folks on the panel and scenery design forum.
Jack

Re: Netpipes SDK

PostPosted: Fri Feb 28, 2003 2:01 pm
by NewbieJack
Well, in the last 5 days I have tried many combinations to convert the Hex information:

36 3E 45 FFFFFFC0 33 FFFFFFEE 19 3C 40

into decimal 28.1, but I have not found the right combination.

Any additional suggestions would be appreciated.

Re: Netpipes SDK

PostPosted: Fri Feb 28, 2003 3:30 pm
by FSTipster
Well, in the last 5 days I have tried many combinations to convert the Hex information:

36 3E 45 FFFFFFC0 33 FFFFFFEE 19 3C 40

into decimal 28.1, but I have not found the right combination.

Any additional suggestions would be appreciated.


Hi again Jack,

I recently got to grips (well - a little bit) with the Panels & Gauges SDK.

I know you're programming this in C:++, but you might try this:

Assign the output for the various values to your own variables, as numeric. I'd hope the Netpipes SDK allows you to do this (the panels and Gauges SDK does).

Re: Netpipes SDK

PostPosted: Fri Feb 28, 2003 9:06 pm
by NewbieJack
FS2002tipster,

I will definitely explore both of your suggestions (C++ numeric and XML).

In the Netpipes SDK description of the Property Dictionary Section Data, I note that the Property field is described as used in the XML gauges.  And I have been able to find the ASCII characters,within the PDIB data, for the XML variables PLANE LATITUDE, PLANE LONGITUDE, etc., within the Netpipes Buffer []. The PDIB record seems to be  where one finds the XML variables needed, and obtains the associated Property ID, needed to find that variable value within the Frame Section Data record (FRIB).

I have some experience with HTML and went to the Library and got a an XML book to explore your second alternative. I'll be sure to let you know what happens.
Thanks again!

Re: Netpipes SDK

PostPosted: Wed Mar 12, 2003 10:00 am
by NewbieJack
Just a closing message.

I finally resulted to severe bit-twiddling and converted the IEEE double numeric information to someting I could use to get the Lat, Lon and Alt.

Thanks again to those that provided suggestions.
:)