Results 1 to 4 of 4
Thread: Weird Offsets
-
09-13-2010, 04:22 PM #1
Weird Offsets
Hiya everyone,
I have, for my 767 Overhead, developed an IRS SIOC script which functions using both SIOC and the IOLCD.exe application (written for an LCD Display).
The script is designed to display my aircraft's current co-ordinates, GS, track, heading... etc
It is, for the most, 80% working. However, there are a few offsets that aren't working for me.
For example, Offset $0580. This is the Aircraft Heading coordinate. In the FSUIPC Offsets Status manual, it states that you must do some calculations... So, I oblidged. Here is my script:
Code:Var 9117, name HDG, Link FSUIPC_IN, Offset $0580, Length 4 { L0 = &HDG * 360 L1 = DIV L0 4294967296 V9872 = L1 }
Can anyone try this offset and/or do you know of any alternatives I could try?
Thanks,
Jack
-
09-13-2010, 07:45 PM #2
- Join Date
- Jan 2007
- Posts
- 496
Re: Weird Offsets
Well, rather, it tells you what the FS units are. FS arranges for the largest possible number (359.99999 ... degrees) to occupy the available 32-bits to the maximum. That effectively means that the number "65536*65536" (one more than the maximum number which can be accommodated) represents 360 (the first heading out of the range 0-359.99999 ...). By doing this it is using those 32 bits to give maximum precision -- more precise, in fact, than a 32-bit Float would give because the latter uses several bits for an exponent.
Code:Var 9117, name HDG, Link FSUIPC_IN, Offset $0580, Length 4 { L0 = &HDG * 360 L1 = DIV L0 4294967296 V9872 = L1 }
1. What is the capacity of the variables represented by L0 and L1? Are they floating point? If they only have 32 bit fixed point capacity, then you are losing much of the value when you multiply by 360, obviously.
2. Is all this operating with unsigned numbers? If not, if they are signed, then any heading of 180 or over will look negative, of course, as the top bit will be set. If you get a negative result as a consequence you'd have to add 360 to correct it.
However, on the LCD display, the heading is completely messed up! It often displays values such as -12 when I am on heading 272... etc
Pete
-
09-18-2010, 07:04 PM #3
Re: Weird Offsets
Hi Pete,
Good news. I've managed to fix the issue with the true heading Offsets; I used some code provided by Nico Kaan on his website, see here:
Code:Var 3682 name HDG1 Link FSUIPC_IN Offset $0580 Length 4 // true heading { L0 = &HDG1 * 8.3819E-008 IF L0 < 0 { L0 = L0 + 360 } &D_HDG = ROUND L0 }
Now, I'm cracking on with the ambient wind offset. I'm using the following formula:
Code:Var 9033, Name WINDDIR, Link FSUIPC_IN, Offset $0E92, Length 2 { L0 = &WINDDIR * 5.9493164063E-03 &WINDDIRCALC = ROUND L0 }
Jack
-
09-24-2010, 10:48 AM #4
- Join Date
- Jan 2007
- Posts
- 496
Re: Weird Offsets
Yes, you are now simply correcting the calculation because you are handling a positive number as if it were signed. As I said.
Now, I'm cracking on with the ambient wind offset.
Pete
Similar Threads
-
Engravity CDU & Win7.. weird 737 CDU menu ??
By Nick1150 in forum PM Boeing FMC/CDUReplies: 1Last Post: 12-19-2010, 04:29 PM -
Weird video driver problem in Vista32
By CrashEd in forum Video Interfacing and HardwareReplies: 7Last Post: 09-18-2009, 12:58 PM -
CDU new versions behave weird
By RobertVdb in forum PM Boeing FMC/CDUReplies: 0Last Post: 08-03-2008, 11:47 AM -
CDU new versions behave weird
By RobertVdb in forum Magenta CockpitsReplies: 0Last Post: 08-03-2008, 10:49 AM -
CDU Inflight arrival runway change weird!
By dcutugno in forum PM General Q & AReplies: 5Last Post: 02-05-2007, 12:13 PM
Girls in your town
A320 Sound Files Missing