Panel Lights LVar Help please

Post any technical issues here. This forum gets priority from our staff.
new reply
User avatar
WB_FlashOver
Technical Sergeant
Posts: 946
Joined: 10 Jun 2012, 18:23
Location: (S05) U.S.A.
Contact:

Panel Lights LVar Help please

Post by WB_FlashOver »

Hello all,
I just purchased the Spit for P3Dv4 and I'm getting the controls set up through LINDA.

My trouble is with the Panel lights. I can use the Default "Lights Panel Toggle" from FSX/P3D through LINDA but this turns on both Cabin Lights and Panel Spot Light. I'm looking for commands to switch them separately. The spot light Lvar is Lamp1State and the cabin light Lvar is Lamp2State but these do not work. Sometimes the switch will twitch but nothing more. Can someone help me with this?

I'm finding that in Win 10 Pro with the last few Windows updates some of the old command style functions are finicky and require and different style. I have had to update my commands in several aircraft, especially when it comes to variable commands to twist knobs/move levers from 0-100 or -50 to +50 incrementally.

FYI
I was able to write the Spit commands for the dash spot light movement up/down & left/right. Just in case someone else is interested I'll post them.


Dash Spot Light Movement

Code: Select all

function FO_Spot_RIGHT ()

	Def = "L:Lamp1AdjustFA"
	Var = ipc.readLvar(Def)
    	if Var < 100 then
	Var = Var + 2
	ipc.sleep(1)
	end
	ipc.writeLvar(Def, Var)
end


function FO_Spot_LEFT ()

	Def = "L:Lamp1AdjustFA"
	Var = ipc.readLvar(Def)
    	if Var > 0 then
	Var = Var - 2
	ipc.sleep(1)
	end
	ipc.writeLvar(Def, Var)
end

function FO_Spot_Arm_UP ()

	Def = "L:Lamp1AdjustLR"
	Var = ipc.readLvar(Def)
    	if Var < 100 then
	Var = Var + 2
	ipc.sleep(1)
	end
	ipc.writeLvar(Def, Var)
end


function FO_Spot_Arm_DN ()

	Def = "L:Lamp1AdjustLR"
	Var = ipc.readLvar(Def)
    	if Var > 0 then
	Var = Var - 2
	ipc.sleep(1)
	end
	ipc.writeLvar(Def, Var)
end
These can possibly be cleaner than what I have but they work.
-- Fly Well, Be Nice, Have Fun ! ! !

Z390 FTW | i9 9900K @ 5.2 | 32GB 3333 CL14 | 3080 Ti FE
970 Pro 512GB (OS)| 970 Evo 1TB | 850 Evo 500GBx2 Raid0
3TB HDD | Define S2 | EKWB Dual Loop


P51civ - T6 - P40 - B17 - B377 - L049 - Comanche - Spit - Bonanza

User avatar
WB_FlashOver
Technical Sergeant
Posts: 946
Joined: 10 Jun 2012, 18:23
Location: (S05) U.S.A.
Contact:

Re: Panel Lights LVar Help please

Post by WB_FlashOver »

Sorry, I was also going to post the Oxy Alt Set commands I wrote. The ones from LINDA Spit module v1.9 don't work anymore.

Code: Select all

function FO_Oxy_Alt_INC ()

	LVarSet = "L:OxyAltSetValve"

 	LvarVar = ipc.readLvar(LVarSet)
	if LvarVar <= 99 then
 	val = LvarVar + 1
	elseif LvarVar == 100 then
 	val = 100
	end
	ipc.writeLvar("L:OxyAltSetValve", val)
--    DspShow ()
end

function FO_Oxy_Alt_DEC ()

	LVarSet = "L:OxyAltSetValve"

 	LvarVar = ipc.readLvar(LVarSet)
	if LvarVar >= 1 then
 	val = LvarVar - 1
	elseif LvarVar == 0 then
 	val = 0
	end

	ipc.writeLvar("L:OxyAltSetValve", val)
--    DspShow ()
end
-- Fly Well, Be Nice, Have Fun ! ! !

Z390 FTW | i9 9900K @ 5.2 | 32GB 3333 CL14 | 3080 Ti FE
970 Pro 512GB (OS)| 970 Evo 1TB | 850 Evo 500GBx2 Raid0
3TB HDD | Define S2 | EKWB Dual Loop


P51civ - T6 - P40 - B17 - B377 - L049 - Comanche - Spit - Bonanza

User avatar
WB_FlashOver
Technical Sergeant
Posts: 946
Joined: 10 Jun 2012, 18:23
Location: (S05) U.S.A.
Contact:

Re: Panel Lights LVar Help please

Post by WB_FlashOver »

Cancel Whopper... I just figured out the Spot and Cabin lights. I had to add the default sim control to the works. These work independently of each other and work fine. 8)

Code: Select all

function Spot_Lamp_Toggle ()
    if ipc.readLvar("L:Lamp1State") == 0 then
    ipc.control(66056)
    ipc.writeLvar("L:Lamp1State", 1)
    else
    ipc.control(66057)
    ipc.writeLvar("L:Lamp1State", 0)
    end
end

function Cabin_Lamp_Toggle ()
    if ipc.readLvar("L:Lamp2State") == 0 then
    ipc.control(66056)
    ipc.writeLvar("L:Lamp2State", 1)
    else
    ipc.control(66057)
    ipc.writeLvar("L:Lamp2State", 0)
    end
end
-- Fly Well, Be Nice, Have Fun ! ! !

Z390 FTW | i9 9900K @ 5.2 | 32GB 3333 CL14 | 3080 Ti FE
970 Pro 512GB (OS)| 970 Evo 1TB | 850 Evo 500GBx2 Raid0
3TB HDD | Define S2 | EKWB Dual Loop


P51civ - T6 - P40 - B17 - B377 - L049 - Comanche - Spit - Bonanza

new reply

Return to “Spitfire MkI/II Tech Support”

Who is online

Users browsing this forum: No registered users and 12 guests