June 3, 200422 yr 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
June 3, 200422 yr 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.
June 3, 200422 yr 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.
June 3, 200422 yr 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 :(
June 3, 200422 yr 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
June 3, 200422 yr 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.???
June 3, 200422 yr >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