The free 'OAT and TIme' clock for the CessnA 172 uses a MSFS variable "SIM TIME" that does exist (throws an EXCEPTION in SimConnect).
Is there any other variable available that can be used instead?
Maybe some undocumented one, as I have not found one in the SDK SimConnect reference documents.
Paul
Cessna 172 - OAT and Time
Re: Cessna 172 - OAT and Time
Which SIm/ Game are you using ? by MSFS, do you mean the MSFS2020 game ? - if so, I don't believe the game is listed as supported by simconnect - but I am not 100% sure.Tetrachromat wrote: ↑Thu Jun 24, 2021 3:31 pm The free 'OAT and TIme' clock for the CessnA 172 uses a MSFS variable "SIM TIME" that does exist (throws an EXCEPTION in SimConnect).
Is there any other variable available that can be used instead?
Maybe some undocumented one, as I have not found one in the SDK SimConnect reference documents.
Paul
Joe. CISSP, MSc.
-
- Posts: 236
- Joined: Sun Feb 14, 2021 6:55 pm
Re: Cessna 172 - OAT and Time
MSFS is the new (almost 1 year old now) flight Simulator from Microsoft/Asobo. It is the successor of FSX. So it supports SimConnect natively out of the box. There is a SDK documentation you can access directly from Air Manager -> Simulator Data -> FS 2020.
I probably found a replacement for "SIM TIME". Need to test it today. It is an environmental variable "E:ABSOLUTE TIME" unit is "seconds".
I probably found a replacement for "SIM TIME". Need to test it today. It is an environmental variable "E:ABSOLUTE TIME" unit is "seconds".
Re: Cessna 172 - OAT and Time
ABSOLUTE TIME is all you can really use I think but you will need to add extra code to workout what the absolute time is when the flight timer should start and likewise when to stop. This is typically done with either WOW or airspeed.
Air Manager panels at https://www.experimentalsimavionics.com
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Re: Cessna 172 - OAT and Time
Have you checked the CLOCK_xxx and ZULU_xxx options ? or am I misunderstanding what you require ? these appears to be no SIM_TIME in the fs2020 SDK
Joe. CISSP, MSc.
-
- Posts: 236
- Joined: Sun Feb 14, 2021 6:55 pm
Re: Cessna 172 - OAT and Time
Yes ZULU TIME and LOCAL TIME are already in use by that instrument (AMTRON AM120), to display Universal Time and Loacal Time. But the instrument can provide Flight TIme and Elapsed Time as well (4 time options) beside outside air temperature in °C and °F and bus voltage.
XPL has 'total flight time' and 'elapsed time' datarefs available, but there is no such variable for FSX/P3D or MSFS. So I need to find an alternative and add some code to get it working.
I thought "ABSOLUTE TIME" may be an option or maybe "GENERAL ENG ELAPSED TIME". ABSOLUTE TIME provides a time in seconds since year 0, but GENERAL ENG ELAPSED TIME does not provide anything.
XPL has 'total flight time' and 'elapsed time' datarefs available, but there is no such variable for FSX/P3D or MSFS. So I need to find an alternative and add some code to get it working.
I thought "ABSOLUTE TIME" may be an option or maybe "GENERAL ENG ELAPSED TIME". ABSOLUTE TIME provides a time in seconds since year 0, but GENERAL ENG ELAPSED TIME does not provide anything.
Re: Cessna 172 - OAT and Time
Hi Paul.
Using the CLOCK_xxxx and ZULU_xxxx should do all you need with a bit of code, as sling say, for flight time you could use, for example wow or ias along with other indications as needed. As a timer then it is a case of storing start of timer set and calculating difference.
Or, use X-Plane
Joe
Using the CLOCK_xxxx and ZULU_xxxx should do all you need with a bit of code, as sling say, for flight time you could use, for example wow or ias along with other indications as needed. As a timer then it is a case of storing start of timer set and calculating difference.
Or, use X-Plane
Joe
Joe. CISSP, MSc.
Re: Cessna 172 - OAT and Time
According to the DAVTRON AM documentation, the flight timer is linked to an electrical pin which is either grounded or set to the bus voltage in order to start/stop the flight timer.
https://www.davtron.com/cmsAdmin/upload ... -13-11.pdf
That makes sense since IRL the flight time is usually counted at the moment when the aircraft starts to move with its own power until the engines are off.
So I would suggest to create you own flight time by using a timer with 1000msec intervals (can be less down to a minute, as FT is usually counted per minute), and checking wether the engine is active, by checking GENERAL ENG GENERATOR ACTIVE:index for example. Generator is a sensible trigger as it is started soon after the engine is started.
In the timer loop you’ll simply check if the generator is active and then use an incremental counter that starts/stops/resets according to the gen state.
A quick maths calculations (you just have to extract hours and minutes) will give you an accurate flight time
If you rather prefer WeightOnWheels time, you can always check via the same timer the SIM ON GROUND variable, which has basically the same effect as a weight on wheels hardware switch located on one the main landing gear strut
As for the elapsed time, it is related to no variable per se, as it is started by the Start/Stop button (CTL Button in your case)
I worked a while ago on this Chrono and was stuck in implementing some advanced timer functions in AM, as these functions require two buttons to be pressed simultaneously
Jacques
https://www.davtron.com/cmsAdmin/upload ... -13-11.pdf
That makes sense since IRL the flight time is usually counted at the moment when the aircraft starts to move with its own power until the engines are off.
So I would suggest to create you own flight time by using a timer with 1000msec intervals (can be less down to a minute, as FT is usually counted per minute), and checking wether the engine is active, by checking GENERAL ENG GENERATOR ACTIVE:index for example. Generator is a sensible trigger as it is started soon after the engine is started.
In the timer loop you’ll simply check if the generator is active and then use an incremental counter that starts/stops/resets according to the gen state.
A quick maths calculations (you just have to extract hours and minutes) will give you an accurate flight time
If you rather prefer WeightOnWheels time, you can always check via the same timer the SIM ON GROUND variable, which has basically the same effect as a weight on wheels hardware switch located on one the main landing gear strut
As for the elapsed time, it is related to no variable per se, as it is started by the Start/Stop button (CTL Button in your case)
I worked a while ago on this Chrono and was stuck in implementing some advanced timer functions in AM, as these functions require two buttons to be pressed simultaneously
Jacques
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ
-
- Posts: 236
- Joined: Sun Feb 14, 2021 6:55 pm
Re: Cessna 172 - OAT and Time
Thank you all. Valuable ideas.
I just discovered that there is an undocumented variable "SIMULATION TIME" which I can use instead of "ABSOULTE TIME". "SIMULATION TIME" has the benefit that it is stopped when you press the escape key to enter the options page, which I use when something unavoidable interrupts my flight session.
And yes, "GENERAL ENG GENERATOR ACTIVE:1" would be the perfect trigger to start stop the FT clock.
Regarding elapsed time you are right. There is also some code for that in the original instrument. I need to study that.
Paul
I just discovered that there is an undocumented variable "SIMULATION TIME" which I can use instead of "ABSOULTE TIME". "SIMULATION TIME" has the benefit that it is stopped when you press the escape key to enter the options page, which I use when something unavoidable interrupts my flight session.
And yes, "GENERAL ENG GENERATOR ACTIVE:1" would be the perfect trigger to start stop the FT clock.
Regarding elapsed time you are right. There is also some code for that in the original instrument. I need to study that.
Paul
-
- Posts: 236
- Joined: Sun Feb 14, 2021 6:55 pm
Re: Cessna 172 - OAT and Time
The variable "GENERAL ENG GENERATOR ACTIVE:1" is always true in the default Asobo Cessna 172. I switched to "SIM ON GROUND*.
So flight time starts right after take off and ends when landed.
So flight time starts right after take off and ends when landed.