Kees69 Posted March 4, 2024 Report Posted March 4, 2024 Hi, To light the LEDs in my home-built overhead for the 767, I write the values of the LVARs to a free FSUIPC offset. I do that in the following way: function checkOverhead() --Check lights overhead ipc.writeUB(0x4251, ipc.readLvar("L:O16_001_BUT")) ipc.writeUB(0x4252, ipc.readLvar("L:O16_001_LT2")) ipc.writeUB(0x4253, ipc.readLvar("L:O16_002_BUT")) ipc.writeUB(0x4254, ipc.readLvar("L:O16_002_LT2")) ipc.writeUB(0x4255, ipc.readLvar("L:O16_003_BUT")) ipc.writeUB(0x4256, ipc.readLvar("L:O16_003_LT2")) ipc.writeUB(0x4257, ipc.readLvar("L:O16_004_BUT")) end event.timer(100, "checkOverhead") However, the list is getting longer (almost 200 outputs/LEDs), so it sometimes takes a long time (1 to 2 seconds) before the script checks whether a light is on and then turns on the corresponding LED in my overhead. Is there a way to make this work faster? I am using Captain Sim 767, with P3D and FSUIPC6. Thanks! Kees
Paul Henty Posted March 7, 2024 Report Posted March 7, 2024 Hi Kees, This forum is for .NET programming; your questions seems to be about Lua so this isn't really the best place to get help with that. However, you'll probably get better performance by using the lua event system for LVars: event.Lvar("lvarname", interval, "function-name") This will call the specified function when the value of the LVar changes. That function can then set the value in the offset. I think this will reduce the processing from the current situation where you are reading the writing every LVAR every 100ms. I don't really know lua that well, so If you want more information about this, please ask John Downson in the main FSUIPC forum (not any of the sub-forums) at the link below. https://forum.simflight.com/forum/30-fsuipc-support-pete-dowson-modules/ Paul
Kees69 Posted March 8, 2024 Author Report Posted March 8, 2024 Hi Paul, Thanks for your reply. I only now realize that I actually posted the message in the wrong forum. I had seen this function before, but it would be quite a job, because I would have to program about 200 different functions (one for each output). I was hoping there would be an easier solution. I will also try it in John's forum. Thx, Kees
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