Jump to content


Photo

Anti-Skid offset?


  • Please log in to reply
7 replies to this topic

#1 spokes2112

spokes2112

    Advanced Member

  • Members
  • PipPipPip
  • 42 posts
  • LocationKGRB

Posted 26 August 2013 - 05:03 PM

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
  • 0
Roman
Gauge Programmer -
Posted Image
On Facebook

#2 Pete Dowson

Pete Dowson

    Advanced Member

  • Moderators
  • 26,948 posts
  • LocationNear Stoke-on-Trent, UK

Posted 26 August 2013 - 05:42 PM

 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


  • 0

#3 Pete Dowson

Pete Dowson

    Advanced Member

  • Moderators
  • 26,948 posts
  • LocationNear Stoke-on-Trent, UK

Posted 26 August 2013 - 06:19 PM

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


  • 0

#4 spokes2112

spokes2112

    Advanced Member

  • Members
  • PipPipPip
  • 42 posts
  • LocationKGRB

Posted 26 August 2013 - 06:29 PM

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
  • 0
Roman
Gauge Programmer -
Posted Image
On Facebook

#5 Pete Dowson

Pete Dowson

    Advanced Member

  • Moderators
  • 26,948 posts
  • LocationNear Stoke-on-Trent, UK

Posted 26 August 2013 - 06:48 PM

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


  • 0

#6 spokes2112

spokes2112

    Advanced Member

  • Members
  • PipPipPip
  • 42 posts
  • LocationKGRB

Posted 26 August 2013 - 07:17 PM

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.n...kid-by-default/  , yes a xml gauge would've worked but installing it into every aircraft would be pain..

 

Thanks again,

You Da Man!

 

Roman


  • 0
Roman
Gauge Programmer -
Posted Image
On Facebook

#7 spokes2112

spokes2112

    Advanced Member

  • Members
  • PipPipPip
  • 42 posts
  • LocationKGRB

Posted 29 August 2013 - 12:18 PM

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.n...t/#entry2764391

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

event.offset(ox0BFD, "UB",  "anti_skid")

  • 0
Roman
Gauge Programmer -
Posted Image
On Facebook

#8 Pete Dowson

Pete Dowson

    Advanced Member

  • Moderators
  • 26,948 posts
  • LocationNear Stoke-on-Trent, UK

Posted 02 September 2013 - 08:52 AM

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


  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users


About simFlight - simflight.com - simflight.de - simflight.fr - simflight.nl - simflight.pt - simflight.es - simflight.it - simflight.jp - simrussia.com - simMarket