March 22, 201214 yr Hi.I'm trying to create some LUA code for the Wilco Embraer 170 that toggles the Engines on/off. I have obtained the Lvars from the LINDA tracer, however the Lvars for the engines do not appear to read or write.The code I have is as follows for Engine 1:function Engine1_Toggle () buffer = ipc.readLvar("L:EmbStarterL") if buffer == 0 then ipc.writeLvar("L:EmbStarterLCover", 1) ipc.writeLvar("L:EmbStarterL", 2) ipc.writeLvar("L:EmbStarterL", 1) ipc.control(66300, 0) ipc.control(65983, 0) ipc.control(66363, 0) ipc.writeLvar("L:EmbStarterCover", 0) else ipc.writeLvar("L:EmbStarterLCover", 1) ipc.writeLvar("L:EmbStarterL", 0) ipc.control(65987, 0) ipc.control(66363, 0) ipc.writeLvar("L:EmbStarterLCover", 0) endendThe ipc.controls I have included in the code work fine. Does anybody know the reason why the Lvars won't read or write?On occasion the starter knob on the panel will flicker back and forth, but nothing happens.Any help would be appreciated.Regards,Chris
March 23, 201214 yr Hi Chris,I do not have the Wilco EMB's so I'm just guessing.What happens, if you trace e.g. EmbStarterLCover?You click the cover in the VC and the LINDA Tracer gives you this LUA back? But no numbers (parameters)?Have you tried to test the Lvars with the LINDA tracer (set value and toggle it)?(just to be sure there's no issue with your code)And inserted as aparemters not just 0 and 1, but also 0 and 100?However, every developer is different and to get a Lvar does not mean, that everything is fine unfortunately ... Guenter Steiner -------------------------------------------------------------------------------------- Betatester for: A2A, LORBY, FSR-Pillow Tester --------------------------------------------------------------------------------------
March 23, 201214 yr Author Thanks for the reply Guenter and the suggestion of using the Tracer to toggle parameters. I also found I was using some of the wrong Lvars to do the job!I've got it working with the following code:function Engine1_Toggle () buffer = ipc.readLvar("L:EmbStarterL") if buffer == 0 then ipc.writeLvar("L:EmbStarterLCoverClick", 1) ipc.writeLvar("L:EmbStarterLClick", 1) ipc.writeLvar("L:EmbStarterLClick", 1) ipc.sleep(1250) ipc.writeLvar("L:EmbStarterLCoverClick", -1) else ipc.writeLvar("L:EmbStarterLCoverClick", 1) ipc.writeLvar("L:EmbStarterLClick", -1) ipc.sleep(1250) ipc.writeLvar("L:EmbStarterLCoverClick", -1) endendCheers,Chris
Create an account or sign in to comment