Jump to content
The simFlight Network Forums

Carenado King Air C90 Switch Timers???

Recommended Posts

I have been working on a script to bring as many of the panel switches on my Carenado King Air C90 out to my sim pit hardware as possible. I have a large number of them working but have hit road blocks on three or four of them. Those would be the Master Caution, Master Warning, Fuel Transfer Test, and Wiper Park switches. The first three have some type of timer in play and that is where this evenings head scratching is coming from... I'll tackle the Wiper Park after I get these timer based switches working . . .

When I try to trap the LVars as I press the buttons in the cockpit view there seem to be four lines that always appear.

370845 LUA.1: L:EX500_LocalTime=0.62591117011176
370908 LUA.1: L:Time_Cont_car =3846
370986 LUA.1: L:GAUGE_ANUM_MASTER_WARNING_TIMER=2265.2802124023

The first appears to check the current local time, it was shortly after 12:30am when I captured these log entries. The second line I'm not sure about at all. The third sets a timer value ( I assume a delay before the Master Warning system does another system check and re-illuminates (assuming alarm conditions still exist). And, the last line of code extinguishes the lamp. I get similar code for the Master Caution as well, and only a slight variation for the Fuel Transfer Test switch.

At a point several log events later the Master Warning comes back on as expected since alarm conditions have not cleared


Each time I click one of the switches I see a similar sequence only with the values progressively higher. Here's the click of the Master Caution that I did only a moment after the above

384932 LUA.1: L:EX500_LocalTime=0.62981561024984
385010 LUA.1: L:Time_Cont_car =4099
385073 LUA.1: L:GAUGE_ANUM_MASTER_CAUTION_TIMER=2279.2806396484


Has anybody seen this or maybe cracked the code? It would seem for me to be able to make these work on external switches I'll need to calculate that timing value and I can not figure out how it is arrived at.


Tom G.

Link to comment
Share on other sites

Just to be sure:

You have tried it with "GAUGE_ANUM_MASTER_CAUTION" ... set it to zero or 1...?

That's always a bit odd to give tips when I ahve no access to the addon itself.

Such timings could be a real pity.

I can only highly suggest LINDA to gather the LUA variables.

With LINDA you have a list of all variables in the GUI, could click and test each single variable.

And you have with the LINDA console a kind of live monitor to see what happens if you press a switch in the planes VC.

Link to comment
Share on other sites

I will be test driving LINDA this weekend to see what I can do with it. Additionally, Paul showed me how to pull a list of all the LVars from an add on, and I also trapped the above code using the logging functions in FSUIPC and lua.

I have tested "GAUGE_ANUM_MASTER_CAUTION" setting it to both 1 and 0. As I thought it would it illuminates or extinguishes the warning lamp. However, the master caution system no longer functions properly after that absent that timer value that is set with "GAUGE_ANUM_MASTER_CAUTION_TIMER" That seems to determine how long the system waits before it rechecks the various systems that might trigger an alarm.

So, the big mystery to solve, I think, is what programming, wizardry, or voodoo do I need to code in my lua script to calculate that timer value???

Link to comment
Share on other sites

I think I can't help you there ... such timers are the worst scenario you could have.

Just try and error, but there are some addons with such timing sequences where I ahve to give up also ...

But you can of course send such a timing signal also, e.g.

L:EX500_LocalTime = 10000

or whatever.

I still wonder why paul still haven't discovered the LINDA LUA hunting abilities ... :rolleyes:

Live could be so easy ...

Link to comment
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
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.