air3b Posted April 15, 2013 Report Posted April 15, 2013 Hello, I'm training for a futur FsDevelopment using mingw32 as compiler (IDE : CodeBlocks) FSUIPC_Read(0x0366, 2, &g, &dwResult);FSUIPC_Process(&dwResult);[/CODE]I read the offset 0x0366 to know if the aircraft is on the ground or not but the value returned is random (it doesn't return value so)I use other offset like aircraft altitude, IAS, TAS, etc... but this one does'nt work...Thank you for answer ;)Air3b
Pete Dowson Posted April 15, 2013 Report Posted April 15, 2013 FSUIPC_Read(0x0366, 2, &g, &dwResult);FSUIPC_Process(&dwResult);[/CODE]I do hope you aren't doing a Process call for each and every offset you want to read? You should group them all and do one Process at regular intervals.I read the offset 0x0366 to know if the aircraft is on the ground or not but the value returned is random (it doesn't return value so)I use other offset like aircraft altitude, IAS, TAS, etc... but this one does'nt work... It works fine. Check it with FSUIPC logging or with FSInterogate. You don't show how you've defined "g", maybe you are interpreting it incorrectly due to a bad declaration?Note that it isn't updated in slew mode (as documented), but it is either 0 or 1.RegardsPete
cellular55 Posted April 16, 2013 Report Posted April 16, 2013 Hi Peter, reading this post i put attention to your comment: 'I do hope you aren't doing a Process call for each and every offset you want to read'. As I have written a program doing several reads and writes with 'process' calls for each one, I would understand which are the risks here and the benefits I could get modyfing the calls as you are suggesting. Thanks ain advance and best regards Joe
Pete Dowson Posted April 16, 2013 Report Posted April 16, 2013 As I have written a program doing several reads and writes with 'process' calls for each one, I would understand which are the risks here and the benefits I could get modyfing the calls as you are suggesting. The whole point of separating the processing of the requests from the actual individual read and write is to allow many reads and writes to be accumulated for processing all at once. The actual read/write calls merely add a request to a list inside your own program. Every Process call involved a Process Switch, with FS being interrupted so that FSUIPC can process the list of requests -- whilst this happens your program is frozen. What you are doing works, but it is extremely inefficient. It slows FS down and it cripples your own program's performance. If you are writing the program only for your own use and are happy with the results, then it isn't a worry. But it makes things look worse than they should be. Regards Pete
cellular55 Posted April 16, 2013 Report Posted April 16, 2013 Hi Peter, thanks a lot for your prompt answer... highly useful as always. I will update my program as suggested, effectively, even if not so visible running FSX, I had some suspect in term of efficiency considering the high number of read/write that i separately do Best regards Joe
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