Re: Switching the PE Client to Mode C from the A/C xpndr
Posted: Tue Mar 05, 2019 3:24 am
Hello I am using Garmin G1000 with P3DV4 simulator. I couldnt able to switch to Mode Charlie and Ident function from the Garmin G1000. I tried adding 2 different LUA script file in the FSUIPC module also but still i am having issue. Below is the scripts I used. Please give some suggestions to fix the issue.
1st LUA Script
function CheckTransponderState(name, value)
if value == 2 then
ipc.control(1120,1)
ipc.display(" Mode Charlie Alt Pressed" , 5)
else
ipc.control(1119,1)
end
end
event.Lvar("G1000_XPDR_ON_ALT_Visible", 700, "CheckTransponderState")
and added below script in the FSUIPC.ini file
[Auto.F1tech Skyhawk 172R]
1=Lua GarminG1000
2nd LUA Script
function GarminG1000_OnXpdrModeChanged(varname, value)
if value == 4 then
if ipc.readUB(0x7b91) > 0 then
ipc.writeUB(0x7b91,0)
ipc.display("XPDR Mode C", 2)
end
else
if ipc.readUB(0x7b91) == 0 then
ipc.display("XPDR Mode Stdby", 2)
ipc.writeUB(0x7b91,1)
end
end
end
function GarminG1000_XpdrIdentPressed(varname, value)
local mode = ipc.readLvar("xpdr_onoff_knob_pos")
if mode >= 3 then
if value == 1 then
ipc.writeUB(0x7b93, 1)
ipc.display("XPDR IDENT", 1, 2)
end
end
end
event.Lvar("xpdr_onoff_knob_pos", 1000, "GarminG1000_OnXpdrModeChanged")
event.Lvar("xpdr_ident_button", 200, "GarminG1000_XpdrIdentPressed")
and added below script in the FSUIPC.ini file
[auto.GarminG1000_C182]
lua GarminG1000-XPDR
1st LUA Script
function CheckTransponderState(name, value)
if value == 2 then
ipc.control(1120,1)
ipc.display(" Mode Charlie Alt Pressed" , 5)
else
ipc.control(1119,1)
end
end
event.Lvar("G1000_XPDR_ON_ALT_Visible", 700, "CheckTransponderState")
and added below script in the FSUIPC.ini file
[Auto.F1tech Skyhawk 172R]
1=Lua GarminG1000
2nd LUA Script
function GarminG1000_OnXpdrModeChanged(varname, value)
if value == 4 then
if ipc.readUB(0x7b91) > 0 then
ipc.writeUB(0x7b91,0)
ipc.display("XPDR Mode C", 2)
end
else
if ipc.readUB(0x7b91) == 0 then
ipc.display("XPDR Mode Stdby", 2)
ipc.writeUB(0x7b91,1)
end
end
end
function GarminG1000_XpdrIdentPressed(varname, value)
local mode = ipc.readLvar("xpdr_onoff_knob_pos")
if mode >= 3 then
if value == 1 then
ipc.writeUB(0x7b93, 1)
ipc.display("XPDR IDENT", 1, 2)
end
end
end
event.Lvar("xpdr_onoff_knob_pos", 1000, "GarminG1000_OnXpdrModeChanged")
event.Lvar("xpdr_ident_button", 200, "GarminG1000_XpdrIdentPressed")
and added below script in the FSUIPC.ini file
[auto.GarminG1000_C182]
lua GarminG1000-XPDR