Demo: LVAR write access for any aircraft control

According to the MobiFlight preset list (see https://hubhop.mobiflight.com/) , that hvar is only available in the stable A320. Which version are you using? For the dev version, there are presets A32NX_EFIS_L_CSTR_PUSH and A32NX_EFIS_R_CSTR_PUSH, which use the following calculator code:
(L:A32NX_EFIS_L_OPTION, enum) 1 == if{ 0 } els{ 1 } (>L:A32NX_EFIS_L_OPTION, enum)
(L:A32NX_EFIS_R_OPTION, enum) 1 == if{ 0 } els{ 1 } (>L:A32NX_EFIS_R_OPTION, enum)
i.e. toggle the appropriate lvar.

The WASM module and WAPI interface I provide supports lvars, hvars and calculator code strings (currently up to 255 characters). You should be able to set/activate any type of variable via calculator code, but the WAPI does not provide a mechanism for returning any values from calculator code executed.
If you are using the WAPI to access lvars/hvars, but would also like to read simulator variables (A:vars), then you can either use SimConnect directly in your application, or use the FSUIPC SDK which will provide read/write access to those simvars held in FSUIPC offsets. Alternatively, if using managed code, you could look into using Paul Henty’s dll client for .Net, which is a higher level c# interface wrapper around the FSUIPC SDK and WAPI.

Calculator code is just what it says. FSUIPC just executes the provided calc. code, so you can use any valid calc code you like, including B-types, A types, K types, etc. If the code is not doing what you think it should, I suspect that it is either invalid or not appropriate for the loaded aircraft.

John

1 Like