P3Dv4 local variables for status of KAP 140

Post any technical issues here. This forum gets priority from our staff.
new reply
mbeuchat
Airman Basic
Posts: 2
Joined: 26 Mar 2018, 15:32

P3Dv4 local variables for status of KAP 140

Post by mbeuchat »

I'm trying to get my GoFlight MCP to control the Cessna KAP 140. Buttons work correctly, as does the display of vertical rate and altitude.

The problem is that the state of KAP 140 is unknown, Generic simconnect variables AUTOPILOT MASTER gives the correct value, but AUTOPILOT HEADING LOCK does not change even if KAP 140 is in HDG mode.

I can't see anything in the local variable list that you publish. How can I get this information. I tried building my own state machine, but it doesn't always match so the right way will be if I can find out status directly: HDG, NAV, APR mode, VS, ALT ALERT etc.

Any ideas?

Marc

User avatar
Nick - A2A
A2A Captain
Posts: 13734
Joined: 06 Jun 2014, 13:06
Location: UK

Re: P3Dv4 local variables for status of KAP 140

Post by Nick - A2A »

Hi Marc - welcome to the forums.

For the general status of the AP, I believe L:kap140_ap is the relevant L:Var. The logic for this is described in the PDF document from A2A. Did you notice that there are separate L:Vars for the mode itself and the button press event for each of the mode buttons?
KAP 140 Autopilot unit:
AP button - (L:kap140_ap_button,bool), also set (L:kap140_ap,bool) to 1, don’t change to 0 on button release
HDG button - (L:kap140_hdg_button,bool) , also set (L:kap140_hdg,bool) to 1, don’t change to 0 on button release
NAV button - (L:kap140_nav_button,bool) , also set (L:kap140_nav,bool) to 1, don’t change to 0 on button release
APR button - (L:kap140_apr_button,bool) , also set (L:kap140_apr,bool) to 1, don’t change to 0 on button release
REV button - (L:kap140_rev_button,bool) , also set (L:kap140_rev,bool) to 1, don’t change to 0 on button release
ALT button - (L:kap140_alt_button,bool) , also set (L:kap140_alt,bool) to 1, don’t change to 0 on button release
UP button - (L:kap140_up_button,bool) , also set (L:kap140_up,bool) to 1, don’t change to 0 on button release
DN button - (L:kap140_dn_button,bool) , also set (L:kap140_dn,bool) to 1, don’t change to 0 on button release
ARM button - (L:kap140_arm_button,bool) , also set (L:kap140_arm,bool) to 1, don’t change to 0 on button release
BARO button - (L:kap140_baro_button,bool) , also set (L:kap140_baro,bool) to 1, don’t change to 0 on button release
AP inner knob - (L:kap140_InnerKnob,percent) (range: 0 – 100)
AP outer knob - (L:kap140_OuterKnob,percent) (range: 0 – 100)
There are many more custom L:Vars used in the Accu-Sim products and the list produced by A2A only documents the most useful ones. You could have a search through this list I compiled using FSUIPC a while ago to see if you can find anything else you need. (The list was compiled using the 182, but any L:Vars related to the KAP 140 simulation should be interchangeable.)

Thanks,
Nick

mbeuchat
Airman Basic
Posts: 2
Joined: 26 Mar 2018, 15:32

Re: P3Dv4 local variables for status of KAP 140

Post by mbeuchat »

Hi Nick,

Thanks for the answer. I am aware of variables like kap140_hdg. When I monitor the value, I can see that it changes from 0 to 1 when HDG is engaged, but it immediately returns to 0, even though the autopilot is operating in HDG mode. It seems that the variables are not persisting. Could this be a bug? I'm running P3Dv4.0 with the latest A2A c172 patch.

Marc

User avatar
robains
Staff Sergeant
Posts: 280
Joined: 12 Sep 2013, 20:25
Location: Hillsboro, OR

Re: P3Dv4 local variables for status of KAP 140

Post by robains »

Late on this, but I'm having similar issues with getting my GF modules (and GIT) to work with the KAP 140 in the MV 310. My issue is with HDG and NAV buttons ... the only way I've been able to get HDG/ROL to work correctly is if I put NAV in NAV Arm mode (which is not correct).

But as far as your issue, what you are looking for is AUTOPILOT_HEADING_LOCK_DIR ... this will be the value you need.

I'm not sure how similar the A2A implementation is of the KAP140, but I'm guessing it's similar to Milviz although there do appear to be some differences base on the LVars list provided.

But if anyone has any info to share regarding HDG/ROL and NAV/NAV ARM, please let me know.

Cheers, Rob.
Image

User avatar
fleahead
Airman
Posts: 45
Joined: 27 Dec 2009, 21:32
Location: Ohio, USA

Re: P3Dv4 local variables for status of KAP 140

Post by fleahead »

I have a similar question but I'll create a new post
Fleahead
Ohio
MSFS
i7-12700 - RTX4080 - Pimax Crystal

new reply

Return to “C172 Trainer Tech Support”

Who is online

Users browsing this forum: No registered users and 10 guests