High-Octane Posted February 25, 2004 Report Posted February 25, 2004 Perhaps, anyone here can help me out for clarfication on Calcluations, not only that, but a proper way implementing code lanuage on calculations. I spend the whole day trying to figure it out and not one :evil: DARN :evil: thing has gone through my head yet. One example: Offset=02CC User=Whiskey Compass BitSize=8 I believe double float has something to do with 64-bit integers, and Visual Basic 6 probably not be able to compile itt, However, from my understanding... I would need to spilt it seprately into 32-bit if I am correct. So from my assumpuation it means I calcuate : 360.0/(65536.0*65536.0) =83.8 something 270.0/(65536.0*65536.0)=213,8 something 180.0/(65536.0*65536.0)=41.9 something 90.0/(65536.0*65536.0)=20.9 some Language implement I assume: If FSUIPC_Read(&H2CC, 8, VarPtr(Compass),dwResult) Then If FSUIPC_Process(dwResult) Then lblCmp.caption = Format (Compass,(dHi), 360.0/(65536.0*65536.0) (Compass,(dHi), 270.0/(65536.0*65536.0) (Compass,(dLo), 180.0/(65536.0*65536.0) (Compass, (dLo), 90.0/(65536.0*65536.0) Did I calculate it right? How about implementing? If not, a better claification from you would be appreicated. One more thing, are there any Offset values for Altitude (not in slew or pause state) for FS2002???
Indagroove Posted February 25, 2004 Report Posted February 25, 2004 Well, in the VB SDK it states that VB does not do 64 bit info. BUT you can cheat it. Use a Currency variable for Floating 64 Then use that Fake64Bit and do your calculations with doubles to prevent overflows.... A = Fake64Bit A = 360# / (65536.0#*65536.0#) The # forces the double. Without it you will get overflow errors Mike
Pete Dowson Posted March 12, 2004 Report Posted March 12, 2004 Sorry for the delay in replying -- I've been on holiday with no Internet access. I'm just trying to catch up with an enormous backlog now! Offset=02CC User=Whiskey Compass BitSize=8 I believe double float has something to do with 64-bit integers, and Visual Basic 6 probably not be able to compile itt "double" floats are the standard floating point format on Intel processors and are, as far as I know, universally supported. They are most certainly not 64-bit integers which are hardly supported by anything. You should be able to just read the 8 bytes directly into a standard floating point varaible, whatever they are called in Visual Basic! In the reply you got from Mike this seems to provide the answer: "Use a Currency variable for Floating 64". Regards, Pete
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