Guido Posted August 13, 2012 Report Posted August 13, 2012 Hi I am new to LUA and below is my first simple program. It should test several 737NGX annunciation flags to control the LEDs of the second RP48. A simple RP48 LED flash test program did work. But I fight with the offsets. I did set the EnableDataBroadcast=1 and tested the Re-simconnect trick but nothing flashs. I am getting out of ideas what to do next. I appreciate your support very much. My LUA script: --Begin model = GFRP48 -- GoFlight model number unit = 1 -- Sets the Variable Device "unit" to GFRP48 174: 0; 175: 1? MCLED = 0 -- Init LED Numbers APLED = 1 ATLED = 2 FMCLED = 3 -- Function Master Cautionto light on/off function MasterCaution(offset,value) if value ~= 0 then gfd.SetLight(model,unit,MCLED) -- Turn RP48 2 MCLED ON else gfd.ClearLight(model,unit,MCLED) -- Turn RP48 2 MCLED OFF end end -- Function AP Cautionto light on/off function APCaution(offset,value) if value ~= 0 then gfd.SetLight(model,unit,APLED) -- Turn RP48 2 APLED ON else gfd.ClearLight(model,unit,APLED) -- Turn RP48 2 APLED OFF end end -- Function AT Cautionto light on/off function ATCaution(offset,value) if value ~= 0 then gfd.SetLight(model,unit,ATLED) -- Turn RP48 3 ATLED ON else gfd.ClearLight(model,unit,ATLED) -- Turn RP48 3 ATLED OFF end end -- Function FMC Cautionto light on/off function FMCCaution(offset,value) if value ~= 0 then gfd.SetLight(model,unit,FMCLED) -- Turn RP48 2 FMCLED ON else gfd.ClearLight(model,unit,FMCLED) -- Turn RP48 2 FMCLED OFF end end -- Main program gfd.SetBright(model, unit, 15) -- Sets the Brightness of Unit#1 on the GFP8 to 15 (full). event.offset(0x6506, "UW","MasterCaution") event.offset(0x6550, "UW","APCaution") event.offset(0x6552, "UW","ATCaution") event.offset(0x6554, "UW","FMCCaution") --END Thank you for help and bregards Guido
Guido Posted August 16, 2012 Author Report Posted August 16, 2012 Hi The problem is solved. I deleted FSUIPC.ini, rebuild and copy-past it. Now it works as expected. Thanks Guido
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now