Quick question: why setting 8 volts as the voltage threshold for your power state?vangyver wrote: ↑Mon Aug 16, 2021 7:39 amCode: Select all
Code: Select all
—Add images in Z-order -- img_add_fullscreen("KX165A.png") redline = img_add("redline.png", 364, 10, 2, 300) -- Add text -- txt_com1 = txt_add(" ", "size:25px; color:#DCF509; halign:left", 25, 40, 200, 200) txt_com1stby = txt_add(" ", "size:25px; color:#DCF509; halign:left", 200, 40, 200, 200) txt_nav1 = txt_add(" ", "size:25px; color:#DCF509; halign:left", 365, 40, 200, 200) txt_nav1stby = txt_add(" ", "size:25px; color:#DCF509; halign:left", 520, 40, 200, 200) -- Set default visibility -- img_visible(redline, false) --subscribe callback -- function new_navcomm_FSX(avionics, nav1, nav1stby, com1, com1stby, battery, generator, FuseNavCom1) --make a boolean power variable based on state of avionics, battery, generator and FuseNavCom1 == 1 local power = avionics >= 8 and (battery >= 8 or generator) and FuseNavCom1 == 1 img_visible(redline, power) if power then txt_set(txt_com1, string.format("%06.02f",com1, com1%1) ) txt_set(txt_com1stby, string.format("%06.02f",com1stby, com1stby%1)) txt_set(txt_nav1, string.format("%06.02f",nav1, nav1%1)) txt_set(txt_nav1stby, string.format("%06.02f",nav1stby, nav1stby%1) ) else txt_set(txt_com1, " ") txt_set(txt_com1stby, " ") txt_set(txt_nav1, " ") txt_set(txt_nav1stby, " ") end end --subscribes -- fsx_variable_subscribe("ELECTRICAL AVIONICS BUS VOLTAGE", "Volts", "NAV ACTIVE FREQUENCY:1", "Mhz", "NAV STANDBY FREQUENCY:1", "Mhz", "COM ACTIVE FREQUENCY:1", "Mhz", "COM STANDBY FREQUENCY:1", "Mhz", "ELECTRICAL BATTERY BUS VOLTAGE", "Volts", "GENERAL ENG GENERATOR SWITCH:1", "Bool", "L:FuseNavCom1", "Enum", new_navcomm_FSX)
I strongly doubt that 28 volts avionics like the KA165 will continue to operate with such a low voltage IRL, something like 24volts (say down to 22.5volts to take into account the battery decay in case of battery only supply) should be the absolute lower limit.
It’s a good idea to link the power state to the Fuse, but I am more confused with the electrical battery bus voltage.
I suspect that avionics are tied to the avionics bus only, that bus is in turn fed by either the battery or generator buses.
I reckon that FSX is somewhat much less comprehensive than XPlane systemwise, but I think that in FSX the avionics bus is fed by the main bus which is in turn fed by the battery or generator.
So only checking the avionics bus voltage should be sufficient, along with the fuse status, and of course the avionics switch status.
Jacques