• 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.

Determine flight status

Messages
34
Country
unitedkingdom
Hi, I'm quite new to C# and SimConnect I have modified example apps to my needs in the past but still my knowledge of C# is very basic.

On to the post now:
I need to determine if the users aircraft is in one of 9 possible states:
1. At Departure Gate
2. Pushing Back
3. Taxying
4. Departing
5. Climbing
6. Cruising
7. Descending
8. Landing
9. At Arrival Gate

This is my thought on how to best determine how to check each state:
1. At Departure Gate:
Check if parking brakes are on and ?
Is there anyway to detect if the aircraft is at a gate?

2. Pushing Back:
Simply check if push back command has been issued - is that possible?

3. Taxying:
Check if aircraft speed is less than 30knts but greater than 0.

4. Departing:
Check if aircraft speed is greater than 100knts + VS is greater than +50fpm + Altitude < 10,000ft?

5. Climbing:
Check if altitude > 10,000ft + VS > +50fpm

6. Cruising:
Check if Altitude = FP flight level + or - 100ft

7. Descending:
Check if Altitude is > 10,000ft + VS = -50fpm or more

8. Landing:
If Altitude < 10,000ft + VS = -50 fpm or more

9. At Arrival Gate:
If on ground + check at valid gate?

So is my theories valid and possible to do with simconnect variables if not what would be a better option
 
I need to determine if the users aircraft is in one of 9 possible states:
1. At Departure Gate
2. Pushing Back
3. Taxying
4. Departing
5. Climbing
6. Cruising
7. Descending
8. Landing
9. At Arrival Gate

Why not subscribe to the "AI Traffic State" SimVar and use that? This returns one of the following Strings:

"init", // 0
"sleep", // 1
"flt plan", // 2
"clearance", // 3
"push back 1", // 4
"push back 2", // 5
"startup", // 6
"pre taxi out", // 7
"taxi out", // 8
"takeoff 1", // 9
"takeoff 2", // 10
"T&G depart", // 11
"enroute", // 12
"pattern", // 13
"landing", // 14
"rollout", // 15
"go around", // 16
"taxi in", // 17
"shutdown", // 18
"preflight support",// 19 --> 0
"postflight support",// 20 --> 18
"waypoint", // 21 non ATC AI --> 12
"takeoff", // 22 non ATC AI --> 10
"taxi", // 23 non ATC AI --> 17
Don't worry about the numbers on the right. That's just the encoding I use in FSUIPC4 to get the same states reported to FSUIPC applications as FSUIPC3 provides, those used by my TrafficLook for its display. The last 5 are extra to FS9, which is why I show a mapping.

Regards
Pete
 
Hi, I'm quite new to C# and SimConnect I have modified example apps to my needs in the past but still my knowledge of C# is very basic.

On to the post now:
I need to determine if the users aircraft is in one of 9 possible states:
1. At Departure Gate
<snip>
9. At Arrival Gate

Tricky question. I wanted to do something similar (detect if plane is at parking spot) but didn't find any way to do this accurately through SimConnect. So I downloaded Scruffyduck's BGL decompiler and used it to create my own database of airport data (basic airport lat/lon and the airports' parking lat/lon).

Using the SIM ON GROUND variable of SimConnect, I regurlarly check if the aircraft is parked i.e. not moving. If it is still, I start looping through all the parking spots and check if it is close enough to one of them.
 
Why not subscribe to the "AI Traffic State" SimVar and use that? This returns one of the following Strings:


Don't worry about the numbers on the right. That's just the encoding I use in FSUIPC4 to get the same states reported to FSUIPC applications as FSUIPC3 provides, those used by my TrafficLook for its display. The last 5 are extra to FS9, which is why I show a mapping.

Regards
Pete

This application is to get the current state of a user aircraft not AI, unless your comment works for Human Aircraft?
 
This application is to get the current state of a user aircraft not AI, unless your comment works for Human Aircraft?

Ooops! That's what comes of trying to do too many things at once. Sorry, I completely missed the fact that you were asking about the user aircraft!:rolleyes:

Never mind. Maybe my list will be useful for someone else ;)

Pete
 
Your rules sound like a good start, and I think a lot of testing in FSX will help you refine them. Most of what you want can be found from simulator variables requested in the context of the user aircraft. One item I cannot determine is user parking; it always comes back as an empty string. Shame really, as FS clearly understands the user's gate allocation. Maybe FSUIPC knows this information?

Regards
Simon
 
One item I cannot determine is user parking; it always comes back as an empty string. Shame really, as FS clearly understands the user's gate allocation. Maybe FSUIPC knows this information?

No, sorry. most folks I know obtain the Gate ID, etc, by looking up the user aircraft's location in a database of gates, taxiways, etc. Radar Contact does that, and others.

Daniel van Os might know how to get such info as his "Follow Me" program gets ATC taxiway routine from FSX. I don't know how, and I've not asked him for such info because I think it's the main competitive advantage he has with Follow Me.

Regards
Pete
 
i think i might just replace both gate status's with a single Taxing to Gate status, then i just need to determine when the aircraft has stopped.
 
Wouldn't the user break your function if he decides to stop in the middle of the taxiway? (ATC tells you sometimes to stop to let another aircraft or vehicle pass)
 
yes only if they decide to shut the engines down, as a double check ill check parking breaks are on and fuel shut off is closed. if i can?
 
yes only if they decide to shut the engines down, as a double check ill check parking breaks are on and fuel shut off is closed. if i can?

You can check both the parking brake state and engine combusion. Remember there's more than 1 engine on many aircraft, and SimConnect variables reflect that.

I remember being on a flight from Gatwick to St. Louis where they shut the engines down during a taxi hold short because they were a "little tight on fuel".

It's rationalise every possible user action, so if you account for normal good pilot behaviour it will turn out well.

Regards
Simon
 
Hi, I'm quite new to C# and SimConnect I have modified example apps to my needs in the past but still my knowledge of C# is very basic.

On to the post now:
I need to determine if the users aircraft is in one of 9 possible states:
1. At Departure Gate
2. Pushing Back
3. Taxying
4. Departing
5. Climbing
6. Cruising
7. Descending
8. Landing
9. At Arrival Gate

This is my thought on how to best determine how to check each state:
1. At Departure Gate:
Check if parking brakes are on and ?
Is there anyway to detect if the aircraft is at a gate?

2. Pushing Back:
Simply check if push back command has been issued - is that possible?

3. Taxying:
Check if aircraft speed is less than 30knts but greater than 0.

4. Departing:
Check if aircraft speed is greater than 100knts + VS is greater than +50fpm + Altitude < 10,000ft?

5. Climbing:
Check if altitude > 10,000ft + VS > +50fpm

6. Cruising:
Check if Altitude = FP flight level + or - 100ft

7. Descending:
Check if Altitude is > 10,000ft + VS = -50fpm or more

8. Landing:
If Altitude < 10,000ft + VS = -50 fpm or more

9. At Arrival Gate:
If on ground + check at valid gate?

So is my theories valid and possible to do with simconnect variables if not what would be a better option
Did you manage to get anywhere as I'm looking for the same thing and I'm struggling to find a place to start
 
Short answer: Start digging FSUIPC.DLL software development kits over here to gain access into Microsoft Flightsimulator "internal( variable) s"

Why you might ask?
FSUIPC.DLL has been around since "FS95" (1996) - "SimConnect" only since "FSX" (2007 - Eleven years later!)
FSUIPC.DLL has way better documentation then any type of official Microsoft free "SDK" I have ever seen in the last 2 decades.
FSUIPC.DLL has software development kits for multiple languages (so you do not get stuck inside Microsoft C-Sharp and Visual Studio IDE's)

Most Important argument: FSUIPC.DLL is still being actively developed and supported over here:
-https://www.schiratti.com/files/dowson.html - old website
-http://www.fsuipc.com/ - newer website and download location of its SDK's
-https://forum.simflight.com/forum/30-fsuipc-support-pete-dowson-modules/ - FSUIPC active! support forum

fsd_fsuipcdll_tutorial.jpg


TIP: This is a highly visual - beginner! level! tutorial - which can help you get started with the FSUIPC.DLL mindset and software development
-https://www.sim-avionics.com/downloads/FSUIPC Help.pdf
 
Short answer: Start digging FSUIPC.DLL software development kits over here to gain access into Microsoft Flightsimulator "internal( variable) s"

Why you might ask?
FSUIPC.DLL has been around since "FS95" (1996) - "SimConnect" only since "FSX" (2007 - Eleven years later!)
FSUIPC.DLL has way better documentation then any type of official Microsoft free "SDK" I have ever seen in the last 2 decades.
FSUIPC.DLL has software development kits for multiple languages (so you do not get stuck inside Microsoft C-Sharp and Visual Studio IDE's)

Most Important argument: FSUIPC.DLL is still being actively developed and supported over here:
-https://www.schiratti.com/files/dowson.html - old website
-http://www.fsuipc.com/ - newer website and download location of its SDK's
-https://forum.simflight.com/forum/30-fsuipc-support-pete-dowson-modules/ - FSUIPC active! support forum

View attachment 82168

TIP: This is a highly visual - beginner! level! tutorial - which can help you get started with the FSUIPC.DLL mindset and software development
-https://www.sim-avionics.com/downloads/FSUIPC Help.pdf
I agree. FSUIPC documentation is more friendly than simconnect or other microsoft SDK.
 
Guys please. This is an 11 year old thread and there is nothing to be gained by resurrecting this dead conversation. The OP has not visited this site since 2011, he won't reply. Recommending you start a new thread, describe your unique and original issue and go from there.

As to the FSUIPC nonsense. PLEASE, please, please read a thread before commenting. Some people actually follow the conversation and repeating dismissed solutions, only adds to the madness and I quote:
Why not subscribe to the "AI Traffic State" SimVar and use that? This returns one of the following Strings:


Don't worry about the numbers on the right. That's just the encoding I use in FSUIPC4 to get the same states reported to FSUIPC applications as FSUIPC3 provides, those used by my TrafficLook for its display. The last 5 are extra to FS9, which is why I show a mapping.

Regards
Pete
This application is to get the current state of a user aircraft not AI, unless your comment works for Human Aircraft?
Ooops! That's what comes of trying to do too many things at once. Sorry, I completely missed the fact that you were asking about the user aircraft!:rolleyes:

Never mind. Maybe my list will be useful for someone else ;)

Pete
 
Back
Top