Dataref issue

Help creating logic scripts for Air Manager Instruments

Moderators: russ, Ralph

Message
Author
SimPassion
Posts: 4997
Joined: Thu Jul 27, 2017 12:22 am

Re: Dataref issue

#11 Post by SimPassion »

Ralph is emphasizing EGT_CYL_deg_C vs EGT_deg_c

for your C172 sample we rather see 12 cyls EGT values, so we have to refer only to the useful ones, related to specs as specified in the ACF file or watching PlaneMaker

Code: Select all

[54.674976,57.87355,56.34716,57.517166,52.376415,53.08211,54.0426,57.883617,53.18491,53.677456,52.88482,54.562237,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
image.png
image.png

and as we see Air Manager is reporting dataref values properly in this case :

image.png

let's take a sample with the Baron 58, handling 2 x Continental IO-520 - 285HP each - 6 flat opposed cylinders by engine, so a total of 12 cylinders
https://en.wikipedia.org/wiki/Continental_O-520

Image

image.png

Code: Select all

--====================================================================================
--								CHECK PURPOSE
--====================================================================================

eng_nbr = 2 -- from 1 to 4 only : handling most of available aircrafts in X-Plane
cyl_nbr = 6

function cyl_egt_check(cyl_egt, cyl_cht, eng_egt)

	for engnbr = 1,eng_nbr,1
	do
		cylstart = 1 + (engnbr - 1) * 12
		print("CYL START #"..cylstart)
		for cylnbr = cylstart,cylstart + cyl_nbr - 1,1
		do
			print("ENG #"..engnbr.." CYL #"..cylnbr.." CHT : "..math.floor(cyl_cht[cylnbr]).." EGT : "..math.floor(cyl_egt[cylnbr]))
		end
	end
	
end


xpl_dataref_subscribe("sim/cockpit2/engine/indicators/EGT_CYL_deg_C", "FLOAT[48]",
						"sim/cockpit2/engine/indicators/CHT_CYL_deg_C", "FLOAT[48]",
						"sim/cockpit2/engine/indicators/EGT_deg_C", "FLOAT[4]",
						cyl_egt_check)
With this sample we get this, which looks correct :

image.png

SimPassion
Posts: 4997
Joined: Thu Jul 27, 2017 12:22 am

Re: Dataref issue

#12 Post by SimPassion »


Macsbig
Posts: 31
Joined: Sun Jan 01, 2023 9:02 pm

Re: Dataref issue

#13 Post by Macsbig »

Thanks for all the info. I'll take a look. Thats alot to digest! ;)
Currently building my own home cockpit, general purpose one with 3 x 32” wrap around monitors and two lower monitors for instruments and PFD’s. Currently, putting together parts for the Toliss A321

Post Reply