FlyingCoder Posted September 3, 2022 Report Posted September 3, 2022 (edited) *** Moved to .Net dll client sub-forum *** Hi, I am currently making my own C# winform application and i cant seem to get the readLvar to be working. I am trying to read the passengers boarding from the GSX pro for MSFS. This is my code. FSUIPCConnection.Process(); myTextbox.Text = FSUIPCConnection.ReadLVar("L:FSDT_GSX_NUMPASSENGERS_BOARDING_TOTAL").ToString(); Console.WriteLine("Reading passengers on board from GSX " + " - " + FSUIPC.FSUIPCConnection.ReadLVar("L:FSDT_GSX_NUMPASSENGERS_BOARDING_TOTAL")); Data will be 0 and i dont know why. Am i missing something? Using the latest FSUIPC 7. I have the FSUIPC_lvar installed in the ocmmunity folder. I hope to get some guidance here. thanks Edited September 4, 2022 by John Dowson Moved to .Net client dll sub-forum
John Dowson Posted September 4, 2022 Report Posted September 4, 2022 I have moved your post to Paul's .Net client sub-forum, but if an lvar doesn't exist it may be due to the lvar scan performed by the WASM was done before the lvar was created/available. If this is the case, you can adjust the WASM ini parameter LvarScanDelay, or call the reload function to get the WASM to rescan for lvars.
Paul Henty Posted September 7, 2022 Report Posted September 7, 2022 When you get 0 back it usually means the LVar doesn't exist. Please see John's advice above. Alternatively, if this is a new application you might consider using the new MSFSVariableServices class. It's much faster than the ReadLVar() method, although it's a bit more complicated to use. One advantage is that it has an event that tells you when the LVars have been scanned and are ready to use. See this post for details: https://forum.simflight.com/topic/92372-added-support-for-lvarshvars-access-in-msfs-via-john-dowsons-wasm-module/ Or download the MSFSVariableServices example application from the website: http://fsuipc.paulhenty.com/#downloads Paul
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