falano Posted September 4 Report Posted September 4 Hello everyone. I'm new to this forum. I need to repair an F18 Super Hornet VRS simulator. The HOTAS for the throttles, joy stick, and pedals are commercially available and are controlled by FSUIPC. However, the rest of the hardware is controlled by a non-commercial HID, and FSUIPC v6 either doesn't detect it or I don't know how to get it to detect it. I've programmed some switches with events and SimConnect, but the F18 VRS is very limited, and I have no experience programming using FSUIPC. In the event that FSUIPC isn't able to detect the HID, could you recommend some documentation for doing so using the FSUIPC SDK? Thank you very much.
John Dowson Posted September 4 Report Posted September 4 1 hour ago, falano said: However, the rest of the hardware is controlled by a non-commercial HID, and FSUIPC v6 either doesn't detect it or I don't know how to get it to detect it. FSUIPC will only detect joystick type HID devices. Could you show me / attach your FSUIPC6.log and FSUIPC6.ini files, and the output from the HidScanner program (should be in your FSUIPC6 Utils folder). 1 hour ago, falano said: In the event that FSUIPC isn't able to detect the HID, could you recommend some documentation for doing so using the FSUIPC SDK? The FSUIPC SDK only provides functions for reading/writing to FSUIPC offsets - it has nothing for devices. You should be able to use the lua com library to detect (and control/assign) your device. Start with using the HidDemo.lua and adapt that to see if it detects your device. The script should be available in the lua example scripts package in your FSUIPC6 Documents folder.
falano Posted September 5 Author Report Posted September 5 Thanks, John, for your response. FSUIPC6 doesn't detect the HID. Therefore, it's nothing shown in FSUIPC6.INI. It's a non-commercial HID, however, with the Hidapi library, I can read its 64-byte output buffer and identify the Sim's hardware activity, but I don't know how to send messages to Prepar3D corresponding to the hardware signals. The VRS F18 Super Hornet documentation, defines many keys for the weapon, and I can manage them by sending the keys to the Prepar3D window, but there are many switches not mapped to keys. I've attached a diagram to better understand my problem. Could I get FSUIPC6 to recognize the HID? I know its VIP and PID. If FSUIPC recognized it, I could create macros with the mouse. I think this would solve my problem. I have never worked with the Lua library or script. If you think it's best best way, could you recommend some documentation? Thank you very much for your time. Esquema del Proyecto.xlsx
John Dowson Posted September 6 Report Posted September 6 13 hours ago, falano said: I don't know how to send messages to Prepar3D corresponding to the hardware signals. You use SimConnect, or you can use the FSUIPC SDK for this. If your program is getting events for button presses, you can then sent an event on to P3D using SimConnect, or write to an FSUIPC offset to trigger an evemt. 13 hours ago, falano said: Could I get FSUIPC6 to recognize the HID? As I said, FSUIPC only recognises joystick type HID devices. for other devices, you can maybe use the Lua com library. 13 hours ago, falano said: I have never worked with the Lua library or script. If you think it's best best way, could you recommend some documentation? Again, as I said, first try using the HidDemo.lua program. You need to edit this to provide your device PID and VID. take a look at that and try that. This will convert any buttons on your devices to virtual buttons/flags that you can then assign in FSUIPC. And it writes axis values to offsets which you can then also use. This lua script is provided as a demo, but is useful for testing if you can control your device via this. If so, then take a look at the lua com library API in the FSUIPC Lua Library document. In FSUIPC. you can also try logging your HID devices to see if this is seen - from the Lua com library documentation: Quote NOTE: Logging HID devices in FSUIPC. You can get a list of all HID devices connected to your PC, as well as their comings and goings, by setting the Custom log value (available from the Log menu) to x200. John
John Dowson Posted September 6 Report Posted September 6 I would like to know if the lua com library can see (and therefore be used to control) your device. I think that would be the easiest solution. If not, rather than bespoke programming, you could look into MobiFlight or SIOC (from OpenCockpits). Many home cockpit builders use this in conjunction with FSUIPC. But I can't help with these products as I have never used them - I do however support FSUIPC users who use these with FSUIPC. Also, have you asked on the support for your device? It is them that should provide the software/drivers and support to communicate to the FS, especially if it is not recognised by windows as a standard "game controller", i.e. a joystick-type HID device. John
falano Posted September 6 Author Report Posted September 6 Thank you very much for your advices and time. I Let you know the out come. Jordi
falano Posted Thursday at 09:38 PM Author Report Posted Thursday at 09:38 PM Hi, Sending keystrokes works with text editors, but not with Prepar3D, or I don't know how to do it. I will use FSUIPC6 for the rest of the project. I am using Prepar3D v6.034 and FSUIPC 6.2.2. Is the ModuleUser64 SDK compatible with FSUIPC6? Thanks in advance.
John Dowson Posted Friday at 08:30 AM Report Posted Friday at 08:30 AM 10 hours ago, falano said: Sending keystrokes works with text editors, but not with Prepar3D Sorry, but what do you mean? How are you sending the leystrokes? 10 hours ago, falano said: Is the ModuleUser64 SDK compatible with FSUIPC6? Yes, it should work with all versions of FSUIPC. John
falano Posted yesterday at 09:27 AM Author Report Posted yesterday at 09:27 AM My former question: Sending keystrokes works with text editors, but not with Prepar3D your answer: Sorry, but what do you mean? How are you sending the leystrokes? I meant that when my program detected a change in the simulator's hardware (switch or button), it would send the code and the scan code of a key. The keys sent this way are recognized by text editors like Notepad or Word, but FSUIPC does not recognize them. Prepar3D also does not recognize the keys that are assigned when they are sent by a program (sendinput). Regarding using other software like MobiFlight or SIOC, I think it is simpler and more direct to use FSUIPC because it is the standard. I will try to look in 'Lua' libraries; I have seen a function called event.key in forums, and I will try it. Do you know any way in which I could somehow emulate a key press that FSUIPC would recognize? Thank you very much.
John Dowson Posted yesterday at 09:39 AM Report Posted yesterday at 09:39 AM FSUIPC takes its key input from the P3D main window (class name FS98MAIN). Any key sent to that windows class should be picked-up by both P3D and FSUIPC. 6 minutes ago, falano said: I have seen a function called event.key in forums, and I will try it. event.key is a lua event function that calls the handling function when a key is pressed. FSUIPC needs to see/receive the key press/release events for this to work. 10 minutes ago, falano said: Do you know any way in which I could somehow emulate a key press that FSUIPC would recognize? FSUIPC runs as a dll inside of P3D. You need to get P3D to recognise the key press, then FSUIPC will also see it.
falano Posted 16 hours ago Author Report Posted 16 hours ago Thank you for your help. I will focus on P3D. I am using P3D v6 and I have recompiled your IPCuser64.c/h for VS2022 (UIPC64_SDK_C_version2). The function FSUIPC_Open keeps giving me error 2. Is there some incompatibility? Or is it an error on my part? Thank you very much.
falano Posted 7 hours ago Author Report Posted 7 hours ago Hello again John, Please note: Providing more information about my question: My program cannot find the FSUIPC window and this is the report: Trying to connect to FSUIPC...? Could not open FSUIPC. Error: 2FSUIPC_ERR_NOFS (FSUIPC not found) Has the window used by FSUIPC6 changed compared to previous versions? My version of FSUIPC is 6.2.2 and P3D is 6.0.34.31011. I have compiled the library with the files UIPC64_SDK_C_version2: IPCuser64.c/IPCuser64.h/FSUIPC_User64.h. Thanks in advance.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now