Bendix KN62A, KR 87 and KX155

Questions about deployment and use of Air Manager Instruments

Moderators: russ, Ralph

Message
Author
Daryn
Posts: 3
Joined: Sat Nov 25, 2023 3:32 am

Re: Bendix KN62A, KR 87 and KX155

#51 Post by Daryn »

I am trying to build the KR87 ADF and the KN 62A DME as hardware instruments in air manager. They look Exactly like the images posted by dfly (And I would like them to function the same/realistically) I don't understand how dfly build or coded these panels? doesn't seem like they are instruments in air manager?

Looking at what dfly posted on the a2a forums (https://a2asimulations.com/forum/viewto ... 07&t=71594), these are exactly what I would like to build, but for the generic C172 and in air manager.

has anybody seen or built hardware functions for an ADF and DME in airmanager???

Please could somebody help out with this before I go crazy?
regards,
Daryn

User avatar
Keith Baxter
Posts: 4685
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Bendix KN62A, KR 87 and KX155

#52 Post by Keith Baxter »

Hi,

Hi I will do a XP version. if you want for MS2020 then you are going to have ask someone to convert for you
I will do the KR87 ADF for you as it is a quick and simple instrument to do.

You can then see how it is done so that you can do the rest.

Note the Cessna only has 3 push buttons working so only those datarefs are available for the Cessna.

I will see what I can do for the flight time but I do not promos


Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

User avatar
Keith Baxter
Posts: 4685
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Bendix KN62A, KR 87 and KX155

#53 Post by Keith Baxter »

Hi,

OK I have done this quickly for XP11 and 12

NOTE I USE THE TM1637 because the displays are a bit far apart for a NAX7219. Make sure you purchase the TM1637 "NON CLOCK" version.

The FS2020 might not work need someone with MS2020 to assist you there.

Code: Select all

---------------Cessna C172  KR87 ADF -------------------

gen_power_xp = 0
av_power_xp  = 0
adf_power_xp = 0
act_digits   = "0200"
syby_digits  = "0200"

--Switches
--Power Switch
hw_switch_add("Power Switch",function(pos)
   gen_power_xp = pos
   xpl_dataref_write("sim/cockpit2/radios/actuators/adf1_power", "INT", gen_power_xp)
end)

---LED's
ant_led        = hw_led_add("ANT LED Display", 0)
adf_led        = hw_led_add("ADF LED Display", 0)
bfo_led        = hw_led_add("BFO LED Display", 0)

---Displays
active_chr = hw_chr_display_add("Active Display", "TM1637", 4)
stby_chr   = hw_chr_display_add("StandBy Display", "TM1637", 4)

--Dials
--Big Dial
hw_dial_add("Big Dial",function(direction)
   if adf_power_xp ~= 0 then
      if direction == 1 then
          xpl_command("sim/radios/stby_adf1_hundreds_thous_up")
          fs2020_event("ADF_100_INC")
      elseif direction == -1 then
          xpl_command("sim/radios/stby_adf1_hundreds_thous_down")
          fs2020_event("ADF_100_DEC")
      end
   end
end)
--Small Dial
hw_dial_add("Small Dial",function(direction)
   if adf_power_xp ~= 0 then
      if direction == 1 then
          xpl_command("sim/radios/stby_adf1_ones_tens_up")
          fs2020_event("ADF1_WHOLE_INC")
      elseif direction == -1 then
          xpl_command("sim/radios/stby_adf1_ones_tens_down")
          fs2020_event("ADF1_WHOLE_DEC")
      end
   end
end)

--Push Buttons
--ADF Button
hw_button_add("ADF button",function()
   if adf_power_xp == 1 then
       xpl_dataref_write("sim/cockpit2/radios/actuators/adf1_power", "INT", 2)
   elseif adf_power_xp == 2 then
       xpl_dataref_write("sim/cockpit2/radios/actuators/adf1_power", "INT", 1)
   end
   fs2020_event("H:adf_AntAdf")
end)
--BFO Button
hw_button_add("BFO button",function()
   if adf_power_xp == 3 then
       xpl_dataref_write("sim/cockpit2/radios/actuators/adf1_power", "INT", 2)
   elseif adf_power_xp >= 1 then
       xpl_dataref_write("sim/cockpit2/radios/actuators/adf1_power", "INT", 3)
   end
   fs2020_event("H:adf_bfo")
end)
--Flip Button
hw_button_add("Flip button",function()
   xpl_command("sim/radios/adf1_standy_flip")
   fs2020_event("ADF1_RADIO_SWAP")
end)

xpl_dataref_subscribe("sim/cockpit2/electrical/bus_volts", "FLOAT[6]",
                      "sim/cockpit2/switches/avionics_power_on", "INT",
                      "sim/cockpit2/radios/actuators/adf1_power", "INT",
                      "sim/cockpit/radios/adf1_freq_hz", "INT",
                      "sim/cockpit/radios/adf1_stdby_freq_hz", "INT", function(bus_volts, avionics, adf_power, adf_freq, adf_freq_stby)
   adf_power_xp = adf_power
   act_digits = adf_freq
   syby_digits = adf_freq_stby
   av_power_xp  = avionics

   if av_power_xp == 1 then
      hw_chr_display_set_text(active_chr,string.format("%04.0f",(act_digits)))
      hw_chr_display_set_text(stby_chr,string.format("%04.0f",(syby_digits)))
      hw_led_set(ant_led,adf_power_xp == 1)
      hw_led_set(adf_led,adf_power_xp >= 2)
      hw_led_set(bfo_led,adf_power_xp == 3)
   else
      hw_chr_display_set_text(active_chr,"    ")
      hw_chr_display_set_text(stby_chr,"    ")
      hw_led_set(ant_led,0)
      hw_led_set(adf_led,0)
      hw_led_set(bfo_led,0)
   end
end)
logic.lua
(3.15 KiB) Downloaded 23 times
Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

Post Reply