<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>http://www.fsdeveloper.com/wiki/index.php?action=history&amp;feed=atom&amp;title=XML%3A_Variables_in_C_Gauges</id>
	<title>XML: Variables in C Gauges - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://www.fsdeveloper.com/wiki/index.php?action=history&amp;feed=atom&amp;title=XML%3A_Variables_in_C_Gauges"/>
	<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=XML:_Variables_in_C_Gauges&amp;action=history"/>
	<updated>2026-06-01T11:23:18Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=XML:_Variables_in_C_Gauges&amp;diff=8155&amp;oldid=prev</id>
		<title>Arno at 18:49, 22 August 2011</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=XML:_Variables_in_C_Gauges&amp;diff=8155&amp;oldid=prev"/>
		<updated>2011-08-22T18:49:33Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 13:49, 22 August 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l90&quot;&gt;Line 90:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 90:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Aircraft Design]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Aircraft Design]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Panel &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;amp; &lt;/del&gt;Gauge Design]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Panel &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;and &lt;/ins&gt;Gauge Design]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Arno</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=XML:_Variables_in_C_Gauges&amp;diff=7119&amp;oldid=prev</id>
		<title>N4gix: /* To control XML variables from a C gauge: */</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=XML:_Variables_in_C_Gauges&amp;diff=7119&amp;oldid=prev"/>
		<updated>2009-11-30T16:34:43Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;To control XML variables from a C gauge:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 11:34, 30 November 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{Infobox-Applicable-FSVersion&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;| FSXI = false&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;| FSXA = true&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;| FSX = true&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;| FS2004 = true&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;| FS2002 = false&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==To control XML variables from a C gauge:==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==To control XML variables from a C gauge:==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>N4gix</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=XML:_Variables_in_C_Gauges&amp;diff=7118&amp;oldid=prev</id>
		<title>N4gix: New page: ==To control XML variables from a C gauge:==  // declare the variable and pointer ID for the variable   double pitot_cover = 1 ; // this is the C variable  ID pitot_cover_id; // this is th...</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=XML:_Variables_in_C_Gauges&amp;diff=7118&amp;oldid=prev"/>
		<updated>2009-11-30T16:32:52Z</updated>

		<summary type="html">&lt;p&gt;New page: ==To control XML variables from a C gauge:==  // declare the variable and pointer ID for the variable   double pitot_cover = 1 ; // this is the C variable  ID pitot_cover_id; // this is th...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==To control XML variables from a C gauge:==&lt;br /&gt;
&lt;br /&gt;
// declare the variable and pointer ID for the variable&lt;br /&gt;
&lt;br /&gt;
 double pitot_cover = 1 ; // this is the C variable&lt;br /&gt;
 ID pitot_cover_id; // this is the pointer address to the XML variable&lt;br /&gt;
&lt;br /&gt;
// Register the variable (this is the XML &amp;quot;name,&amp;quot; e.g., L:PitotCover&lt;br /&gt;
&lt;br /&gt;
 case PANEL_SERVICE_PRE_INITIALIZE:&lt;br /&gt;
     register_named_variable ( &amp;quot;PitotCover&amp;quot; );&lt;br /&gt;
 break;&lt;br /&gt;
&lt;br /&gt;
// now, you can use the next two statements to (a) associate the ID with the XML variable, then (b) set the variable to be identical to the C variable, e.g., pitot_cover&lt;br /&gt;
&lt;br /&gt;
 case PANEL_SERVICE_PRE_UPDATE:&lt;br /&gt;
     pitot_cover_id = check_named_variable ( &amp;quot;PitotCover&amp;quot; ) ;&lt;br /&gt;
     set_named_variable_value ( pitot_cover_id, (FLOAT64)pitot_cover ) ;&lt;br /&gt;
 break;&lt;br /&gt;
&lt;br /&gt;
// now, in my mouse routine, I can set the value of pitot_cover, and it will be automatically passed to the XML variable!&lt;br /&gt;
&lt;br /&gt;
 BOOL FSAPI mouse_pitotcb( PPIXPOINT relative_point, FLAGS32 mouse_flags)&lt;br /&gt;
 {&lt;br /&gt;
     if ( pitot_cover == 0 ) { pitot_cover = 1 ; } else { pitot_cover = 0 ; }&lt;br /&gt;
     return FALSE;&lt;br /&gt;
 }  &lt;br /&gt;
&lt;br /&gt;
// now, to use the XML variable to control the C variable, the only&lt;br /&gt;
// difference is that you would use the get_named_variable_value command instead, and omit the mouse code!&lt;br /&gt;
&lt;br /&gt;
 pitot_cover_id = check_named_variable(&amp;quot;PitotCover&amp;quot;);&lt;br /&gt;
 pitot_cover = get_named_variable_value (pitot_cover_id);&lt;br /&gt;
&lt;br /&gt;
==Alternate Method==&lt;br /&gt;
&lt;br /&gt;
There is another method that may be used to communicate between C gauges and XML gauges, using the execute_calculator_code(); function. Here is the prototype for the function:&lt;br /&gt;
&lt;br /&gt;
 execute_calculator_code(PCSTRINGZ code, FLOAT64* fvalue, SINT32* ivalue, PCSTRINGZ* svalue);&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Translating&amp;quot; the function into more easily understood pseudo-code, we have this:&lt;br /&gt;
&lt;br /&gt;
 execute_calculator_code(XML variable name,units, floating point var name, integer variable name, string variable name);&lt;br /&gt;
&lt;br /&gt;
To use the function, first determine from the &amp;quot;units&amp;quot; of the XML variable whether the returned value will be a floating point number, an integer, or a string.&lt;br /&gt;
&lt;br /&gt;
When constructing the function call, only ONE of the fields 2 through 4 will be used, an the unused fields filled with &amp;quot;NULL&amp;quot; value. For example, we want to fetch an ADF frequency, so we&amp;#039;d use something like this:&lt;br /&gt;
&lt;br /&gt;
 FLOAT64 adf1_frequency = 0; // first declare the float C variable&lt;br /&gt;
 execute_calculator_code(&amp;quot;(A:ADF ACTIVE FREQUENCY:1, KHz)&amp;quot;,&amp;amp;adf1_frequency,NULL,NULL);&lt;br /&gt;
&lt;br /&gt;
If the XML variable is an integer, here is an example:&lt;br /&gt;
&lt;br /&gt;
 SINT32 time_of_day; // first declare the integer C variable&lt;br /&gt;
 execute_calculator_code(&amp;quot;(E:TIME OF DAY,Enum)&amp;quot;,NULL,&amp;amp;time_of_day,NULL);&lt;br /&gt;
&lt;br /&gt;
If the XML variable is a string, here is an example:&lt;br /&gt;
&lt;br /&gt;
 PCSTRINGZ VorIcaoCode; // first declare the string C variable&lt;br /&gt;
 execute_calculator_code(&amp;quot;(C:fs9gps:WaypointICAO,st ring)&amp;quot;,NULL,NULL,&amp;amp;VorIcaoCode);&lt;br /&gt;
&lt;br /&gt;
Take note that the string example also shows how we can easily fetch stuff from the GPS system using this technique!&lt;br /&gt;
&lt;br /&gt;
Custom L:variables may also be obtained following the same structure shown above.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;BOOLEAN:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 execute_calculator_code(&amp;quot;(L:MyCustomVariable,bool)&amp;quot;,NULL,&amp;amp;my_custom_variable,NULL);&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;FLOAT:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 execute_calculator_code(&amp;quot;(L:MyCustomVariable,enum)&amp;quot;,&amp;amp;my_custom_variable,NULL,NULL);&lt;br /&gt;
&lt;br /&gt;
This method is much easier to use that the method described in the previous section. &lt;br /&gt;
&lt;br /&gt;
To &amp;#039;&amp;#039;&amp;#039;SEND&amp;#039;&amp;#039;&amp;#039; a command with this method, use the following format:&lt;br /&gt;
&lt;br /&gt;
 execute_calculator_code(&amp;quot;(&amp;gt;K:SOUND_TOGGLE)&amp;quot;, NULL, NULL, NULL);&lt;br /&gt;
&lt;br /&gt;
If you need to pass a value for a SET type key_event, simply use the same syntax used in an XML gauge by prefixing the command with the value (which can itself be another XML variable as shown below):&lt;br /&gt;
&lt;br /&gt;
 execute_calculator_code(&amp;quot;(A:Plane heading degrees gyro,degrees) (&amp;gt;K:HEADING_BUG_SET)&amp;quot;, NULL, NULL, NULL);&lt;br /&gt;
&lt;br /&gt;
[[Category:Aircraft Design]]&lt;br /&gt;
[[Category:Panel &amp;amp; Gauge Design]]&lt;/div&gt;</summary>
		<author><name>N4gix</name></author>
	</entry>
</feed>