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

Gps displays some Vars, not others. Why?

Messages
1,564
Country
thailand
I can make use of fs9gps variables within the XML code of the gauge I’m building…but I can’t always display the fs9gps variables directly and I need some help figuring out why.

Here’s an example:
Code:
<Gauge Name="GPS display Question" Version="1.0">
	<Size X="400" Y="1000" />
	
	<Macro Name="c">C:fs9gps</Macro>
	<Macro Name="g">C:fs9gps</Macro>

	<Update>
	(@c:FlightPlanWaypointRemainingTotalDistance,nmiles) (>L:DistanceToDestination,nmiles)
	</Update>
	
	<Element>
		<Position X="10" Y="10"/>
		<Text X="732" Y="15" Bright="Yes" Length="61" Font="Arial" Color="White" Adjust="Center" VerticalAdjust="Center" Multiline="No" Fixed="Yes">
			<String>%((@c:FlightPlanDepartureAirportIdent))%!10s!%(' @c:FlightPlanDepartureAirportIdent')%!-50s!</String>
		</Text>
	</Element>
	
	<Element>
		<Position X="10" Y="28"/>
		<Text X="732" Y="15" Bright="Yes" Length="61" Font="Arial" Color="White" Adjust="Center" VerticalAdjust="Center" Multiline="No" Fixed="Yes">
			<String>%((@c:FlightPlanWaypointsNumber,number))%!10.2f!%(' @c:FlightPlanWaypointsNumber')%!-50s!</String>
		</Text>
	</Element>
	
	<Element>
		<Position X="10" Y="46"/>
		<Text X="732" Y="15" Bright="Yes" Length="61" Font="Arial" Color="White" Adjust="Center" VerticalAdjust="Center" Multiline="No" Fixed="Yes">
			<String>%((@c:FlightPlanWaypointRemainingTotalDistance,nmiles))%!10.2f!%(' @c:FlightPlanWaypointRemainingTotalDistance')%!-50s!</String>
		</Text>
	</Element>
	
	<Element>
		<Position X="10" Y="64"/>
		<Text X="732" Y="15" Bright="Yes" Length="61" Font="Arial" Color="White" Adjust="Center" VerticalAdjust="Center" Multiline="No" Fixed="Yes">
			<String>%((L:DistanceToDestination,nmiles))%!10.2f!%(' L:DistanceToDestination')%!-50s!</String>
		</Text>
	</Element>
</Gauge>

The following is displayed on my screen:

PHHN C:fs9gps:FlightPlanDepartureAirportIdent
7.00 C:fs9gps:FlightPlanWaypointsNumber
0.00 C:fs9gps:FlightPlanWaypointRemainingTotalDistance
54.71 L:DistanceToDestination

Everything appears correct except the third value, FlightPlanWaypointRemainingTotalDistance. Note that L:DistanceToDestination gets its value directly from FlightPlanWaypointRemainingTotalDistance and 54.71 is the correct number.

But, why the 0.00 display for FlightPlanWaypointRemainingTotalDistance?

I’m missing something simple but I don’t know what it is. Suggestions?

rpmc
 
The @c is a macro call. The expression is "sent" to FS during one cycle, but the result isn't obtained until the next cycle. But, because you aren't "storing" the answer "received" to an L:var, the request "sent" during the second cycle "cancels out" the answer "received..."

In simple terms, the same memory location is used for both the question and the answer!
 
Back
Top