Fragtality/PilotsDeck

B-VAR Support in 0.8.0

richardkennedy opened this issue · 24 comments

I'm testing the change log for 0.8.0 but I'm struggling to get B-VARS working, could you confirm the format?

Well, the API/SDK of MSFS is still very limited when it comes to B-VARS / InputEvents. From my Research only a Fraction is exposed - only the "Set" Part works. The Author of SPAD.next did a Video about that: https://www.youtube.com/watch?v=QKlOUs-xtns
On top of that, they are in a strange "middle ground" between H-VARs and L-VARs. Sometimes they only work as Command (so the Value send does not matter and their Value will not change, but they do trigger something) like H-VARs, sometimes their Value can be read & written like L-VARs (or other Variable/Read Types).

So if and how they are useful comes down to the Aircraft. The Fenix has only a few for the EFIS/FCU Knobs and they work mostly fine (in the Sense of actually turning the Knob visually and changing the FCU Display). The Ini A300 has a Truckload of them, but from the few I tested they only move the Button visually, but not actually trigger the underlying Function (e.g. the ECP "ENG" Button moves, but the ENG Page does not show up).

Other Issues that might be, since not documented yet:

  • Their Syntax requires to always add a "B:" before the Name - regardless if being for a Value or as a Command!
  • Don't use the Names as seen in the Dev-Mode, because you will also see the InputEvents which MSFS does not expose via SimConnect. Either look in the Log, or use something like FSUIPC to list the Names. For Example the B-Vars for the Fenix' FCU Speed Knob would need to be configured as:
B:FNX320_Input_Knob_PushPull_E_FCU_SPEED_Push
B:FNX320_Input_Knob_PushPull_E_FCU_SPEED_Pull
B:FNX320_Input_Knob_PushPull_E_FCU_SPEED_Knob

Thanks, will keep testing 👍🏻

Check the latest Version - there was a Bug where B-Vars used as Value did not work

This appears to be working well

@Fragtality you mentioned that B-vars should be tracked through the Log

Don't use the Names as seen in the Dev-Mode, because you will also see the InputEvents which MSFS does not expose via SimConnect. Either look in the Log, or use something like FSUIPC to list the Names

Which "Log" are you referring to? Which setup should I use to track them in FSUIPC?

The Plugin's Log - but it is now a separate File in the Plugin-Directory, containing the B-Vars for the current Aircraft: InputEvents.txt

FSUIPC GUI?

I'm struggling with the B-vars, being totally unable to handle them.

I'm trying to manage a lever which in the developer mode for the Inc and Dec has the following code:

(O:FUEL_LV_Fuel_supply_engine_3_Position) p0 + (>B:FUEL_LV_Fuel_supply_engine_3_Set)
(O:FUEL_LV_Fuel_supply_engine_3_Position) p0 - (>B:FUEL_LV_Fuel_supply_engine_3_Set)

Which in the end means you put a value from 0 to 3

First I tried with the BVar option, using Command Address FUEL_LV_Fuel_supply_engine_3_Set, then I also tried with a Lua,

SimVar("B:FUEL_LV_Fuel_supply_engine_3_Set")

function ToggleFuelOilEng_3()

	SimWrite("FUEL_LV_Fuel_supply_engine_3_Set",3)
	
end

But none of those worked. I also tried to find that dedicated log to B-Vars, but I couldn't find it in the log folder

I still have a lot to learn about the simulator guts...