Jump to content

You're browsing the 2004-2023 VATSIM Forums archive. All content is preserved in a read-only fashion.
For the latest forum posts, please visit https://forum.vatsim.net.

Need to find something? Use the Google search below.

X-Plane UDP examples in C#


Luke Kolin
 Share

Recommended Posts

Luke Kolin
Posted
Posted

Does anyone know of any (good, preferably - but I'm not picky) examples of parsing X-Plane 9 UDP datagrams in C#?

 

Cheers!

 

Luke

... I spawn hundreds of children a day. They are daemons because they are easier to kill. The first four remain stubbornly alive despite my (and their) best efforts.

... Normal in my household makes you a member of a visible minority.

Link to comment
Share on other sites

  • 9 months later...
Luke Kolin
Posted
Posted

In a follow-up, I have an offer.

 

Our ACARS 3.x code base introduces the notion of a "simulator bridge" - a way of abstracting away the underlying simulator and its proprietary interface from the pilot client software itself. We currently have a reference implementation for FS8/9/X using FSUIPC. I'd be happy to open-source this implementation as well as all the C# cl[Mod - Happy Thoughts]es required to create new simulator bridges in return for an open-source simulator bridge targeting X-Plane 9 (or 10) on .NET 3.5 or above.

 

Hopefully this will be a way of increasing X-Plane penetration as well as providing a good start for external parties wanting to write FS flight data recorders.

 

Cheers!

 

Luke

... I spawn hundreds of children a day. They are daemons because they are easier to kill. The first four remain stubbornly alive despite my (and their) best efforts.

... Normal in my household makes you a member of a visible minority.

Link to comment
Share on other sites

Rahul Parkar
Posted
Posted

Luke,

 

I would be interested in the open-sourcing of these cl[Mod - Happy Thoughts]es regarding a project I am currently working on.

 

Thank you for this

 

Cheers!

Rahul

Rahul Parkar

"On second thoughts Nappa, catch it, catch it with your teeth" -- Vegeta

Professional Nerd. (Professionally not professional)

Link to comment
Share on other sites

  • 2 weeks later...
Keith Smith
Posted
Posted

Luke,

 

Most new development that takes place for X-Plane utilizes the SDK to extract data, rather than UDP. Have you considered doing that instead?

Link to comment
Share on other sites

  • 3 weeks later...
Luke Kolin
Posted
Posted
Most new development that takes place for X-Plane utilizes the SDK to extract data, rather than UDP. Have you considered doing that instead?

 

I have - briefly. Are there any examples for those of us who write using a language other than C?

 

Cheers!

 

Luke

... I spawn hundreds of children a day. They are daemons because they are easier to kill. The first four remain stubbornly alive despite my (and their) best efforts.

... Normal in my household makes you a member of a visible minority.

Link to comment
Share on other sites

Keith Smith
Posted
Posted

I believe there are Delphi examples that come with the SDK. Additionally, there is a plugin that bridges with Python, too. The FSEconomy plugin for X-Plane is a good example of one of the Python-based plugins.

Link to comment
Share on other sites

Erhan Atesoglu 1050499
Posted
Posted

Keeping up with with C# support is a little bit difficult I would imagine with a new frame work coming out every year. Perhaps when Microsoft has a final version out, but can you really blame LR for not supporting it? Even FSX SimConnect is only unofficially supported, through a former Aces employee blog.

Link to comment
Share on other sites

Luke Kolin
Posted
Posted
I believe there are Delphi examples that come with the SDK.

 

I'll take a look at that one - we'll see how much of my Pascal I still remember.

 

Keeping up with with C# support is a little bit difficult I would imagine with a new frame work coming out every year. Perhaps when Microsoft has a final version out, but can you really blame LR for not supporting it?

 

I'm not sure why you make such a statement. Our FSUIPC code compiled without a single modification from 2.0, 3.5 and now 4.0.

 

Besides, if take your statement and flip it on its end, can you really blame me for not supporting X-Plane if they keep coming out with new versions every year or so?

 

Cheers!

 

Luke

... I spawn hundreds of children a day. They are daemons because they are easier to kill. The first four remain stubbornly alive despite my (and their) best efforts.

... Normal in my household makes you a member of a visible minority.

Link to comment
Share on other sites

Jesse Shelly 1203647
Posted
Posted

Hi Luke,

 

I don't know if you're still in need of that C# information, but I have it for you if needed. I've been successful in communicating with X-Plane, version 9, via UDP and a simple C# program (written using Microsoft Visual C# 2008 Express). I just wrote up a small tutorial this past week all about it, including a video with me "flying" by using external circuitry.

 

Check it out here: http://www.NuclearProjects.com/xplane

 

Jesse

Link to comment
Share on other sites

Luke Kolin
Posted
Posted
I don't know if you're still in need of that C# information, but I have it for you if needed. I've been successful in communicating with X-Plane, version 9, via UDP and a simple C# program (written using Microsoft Visual C# 2008 Express). I just wrote up a small tutorial this past week all about it, including a video with me "flying" by using external circuitry.

 

The site appears down now (no DNS resolution) but when I saw it, it seemed like a better tutorial on how to send and receive datagrams over UDP than to specifically interact with X-Plane. I'd be interested to see what you do with it; if you end up creating some cl[Mod - Happy Thoughts]es to abstract away the X-Plane UDP protocol I'd be very interested.

 

Good luck!

 

Cheers!

 

Luke

... I spawn hundreds of children a day. They are daemons because they are easier to kill. The first four remain stubbornly alive despite my (and their) best efforts.

... Normal in my household makes you a member of a visible minority.

Link to comment
Share on other sites

Erhan Atesoglu 1050499
Posted
Posted

Luke: won't X-UIPC do the job for you?

Link to comment
Share on other sites

Luke Kolin
Posted
Posted
Luke: won't X-UIPC do the job for you?

 

No. It appears to have only about a fifth of the offsets I need, and doesn't support sending controls at all.

 

Cheers!

 

Luke

... I spawn hundreds of children a day. They are daemons because they are easier to kill. The first four remain stubbornly alive despite my (and their) best efforts.

... Normal in my household makes you a member of a visible minority.

Link to comment
Share on other sites

Erhan Atesoglu 1050499
Posted
Posted
Luke: won't X-UIPC do the job for you?

 

No. It appears to have only about a fifth of the offsets I need, and doesn't support sending controls at all.

 

Cheers!

 

Luke

 

Looks like your stuck with C++ Interop... there are automated tools that'll wrap the headers for you. I just always found it weird working with pointers in C#, or rather a pointer object...

Link to comment
Share on other sites

 Share