FSX TCAS gauge - bearing variable always unsubscribed

Questions about deployment and use of Air Manager Instruments

Moderators: russ, Ralph

Post Reply
Message
Author
flyatr
Posts: 300
Joined: Tue Dec 01, 2015 8:53 am

FSX TCAS gauge - bearing variable always unsubscribed

#1 Post by flyatr »

Hi,

for my TCAS gauge I have written an xml gauge that is installed in my fsx aircraft's panel (invisible). It basically querys the simulators AI aircraft table and copys some values to local variables (L:Vars). A test with the blackbox3 xml gauge shows that all variables are updated (screen shot).

In Air Manager however I get data for all variables except "L:TCAS_bearing". The viewer lists it as UNSUBSRIBED. I have tried changing the unit to Number, Radians, etc. both in the xml code and in the Air Manager subscribe with no luck.

Maybe someone has an idea what could be wrong here?

Black box test gauge:
tcas1.jpg

Air Manager Viewer:
tcas2.jpg

XML code for FSX gauge:

Code: Select all

<Gauge Name="TrafficInfo" Version="1.0"> 
<Size X="400" Y="300" />
		<Update Frequency="5" Hidden="No">
				<!-- Clear old values -->
				0 (&gt;L:TCAS_bearing,degrees) 
					(&gt;L:TCAS_distance,nmiles) 
					(&gt;L:TCAS_altitude, feet)

				<!-- Set traffic search parameters -->
				16 (&gt;C:ITrafficInfo:Filter, enum)  <!-- Bit 4: TRAFFIC_FILTER_IN_AIR -->
				15 (&gt;C:ITrafficInfo:Radius,nmiles) 
				16 (>C:ITrafficInfo:MaxVehicles)

				<!-- Increment or reset counter that cycles through the AI found -->
				(L:AircraftID, enum) ++ (>L:AircraftID, enum)				
				(L:AircraftID, enum) (C:ITrafficInfo:MaxVehicles) ==
				if{ 0 (>L:AircraftID, enum) }	
				
				<!-- Select the aircraft -->
				(L:AircraftID, enum) d (&gt;C:ITrafficInfo:CurrentVehicle,enum) 
					(&gt;C:ITrafficInfo:SelectedVehicle,enum)  
				
				<!-- Get position data -->
				(A:PLANE LATITUDE,degrees) (&gt;C:fs9gps:GeoCalcLatitude1,degrees)  
				(A:PLANE LONGITUDE,degrees) (&gt;C:fs9gps:GeoCalcLongitude1,degrees)  
				(C:ITrafficInfo:S:PLANE LATITUDE,degrees)  (&gt;L:temp_lat,degrees)  
				(L:temp_lat) (&gt;C:fs9gps:GeoCalcLatitude2,degrees)  
				(C:ITrafficInfo:S:PLANE LONGITUDE,degrees) (&gt;L:temp_lon,degrees)  
				(L:temp_lon,degrees) (&gt;C:fs9gps:GeoCalcLongitude2,degrees)  
				(C:fs9gps:GeoCalcBearing,degrees) (&gt;L:TCAS_bearing,degrees) 
				(C:fs9gps:GeoCalcDistance,nmiles) (&gt;L:TCAS_distance,nmiles) 
				(C:ITrafficInfo:S:PLANE ALTITUDE, feet) (&gt;L:TCAS_altitude, feet)
				(C:ITrafficInfo:S:VERTICAL SPEED, feet per minute) (&gt;L:TCAS_vSpeed, feet per minute)
        </Update>
 </Gauge>

Air Manager script:

Code: Select all

counter=0

function new_data_fsx(own_altitude, heading, id, bearing, distance, altitude, vSpeed)
	if counter == 9 then
		counter = 0
		if id==2 then
		print(id.." ".. bearing.." "..distance.." "..altitude.." "..vSpeed)
		end
	end
	counter = counter + 1
end

fsx_variable_subscribe("PLANE ALTITUDE","Feet",
"PLANE HEADING DEGREES GYRO", "DEGREES",
"L:AircraftID", "Number",
"L:TCAS_bearing", "Degrees",
"L:TCAS_distance", "Number",
"L:TCAS_altitude", "Number",
"L:TCAS_vSpeed", "feet per minute",
new_data_fsx)

User avatar
russ
Posts: 593
Joined: Tue Oct 27, 2015 5:37 pm

Re: FSX TCAS gauge - bearing variable always unsubscribed

#2 Post by russ »

I suppose you have tried exiting both Air Manager and the Sim and restarting. I have had very frustrating problems when I change the type( X-Plane) or Units(FSX) where I have initially used the wrong kind. It's like once the connection has been established wrong I cannot change it to reestablish it correctly without restarting everything. I have spent hours struggle no to figure out what I was doing wrong with NKY to later find out it wasn't me. This may not be your issue but it's worth mentioning.

I have also tried clicking the get available variables button even though I think the Lvar is showing in the window NKY to have it show up again and see there was a minor typo in my original code. I specialize in mistakes but this is another idea.

Good luck your project looks neat.
Russ Barlow
Air Manager Evangelist

flyatr
Posts: 300
Joined: Tue Dec 01, 2015 8:53 am

Re: FSX TCAS gauge - bearing variable always unsubscribed

#3 Post by flyatr »

Thanks, Russ. Btw. what's NKY?
After two hours of testing every possible combination of units and restarting both programs with no luck I found this:

It seems that the first L: variable in the XML code will not be subscribed by AM! The whole time testing "L:TCAS_bearing" was the first used in the XML code. After adding this line at the very top of my XML code the problem is gone:

Code: Select all

1 (&gt;L:dummy, enum)
It's just writing a constant value to a dummy variable that is not used at all.


I cannot tell if this is due to my XML code or Air Manager. Maybe you'd like to investigate.

User avatar
Ralph
Posts: 7878
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: FSX TCAS gauge - bearing variable always unsubscribed

#4 Post by Ralph »

It's something we'll check for the 3.0 release. Thanks for the investigation!

User avatar
russ
Posts: 593
Joined: Tue Oct 27, 2015 5:37 pm

Re: FSX TCAS gauge - bearing variable always unsubscribed

#5 Post by russ »

We had that problem in an earlier version but I thought Corjan fixed it for good? I assume you are using 2.1.3?

BTW. NKY is a spelling autocorrect for what was meant to be "only". I live the in Northern Kentucky which we abbreviate NKY and if I may as a letter on only my spell check is routinely making it NKY... sorry.
Russ Barlow
Air Manager Evangelist

flyatr
Posts: 300
Joined: Tue Dec 01, 2015 8:53 am

Re: FSX TCAS gauge - bearing variable always unsubscribed

#6 Post by flyatr »

Yes I'm using 2.1.3.

btw, https://goo.gl/images/Ooi1nY

Post Reply