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

How can I pass GPS variable value to a LVar (Solved)

Messages
205
Country
netherlandsantilles
Dear all,
I have another question here I'm struggling with at some point I cannot understand why?
It should be possible to pass a GPS variable value to a LVar isn't? I recall have seen it be done in several examples with way points etc...but I'm trying to do a stupid thing and I don't manage to understand why it doesn't workout for me. There is that blinking yellow "msg" you usually find in the GPS when you cross airspace etc, and I want to have it display in my PFD (and eventually close it as well) without having to open the GPS.

exmpl.JPG

Looking true the GPS code I found two variables that I believe might contain the values needed that trigger this msg in the GPS which I want to pass to a LVar to rigger this in the PFD.

At start of the GPS_500.XML file I see the following for :

Code:
<Gauge Name="GPS_500" Version="1.0">
    <Image Name="gps_500_background.bmp"/>
    <!-- local vars
        activateLeg                - 1=display activate leg popup, 0=hide activate leg popup
        blinkingField            - 1-based index of field that is blinking, 0 if no blinking
        blinkingFieldEnabled1    - bool to indicate whether field is available for cursor scrolling/blinking
        blinkingFieldEnabled2    - "
        blinkingFieldEnabled3    - "
        blinkingFieldSaved        - saved when going from one blinking screen to another to blink correct field on close
        currentGroup            - 0=nav, 1=wpt, 2=nrst, 3=fpl, 4=proc
        currentPageNAV        - current sub-page for page group 0
        currentPageWPT        - "                               1
        currentPageNRST        - "                               2
        currentPageFPL        - "                               3
        menuBlinker
        messagePopup            - 1=display message popup, 0=hide message popup

Further down I found also 2 other variables:
(@c:NewMessagesNumber) and (@MSGToggle)

So I try to pass the values from all of them but so far without any luck which makes me now believe that most probably I dont understand how that works or Im doing something wrong?
This is part of my script in the <Update> section of the PFD where I try to pass the values:

Code:
   <!-- Macros -->
   
    <Macro Name="c">C:fs9gps</Macro> 
    <Macro Name="g">C:fs9gps</Macro>
    <Macro Name="MSGToggle">(@g:messagesOff) ! (&gt;@g:messagesOff)</Macro>


      <Update>
     
        (@MSGToggle) (>L:gps_test01,bool)

        (@c:NewMessagesNumber) 0 &gt;
        (@c:messagePopup) 0 &gt; or if{ 1 (>L:msg_on,bool) }  els{ 0 (>L:msg_on,bool) }
       
        </Update>

Any advice for me?
 
GPS variables are active only in their host gauge and cannot be read by another gauge in the panel set. If it were me, in the gps host gauge, I would write the gps message string variable to an XMLVAR (XMLTOOLS) string variable and read the XMLVAR variable in your pfd.

Bob
 
Thanks again Bob,
So even if I put my LVar into the GPS gauge I wont be able to read it? this XMLTool you referring to need to be installed on any machine that have this panel installed or it will compile in some form into my gauge?
 
You can read L:Vars in any gauge, just not C:fs9gps:Vars. L:Vars, of course, can hold only numeric values, but that might be ok for your use.
 
Ok I understand now, thanks for clarifying Bob.

Hey I have move my LVar into the GPS gauge and now I notice the LVar is reading the GPS Values correctly, I wasn't expecting that...so maybe I will have to go the way around :scratchch
 
I manage by putting this piece of script in the GPS update section:
Code:
        (@c:NewMessagesNumber) 0 &gt; if{ 1 (>L:msg_on,bool) } els{ 0 (>L:msg_on,bool) }

And this other piece in the update section of my PFD to enable disable the animation:
Code:
(L:msg_on,bool) if{ 1 (>L:MSG_ON,bool) } els{ 0 (>L:MSG_ON,bool)}

No need to use third party tool for it, works like charm!
Thank you all.
 
I don't know what the last piece of code does? It is saying if the variable is true set the same variable to true, and the same thing for false. It does essentially nothing?
 
I totally agree the script is funky and make no sense but it was the only way I got it to work.
I'm constantly learning something new with XML...after several attempts I noticed (probably because of my lack of knowledge about XML) that for some strange reason LVars are not being interpret as the same variables when you write it in Capital or in lowercase(?). Anyway that I found out was the difference that made it work.

Consequently, (L:msg_on,bool) is the local variable in the GPS that captures the state of messages within the GPS, and (L:MSG_ON,bool) (Capital!) takes the value and pass it to my PFD gauge.o_O crazy it is..
 
Bthwy: Bob was right I noticed if i just use same LVar in both the GPS gauge and my PFD gauge, the LVar cannot be read by my gauge.
 
Back
Top