Jump to content
The simFlight Network Forums

John Dowson

Members
  • Posts

    13,272
  • Joined

  • Last visited

  • Days Won

    271

Everything posted by John Dowson

  1. I have done some further testing on writing to offsets 0x3110 (for control number) an4 0x3114 for the parameter, and this works as expected, i.e. the control is always sent when writing to offset 0x3110, even if its the same control number, and if the parameter in 0x3114 has been changed or not - whatever that offset holds when 0x3110 is triggered will be used. This is the case in the current released version, so that patched version I attached is not actually needed. So if you are seeing different behavior when writing to these offsets via SIOC, then it is an issue with SIOC. John
  2. Sorry, but I have no idea. Are you saying that you previously had it connected via a COM cable to COM ports, and are now using a serial-to-USB cable and it is connected to a USB port? Why are you configuring COM ports if it is a HID/USB connection? Why do you need to set a baud rate if it is connected via USB? Have you tried using the PFC hid driver rather than the com driver? I have no PFC equipment and have never even seen or used any. All my knowledge on this comes from the documentation and existing support requests, so I suggest you start there (i.e. read the documentation).
  3. Btw, the calc code for FNX320_APU_START_SWITCH is: (L:S_OH_ELEC_APU_START) 2 + (>L:S_OH_ELEC_APU_START) i.e. it is incrementing the lvar by 2, not 1. So maybe try: - Toggle APU Start Button local val = ipc.readLvar("S_OH_ELEC_APU_START") if val == 0 then ipc.writeLvar("S_OH_ELEC_APU_START", 2) else ipc.writeLvar("S_OH_ELEC_APU_START", 0) end The calc code for the press/release presets looks rather strange to me, as it seems to be sending two values to the lvar, which I didn't think possible: push: 1 (L:S_OH_ELEC_APU_START) ++ (>L:S_OH_ELEC_APU_START) release: 0 (L:S_OH_ELEC_APU_START) ++ (>L:S_OH_ELEC_APU_START) If the presets are not working, you can ask about this on the MF support discord server (MSFS2020 channel). John
  4. They are MF presets, and there is also FNX320_APU_START_SWITCH. You can assign to presets directly (check the select fir Preset checkbox), or in lua you can use ipc.execPreset function. I don't have the fenix to check these. John
  5. Does the lvar change values? Ifthe script is sunning as expected and the lvar is changing values, then you need something more than just to set that lvar. Why not try the presets instead: APU Start Button Push and APU Start Button Release Use logging to see if the script is running and the lvar is being updated: set logging for Lua Plugins and WAPI debug level logging.
  6. Your FSUPC6 installation is here: So all FSUIPC related files should be under that folder. However, you should NOT use the P3D installation folder. If yuo have installed there, then uninstall and re-install in a different (non windows-protected) folder. Don't foget to copy/move your FSUIPC6.ini and FSUIPC6.key files across to the new location to preserve your settings and registration, as well as any other files (*.lua, *.dll) that you are using. Are the button assignments working? If the ini file you attached is the one being read, I cannot see how just the axis assignments are lost. Can you set logging for Axes Controls and show me another log file, if you get the same issue after re-installation. Note that you should also always exit P3D/FSUIPC before attaching log files - the one you attached shows that FSUIPC was still running. Are you sure that this is not because the system is paused? There are a few messages indicating that the sim pause is turned on, but non indicating that it was turned off: Note that you also have controllers turned on in P3D: when assigning in FSUIPC, best to turn off controllers in P3D. If controllers are on, make sure that any axes/button that is assigned in FSUIPC is not assigne in P3D. And be-aware that sometimes P3D can automatically re-assign a button or axis, so you may need to check regulary if you get issues. John
  7. Is APLv2 using offset 0x0BCC to detect if the spoilers are armed or not? Can you try logging that offset (Log->Offsets. as U32) to see if the value in that offset changes to 1 when armed. If not, then that will be the issue. You would need to determine what is holding the spoilers armed state if it is not the simvar SPOILERS ARMED, and add that to a spare offset and then spoof the reading from offset 0x0BCC to the new offset. I can help with this if needed. First, log offset 0x0BCC and see if it changes or not. If it changes, then you need to contact support for APL. If it doesn't, then look at the available lvars to see if any of them look appropriate (Add-ons->WASM->List Lvars), and if so check the value (i.e. arm/disarm and see if the value changes) If you find an lvar that holds this state, you can then add that to a spare/free FSUIPC offset - to do this, see the Advanced User guide, section Adding Lvars to Offsets on page 47. Once it is in an offset, you can then write a lua script (which should be auto-ran in your MD-11 profile) to spoof offset 0x0BCC to the one holding the actual armed value, via writing to offset 0x0024, There is a sample script provided that shows how to do this (liar.lua), which you can use and modify for your own needs. John
  8. Yes, please create a User Contribution for this - I think that would be useful! John
  9. There are two methods to use the PMDG custom controls: one is via the Rotor Brake Control, and the 2nd method is to use the custom control number. EVT_MPM_AUTOBRAKE_SELECTOR is defined in the PMDG SDK header file PMDG_NG3_SDK.h: So the custom control number would be 69632 + 460 = 70092. For the values the control takes, you need to see what the associated variables holds: Generally you would use custom controls via the Rotor Brake method to emulate mouse clicks, and the custom control methos can send actual values (as well as emulate mouse clicks). See the followinf FAQ entries on using both methods, and on how to determine the control number/parameter to use" Note that there also special offsets for PMDG aircraft, so, for example, the current value of MAIN_AutobrakeSelector would be held in offset 0x6607 (if/when PMDG offsets are enabled and data broadcasting has been activated): John
  10. Two things wrong here: - there is no such type as S16 - use S32. And 4 bytes is too small - that should probably be 16 - the simvar name is AIRCRAFT OBJECT CLASS, not object_class Ah, missed that one, and that one is better as it also exists in MSFS2020. Just tried this in both MSFS2020 and MSFS2024 with the following entry in the myOffsets.txt file: and this seems to work in both MSFS2020 and MSFS2024: John
  11. You could do that, but that is an issue - you would have to remember to not install that file each time you updated. I don't see any advatantage in doing this. Really I should process the myevents.txt file first, so the control numbers for the presets always start from that file. I could change this in the next release I guess, as anyone who is using the control numbers for presets is most probably not using the events.txt file for this reason. I think this is because you are writing the parameter AFTER the control number to offset 0x3110. As I said, you should write the parameter first, then write the control number to offst 0x3110 after the parameter has been written. The change in that version was to allow the same control number written to 0x3110 to still trigger the events. I will do some more testing on this next week, Well, that is surprising as the preset/calc code should be the same as sending the Rotor Brake control. I will also test this next week. Yes - this is what hat patched version was supposed to address, so I am not sure why it isn't working. I will get back to you sometime next week when I have had time to test a bit more. John
  12. Maybe better to send a fixed number of events on a short press rather than using the time, where the number of events could vary. To do this, use a counter instead of elapsed time: initialse the counter to zero before the loop, increment the counter in the loop and the loop condition should exit when the flag is cleared and the counter is above the minimum needed.
  13. Here's an updated script with that added: local trimUpControl = 65615 local trimDownControl = 65607 function trimControl(flag) startTime = ipc.elapsedtime() nowTime = startTime if flag == 0 then -- trim up while ipc.testFlag(0) or nowTime - startTime < 100 do ipc.control(trimUpControl) nowTime = ipc.elapsedtime() end elseif flag == 1 then -- trim down while ipc.testFlag(1) or nowTime - startTime < 100 do ipc.control(trimDownControl) nowTime = ipc.elapsedtime() end end end event.flag(0, "trimControl") -- trim up event.flag(1, "trimControl") -- trim down ipc.log("*** lua elevator Trim (repeat) script now running") elevTrimRepeat.lua
  14. Yes - and I corrected my previous post.
  15. Use the ipc.elapsedtime function just before the loop starts (startTime) , and again after the control has been sent (nowTime). Then change the condition in the while loop to only exit the loop when the flag is not set or the difference between the two times is > 100 (i.e. ipc.testFlag(1) or nowTime - startTime < 100).
  16. Note also that all auto-ran lua scripts are killed and restarted when you go back to the main menu. If you are having the script auto-ran from the general [Auto] section (as opposed to a profile [Auto.xxx] section, you can just exit the script if you don't want to use it with the loaded aircraft, as this would save resources. I would not recommend changing aircraft without going back to the main menu (e.g. via devmode aircraft selector or other means) as this method is not fully supported by FSUIPC. John
  17. The script I provided will be a lot more efficient as there is no timer running and it just re-acts to the flag-change events. Why are you testing/checking the aircraft name - are you running the script for all aircraft? Much better to just have the lua script auto-started in a profile for the aircraft that need it. John
  18. Try the following: local trimUpControl = 65615 local trimDownControl = 65607 function trimControl(flag) if flag == 0 then -- trim up while ipc.testFlag(0) do ipc.control(trimUpControl) end elseif flag == 1 then -- trim down while ipc.testFlag(1) do ipc.control(trimDownControl) end end end event.flag(0, "trimControl") -- trim up event.flag(1, "trimControl") -- trim down ipc.log("*** lua elevator Trim (repeat) script now running") Have that script auto-ran via your profile [Auto.xxx] section, then assign your trim buttons to: trim Up: press to 'LuaSet <luaScriptName>' with parameter 0, release to 'LuaClear <luaScriptName>' with parameter 0 trim Down: press to 'LuaSet <luaScriptName>' with parameter 1, release to 'LuaClear <luaScriptName>' with parameter 1 if its too fast, add an ipc.sleep(n) (where n is the number of ms to sleep, start with 10 and adjust as needed) after the ipc.control calls. John elevTrimRepeat.lua
  19. First, you posted in the main support forum - please use the FSUIPC7 sub-forum for all issues/questions on using FSUIPC7 with MSFS2020/MSFS2024. I have moved your post. Looking at your log file, this is because the WASM module is not installed: Presets, lvars. hvars and calculator code will not work without the WASM. So please re-install and make sure the WASM is installed. If there are issues instaling the WASM, please show me / attach your InstallFSUIPC7.log file. Your log file also showa connection issue with quite a few connection attempts. You manually started FSUIPC7 before starting MSFS. If manually starting FSUIPC7, then it is always better to do this after FSUIPC has started. If you wnt to start FSUIPC7 before MSFS, then you need to set the ini parameter DetectToConnectDelay to the same value as DetectToConnectDelayAuto to prevent too many connection attempts once MSFS has started. It is generally better to use the auto-start facility, but if starting FSUIPC7 manually then do this once MSFS has started and arrived at the main menu (or adjust that parameter appropriately). John
  20. Ok, let me know how it goes or if you have any issues/further questions. Thinking about this, it won't be that straight forward, as you need to repeat sending the control while the button is held down, and stop sending them when the button is released. This can be tricky in lua. Off-hand, I can think of a couple of ways of doing this, but each may have issues and will need testing: 1. Use event.button and have the script auto-run (in the profile). The event.button handling function should loop forever sending the control. To stop the controls being sent, you need to assign the same button, but on release, to restart the lua script. This will then kill the existing script (and end the forever loop) and restart it ready for the next button press. The downside of this solution is that there may be a small delay after releasing before pressing will work again, as the script needs to be restarted (and recompiled first). 2. Again, have the script auto-ran (in the profile), but use event.flag instead, and assign the button press to LuaSet <luaScript> and the release to LuaClear <luaScript> (or maybe just both to LuaToggle), with the parameter for both being any flag number (0-255). In the event.flag handling function, you would either: - start an event.timer, which would call a handing function at regular intervals which sends the appropriate inc/dec control - cancel the existing timer using event.cancel. The downside of this solution maybe the speed/throughput, which will need testing. Note also you could either use one script for both in/dec, or have separate scripts. Let me know how it goes, I could maybe take a deeper look over the weekend (or next week) and see what works best, and provide you with a lua template script if needed. John
  21. The log file you attached shows that FSUIPC could not connect to MSFS. Nothing is going to work if it cannot connect. Try tuning your start-up parameters (namely the DetectToConnectDelayAuto ini parameter which may need updating/increasing) - see the Asvanced User guide for details, or the following FAQ entry: But the ini file you attached shows you do not have any axes/levers assigned in the general section of FSUIPC - your [Axes] config section is empty. You only have 10 button assignments, to prop pitch, throttle and elevator trim. So the axes must be assigned in MSFS, so check there. You also have one profile defined for the 'FSS Embraer E170 American', but this is empty (i.e. no assignments).
  22. That is interesting, as this means that what you wrote to the offset was actually applied, as the read values are populated from what is received from the FS, not what is written (there are separate memory addresses for read and write).. Strange this has no effect then. Do you see the (read) values change in that offset when you actually change the trim? Ok, let me know how it goes or if you have any issues/further questions. John
  23. Setting the ButtonRepeat ini parameter will apply to all buttons, as you say. If you want to change for a single button, you could try using a lua script (using event.button) instead of a direct assignment. But if this is for trim, doesn't the standard method of setting up trim work? i.e. rather than sending more/repeated inc/dec controls, set the elevator trim percent via offset 0BC0? You can also use different inc/dec deltas to have a fast and a slow increase/decrease. This is the standard method of assigning to replicate a trim wheel. For example, these are the assignments I use on a rotary to control the trim (for most aircraft): There are also some more advanced lua solutions in this FAQ entry: John
  24. No. It is generally better to assign with Send direct to FSUIPC calibration (and calibrating). Only use Send to FS as normal axis if sending to calibration causes issues or doesn't work, which can happen with some aircraft. Note that, by default, axes assigned using Send to FS as normal axis are still calibrated in FSUIPC (if a calibration section exists), but this is performed after the event has been received back from the FS (which is masked/blocked). John
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.