Sign in to follow this  
Guest Torin

Help with C# for motion platform

Recommended Posts

I posted this on the fsdeveloper forums yesterday, but haven't really seen a response. Let me first give you a bit of background. I'm new to the development world of FSX and flight sims in general. I'm actually a web developer who is quite proficient at javascript, actionscript, etc. So object oriented programming is something I do everyday. I have been going down the road of creating a motion platform (3dof)and would like to create the control system in managed code (C#). I have already created some small applications based on the SDK examples that will grab the landing gear status and some location info (long, lat, altitude, pitch, bank) of the aircraft. Where I'm having the problem, is having simconnect stream the data to my application on a constant basis. Do I setup a "simconnect_OnRecvEvent" that will continually send the data? None of the C# examples seems to show how to do this. You will find my code here: http://forums.avsim.net/user_files/173186.zipI'm not asking anyone to do the programming for me, but would perhaps like some pointers as to what direction to take. I have also setup a full time website for my project that will outline my progress. So far I don't have much up there, but will soon. The site URL is http://www.simulatormotion.com/Thanks,Torin

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Ok, so I have been playing around, and I understand that I need to use a RequestDataOnSimObject. However, when I try this I get the following error:No overload for method 'RequestDataOnSimObject' takes '5' argumentsHere is my call to RequestDataOnSimObject:simconnect.RequestDataOnSimObject(DATA_REQUESTS.REQUEST_1, DEFINITIONS.Struct1, SimConnect.SIMCONNECT_OBJECT_ID_USER, SIMCONNECT_PERIOD.ONCE, SIMCONNECT_DATA_REQUEST_FLAG.DEFAULT,);Here is a link to the full code:http://forums.avsim.net/user_files/173196.zipAny pointers would be appreciated.Thanks,Torinhttp://forums.avsim.net/user_files/173196.zip

Share this post


Link to post
Share on other sites

Not a word from anyone here. Must be a weekend. I figured it out. I'm a moron. This is the fix:simconnect.RequestDataOnSimObject(DATA_REQUESTS.REQUEST_1, DEFINITIONS.Struct1, SimConnect.SIMCONNECT_OBJECT_ID_USER, SIMCONNECT_PERIOD.VISUAL_FRAME, 0, 0, 0, 0);Torin

Share this post


Link to post
Share on other sites

I have Microsoft Visual C# and C++ Express Editions on my computer. I think C++ is what you need to use with FSX vice C#. Reading the intro to C# led me to believe this.W. Sieffert

Share this post


Link to post
Share on other sites

Actually I have C# working great for my motion platform prototype. Just tweaking the settings at this point. Then on to the final version of the larger platform.

Share this post


Link to post
Share on other sites

>I have Microsoft Visual C# and C++ Express Editions on my>computer. I think C++ is what you need to use with FSX vice>C#. Reading the intro to C# led me to believe this.>>W. SieffertSimConnect works great with C# and Visual Basic.NET as well as C++. Some crafty guys in our community have ported it to Fortran as well, I believe.

Share this post


Link to post
Share on other sites

Fortran! That's crazy!Very cool though. I think Microsoft has done a stellar job with SimConnect.

Share this post


Link to post
Share on other sites

It's actually Delphi, I was going for exaggeration.I'm still surprised at what people have been able to do.

Share this post


Link to post
Share on other sites

TEE-HEE!! Its all 1's and 0's deep down!!Ah yes, Fortran IV!! Brings back memories at the keypunch card machine and turning in the work to the batch operators.Waiting till the next day to see if one of the cards was turned up to indicate where you went wrong!!W. Sieffert

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this