P3D v4 XML Coding Mystery

As part of my autopilot control coding, the two code blocks below are used to turn the autopilot BC hold function on and off. To prevent flooding, the next to last line in the first block checks the value of (A:AUTOPILOT BACKCOURSE HOLD, bool) before turning on the BC hold function. But doing this check causes some type of conflict such that the value of (A:AUTOPILOT BACKCOURSE HOLD, bool) rapidly and continually flips back and forth between 0 and 1. It does this even if I completely remove the second code block below which turns the BC hold function off. If I remove the (A:AUTOPILOT BACKCOURSE HOLD, bool) check in the first block, everything works as intended. Nowhere else in the overall autopilot control code is BC hold turned on or off using the associated K events. I can't figure out why checking the value of (A:AUTOPILOT BACKCOURSE HOLD, bool) before turning on BC hold causes this problem. Would appreciate hearing any ideas.
Thx,
Al


XML:
(L:BC_MODE, bool)  1 ==
(L:NAV_MODE, bool)  1 == and
(A:GPS DRIVES NAV1, bool)  0 == and
(L:NAV_CAP_BC,bool) 1 == and
(A:AUTOPILOT BACKCOURSE HOLD, bool)   0 == and
if{ (>K:AP_BC_HOLD_ON) }

(L:BC_MODE, bool)  0 ==
(L:NAV_MODE, bool)  0 == or
(A:GPS DRIVES NAV1, bool)  1 == or
(L:NAV_CAP_BC,bool)  0 == or
(A:AUTOPILOT BACKCOURSE HOLD, bool) 1 == and
if{ (>K:AP_BC_HOLD_OFF) }
 
Last edited:

tgibson

Resource contributor
I assume another part of your code or another gauge is turning the BC mode off? Or something is changing the values of your L: variables back and forth?
 
Tom, thanks for the respons.
The problem turned out to be a conflict between (>K:AP_LOC_HOLD_ON) and (>K:AP_BC_HOLD_ON). I had thought that these events 'worked together' for a back course approach with the AP_BC_HOLD_ON event basically just taking care of the CDI reverse sensing issue. But it seems AP_LOC_HOLD_ON and AP_BC_HOLD_ON are mutually exclusive and AP_BC_HOLD_ON is all that is needed for the back course approach.

Al
 
Top