Hi John, I use LUA for managing LVARS and all works very well. Since I use OpenCockpits MCP and EFIS, I have to use some offsets ("A001, A002, A003...") to allow LUA to detect OC buttons or knobs, and then it sets the LVARS properly. So this code works perfectly (with default Asobo A320 neo) :
function MFD_RANGE_SET()
MFD_range = ipc.readUB(0xA001)
ipc.writeLvar("L:A320_Neo_MFD_Range", MFD_range)
end
event.offset("A001","UB", "MFD_RANGE_SET")
When offset A001 changes (controlled by my O.C. EFIS range knob, the Lvar is set correctly.
I tried to handle also HVARS :
function PFD_ILS_MODE()
ILS_BTN = ipc.readUB(0xA004)
if ILS_BTN == 1 then
ipc.activateHvar("H:A320_Neo_PFD_BTN_LS")
end
end
event.offset("A004","UB", "PFD_ILS_MODE")
This DOESN'T WORK, but if I replace the activateHvar with calculator code, it works perfectly
function PFD_ILS_MODE()
ILS_BTN = ipc.readUB(0xA004)
if ILS_BTN == 1 then
ipc.execCalcCode("(>H:A320_Neo_PFD_BTN_LS)")
end
end
event.offset("A004","UB", "PFD_ILS_MODE")
What I am doing wrong with ipc.activateHvar ?
No problems for me to use calculator code, but I would like to understand why ipc.activateHvar doesn't work.
The same happens with other Hvars, all work in calculator code but not in ipc.activateHvar.
Maybe that this happens because I can't find those Hvars under wasm --> list Hvars, but the calculator code finds them. How can I add them to FSUIPC ?