I have a pretty simple LUA script I've been using to monitor the PMDG 737 seatbelt switch position and also set it in the MSFS seatbelt offset, so that external apps can detect it, but for some reason, without the script having changed at all, it stopped working as far as reading the Lvar is concerned, and when I use the key binding I've added to restart it, FSUIPC7 hangs completely, and has to be killed through Task Manager.
function setSeatbeltSign(varName,varValue)
print(varName,varValue)
if varValue ~= 0 then
ipc.writeUB(0x341D,1)
else
ipc.writeUB(0x341D,0)
end
end
event.offset(0x64FB,"UB","setSeatbeltSign")
event.Lvar("switch_104_73X",250,"setSeatbeltSign")
(I added the print just for debugging purposes after it started hanging)
Originally I was only listening to the 0x64FB offset, which is the published offset for the seatbelt sign on the PMDG 737, but then I noticed that when using PilotsDeck / Stream Deck, the PMDG 737 profile I was using for it was reading from and writing into the Lvar, so I added that one too. I had a few flights where it all worked great, and whether I was switching the seatbelt sign using the mouse, or using my Stream Deck, I could see the change reflected in the external app that was watching for the 0x341D offset. Today, I couldn't get the Lvar to work (only flipping the switch with the mouse would be reflected in the 0x341D offset, while writing into the Lvar using the Stream Deck would be reflected visually in the plane's cockpit, but 0x341D would remain unchanged), and whenever I try to restart the Lua script using my keybinding (lshift+c), FSUIPC7 hangs entirely. I can't open its UI, Windows says it's "not responding", Mobiflight reports having lots its connection with it, and same with Passenger2.
Let me know whatever information I can provide, and whatever steps you'd like me to try so as to debug this. I've attached my .ini.
Appreciate your help.
FSUIPC7.ini