Jump to content
Sign in to follow this  
felixthreeone

Duke B60 landing lights mod?

Recommended Posts

Hello,

 

I was wondering if anyone can help me with this; I noticed the other day while flying the realair Duke B60 that when I switch on the landing light on my saitek switch panel, only the left landing light illuminates. In the VC, there are 2 switches for the landing lights; one for the left side and one for the right side. Is there any way to have them 'connected' so that when i flip the switch both landing lights illuminate at the same time? If not, I can just keep doing it the way I have been by switching on the second light in the VC....thanks in advance!

Share this post


Link to post
Share on other sites

If you have FSUIPC, you can do it direct with a Lua script, or I'm sure you can use the free facility called LINDA. As for me, I wanted to do the same thing just last week, so here is the Lua script I made for that (includes logic to manipulate all the lights with any button (as a toggle), including the three position lights and also the cowl flaps. Note that some of the code is a straight cut and paste from existing Lua scripts freely available, so if it looks stylistically similar to other Lua scripts you've seen, you're right, it is! :P

 

Note that I use a slightly different script for the Turbine Duke, since its lights have different switches.

-- parameter number
--1 = Cowl flap Left Decrease
--2 = Cowl flap Left Increase
--3 = Toggle Cockpit Lights
--4 = Toggle Landing Lights
--5 = Toggle Nav Lights
--6 = Toggle Beacon Lights
--7 = Toggle Strobe (AND Nav) Lights
--8 = Toggle Recognition (AND Beacon) Lights
--9 = Toggle Taxi Lights
--10 = Toggle Instrument Panel Lights
--11 = Cowl Flap Right Decrease
--12 = Cowl Flap Right Increase

--For certain 3 position light switches, and the logic of my panel, I had to use
--both ipc.control and also ipcWrite in order to make it work. I don't know why
--I couldn't just read the switch and set the switch, but it didn't work that way
--Note that some portions of this script are cut and pastes from existing scripts made by others



-- Cowl flap_L switch decrease flaps--close
if ipcPARAM == 1 then
 if ipc.readLvar("L:Duke_Cowl_Flaps_Switch_1") == 2 then --they are fully open, so half open
 ipc.writeLvar("L:Duke_Cowl_Flaps_Switch_1", 1)
 ipc.sleep(500)

else -- they are either half open or closed, so close

 ipc.writeLvar("L:Duke_Cowl_Flaps_Switch_1", 0)
 ipc.sleep(500)
 end


-- Cowl flap_L switch increase flaps--open
elseif ipcPARAM == 2 then
if ipc.readLvar("L:Duke_Cowl_Flaps_Switch_1") == 0 then --they are closed , so half open
 ipc.writeLvar("L:Duke_Cowl_Flaps_Switch_1", 1)
 ipc.sleep(500)

else -- they are either half open or open, so open

 ipc.writeLvar("L:Duke_Cowl_Flaps_Switch_1", 2)
 ipc.sleep(500)
 end

-- Main Cockpit Lights toggle
elseif ipcPARAM == 3 then	

 ipc.control(66579)
ipc.sleep(500)

-- Toggle Landing Lights
elseif ipcPARAM == 4 then
 ipc.control(66376) --right
 ipc.control(65751) --left
ipc.sleep(500)
-- Toggle Nav Lights
elseif ipcPARAM == 5 then
if ipc.readLvar("L:Switch_Duke_Nav_Lights")== 1 then
	 ipc.control(66379)
	 ipc.writeLvar("L:Switch_Duke_Nav_Lights",0)
elseif ipc.readLvar("L:Switch_Duke_Nav_Lights")== 2 then --strobes and navs
 ipc.control(65560) --toggle strobes off
 ipc.writeLvar("L:Switch_Duke_Nav_Lights",1)
ipc.sleep(250)
ipc.writeLvar("L:Switch_Duke_Nav_Lights",0)
ipc.sleep(500)
else --switch is already on, so just turn off
 ipc.control(66379)
 ipc.writeLvar("L:Switch_Duke_Nav_Lights",1)
ipc.sleep(500)
end



-- Toggle Beacon Lights
elseif ipcPARAM == 6 then
 if ipc.readLvar("L:Switch_Duke_Beacon_Light") == 1 then --switch off, turn beacon on
 ipc.control(66239)
ipc.writeLvar("L:Switch_Duke_Beacon_Light", 0)
ipc.sleep(500)
 elseif ipc.readLvar("L:Switch_Duke_Beacon_Light") == 2 then --beacons and recognition light both on
ipc.control(66377) -- toggle off recognition lights, but leave beacon on
ipc.writeLvar("L:Switch_Duke_Beacon_Light",1) --move switch to the one position
ipc.sleep(250)
ipc.writeLvar("L:Switch_Duke_Beacon_Light",1) --move switch to the beacon only 0 position
ipc.sleep(250)
else --switch is already on, just turn off
ipc.control(66239)
ipc.writeLvar("L:Switch_Duke_Beacon_Light", 1)
ipc.sleep(500)
end

-- Toggle Nav and Strobe Lights
elseif ipcPARAM == 7 then
 if ipc.readLvar("L:Switch_Duke_Nav_Lights")== 1 then
-- if switch off, then turn both strobes and navs on
ipc.control(65560)
 ipc.control(66379)
ipc.writeLvar("L:Switch_Duke_Nav_Lights",2)
ipc.sleep(500)

elseif (ipc.readLvar("L:Switch_Duke_Nav_Lights") == 0) then
ipc.writeLvar("L:Switch_Duke_Nav_Lights",1)
ipc.sleep(250)
ipc.control(65560) --toggle strobe on, leave nav on
ipc.writeLvar("L:Switch_Duke_Nav_Lights",2)


ipc.sleep(500)
else --Already at strobe and nav position, so just toggle for off
ipc.control(65560)
ipc.control(66379)
ipc.writeLvar("L:Switch_Duke_Nav_Lights",1)
ipc.sleep(500)
end

-- Toggle Beacon and Recognition Lights
elseif ipcPARAM == 8 then
	 if ipc.readLvar("L:Switch_Duke_Beacon_Light") == 1 then --both beacon and recognition lights off
	 ipc.control(66239)
	 ipc.control(66377)
 ipc.writeLvar("L:Switch_Duke_Beacon_Light", 2)
 ipc.sleep(500)
elseif ipc.readLvar("L:Switch_Duke_Beacon_Light") == 0 then --switch has beacon already on
 ipc.writeLvar("L:Switch_Duke_Beacon_Light", 1) --move switch to off
 ipc.sleep(250)
 ipc.control(66377) --switch on recognition, leave beacon on
 ipc.writeLvar("L:Switch_Duke_Beacon_Light", 2) --move switch to beacon and recognition
 ipc.sleep(250)
else -- beacon and recognition already on, toggle off and return switch to pos 1
 ipc.control(66239)
	 ipc.control(66377)
 ipc.writeLvar("L:Switch_Duke_Beacon_Light", 1)
 ipc.sleep(500)
end
elseif ipcPARAM == 9 then --toggle taxi lights
 ipc.control(66240)
 ipc.sleep(500)

-- Toggle Instrument Panel Lights
elseif ipcPARAM == 10 then --Toggle Instrument Panel Lights
 ipc.control(65750) --mapped to wing lights


elseif ipcPARAM == 11 then
 if ipc.readLvar("L:Duke_Cowl_Flaps_Switch_2") == 2 then --they are fully open, so half open
 ipc.writeLvar("L:Duke_Cowl_Flaps_Switch_2", 1)
 ipc.sleep(500)

else -- they are either half open or closed, so close

 ipc.writeLvar("L:Duke_Cowl_Flaps_Switch_2", 0)
 ipc.sleep(500)
 end


-- Cowl flap_R switch increase flaps--open
elseif ipcPARAM == 12 then
if ipc.readLvar("L:Duke_Cowl_Flaps_Switch_2") == 0 then --they are closed , so half open
 ipc.writeLvar("L:Duke_Cowl_Flaps_Switch_2", 1)
 ipc.sleep(500)

else -- they are either half open or open, so open

 ipc.writeLvar("L:Duke_Cowl_Flaps_Switch_2", 2)
 ipc.sleep(500)
 end
end

 

Probably a little bit different and perhaps more than you were asking for, but I still hope this helps--if not than maybe others can use it--Just cut and paste the contents of this into a file called something like DukeControls.lua, stick it in your Modules folder (so that Fsuipc can see it), and then assign with the appropriate parameter as necessary on the FSUIPC button press screen.

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...