• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

'Latching' an event in xml ?

Messages
95
Country
ireland
Hi folks....

I'm wondering if somebody can help me with this little piece of code, it's for a 'FINAL' light on my project plane's autopilot, used during approach. Currently, the light comes ON when... The Glideslope is being 'held' AND the Localiser is being 'held' AND Flaps are greater than 13 degrees AND the Outer Marker has been passed (and the relevant switches are on etc). It works fine but the light goes out after I pass the Outer Marker (the boolean condition having returned to '0')... How can I get the light to stay on after that particular condition has passed ? i.e. I need that light to 'latch' on and stay on until the remainder of the approach.

Many thanks.

Skip

<PartInfo>
<Name>J200_AP_LITE_fnl_vis</Name>
<Visibility>
<Parameter>
<Code>
(A:AUTOPILOT GLIDESLOPE HOLD, bool) 1 ==
(A:AUTOPILOT NAV1 LOCK, bool) 1 ==
(A:MARKER BEACON STATE, enum) 1 ==
(A:FLAPS HANDLE INDEX, number) 25 &lt; ==
(L:J200_APMasterSW,bool) 50 * and
(L:J200_AP_test_button, bool) 1 == or
if{ 1 } els{ 0 }
</Code>
</Parameter>
</Visibility>
</PartInfo>
 
Use a Lvar boolean to see if the marker was passed and set it to false at the beginning.
Then you keep checking the marker beacon state. If the outer marker is active the Lvar is set to true.
Also add some code to set the Lvar back to false when the approach is done.
 
Hi Jeroen, Many thanks for your quick reply... I'm afraid I don't know enough xml to effect your solution, the exact syntax is what stumps me everytime. I tend to trick around with stuff and use the 'see if it works' method :).
Can you offer any hints on how exactly to do this ?

Skip
 
I would do one code that 'activates a key'. For instance; 'all variables are met; then turn on L:approach mode Alpha,bool 1 == (on). <-- that is your key

Next code; if L:approach mode Alpha,bool 1 == (if this is on), then turn on the light. Els { 0 }

Then have a third code that says if such and such variables no longer exist, or perhaps a timer is set (also maybe, on a secondary code block) then 'shut down L:approach mode Alpha,bool) (off)

You could have a timer in the light command, then have it turn off if 'sim is on the ground' (you land).


Quite a few things you can do.


Also, you could reset L:approach mode Alpha via 'if altitude above ground is greater then 1000 feet, (and maybe something else) and also L:approach mode Alpha,bool 1 == (on), then turn Alpha back to 'off' mode.



Bill
 
Sorry... I thought this was a gauge, not a part with visibility. My oops.

What you can do is make the visibility 'visible' if a L:var 'key' is active, (....,bool) 1 ==

Then make a hidden gauge, and put blocks of code in that which would have all your variables and would control if the 'key' is on or not.

Also... You need a second one that is 'off' when key is off. So you have one 'on' and one 'off' when key is either on or off. Or make the part that is off 'slightly smaller' then the on part, so that the on part fits over the off and you can then just have the on part go visible, which would cover up the slightly smaller off part.
 
Back
Top