Jump to content
The simFlight Network Forums

Anti-Skid offset?


Recommended Posts

Pete,

 

 I have searched in vain in the offset status doc to see if there was an offset to use for the status of the anti-lock brake system.. I am writing a LUA script so that a user of a gamepad would have the antiskid on at all times for all aircraft in all situations. Anti skid always returns to off on any aircraft load/reload. The following is the best working LUA so far -- (loaded via [Auto])

-- TOGGLE ANTI SKID BRAKES
function anti_skid()    
	ipc.control(66720)			
end

-- CALL THE FUNCTION ON INITIAL FSX LOADING OR AN AIRCRAFT CHANGE
anti_skid()

-- CALL THE FUNCTION FOR, FLIGHT RESET OR AN AIRCRAFT RELOAD COMMAND
event.control(66512 , "anti_skid") -- Reload Aircraft
event.control(65591 , "anti_skid") -- Situation Reset 
The above covers most of the bases except for - 

- Selecting the exact same aircraft from the select aircraft menu

- Selecting any flight, or reselecting the same flight, that has the same aircraft.

- A crash reset ?? (Did not test)

In each of the above cases Anti-Skid is turned off via FSX.  

 

Would I like to do is something like -

 

-- TOGGLE ANTI SKID BRAKES
function anti_skid()
        status = ipc.read(ANTI-SKID STATUS)
        if status ~= 1 then 
	  ipc.control(66720)
        end 			
end

-- CALL THE FUNCTION ON INTIAL FSX LOADING OR AN AIRCRAFT CHANGE
anti_skid()

-- CALL THE FUNCTION FOR, FLIGHT RESET OR AN AIRCRAFT RELOAD COMMAND
event.control(66512 , "anti_skid") -- Reload Aircraft
event.control(65591 , "anti_skid") -- Situation Reset
event.sim(FLIGHTLOAD, "anti_skid") -- Any flight load
OR - even better to cover all the bases

function anti_skid()
status = ipc.read(ANTI-SKID STATUS)
        if status ~= 1 then 
 ipc.control(66720)
        end  
end
event.timer(3000, "anti_skid")
 

 Just wondering if the offset is available and just maybe not in the document? The variable is available for both XML and, from I gather C type/Simconnect gauges too.

 

Roman

Link to comment
Share on other sites

 I have searched in vain in the offset status doc to see if there was an offset to use for the status of the anti-lock brake system.

...

Just wondering if the offset is available and just maybe not in the document? The variable is available for both XML and, from I gather C type/Simconnect gauges too.

 

No, it is not currently available through FSUIPC, but it would be dead easy to add it.  It's just that no one has ever asked for it.

 

FSUIPC4's interface to FSX was intended as a compatibility layer for programs written to work with FSUIPC on FS9 and earlier, so the prime objective was, of course, to match the data as far as possible. Things extra in FSX or P3D have been added later, on request. Where there are suitable SimConnect variables it isn't a problem, just a matter of finding a suitable spare offset locatin (only a BYTE needed in this case) and adding it to a table.

 

I'll have a look now ...

 

Regards

Pete

Link to comment
Share on other sites

I'll have a look now ...

 

Okay. I've added it but I'm having a hard time testing it. Which aircraft does it operate with, please? I've tried using the ANTISKID BRAKES TOGGLE control on the default FSX 738 and that makes SimConnect still return FALSE for the active setting. Is there something needed beforehand? The engines are running.

 

As soon as I can verify it I can make an interim build for you to use.

 

Regards

Pete

Link to comment
Share on other sites

Pete,

WOW! Thank You so much! I have been using the stock A321 for testing. Note the VC does NOT reflect anti-skid but the 2d "Gear Panel" does. (Shift-6)

I have tested it on alot of aircraft with a xml gauge and it commands / returns / actually works during testing.

Roman

Link to comment
Share on other sites

I have been using the stock A321 for testing. Note the VC does NOT reflect anti-skid but the 2d "Gear Panel" does. (Shift-6)

 

Got it! Thanks. Yes it works fine. Download FSUIPC4913

 

Offset 0BFD, one byte, 1 = on, 0 = off. Can write to it too (it uses the Antiskid brakes toggle to match what you write, if different).

 

I've not got time to do a documented release at present. I'm accumulating a small collection of updates and will release next week some time.

 

Regards

Pete

Link to comment
Share on other sites

Pete,

It works a charm! :smile:

 

 

 

It's just that no one has ever asked for it.

It was.. A LONG time ago here in the forum.. (I Used the search function first) I Believe it was just too early since the release of FSX though to go further.

 

I ended up with this - no fuss, it just works and always will..

function anti_skid()
status = ipc.readSB(0x0BFD)
        if status ~= 1 then 
 ipc.control(66720) 
        end  
end
event.timer(3000, "anti_skid") 

This little project was based on this http://forum.avsim.net/topic/416919-way-to-turn-on-anti-skid-by-default/  , yes a xml gauge would've worked but installing it into every aircraft would be pain..

 

Thanks again,

You Da Man!

 

Roman

Link to comment
Share on other sites

Hi Pete,

 

NEVER MIND ... Ha Ha .. Read the manual LOL!!  "The function is also executed initially, when the plugin is first run, in order to initialise things. This saves using an explicit call to do the same."

 

Your code is soooo much more elegant!  :mrgreen:

 

Have a great weekend,

Roman

 

P.S. Maybe a typo in the code?

 

event.offset(ox0BFD, "UB", "anti_skid")   -- Red, oh ex .. Would this work?

event.offset(0x0BFD, "UB", "anti_skid")   -- Red, zero ex ..

 

__________________________________________________________________________________________________

 

 

 

IIRC in one particular situation (donot remember which one) when the aircraft was changed the anti-skid was toggled off and then the Lua was loaded afterwards. In this case would the lua file not work?  

 

 RE- http://forum.avsim.net/topic/416919-way-to-turn-on-anti-skid-by-default/#entry2764391

function anti_skid()
    ipc.writeUB(0x0BFD, 1)
end

event.offset(ox0BFD, "UB",  "anti_skid")
Link to comment
Share on other sites

event.offset(ox0BFD, "UB", "anti_skid")   -- Red, oh ex .. Would this work?

 

No, it must be a ZERO! Did I type an 'O'? Ouch. Sorry.

 

IIRC in one particular situation (donot remember which one) when the aircraft was changed the anti-skid was toggled off and then the Lua was loaded afterwards. In this case would the lua file not work?  

 

 

 

It should always work -- the event is automatically triggered when the Lua is loaded as well as when the offset changes.

 

Regards

Pete

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.