Ahmet Mehmetbeyoğlu Posted October 17, 2011 Report Posted October 17, 2011 Hi, I have a little problem. When I try to read the ambient wind speed offset 0x0E90 with C#, I get an imposible value. Do I have to convert it to something? Or am I doing something wrong? "private Offset<int> _ambientWindSpeed = new Offset<int>(0x0E90)"
Paul Henty Posted October 17, 2011 Report Posted October 17, 2011 private Offset<int> _ambientWindSpeed = new Offset<int>(0x0E90) Hi Ahmet, The FSUIPC SDK documentation says that this offset is 2 bytes long. You have declared the offset as an 'int' type, which in C# is a 4-byte integer. What you are getting is offset 0E90 AND 0E92 together in one value. That's why it's impossibly large. You need to declare the offset as a 2-Byte integer which in C# is the 'short' type: private Offset<short> _ambientWindSpeed = new Offset<short>(0x0E90) Please take some time to review the User Guide that comes with my DLL. It has a section called 'Registering your interest in an Offset' which includes a table showing which .NET types to use for all the different offset lengths and types. It's impossible to get meaningful data from FSUIPC if you don't understand offset lengths and their related data types. Paul
Ahmet Mehmetbeyoğlu Posted October 18, 2011 Author Report Posted October 18, 2011 Thanks to you Paul, I learned something new today.
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