Luke Kolin Posted Thursday at 01:31 PM Report Posted Thursday at 01:31 PM I am using a modified LVAR logging script with the ability to selectively include/exclude LVARs. It works fine in FSUIPC6 and below, but attempting to run in FSUIPC7 and MSFS gives me no data. I tried removing the ipc.display() line (I vaguely recall that may be unsupported in MSFS), but it doesn't log to the FSUIPC log and I see the script getting killed even though I don't trigger a LuaKill. Is there something obvious I am missing? Cheers FSUIPC7.log LogLVars.lua
John Dowson Posted Thursday at 02:02 PM Report Posted Thursday at 02:02 PM How are you starting this lua script? Can you also attach your FSUIPC7.ini please, and also another log file but with logging for Buttons & Keys activated as well as Lua Plugins. But why don't you use the lvar logging facilities provided in FSUIPC7? This will log to the log file and optionally also to an ext window. See the section Logging Lvar Updates in page 48 of the Advanced User guide. 22 minutes ago, Luke Kolin said: I tried removing the ipc.display() line (I vaguely recall that may be unsupported in MSFS) Yes, the simconnect display facilities are not available in MSFS.
Luke Kolin Posted Friday at 01:37 PM Author Report Posted Friday at 01:37 PM 23 hours ago, John Dowson said: But why don't you use the lvar logging facilities provided in FSUIPC7? This will log to the log file and optionally also to an ext window. See the section Logging Lvar Updates in page 48 of the Advanced User guide. I had forgotten about that, but I would strongly urge an enhancement to this functionality - the modification that I made to Pete's original Lua script was to add optional filter substrings so I could automatically include and exclude LVARs based on name. This would avoid a fair bit of work adding entries to the INI file one LVAR at a time. I'm attaching my FSUIPC7 log the second time around. It appears that Lua execution is very, very very slow. I terminated the sim before the script did a single execution to completion. Cheers FSUIPC7.log
John Dowson Posted Friday at 02:00 PM Report Posted Friday at 02:00 PM 31 minutes ago, Luke Kolin said: I would strongly urge an enhancement to this functionality - the modification that I made to Pete's original Lua script was to add optional filter substrings so I could automatically include and exclude LVARs based on name. This would avoid a fair bit of work adding entries to the INI file one LVAR at a time. This would only be useful for a handful of users and is not something I will look into, sorry - I have far too much to do this year already. It is pretty quick and easy to cut and paste the lvar names from the log, so that will have to suffice for now. 31 minutes ago, Luke Kolin said: I'm attaching my FSUIPC7 log the second time around. So the lua isn't being killed? What changed? 31 minutes ago, Luke Kolin said: I terminated the sim before the script did a single execution to completion. Can you leave it running please, at least to see if it works or gets killed - that is if you want me to look into this. 31 minutes ago, Luke Kolin said: It appears that Lua execution is very, very very slow. Yes, this has been reported in several other threads. Note that: 1. Debugging lua plugins will make them run far far slower. 2. It seems that lua scripts run a lot slower (by a factor of 8 or so) when FSUIPC7 is started by MSFS. Try exiting FSUIPC7 and re-starting manually. 3. You can usually get better performance from lua scripts by using the LuaAffinityMask ini parameter to move lua execution off of core 0/1. This also applies to FSUIPC using ThreadAffinityMask. I use: ThreadAffinityMask=xFC LuaAffinityMask=x100F00 But there are online tools to calculate affinity masks based upon the number of cores you have (and if you use hyperthreading) Regards, John
Luke Kolin Posted Saturday at 12:41 PM Author Report Posted Saturday at 12:41 PM I'm enclosing a log. I started FSUIPC7 separately, after MSFS was running It looks like the first iteration through the loop was exponentially slower. I'm going to take out the debug options and see if it gets killed again, if not I'll chalk it up to the ipc.display call. Cheers FSUIPC7.zip
Luke Kolin Posted Saturday at 01:46 PM Author Report Posted Saturday at 01:46 PM It looks like turning off LUA debugging kills it. Maybe a race condition? I'll add more logging later today. Cheers
John Dowson Posted Saturday at 02:23 PM Report Posted Saturday at 02:23 PM Please attach your ini with the logs, as already requested. Please update if you find anything, but this is very low priority (for me!) and I just don't have time to look at this in detail at the moment as I have far to much to do. I will investigate further when time permits, maybe in a few weeks time... John
John Dowson Posted Sunday at 10:20 AM Report Posted Sunday at 10:20 AM One other suggestion: rather than scanning and storing lvar values, why don't you use the event.Lvar function and get a callback when the lvar value changes? I suspect that would be a lot more efficient...
John Dowson Posted Monday at 12:47 PM Report Posted Monday at 12:47 PM Just took a look at the lua script and it is incredibly inefficient.... Why are toy loading all lvars, and then checking for matches in the scanLVARS function? It would be so much more efficient if you: 1. Did the check on your matches and exclusions when you load the lvars. You can store matching lvars in a table if you like but this really isn't needed. 2. When you get get a match, simply add an event on that lvar which will get called when the lvar value changes 3. Log the lvar value change in the event.lvar callback I suspect that that the script was previously being killed because it is either running out of memory, but more likely it is taking far too long and you are restarting the script (by pressing the key again) and the currently running script is being killed (logging should show this!).
John Dowson Posted Monday at 02:34 PM Report Posted Monday at 02:34 PM @Luke Kolin Please see the attached script. Note that with 4423 lvars available, this takes 69 seconds for the initial scan of all the lvars, and is the same when FSUIPC is auto-started or manually started. There were no fundamental changes to the lua interface in FSUIPC7, just some additional functions were added (and access to lvars changed), so I don't understand why lua runs so much slower in FSUIPC7. I will look into this again when time permits. John LogLVars.lua
John Dowson Posted 15 hours ago Report Posted 15 hours ago @Luke Kolin Here's another version that also logs to an Ext window. This takes 10 seconds to initialise with 528 lvars. John LogLVars.lua
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