Cessna 172 - OAT and Time

Questions about deployment and use of Air Manager Instruments

Moderators: russ, Ralph

Message
Author
Tetrachromat
Posts: 236
Joined: Sun Feb 14, 2021 6:55 pm

Cessna 172 - OAT and Time

#1 Post by Tetrachromat »

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

User avatar
jph
Posts: 2846
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: Cessna 172 - OAT and Time

#2 Post by jph »

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
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.
Joe. CISSP, MSc.

Tetrachromat
Posts: 236
Joined: Sun Feb 14, 2021 6:55 pm

Re: Cessna 172 - OAT and Time

#3 Post by Tetrachromat »

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

User avatar
Sling
Posts: 5237
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: Cessna 172 - OAT and Time

#4 Post by Sling »

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.

User avatar
jph
Posts: 2846
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: Cessna 172 - OAT and Time

#5 Post by jph »

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.

Tetrachromat
Posts: 236
Joined: Sun Feb 14, 2021 6:55 pm

Re: Cessna 172 - OAT and Time

#6 Post by Tetrachromat »

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.

User avatar
jph
Posts: 2846
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: Cessna 172 - OAT and Time

#7 Post by jph »

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
Joe. CISSP, MSc.

JackZ
Posts: 2262
Joined: Mon Feb 22, 2016 1:02 pm

Re: Cessna 172 - OAT and Time

#8 Post by JackZ »

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
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

Tetrachromat
Posts: 236
Joined: Sun Feb 14, 2021 6:55 pm

Re: Cessna 172 - OAT and Time

#9 Post by Tetrachromat »

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

Tetrachromat
Posts: 236
Joined: Sun Feb 14, 2021 6:55 pm

Re: Cessna 172 - OAT and Time

#10 Post by Tetrachromat »

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.

Post Reply