Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hi Pete,

This problem is really small but I hope you can help. I use a LUA script to tune my radios,( I didn't write it), but the script was published some time ago and and I have had no problems in FSX and P3d and even with the "fix" in P3D2 (prior 4.923), but when I installed 4.923 everything across the board seemed fine except in the ADF radio tuning; the . (dot) and 0 will not work and therefor will not tune. The . (dot) and 0 work for all other radios. The same problem exists in P3D and FSX as well with 4.923. Any thoughts? Henry

Posted

Hi Pete, This problem is really small but I hope you can help. I use a LUA script to tune my radios,( I didn't write it), but the script was published some time ago and and I have had no problems in FSX and P3d and even with the "fix" in P3D2 (prior 4.923), but when I installed 4.923 everything across the board seemed fine except in the ADF radio tuning; the . (dot) and 0 will not work and therefor will not tune. The . (dot) and 0 work for all other radios. The same problem exists in P3D and FSX as well with 4.923. Any thoughts? Henry

 

Sorry, I need more information. Nothing's changed in any area of FSUIPC which could affect this. I casn't imasgine what would be different with ADF compared to others in terms of character recognition. Can you show me the code which doesn't work? I'd need to be able to reproduce it here.

 

Pete

Posted

Thanks Pete for the quick reply. Great service as always.  Just for grins I re installed FSUIPC and then the scripts...no improvement. Perhaps I should have uninstalled first.  Same across all three sims.  Here are the scripts.  If you need more information, let me know....Regards,

Henry

Posted

Thanks Pete for the quick reply. Great service as always.  Just for grins I re installed FSUIPC and then the scripts...no improvement. Perhaps I should have uninstalled first.  Same across all three sims.  Here are the scripts.  If you need more information, let me know....Regards,

Henry

 

I see no scripts, and to be honest I don't have time to plough through Lua programs to find the bit not working. I would be grateful if you'd just supply a little example of what doesn't work, please.

 

Try pasting stuff into messages. Trying to attach things here is problematic.

 

I was hoping to release an update on Monday, so if you are quick enough, and succinct enough, I might be able to sort it for then. Otherwise it goes back another week.

 

Regards

Pete

Posted

Ok Pete, bear with me, I am trying.... but this may be above my level of incompitance!!

 

This is the script that doesn't work:

 

acr = ipc.get("ACTIVE_RADIO")
ipc.set("KEY_STR", 0)
ipc.set("KEY_POS", 1)
ipc.set("DECIMAL_SET", false)

onoff = ipc.get("ONOFF")

if (not(onoff == nil) and onoff == "OFF") then
    return
end

if ipcPARAM == 1 then
    acr = "ADF_2"
else
    if ipcPARAM == 2 then
        acr = "ADF_1"
    end
end

if not(acr == nil) and acr == "ADF_1" then
    nacr = "ADF_2"
    b1 = ipc.readUB(0x02D4)
    b2 = ipc.readUB(0x02D5)
    
    n1 = logic.And(b1, 15)
    n2 = logic.And(b2, 15)
    
    b3 = ipc.readUB(0x02D6)
    b4 = ipc.readUB(0x02D7)
    
    ipc.writeSTR(0x3380, nacr .. ":  " .. b4 .. n2 .. logic.Shr(b1, 4) .. n1 .. "." .. b3);

else
    nacr = "ADF_1"
    b1 = ipc.readUB(0x034C)
    b2 = ipc.readUB(0x034D)
    
    n1 = logic.And(b1, 15)
    n2 = logic.And(b2, 15)
    
    b3 = ipc.readUB(0x0356)
    b4 = ipc.readUB(0x0357)
    
    ipc.writeSTR(0x3380, nacr .. ":  " .. b4 .. n2 .. logic.Shr(b1, 4) .. n1 .. "." .. b3);
end
ipc.set("ACTIVE_RADIO", nacr);

ipc.writeSW(0x32FA, 8);

 

 

 

 

This one works:

acr = ipc.get("ACTIVE_RADIO")

ipc.set("KEY_STR", 0)

ipc.set("KEY_POS", 1)

ipc.set("DECIMAL_SET", false)

 

onoff = ipc.get("ONOFF")

 

if (not(onoff == nil) and onoff == "OFF") then

               return

end

 

if ipcPARAM == 1 then

               acr = "COM_2"

else

               if ipcPARAM == 2 then

                              acr = "COM_1"

               end

end

 

if not(acr == nil) and acr == "COM_1" then

               nacr = "COM_2"

               b1 = ipc.readUB(0x3118)

               b2 = ipc.readUB(0x3119)

              

               n1 = logic.And(b1, 15)

               n2 = logic.And(b2, 15)

              

               b3 = ipc.readUB(0x311C)

               b4 = ipc.readUB(0x311D)

              

               n3 = logic.And(b3, 15)

               n4 = logic.And(b4, 15)

              

               ipc.writeSTR(0x3380, nacr .. ":  1" .. logic.Shr(b2, 4) .. n2 .. "." .. logic.Shr(b1, 4) .. n1 .. "  -  " .. "1" .. logic.Shr(b4, 4) .. n4 .. "." .. logic.Shr(b3, 4) .. n3);

else

               nacr = "COM_1"

               b1 = ipc.readUB(0x034E)

               b2 = ipc.readUB(0x034F)

              

               n1 = logic.And(b1, 15)

               n2 = logic.And(b2, 15)

              

               b3 = ipc.readUB(0x311A)

               b4 = ipc.readUB(0x311B)

              

               n3 = logic.And(b3, 15)

               n4 = logic.And(b4, 15)

              

               ipc.writeSTR(0x3380, nacr .. ":  1" .. logic.Shr(b2, 4) .. n2 .. "." .. logic.Shr(b1, 4) .. n1 .. "  -  " .. "1" .. logic.Shr(b4, 4) .. n4 .. "." .. logic.Shr(b3, 4) .. n3);

end

ipc.set("ACTIVE_RADIO", nacr);

 

ipc.writeSW(0x32FA, 8);

 

I hope this is what you wanted.  If not, then I need specific direction.

Henry

Posted

Ok Pete, bear with me, I am trying.... but this may be above my level of incompitance!!

...

I hope this is what you wanted.  If not, then I need specific direction.

 

Ah, you don't actually understand these scripts? Have you tried asking the author for assistance?

 

I don't really understand what they are trying to do -- the assorted "ipc.get" and "ipc.set" actions imply they are part of some bigger control part.  Additionally, neither of these actually set anything to the radios in FS -- they READ the current radio values, but all they then do is display the values in a message on screen.for 8 seconds. Evidently there's more -- there's nothing in these to go wrong excepting maybe get the message wrong ... does the ADF message look wrong?

 

How do you use them? In other words, what do you assign in FSUIPC and how do you operate? Are there instructions anywhere?

 

If the ADF is not getting set correctly it is because of an error in another part, somewhere, not in these as they do't set anything. Nor do they appear to try to change anything, for that matter.

 

BTW next time you post code samples etc please use the little <> button above the editing area here with the code all selected so it wraps it in a selection box -- this keeps trhe formatting intact and makes it easier for me to save and use as a file.

 

[LATER]

 

Are the scripts you are using related to the ones downloadable from the User Contributions subforum here, in the thread "Setting FSX Radios, OBSs and the Autopilot Using the Keyboard Numberpad"? If so then yours looks out of date. Can you try the latest one there, less than a month old now?

 

Thanks,

Pete

Posted

Are the scripts you are using related to the ones downloadable from the User Contributions subforum here, in the thread "Setting FSX Radios, OBSs and the Autopilot Using the Keyboard Numberpad"? If so then yours looks out of date. Can you try the latest one there, less than a month old now?

 

I've now downloaded and installed the complete package from that thread, and tested it on COM and ADF radios, and it all works perfectly well. I am normally using FSUIPC 4.924 (to be released soon), but also specifically loaded the released version 4.923 with the same good results.

 

I also see nothing in any of these Lua scripts which would invoke anything changed between version 4.92 and 4.923. Most of the changes between those were only in the Installer itself, and the others are internal hook changes for P3Dv2 affecting things like wind smoothing and mouse macros.

 

There's also no apparent difference in any of the scripts which could account for two particular keys (. and 0) being treated any differently that the others (1-9), nor any differently between the different radios.

 

So, sorry, I can't help. Perhaps you need to update to the latest package in that User Contrinutions thread I mentioned?

 

Regards

Pete

Posted

Thanks Pete.....right on, I don't understand them.....surprised myself that I got this far...I will download the new one and report back.  Thanks for your help....the service is appreciated!

Henry. 

Posted

Just a quick note to Pete, thanks for the help, worked fine....back to normal.  I really feel bad to have troubled you......I guess my curiosity was, why did everything work but one, and because this was non commercial code, I didn't even think to look for an up date.  We all can be greatful that Pete is this dedicated to his product.  And, as a side note, the radio tuning is now expanded to include OBS tuning, and heading as well as a couple of other extras.  Works fine in P3d2

Henry

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.