Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Autopilot APR in FSUIPC

Featured Replies

Hi,I'm programming with VB for my avionics and I could get all the reading from FSUIPC except 1, the APR indicator on the autopilot.For example to get the HDG indicator I used the following:FSUIPC_Read(&H0C78, 4, VarPtr(tmp), dwResult)FSUIPC_Process(dwResult)aa = Hex(tmp)If aa = 1 Then txt_tmp = "HDG" Else txt_tmp = ""print txt_tmpFor the APR, in the FSUIPC doc the address for it is 0800 (Autopilot approach hold),I'm I using the wrong offset? If so, which is the right one.Thanks for any help.Cheers.Michel

No idea if it makes any difference but i read from " &HC78 " instead of " &H0C78 ". I use VB.Net myself.If you need APR, you should read the "800" and not "C78" I think. The special note sais that if you WRITE to it, you turn them both on. But you're just reading so read 800 instead.No idea if this solves the problem.

I tried 800 and I'm still getting always a 1 at that address to!Any idea???

Nope, sorryWill try this offset when I get back home this weekend.

I am not familira with visual basic, but if your routine works for that offset, there is no reason not to work with any other offset.So probably the problem is elsewhere.First: since you're reading the fsuipc operation result, is it positive?Second: i read "aa=hex(tmp)" while are you converting this to hex?All flags in FS (autopilot modes active, engine running flags, and so on) are boolean.No need to convert, just check if they are true or false.

h

:D :-lol

Sounds about right, just do a boolean check to see if it's 1 or 0. If it's 1 then switch it on, 0 switch to off etcHere's a paradox...If I said I never tell lies, am I telling the truth, or am I lying?I could be lying, in which case it's a valid statement (taken into the context of a lie), or I could be telling the truth, which is also a valid statement... Hurts your brain trying to figure it out :(

You we're right about a problem elsewhere, I wasn't reseting my "aa" variable after each timer pass! Now the APR works OK. But I need to convert the result to hex to get a 1 or 0 for those flags.OK now I'm stuck elsewhere, I can't decode the DME data, I'm getting values like 808333630 for DME1 distance (the real reading is ----) 540028876 for DME1 speed (real = ----), 808335417 for DME2 distance (real 98.0) and 808333630 for DME2 speed (real 000). I've tryed divided by 65536, convert hex to dec, ect, doesn't look like what it says in the FSUIPC manual.Help!!!After that one I would have all the info I wanted.Thanks all for your advices.Michel

DME1 distance as character string, either

I have to use a "long" type var to make "FSUIPC read" work and even if I convert the result to char I still get the same result.???

>I have to use a "long" type var to make "FSUIPC read" workMhhh, long is a number type.Not char.Char i'm afraid is char.If you can't make it work with char type, try asking Pete Dowson at the simflight forum.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.