Jump to content
Sign in to follow this  
Guest CaptnKebec

Autopilot APR in FSUIPC

Recommended Posts

Guest CaptnKebec

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

Share this post


Link to post
Share on other sites
Guest PoRrEkE

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.

Share this post


Link to post
Share on other sites
Guest CaptnKebec

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

Share this post


Link to post
Share on other sites
Guest PoRrEkE

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

Share this post


Link to post
Share on other sites
Guest Erups

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.

Share this post


Link to post
Share on other sites
Guest Ceawlin BSX029

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 :(

Share this post


Link to post
Share on other sites
Guest CaptnKebec

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

Share this post


Link to post
Share on other sites
Guest Erups

DME1 distance as character string, either

Share this post


Link to post
Share on other sites
Guest CaptnKebec

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.???

Share this post


Link to post
Share on other sites
Guest Erups

>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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...