Jump to content
The simFlight Network Forums

SquawkBox 4 Mode Sel


Recommended Posts

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:

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • 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.