-
Posts
74 -
Joined
-
Last visited
-
Days Won
2
Content Type
Profiles
Forums
Events
Gallery
Downloads
Everything posted by joeherwig
-
Great to hear that you had such an flexible addition already in mind. It's so valuable to have so engaged people in the community! Kudos! I'll check your proposal. It sounds promising.
-
John / Pete, There are a couple of opportunities to submit via execute calculator code a value for those dimmers. See documentation for the glareshield dimmers: https://docs.flybywiresim.com/pilots-corner/a32nx-briefing/a32nx_api/#glareshield So for instance for the FlyByWire A32nx there are plenty of indexed light potentiometers out of the range 1-30. They are addressed via Calculator Code @ 10.23 / 50 max 100 min 85 (>K:2:LIGHT_POTENTIOMETER_SET) for instance means "Set the 'Integrated main Panel and Pedestal Lights' (Index 85) to 50% of its maximum brightness". I think what would help a lot of the cockpit builders is to have a function available in FSUIPC to send a value to a executeCalculatorCode function from an analogue input. So something like @ 10.23 / %val% max 100 min 85 (>K:2:LIGHT_POTENTIOMETER_SET) where %val% would just insert what FSUIPC reads from the analogue input. so something like: Would avoid that you need to add each and everything into your code and offer the ability to access even more stuff from FSUIPC (licensed of course ð Could that be an option? I'm sure I'd not be the only one really looking forward for something like that.
-
Best way to make browser interface with FSUIPC?
joeherwig replied to Firefly's topic in FSUIPC Support Pete Dowson Modules
That was, what made my day. So thanks a lot! -
Best way to make browser interface with FSUIPC?
joeherwig replied to Firefly's topic in FSUIPC Support Pete Dowson Modules
Great! I'll try it out this evening. Best regards and have a nice weekend. Joe -
Best way to make browser interface with FSUIPC?
joeherwig replied to Firefly's topic in FSUIPC Support Pete Dowson Modules
Hi @Paul Henty Thanks for the brilliant Websocket Server. I succeeded to access a lot of HVars and LVars which is really great. By trying to use the website i built as well on my mobile, i noticed, that i'm only able to register the websocket server either on localhost or 127.0.0.1 (which is just the IP4 representation of localhost). But via the IPV6 nor - and worse - the Hostname i do not succeed to register/start the websocket server. With a websocket server i made on my own, i can easily register on that port. Probably you've an idea, what the reason might be. My aim is to access with multiple clients to the websocket server. Is that supported as well? Best regards and thanks for your great solution, Joe -
Hi John, ladies and gents, After updating FSUIPC i experience again the problem that the Hvars are not available anymore. Even though the WASM is obviously correct installed and started. All the Lvar-stuff works flawless, but HVars i don't get running again. Any hint, where i can take a look at? It happesn no matter whether i let the FSUIPC installer put the fsuipc-lvar-wasm into the MSFS Community folder directly or if i add it via addon-linker.
-
LUA file and button / keypress assignments
joeherwig replied to rustam's topic in FSUIPC Support Pete Dowson Modules
HI Reinhard, Thanks for pointing that out... But i didn't miss that. As you can see here, working with LUA functions offers much more like displaying text on VRinsight panels, making decisions based on other values etc. That is ways more then just "send value to LVar". Some examples: https://github.com/joeherwig/A32nx-LINDA-aircraft-module/blob/main/A32nx/LINDA/aircrafts/A320/user.lua#L53 https://github.com/joeherwig/A32nx-LINDA-aircraft-module/blob/main/A32nx/LINDA/aircrafts/A320/user.lua#L365 https://github.com/joeherwig/A32nx-LINDA-aircraft-module/blob/main/A32nx/LINDA/aircrafts/A320/user.lua#L510 https://github.com/joeherwig/A32nx-LINDA-aircraft-module/blob/main/A32nx/LINDA/aircrafts/A320/user.lua#L1021 -
LUA file and button / keypress assignments
joeherwig replied to rustam's topic in FSUIPC Support Pete Dowson Modules
@John Dowson the lookup table requires, that I need to maintain the functions on at least two places. So a change of a function name like fixing a typo requires multiple synced changes. Adding new functions has to be done at the end of the table which gives a really weird order and parameters in without any 'near' to other functions of the same context just because I added them not directly afterwards. Setting up needs to count indices within the table to understand, what I have to setup as parameter just to execute a function. So if you test "what did I assign" in FSUIPC, you'll just see function 73. And if I turn the potentiometer a bit further function 126. ðĪŠ That is what I meant with not easy to maintain. It is simply nerd stuff then, not feasible for average users. @aua668 Thanks for the hint. Probably you know LINDA for really easy assignments to standard buttons and vrinsight components. As linked, I'd like to provide an easy to import and flexible to use module that simply doesn't work with tens or hundreds of files for just one aircraft. -
LUA file and button / keypress assignments
joeherwig replied to rustam's topic in FSUIPC Support Pete Dowson Modules
Hi Pete, Hi John, I just found the post above, when i tried to assign LUA-function calls to axes ranges or buttons. What i'm trying to do is using an aircraft specific lua script containing multiple functions and assigning those calls to buttons or ranges of axes. In general i'm able to get the introduced parameter... via: There is a small but. Only parameters i can assign are integers (as it seems). But as i'd like to pass the function name of my desire, that of course doesn't work based on integers. And keeping them in a function table and accessing it via the table index will give awful and really not useable code, i'm trying to find an approach to do so. Of course i know, that there are also the evt-files containing the events and mcro-files directly accessing the L:Vars But i didn't find the right place, where is mentioned how i'm able to call a lua and access a dedicated function call in there. And as splitting all the function over hundreds of files makes it really awful to maintain, i hope you can point me into the right direction. Or is there any other way how to assign a function call from a lua to ranges? LINDA only allows to assign to buttons but not to analogue ranges which i'd like to use. Thanks for your guidance and best regards, Joe -
Hi John, Hi Pete, ladies and gents, I have the events from the .evt file working great using FSUIPC7. Now i'm struggling on the next challenge. Instead of assigning it directly to buttons or axis, i'd like to trigger those events from LUA scripts and do some more things. Unfortunately even searching all the FSUIPC documentation - i only found the brief hint below: Is there any way to trigger those events from within LUA scripts as well? Even the FSUIPC7: Lua Library Reference didn't help me. Probably i just missed it. I now assigned those events to Buttons on the VRI MCP2A. That results in [Buttons.A320] 0=P289,22,C32776,0 -{:A32NX.FCU_SPD_PUSH}- 1=P289,17,C32777,0 -{:A32NX.FCU_SPD_PULL}- 2=P289,23,C32783,0 -{:A32NX.FCU_HDG_PULL}- 3=P289,28,C32782,0 -{:A32NX.FCU_HDG_PUSH}- 4=P290,7,C32788,0 -{:A32NX.FCU_ALT_PUSH}- 5=P290,2,C32789,0 -{:A32NX.FCU_ALT_PULL}- 6=P290,14,C32790,0 -{:A32NX.FCU_VS_INC}- 7=P290,10,C32794,0 -{:A32NX.FCU_VS_PULL}- 8=P289,25,C32780,0 -{:A32NX.FCU_HDG_DEC}- 9=P289,24,C32780,0 -{:A32NX.FCU_HDG_DEC}- 10=P289,26,C32779,0 -{:A32NX.FCU_HDG_INC}- 11=P289,27,C32779,0 -{:A32NX.FCU_HDG_INC}- 12=P290,5,C32785,0 -{:A32NX.FCU_ALT_INC}- 13=P290,6,C32785,0 -{:A32NX.FCU_ALT_INC}- 14=P290,3,C32786,0 -{:A32NX.FCU_ALT_DEC}- 15=P290,4,C32786,0 -{:A32NX.FCU_ALT_DEC}- 16=P290,12,C32791,0 -{:A32NX.FCU_VS_DEC}- 17=P290,11,C32791,0 -{:A32NX.FCU_VS_DEC}- 18=P290,13,C32790,0 -{:A32NX.FCU_VS_INC}- 19=P290,15,C32793,0 -{:A32NX.FCU_VS_PUSH}- in the FSUIPC7.ini. Taking a look in the "FSUIPC7 for advanced users.pdf" i noticed, that it looks just like So i added those as functions in my LUA: function A32nx_HDG_Mode_Managed () ipc.control(32782, 0) end function A32nx_HDG_Mode_Selected () ipc.control(32783, 0) end Could you please confirm, that my assumptions are right? In case it is like that. Would it be probably possible to somehow mention anywhere in the documentation how i can get the control numbers based on the aircraft event names? It's a bit hard to reverse-engineer. ð Thanks and have a good night! Joe
-
FSUIPC WASM module + client-side API + lvar/hvar discussion topic
joeherwig replied to John Dowson's topic in FSUIPC7 MSFS
Hey guys, I already succeeded to read a lot and write some of the L:Vars and trigger a couple of H:Vars successfully. (A32nx) unfortunately writing on a lot of L:Var starting with XMLVAR_ eg. XMLVAR_Momentary_PUSH_OVHD_FUEL_LTKPUMPS1_Pressed ... XMLVAR_Momentary_PUSH_OVHD_ELEC_BAT1_Pressed ... XMLVAR_Momentary_PUSH_OVHD_ANTIICE_ENG1_Pressed ... XMLVAR_Momentary_PUSH_OVHD_FLTCTL_SEC2_Pressed ... it fails. But for the following ones it works great: function A32nx_Autobreak_Off() A32nx_Autobreak_SET(0) end function A32nx_Autobreak_Low() A32nx_Autobreak_SET(1) end function A32nx_Autobreak_Mid() A32nx_Autobreak_SET(2) end function A32nx_Autobreak_Max() A32nx_Autobreak_SET(3) end function A32nx_Autobreak_SET(autoBreakLevel) ipc.writeLvar("L:XMLVAR_Autobrakes_Level", autoBreakLevel) local autoBreakLevelText = {"off","low","mid","max"} DspShow ("A-BRK", autoBreakLevelText[autoBreakLevel+1]) end Is that just FlyByWireSim specific? Missing implementation? -
generic triple use for buttons (single, double and long press)
joeherwig replied to joeherwig's topic in User Contributions
Uhm... Sounds reasonable Alan. I introduced the index later and did not properly investigate into the event.Button params well... 'll have to take a look at it. Thanks for your great analysis. -
generic triple use for buttons (single, double and long press)
joeherwig replied to joeherwig's topic in User Contributions
Thanks for pointing towards that John. Now it is: --[[ The following files are included using "dofile" to ensure that the functions you want to assign / call within the TripleUseAssignments.lua are available. The Examples listed in here refer to teh new MSFS2020 where LINDA (https://www.avsim.com/forums/forum/427-linda-downloads/) is used. LINDA (Lua Integrated Non complex Device Assignments) brings LUA scripts that map FSUIPC Offsets and even more logic to nice and self descriptive function names, which makes it much easier to assign them and even at a later point simply understand the assignments. In Case you want to get it running for other Simulators like P3D, FSX etc. you have to refer the related Function lists here. Of course TripleUse does not require to run LINDA to refer to those script files. You can also write and add your own. For me it was simply convenient to use the already made ones which saved me a lot of time. ]]-- -- Common functions needed, when you want to refer to the lib-msfs and lim-fsxcontrols functions. dofile([[.\LINDA\system\common.lua]]) -- The function definitions as provided with LINDA. dofile([[.\LINDA\libs\lib-msfs.lua]]) dofile([[.\LINDA\libs\lib-fsxcontrols.lua]]) -- The assignments of functions to your game device buttons itself dofile([[.\TripleUseAssignments.lua]]) -- Used to have a placeholder in case you do not want to assign something in the TripleUseAssignments.lua for some function. In that case just assign "ignore". As an "ignore" function did not exist in the above Function libs, i just added it here. function ignore () end The rest of the document remained functional the same and does not contain additional comments. Hope that helps. -
generic triple use for buttons (single, double and long press)
joeherwig replied to joeherwig's topic in User Contributions
Hey guys - and girls of course... ð I just added some comment into the TripleUse.lua hoping to point a bit more into the right direction in case you want to use other function scripts like your own ones, or some from P3D, FSX etc. Sry. for keeping you alone so long. I'm currently quite busy. -
How to properly read light switches @ [0D0C]?
joeherwig replied to YankeeFan's topic in FSUIPC Support Pete Dowson Modules
In case someone wants to play around with it in JS... Just open your webbrowsers Dev-Tools [F12] and execute the below snipet in your browsers console: // set the numeric value as reported from FSUIPC Offset 0x0D0C fsuipc_0d0c = 234 fsuipc_0d0c = (fsuipc_0d0c >>> 0).toString(2); // log the bit-sequence as string to console console.log(fsuipc_0d0c) light = {} light.navigation = fsuipc_0d0c.charAt(0)* 1 light.beacon = fsuipc_0d0c.charAt(1) * 1 light.landing = fsuipc_0d0c.charAt(2)* 1 light.taxi = fsuipc_0d0c.charAt(3)* 1 light.strobes = fsuipc_0d0c.charAt(4)* 1 light.instruments = fsuipc_0d0c.charAt(5)* 1 light.recognition = fsuipc_0d0c.charAt(6)* 1 light.wing = fsuipc_0d0c.charAt(7)* 1 light.logo = fsuipc_0d0c.charAt(8)* 1 light.cabin = fsuipc_0d0c.charAt(9)* 1 // log as object console.log(light) // log as beautified string console.log(JSON.stringify(light,null, '\t')) which results in { "navigation": 1, "beacon": 1, "landing": 1, "taxi": 0, "strobes": 1, "instruments": 0, "recognition": 1, "wing": 0, "logo": 0, "cabin": 0 } -
Hey guys, based on the TripleUse.lua i tried to get an more generic and easier to configure script. This supports to easily assign lua functions to button presses but not only for the rising or falling edge of the signal but also for double-press (like doubleclick) or for long press. It is based on Pete's TripleUse.lua but extended to be able to call the funtions that were already defined in other lua scripts like the ones coming with LINDA. You can just refer to it and re-use all the additional stuff like writing something to VRInsight panel displays etc. --[[ 1=BU0836A Interface 2=MFG Crosswind V2 3=FCU / Lights 5=Joystick 7=Controller (GAME FOR WINDOWS >) btnFunc is an multi-dimensional array (lua:table) containing data in the format { joy, button, singlePressFunctionName, doublePressFunctionName, longPressFunctionName } use function name "ignore" to mark an status as unused. ]] btnFunc = { { 3, 7, "DeIce_PITOT_on", "ignore", "DeIce_PITOT_off"}, { 5, 3, "APU_STARTER", "APU_EXTINGUISH_FIRE", "APU_OFF_SWITCH"} } In the 2nd line of the btnFunc "Table"/ array you can see, that the Joystick button three has the APU assigned that way: single short press: APU start double short presses: APU extinguisher fires long press: APU is switched off. Of course that list / array with buttons can be easily extended to all recognized "USB_Gamecontroller_Buttons". I published the more generic TripleUse.lua and TripleUseAssignments.lua on Github. See: https://github.com/joeherwig/msfs-fsuipc-lua-scripts Probably someone might find that useful. Thanks Pete for your support! Joe
-
Problem with "TripleUse.lua"
joeherwig replied to Pizman's topic in FSUIPC Support Pete Dowson Modules
Hi Pete, Thanks for your support... I finally succeeded. In case, you're iterested in the "how"... i published the more generic TripleUse.lua and TripleUseAssignments.lua on Github. See: https://github.com/joeherwig/msfs-fsuipc-lua-scripts Probably someone might find it usefull as well. -
Problem with "TripleUse.lua"
joeherwig replied to Pizman's topic in FSUIPC Support Pete Dowson Modules
Hi Pete, Thanks for the fast reply. Well... It's not LINDA specific but just a matter of organizing my LUA code. Using the already available functions from the other lua file has a simple benefit: It makes the code more readable and ways easier to understand and doesn't require fiddling around with cryptic numbers nor duplicating code lines. Anyway... The work of mapping offsets and the corresponding values to functions was already done, so why should i do it again? Being "functional lazy" is not always bad. And it also includes writing messages to the VRInsight display or able to play sounds directly, which is quite handy imho. See some extract from the file LINDA\lib\lib-msfs.lua underneath the FSUIPC.exe path: -- Default MSFS -- Updated for LINDA 4.0.0 -- Aug 2020 -- V 1.20 --[[ v1.20 * changed Auto_MASTER implementation --]] -- ## Autopilot controls ##################################### -- ... function Autopilot_HDG_BUG_align () val = ipc.readDBL(0x2B00) ipc.writeUW("07cc", val/360*65536) DspHDG(val) end -- ... -- ## Radios functions ##################################### function isAvionicsOn () return ipc.readUB(0x2E80) == 1 end function Radios_DME_AUDIO_toggle () if logic.And(ipc.readUB(0x3122), 2) ~= 2 then if _MCP1 () then DspShow("DME","AUD") else if RADIOS_MODE == 4 then -- DME display is open DspRadioIdent_on () else DspShow("DME","AUD","DME","Ident On") end end ipc.control(65839) else if _MCP1 () then DspShow("DME","off") else if RADIOS_MODE == 4 then -- DME display is open DspRadioIdent_off () else DspShow("DME","aud"," DME","IdentOff") end end ipc.control(65834) end end -- ... So instead of again writing the same 24 additional lines for toggling the DME Audio on long-press just in another lua file, i'd like to include the function call in the above mentioned LUA table (array), and that's it. But i'm simply not sure, how i can access the functions being defined in C:\FSUIPC7\LINDA\lib\lib-msfs.lua in my C:\FSUIPC7\TripleUse.lua that's all i wish to do. ð -
Best way to make browser interface with FSUIPC?
joeherwig replied to Firefly's topic in FSUIPC Support Pete Dowson Modules
Hi Paul, first of all... thanks for jumping onto the Websocket-Train. ð I tried to approach something similar with https://gitlab.com/joeherwig/portable-sim-panels-fsuipc-server which is used for https://github.com/joeherwig/portable-sim-panels But It seems, i should investigate into the new Websocket-Server you provided. What is essential is that only updated data is sent to the subscribers, as registering on events of course is a performance-bottleneck if you're receiving information which you don't need, as they did not change. May i suppose, that this feature is already there? And one more suggestion... If we anyway have a "list" of FSUIPC offsets, there types and calculations... Wouldn't it be a good idea, to provide that already in the right format (JSON array), so that users can just import that without the need of fiddling around with the right types and conversions. I'm sure based on the documentation Pete and John are doing anyway, it is also possible to render it into JSON right? Thanks a lot! Joe -
Hi Pete, Thanks for your kind reply. So i fully aggree, it is much more worth the effort to help us with FS2020... ð But it is great to see, that there are others also using JS to work with the simulator. Probably one of those users has any ideas how to approach it. I'll check the threads. Thanks for the links! All the best to you and your family for 2021! Joe
-
Problem with "TripleUse.lua"
joeherwig replied to Pizman's topic in FSUIPC Support Pete Dowson Modules
Hi Pete, hi John, hey guys, I tried to make the tripleUse.lua for me a bit more flexible. Most of the part i already succeeded. But still one small thing is missing. I'm trying to hand in a config, where i can set function calls for each of the three types (single-, double-, long-press) So far all the events are registered and entered. I also get the right "function call". But obviously the functions are not found. Probably you can give me a hint on that, how i'm able to access the MSFS / FS2020 functions which i can also assign via LINDA. Thanks a lot and best regards, Joe Code: FSUIPC7.log ********* FSUIPC7, Version 7.0.3 (23rd December 2020) by John Dowson ********* ... 15312 -------------------- Starting everything now ---------------------- 15375 LUA.1: beginning "H:\FSUIPC7\ipcReady.lua" 15516 LUA.2: beginning "H:\FSUIPC7\linda.lua" 15531 LUA.2: LINDA:: [START] *********************** STARTING LINDA *********************** 15547 LUA.2: [START] LINDA Ver = 4.0.3 15562 LUA.2: [START] FSUIPC Ver = 70030000 15578 LUA.2: [START] MSFS Ver = 110 15641 LUA.3: beginning "H:\FSUIPC7\TripleUse.lua" 15641 LUA.3: 3 7 1 15656 LUA.3: 3 8 2 15687 LUA.3: 3 9 3 15906 LUA.2: LINDA:: [START] Loading System Configuration files ... 19219 *** LUA Error: [string "Avionics_MASTER_on()"]:1: attempt to call global 'Avionics_MASTER_on' (a nil value) 22125 *** LUA Error: [string "Avionics_MASTER_off()"]:1: attempt to call global 'Avionics_MASTER_off' (a nil value) 24094 *** LUA Error: [string "Avionics_MASTER_on()"]:1: attempt to call global 'Avionics_MASTER_on' (a nil value) 25391 LUA.3: ...... ignoring buttonpress It seems, that the function calls are not found. Do you have any hints for me? And congrats... It's phantastic, what is possible with FSUIPC! Worth every penny. ð TripleUse.lua -
Hello Pete, hello John, As Microsoft is moving clearly towards HTML and JS for gauges, mods, extensions etc. i wounder whether there are already any plans to enable also JS within the FSUIPC world. I again struggled on with very basic tasks like array.length() etc. which is always ways more complicated in lua then in the JS world. So in case you have any plans regarding that,... just let us know! Best regards, Joe