• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FS2004 Programming a C-gauge Autothrottle

Messages
254
Country
us-kentucky
Hi all,

In my pursuit of the perfect 747 classic, I have decided that I want to learn how to program more advanced gauges than just XML gauges so that I can do more advanced things, such as directly controlling Throttles, Axes, etc.

I am a little lost as to where to start with C-programming in the context of FS. Much like how XML has many many uses outside of FS, C and C++ have many features and uses outside of FS and I don't want to spend time learning how to program and use features I won't need to for FS purposes (how much or how little that applies here is unknown to me as I have next to no experience with C). I am happy to sit and read or watch any tutorials and documentation and books necessary, I just want to make sure it will actually be useful for FS gauge creation.

With that in mind, I figure a simple place to start with C-gauge programing would be to attempt to make an Autothrottle. I figure that I will learn how to do most all of the basic operations I will need C-gauge programming for by creating such a gauge.

In my 747, EPR is calculated as a function of N1 via an XML gauge for all mach numbers and N1 speeds based on tables available in PW documentation (Recently I found similar tables for the CF6-50 and RB211-524C2 so I can make the other models too! :) ). I will either need to recreate these functions in the C-gauge or be able to access the calculated L:var for EPR via the C-gauge. Further, I would like to be able to access other L:vars such as those from my electrical system programmed in XML to properly control when the autothrottle has electrical power, ADC power, etc. or not.

Then I want to be able set the throttle position as a function of a calculated EPR, N1, or whatever. I figure a simple PID will suffice for this. Later, I would like to be able to set an autothrottle speed control using a slightly more complex PID that uses longitudinal acceleration. I then hope to expand this into a full autopilot that properly uses PID's and accelerations.

Will C-gauges do what I need them to for FS2004 i.e. writing directly to the throttle position, as well as accessing XML L-vars? I remember reading somewhere that C gauges can access Lvars but I don't remember where I read that or how it is done. I have been examining the FSUIPC documentation regarding offsets and I feel this might be useful as well but I am not sure if I will need to go that route or if there is a different way.

Some other questions I have:
What compiler should I use?
What program should I use to create the actual code (Is notepad++ sufficient?)

Any recommendations on good tutorials or documentation that will teach be the required knowledge would be great. I am reading through the SDK right now. It sounds to me like I just need to sit down with a good C tutorial and start working away at it.


Thanks!
Chris
 
Last edited:
Check the SDK, there are some C/C++ gauge examples in there that might be of help.
For which compiler to use, I'm assuming most devs used Visual Studio, which can cost some coin. But since apparently you are using an older version of FS (FS2004) if you can find an older version of Visual Studio you can probably get it very cheaply on amazon or ebay etc and it would be fine for the sim version you are using. You would be able to access all of the XML Lvars from a C/C++ gauge as well as setting the throttle position directly. Its not necessarily easy, but it can be done.
 
Thanks Dai for sharing your valuable C-gauge development insights. Much appreciated!

Questions:
1 - Do you have your own official download location for your latest "Gauge creation" tutorials? (and perhaps other materials)

Why? I have found your tutorial-packages in the libraries of various websites (like flightsim.com / avsim.com / flyawaysimulation.com / simviation / fs2000.org / ...)
So far i've been able to locate:
- Our own profile / resource page here on the fsdeveloper forum
-https://www.fsdeveloper.com/forum/members/dragonflightdesign.3563/#resources

- Your own AVSIM forum page:
- https://www.avsim.com/profile/141955-dragonflightdesign/

but no "DragonflightDesign" official website of some sort...


2 - Is this the most recent, up-to-date version of your C-Gauge tutorial?
 
The one hosted here is the most up-to-date one. Normally the Avsim version is kept in line. No, no website - can't be assed to keep one going! 😄
 
The one hosted here is the most up-to-date one. Normally the Avsim version is kept in line.
1 - DragonflightDesign - Fsdeveloper Page <bookmarked>

No, no website - can't be assed to keep one going! 😄
2 - LOL - From what Ive seen around the web and on this forum, you are already way too busy to do so Dai.

3 - Thanks for your replies, and thanks again for sharing your hard earned C_coding_wisdoms with the rest of the community.
Your tutorials really help me to gain more in-depth, in-sights to the :stirthepo Flightsim internal software :wizard: Dungeon.
 
Back
Top