Jump to content
The simFlight Network Forums

Avi

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by Avi

  1. got it to work cleanly now :) public double GetHSIBank() { byte[] HSI = {0, 0, 0, 0, 0, 0, 0, 0}; double HSID = 0; token = 0; dwResult = 0; result = f.FSUIPC_Read(0x2f78, 8, ref token, ref dwResult); result = f.FSUIPC_Process(ref dwResult); result = f.FSUIPC_Get(ref token, 8, ref HSI); //TODO: Error handling HSID = System.BitConverter.ToDouble(HSI, 0); return HSID; } Quite simple, reading the data into a byte array and converting it to double.
  2. alright, thanks for the hints, I will take a look into it and report back with my findings tomorrow :)
  3. thanks for taking your time pete, as far as I understand, there's no overload of FSUIPC_Get() in the C# SDK that supports ref double, so would it be a better idea to read it into a byte[8] array and converting it to a double?
  4. Hello, this is my first post in this forum, but from what i've seen before, it seems like a nice place to be.. However, I'm experimenting with FSUIPC and C# to get it to export values from the Artificial Horizontal to a C# program, and this is what I've got: public double GetHSIBank() { token = 0; dwResult = 0; dwOffset = 0x2F78; dwSize = 8; result = f.FSUIPC_Read(dwOffset, dwSize, ref token, ref dwResult); //TODO: Error handling result = f.FSUIPC_Process(ref dwResult); //TODO: Error handling result = f.FSUIPC_Get(ref token, ref dwResult); //TODO: Error handling return dwResult; } With this code I get strange values like 1443357819 and such. I know the code shouldn't work either, since it's a 8 bit float value being stored into an int, (It's a total ripoff of the ASI example), but I can't just figure out the right way to do it. If someone gave me a hint/sample on how it's supposed to be done it would be a lot of help. Thanks in advance.[/code]
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.