Jump to content
The simFlight Network Forums

Recommended Posts

Posted
function SquawkMode(offset, value)
     
     if value <> 0 then
         ipc.writeUB("7b91",0)
     else
         ipc.writeUB("7b91",1)
     end
 end
 event.offset("65CD", "UB", "SquawkMode")

Hi Peter, i'm using this script to monitor the change in XPDR mode in the PMDG 737NGX and change the SB4 mode automatically but nothing seems to work, can you point me in the right direction?

Here is the script:

 

Posted

i'm using this script to monitor the change in XPDR mode in the PMDG 737NGX and change the SB4 mode automatically but nothing seems to work, can you point me in the right direction?

 

Didn't you check the FSUIPC log, because I think it will have logged an error on the line

if value <> 0 then

because there's no <> symbol in Lua. For not equals you use ~=.

 

ALWAYS check the log. That's where errors will be shown.

 

Also do some other checks. For example, do you see 65CD changing? (Use the Monitor option on the FSUIPC logging tab). If not you haven't enabled the 737NGX to populate the data.

 

Also check that you don't have "NoActionOn7B91=Yes" set in the FSUIPC4 INI file.

 

BTW why are you wanting to set 7B91 to zero when the transponder is enabled? Shouldn't it be the other way around? I don't recall anything about SB I'm afraid, but it seems more logical for it to use non-zero for "on".

 

Pete

Posted

Thank you Pete, yes was monitoring the offset in FSX change, when opened the log i found the errors, corrected those and now is working well!

 

In SB4 the 0 is for Normal (on), so it's inverted.

i will publish the script for ohers to use as it's requested feature from some of us.

Unfortunately IDENT in NGX737 is not mapped...

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.