
Paul Henty
Members-
Posts
1,724 -
Joined
-
Days Won
77
Content Type
Profiles
Forums
Events
Gallery
Downloads
Everything posted by Paul Henty
-
fsuipc7 FSUIPC 7 MSFS2020 VB.net HELP
Paul Henty replied to ihiyani's topic in FSUIPC Client DLL for .NET
I don't know how these offsets work. You might want to post in the main FSUIPC support forum with a description of what you are trying to do. More people will see it there. Someone might know how these offsets should be used. Paul -
fsuipc7 FSUIPC 7 MSFS2020 VB.net HELP
Paul Henty replied to ihiyani's topic in FSUIPC Client DLL for .NET
First, please make sure you're only declaring offsets once. Usually this is at the main class or form level. All these offsets are write-only so they should be marked as write-only when you declare them. They should also be placed in their own group so you can process them separately. The pushback seems to be different from the tug. The tug goes forward, not back. Private TugH As New Offset(Of UInteger)("tug", &H31F8, True) Private TugS As New Offset(Of UInteger)("tug", &H31FC, True) Private PushBackState As New Offset(Of UInteger)("pushback", &H31F4, True) For offset 31F8, the heading in degrees needs to be converted to FSUIPC Units: Dim HDG as integer = TextHDG.text * 360D / (65536D * 65536D) For offset 31FC the values are in feet/second. The Process() call must come after you set the values so the new value can be written: Dim HDG as UInteger = TextHDG.text Dim SPD as UInteger = TextSPD.text TugH.Value = HDG * 360D / (65536D * 65536D) TugS.Value = SPD FSUIPCConnection.Process("tug") Paul -
Yes this confused me at first. That's why it wasn't working properly before. The documentation appears wrong. What I discovered is that in Hex these values are 01nn for messages and 02nn for menus. I've no idea what the last byte means so I just ignore it now and test 0xB005 for 1 and 2. That seems to work nicely. Thanks for confirming you're seeing 0 for the simconnect id (0xB00C). That seems to be a problem specific to FSUIPC6. With FSUIPC4 it's fine for me here. Paul
-
Hi James, Version 3.1.23 BETA is now on Nuget. (Tick the 'Include Prereleases' box to make it show up). I didn't make textmenus thread safe. Should be okay now. Strange as I'm not seeing that here with FSX/FSUIPC4. The Simconnect ID is an Integer stored in offset 0xB00C. Can you check that your end please e.g. via the FSUIPC Logging? If it's also 0 there, then you'll have to speak to John/Pete about it in the main forum. The menu/message detection was not reliable. I've fixed it now so you should see menus with empty titles. Let me know how you get on... Paul
-
Thanks for that Spokes. I see there are other controls that reference the Vertical Speed. Have you tried these @Fabio Drago instead? AP_PANEL_VS_HOLD AP_PANEL_VS_OFF AP_PANEL_VS_ON AP_PANEL_VS_SET AP_VS_OFF AP_VS_ON AP_VS_SET The _SET controls probably take 0 and 1 as a parameter. Paul
-
If it's just that control then it sounds like it's not implemented in MSFS SimConnect or FSUIPC7 yet. Maybe @John Dowson can take a look. Paul
-
FSUIPCControls are listed in "FSUIPC For Advanced Users". These have notes about their parameters. There is no documentation for the basic FS control parameters as far as I know. The list of known FS/P3D controls is in the FSUIPC documentation folder called "The 2016 List of FSX and P3D Controls.pdf" (or similar). There is no info about the parameters however. If you turn on the FSUIPC logging for 'Events (non-axis controls)' and 'Send to a console window' you can see in real time what events are being generated. With this active you can operate the VS hold switch in the sim and then see what event was generated. The event names displayed will match the Enum and controls documentation. I think it also shows the parameter values. Paul
-
I guess XPUIPC hasn't implemented events/controls then. The FsControl list contains all the controls that are built into the flight sim. The FSUIPCControl are extra controls provided by FSUIPC. These are either useful controls that affect the flight sim, or controls to operate features in FSUIPC itself. For example: FsControl has a control to automatically starting all the engines. (ENGINE_AUTO_START) FSUIPCControl provides extra controls to automatically start each of the 4 engines separately.(e.g. ENGINE_3_AUTOSTART) FSUIPCControl provides a control to remove the AI Traffic (TRAFFIC_ZAPALL). This is a feature provided by FSUIPC itself. The control allows programs to activate this FSUIPC feature. There are also other control lists: FSUIPCAutoPilotControl FSUIPCAxisControl PMControl (Controlling glass cockpit software from Project Magenta) PMDG_737_NGX_Control (Controlling the 737 from PMDG) Paul
-
Hi Fabio, You can. Events are also known as Controls. Make a call like this: FSUIPCConnection.SendControlToFS(FsControl.AP_ALT_VAR_DEC, 0); If the event requires a parameter value (e.g. the amount to decrement) then put this as the second parameter. Just pass in 0 if there is no parameter needed. Paul
-
Hi Jaxx, Each offset is treated as unique by the DLL, even if 2 or more have the same address and size. This means the Process() call will add all the duplicates to the request file that is sent to FSUIPC. (assuming they are in the same group). FSUIPC will then fill in the same data for all the duplicate offsets. The time taken to fill in data for most offsets is negligible compared to the overall communication process. So having a few duplicate offsets isn't doing much harm. If this is only to prevent a few duplicate offsets then it's probably not worth it. It would only be a concern if you're getting like 50 duplicates of the same offset, or if your requesting many offsets (>200) and they are all duplicated. If it's just 2 or 3 duplicates of a couple of offsets then the extra time taken up by the duplicates will be barely measurable. Paul
-
Hi Fabio, Your code looks okay. I've tried it here with FSX, but that sim doesn't seem to support negative altitudes for the autopilot at all. You can't set them on the panels of any aircraft. If negative hold altitudes are now supported in MSFS (on default aircraft) then my guess is that FSUIPC7 and/or SimConnect hasn't been changed to support this. Maybe @John Dowson can shed some light on this. Paul
-
can we get an enum for the PMDG 747?
Paul Henty replied to Jason Fayre's topic in FSUIPC Client DLL for .NET
Yes I will add the 747 and 777 control enums when I add the PMDG offset helper classes. I can't do it until next month though, but It'll be before Christmas. Paul -
No, I deliberately avoided any third party frameworks and libraries, on both the server and browser. If you declare a function like this you need to instantiate it with the new keyword. var myFunctionInstance = new myFunction(); and then use the instance, not the function definition.. In my original example I use a shortcut syntax which does both steps in one line. Here the instance is called connection and the function is anonymous. var connection = new function () { This is close but: 1. You don't have a variable called connection any more because you deleted it and replaced it with: function myfunction() 2. Everything to do with javascript is case sensitive so openconnetion() would need to be openConnection(). Paul
-
I think there are two problems here... 1. There is nothing in the script (connection.js) or the webpage (index.html) that runs any of the code in the connection function. I therefore don't think this is being run at all. 2. The dev tools output says the WebSocket URL is ws://127.0.0.1:5500/index.html/ws. However your code (which I don't think is being run) says ws://localhost:2048/fsuipc/. I can't see anywhere in your code that the first URL is referenced, and it's certainly wrong. It shouldn't have index.html in it. I suspect problem 2 is because you've got the WebSocket server running on the same port as your WWW server (5500). The WebSocket server should run on a different port. Your code specifies 2048 so you should configure the WebSocket server to run on 2048. For problem 1 you need to call connection.openConnection() from somewhere. Maybe a button press on the webpage. Maybe when the page has finished loading (set code for the window.onload event). Note that you'll need a <div> on the html page with an ID of 'connectionStatus' to show the connection status. Paul
-
HI Pete, Yes, that would explain it. I'm seeing gaps in the offset addresses that don't exist in the header file. I might revisit this in December when I have more time to do the manual checking and adjustments. Thanks, Paul
-
Hi Jason, I've tried to automatically create a class for the 737 offsets by writing a program to generate it from the PMDG header file. Unfortunately, the layout of the FSUIPC offsets doesn't match the header file, so that doesn't work. I can't think of any other easy ways to do this. Unless someone else has already done this and wants to share, you'll have to declare the offsets you want manually. Paul
-
Just an update. Using structs is possible but not that easy. I'll try to build a helper class into the DLL for the 737 offsets. It'll work like the CDU class. Paul
-
Hi Jason, Pete's idea might work. I've never tried it though. It should be possible to define a single offset of type Byte[]. Then use that value to populate a predefined structure. I'll give it a go here with a small struct and see if I can get it working. You'll need to define the entire PMDG structure though, converting it from the C definition, so I'm not sure if it will save you much time. Reading one offset will likely perform better than reading 100 though. For the CDU display, there isn't a 'selected' line, so I don't think you need to worry about that. The LSK keys are just lined up to the left and right of a particular row of text of the CDU. You can get an array of rows from the Rows property. The keys are lined up as follows: Starting at the top with LSK 1, this lines up with the Row with index 2.(The third row). The other keys are as follows: LSK 2 is lined up with Row with index 4. LSK 3 is Row 6 LSK 4 is Row 8 LSK 5 is Row 10 LSK 6 is Row 12 There are keys on both sides of the screen. Each row will have two options. The left option will be in the first half of the row text, the right option in the second half. You need push the LSK button that is aligned with the instruction on the same row. E.g. Row index 12 might be showing '<index' on the left and 'Pos Init>' on the right. So to activate 'Pos Init' this would be LSK R6 (Right hand side, 6th button down). For data entry, the keyboard below the screen is used to enter the data into the bottom row of the screen (left side). Then you press the relevant LSK key to move that data into the correct field. The field name is usually on the row above where the data is shown. For example, the field name for the transition altitude will be on the right hand side of row index 9. The data for this is displayed under it on the right side of row 10. You would type in the transition altitude and then press the LSK 5 (on the right) to enter the data. I'm pretty sure that all the data and commands on a page appear in the same place every time. So you won't need to work that out in real time. Pos Init for example is always on LSK R6 when that particular page is active.(Indent page 1/2). The page title is always on the first row (index 0). Paul
-
Synchronize heading bug to current heading.
Paul Henty replied to djenn's topic in FSUIPC Client DLL for .NET
I can't see anything to do this automatically. There doesn't seem to be a control (event) either. However, you can set the heading bug by writing to offset at 0x07CC (autopilot heading). The current magnetic gyro compass heading is in offset 0x2B00. You can read that value and write it to 0x07CC (after converting the units). Paul -
request simple c# demo script
Paul Henty replied to michielsweb's topic in FSUIPC Client DLL for .NET
Hi, I don't think you need the Process() call.The SendControlToFS() already includes its own Process() so you don't need to call Process() yourself to send the control. If there is no other reason for it being there, you can halve the time taken for each tick by removing that line. Other than that, it will be as fast as it gets. It's going to take the time for a Process() call for each encoder 'tick'. How long that takes depends on your PC, what add-ons you're using etc. You can check for yourself by displaying the value of the following property: FSUIPCConnection.Statistics.ProcessAvg.TimeForProcessCall Turn a few encoders so it can build an average. The value is in milliseconds. You can also see min and max values using ProcessMin and ProcessMax. Paul -
Slow performance FSUIPCConnection.SendControlToFS
Paul Henty replied to Delphi's topic in FSUIPC Client DLL for .NET
It's not. Just checked and it's commented out. Paul -
The limit will be how long it takes for a Process() call to complete. This depends on your particular setup. e.g. if the flight sim is running complex 3rd-party aircraft, if the PC is doing other things, if there are any other addons using FSUIPC or SimConnect etc. On my PC with no addons and a default Cessna it takes about 12ms. So a timer loop under 12ms would not improve the update rate. 12 ms would be the maximum. On your system you can see the average time taken for Process() calls by displaying the value of this property: FSUIPCConnection.Statistics.ProcessAvg.TimeForProcessCall Let you application run for a bit so it can build an average. The value is in milliseconds. You can also see min and max values using ProcessMin and ProcessMax. Paul
-
Best way to make browser interface with FSUIPC?
Paul Henty replied to Firefly's topic in FSUIPC Support Pete Dowson Modules
Hi John, I don't have MSFS so I assumed I couldn't install/start FSUIPC7, but I just found that I can. I tested with version V0.2.0 (0.1.0 threw an error on shutdown). All looks good including starting, shutting down, autostart. Thanks, Paul -
Best way to make browser interface with FSUIPC?
Paul Henty replied to Firefly's topic in FSUIPC Support Pete Dowson Modules
Hi everyone, I've just released version 0.2.0 of the server. Changes and additions are as follows: Added option to use SSL (wss://). Requires you have an SSL certificate from a trusted issuing authority installed, and bound to the port you are using Default address for new installations is now 'localhost' rather than 127.0.0.1 Website now supports the browser's back and forward buttons Browser bookmarks will now deep-link to the selected page Added payload commands to more easily read and write payload station and fuel tank data. Paul -
Monitor changes in offset/Lvars
Paul Henty replied to hkhoanguyen's topic in FSUIPC Client DLL for .NET
Hi, There is no event system in the DLL like event.offset. FSUIPC cannot notify a connected application, it can only respond to requests. For offsets you can know if they have changed since the last Process() by checking the ValueChanged property. For LVars this doesn't exist, so you have to compare the new value with the old. If you want to create an real C# event system you would need to set up a timer to keep reading the offsets and then fire an event when you detect changes. Paul