quintinm Posted July 2, 2023 Report Posted July 2, 2023 Hi, I'm wondering why when I write to the offset 07CC the A32NX (fly-by-wire) doesn't change in the cockpit ? With my mouse, when I scroll the HDG (autopilot) 07CC changes but not the contrary ? It's seems be one way only. Maybe it exists another offset that makes the bridge between. thank you Michel
John Dowson Posted July 2, 2023 Report Posted July 2, 2023 Which version of the FBW A32NX are you using? I am no expert for the A320, but I think this can depend on the AP mode (managed or selected). If the Autopilot Heading lock is set (offset 0x07C8) then you cannot update this value. You could try offset 0x07CE (target heading), or look at the available MF presets to see what they use to control the AP heading value, and use that - either the preset directly or the lvar (or whatever the preset is using). I will update the title and maybe some other FBW users can help.
quintinm Posted July 2, 2023 Author Report Posted July 2, 2023 Hi Mr Dowson, thank you for your quick answer ! I'm using A32NX A320-251N vers 0.10.1 (stable) You're right 07C8 (lock) is value 1 and I can't write 0 to unlock it but LAVR:A32NX_AUTOPILOT_LOC_MODE is 0 (so unlock) 07CE I didn't find it I know that they use LVAR:A32NX_AUTOPILOT_HEADING_SELECTED and this variable moves (incr/dec) with the mouse into the cockpit. The issue is that I dont understand and "connect" 07C8 with this Lvar (or vice versa) Afterall (at the end of the day) I need : LVAR:A32NX_AUTOPILOT_HEADING_SELECTED changes when 07C8 changes, BUT currently 07C8 changes when LVAR:A32NX_AUTOPILOT_HEADING_SELECTED changes do you have any idea ?
John Dowson Posted July 2, 2023 Report Posted July 2, 2023 1 hour ago, quintinm said: You're right 07C8 (lock) is value 1 and I can't write 0 to unlock it No, its read-only... 1 hour ago, quintinm said: but LAVR:A32NX_AUTOPILOT_LOC_MODE is 0 (so unlock) Ok, that is strange 1 hour ago, quintinm said: 07CE I didn't find it What version of FSUIPC7 are you using? Make sure you are using the latest version, 7.3.21: 0x07CE 2 AUTOPILOT HEADING LOCK DIR:3 Responded Autopilot target heading value, as degrees*65536/360 Not sure when that was added but was quite a while ago... 1 hour ago, quintinm said: I know that they use LVAR:A32NX_AUTOPILOT_HEADING_SELECTED and this variable moves (incr/dec) with the mouse into the cockpit. The issue is that I dont understand and "connect" 07C8 with this Lvar (or vice versa) Afterall (at the end of the day) I need : LVAR:A32NX_AUTOPILOT_HEADING_SELECTED changes when 07C8 changes, BUT currently 07C8 changes when LVAR:A32NX_AUTOPILOT_HEADING_SELECTED changes do you have any idea ? As I said, I am no A320 expert, but I can take a look for you tomorrow and report back. John
quintinm Posted July 2, 2023 Author Report Posted July 2, 2023 I'm using Fsuipc 7.3.21 and 0x07CE value is 0 ... even spad.next doesn't recognize it. However he finds every of your offsets thank you mr. Dowson I'm gonna wait after you a+ Michel
John Dowson Posted July 3, 2023 Report Posted July 3, 2023 I can only seem to change the heading with the Heading Bug Inc/Dec controls. The fast versions of these controls do not work either. Both the fast versions of these controls and writing to offset 07CC use the Heading Bug Set control - this control doesn't seem to be working in the FBW A320. However, it is probably better to use the FBW custom events (or presets). These events are provided in a file called flybywire-aircraft-a320-neo.evt located in your EventFiles subdirectory. Copy or move this file to your FSUIPC7 installation folder (i.e. up one level) to use. Once installed, you will have the following custom events that you can use for the FCU heading: A32NX.FCU_HDG_INC A32NX.FCU_HDG_DEC A32NX.FCU_HDG_SET A32NX.FCU_HDG_PUSH A32NX.FCU_HDG_PULL If you want to control the heading via offset 07CC, you would need a lua script to monitor this offset and send the value (when changed) to the sim using the A32NX.FCU_HDG_SET event, or, probably easier, using calculator code. If you want to do it this way, let me know and I can look into providing a script for you.
quintinm Posted July 3, 2023 Author Report Posted July 3, 2023 Mr Dowson, I copied the .evt file to the fsuipc installation folder. According to you it's better to use the calculator code but I dont know how. Can you help me (again) ? thank you Michel
John Dowson Posted July 3, 2023 Report Posted July 3, 2023 Can you explain what you want to achieve? As I said, you can use either the Heading Bug inc dec controls, or the custom events. You will need a lua script that uses the A32NX.FCU_HDG_SET control, via calculator code, if you want to use an offset to control the heading bug. If you can let me know exactly want you are trying to do, I will look into it, but probably tomorrow now. John
quintinm Posted July 3, 2023 Author Report Posted July 3, 2023 Long story short : I have a Flightdecksolution FCU. With FSX I used the Wilco Offsets by writing and reading each of them (thru VB) and my display's FCU showed the right numbers. Now with MSFS2020 I use FBW A320 and, of course, those offsets dont work anymore ;( I got the AP altitude thru 0818. When I turn my knob (from my FCU) the number increases or dec in the FBW cockpit. So it's working. Now I have tried to do the same thing but for the AP HDG but it's doesn't work. thank you in advance Michel
John Dowson Posted July 4, 2023 Report Posted July 4, 2023 Rather than using offset 0x07CC for the heading,, it is better to add the AUTOPILOT HEADING LOCK DIR simvar to a different offset, so that this doesn't trigger the default behavior associated with that offset. To do this, you need to use the myoffsets.txt file. Create this file (in your FSUIPC7 installation folder) if it doesn't exist, and then add the following line: 0xA000, 2, AUTOPILOT HEADING LOCK DIR, F64, degrees This will add that simvar to offset 0xA000. You can change this to another free-to-use offset if already using this one. you then need to change/update your VB code to use this offset for the heading. Then you will need a simple lua script to update the heading when this offset changes value. The script should be auto-started using your profile-specific [Auto.xxx] section, e.g. [Auto.FBW-A32NX] 1=Lua FBW-Heading The lua file (also attached) is straight-forward, and just sends the offset value using the appropriate control, when the offset value changes: Quote function FBWHeadingUpdate(offset, value) -- ipc.log("Heading updated: " .. value) ipc.execCalcCode(value .. " (>K:A32NX.FCU_HDG_SET)") end event.offset(0xA000, "UW","FBWHeadingUpdate") FBW-Heading.lua Please try this and let me know if you have any issues. John
quintinm Posted July 4, 2023 Author Report Posted July 4, 2023 8 hours ago, John Dowson said: Then you will need a simple lua script to update the heading when this offset changes value. The script should be auto-started using your profile-specific [Auto.xxx] section, e.g. [Auto.FBW-A32NX] 1=Lua FBW-Heading I presume I have to put this in my fsuipc7.ini ? and where I put your .lua file ? thanks!
John Dowson Posted July 4, 2023 Report Posted July 4, 2023 Yes, but use your profile name ([Auto,xxx] where xxx is your profile name) or if not using profiles then just [Auto]. Please read the documentation - how to auto-start luas is explained there - as well as most other functionality! John
John Dowson Posted July 6, 2023 Report Posted July 6, 2023 On 7/4/2023 at 9:54 PM, quintinm said: and where I put your .lua file ? By default, in your FSUIPC7 installation folder... John
quintinm Posted July 6, 2023 Author Report Posted July 6, 2023 Hi Mr. Dowson, I did everything and before changing my VB, I noticed that the A000 offset didn't change. I tough I was the same value than the heading ? but still valued 0.000 see picture here included thank you
John Dowson Posted July 7, 2023 Report Posted July 7, 2023 12 hours ago, quintinm said: I noticed that the A000 offset didn't change. I tough I was the same value than the heading ? but still valued 0.000 Did you add the simvar AUTOPILOT HEADING LOCK DIR to that offset via the myoffsets.txt file? Do you see the following entry in your FSUIPC7.log file: Quote 28781 Adding simvar 'AUTOPILOT HEADING LOCK DIR' to offset A000 (size 2, type 'F64') for read-only access ? 12 hours ago, quintinm said: see picture here included Please attach files, not pictures.
quintinm Posted July 8, 2023 Author Report Posted July 8, 2023 Hi Mr. Dowson, here included my log file. And yes we can see the adding simvar thank you Michel FSUIPC7.log
John Dowson Posted July 8, 2023 Report Posted July 8, 2023 What is the issue? It looks like the script is working: Quote 186469 LUA.2: Heading updated: 220 ? Can you please explain what your issue is, and attach a full log file (i.e. always please exit FSUIPC7 before attaching a log file, and never use the New Log feature) with logging for lua plugins enabled (and no other logging set please) as well as offset monitoring for offset A000. Also please disable Linda for the time being - you can re-enable it after we have solved your problem. John
quintinm Posted July 8, 2023 Author Report Posted July 8, 2023 Here included my log file since the beginning when I start MSFS until I close the simulator We can see the Heading changed with Lua. My issue is the offset A000 still 0.00000 when I put in Log->offsets ... (I can see on top of my screen and it's written Monitor IPC:A000 (FLT64) = 0.000000 thank you Michel FSUIPC7.log
John Dowson Posted July 8, 2023 Report Posted July 8, 2023 13 minutes ago, quintinm said: (I can see on top of my screen and it's written Monitor IPC:A000 (FLT64) = 0.000000 It is not a FLT64 (8-bytes) but a an unsigned word - 2 bytes (U16) , as also used in the lua script (UW) - try logging it as that (i.e. U16), and also please send the offset logging to the normal log file as well. The logging in the lua is definitely showing the correct value: Quote 1537546 LUA.2: Heading updated: 221 1538156 LUA.2: Heading updated: 222 1538828 LUA.2: Heading updated: 223 18 minutes ago, quintinm said: Here included my log file since the beginning when I start MSFS until I close the simulator You still have Linda running and have not set only the logging asked for... John
quintinm Posted July 8, 2023 Author Report Posted July 8, 2023 56 minutes ago, John Dowson said: You still have Linda running and have not set only the logging asked for... I didn't start Linda Yet ! Does it starts automatically wight FSUIPC ? and how doing this ?
John Dowson Posted July 8, 2023 Report Posted July 8, 2023 4 minutes ago, quintinm said: I didn't start Linda Yet ! Does it starts automatically wight FSUIPC ? It is probably started from your ipcReady.lua.... but it doesn't matter if you don't have any issues. Your log shows that offset A000 is being updated with the correct heading, you are just logging that offset incorrectly as far as I can see....
quintinm Posted July 8, 2023 Author Report Posted July 8, 2023 Yes you are right, I changed for U32 and it's working Now I will change my VB and keep you in touch soon thank you again Michel
John Dowson Posted July 8, 2023 Report Posted July 8, 2023 1 minute ago, quintinm said: I changed for U32 and it's working But why U32? That is 4-bytes. You are adding this as 2-bytes: On 7/4/2023 at 2:03 PM, John Dowson said: 0xA000, 2, AUTOPILOT HEADING LOCK DIR, F64, degrees You should therefore use U16, as I said...
quintinm Posted July 9, 2023 Author Report Posted July 9, 2023 Mr. Dowson, can I use another offset rather than A000 ? do you have a range of offset for that ? thank you Michel
John Dowson Posted July 9, 2023 Report Posted July 9, 2023 1 hour ago, quintinm said: can I use another offset rather than A000 ? do you have a range of offset for that ? You can use any offsets that are designated as 'free for general use' in the offset status document, or any offset allocated to a 3rd-party aircraft or utility that you do not use. For example, the following are all free for general use: 0x2544 - 184 bytes 0x2644 - 184 bytes 0x2744 - 216 bytes 0x2ABC - 68 bytes 0x6174 - 28 bytes 0x66C0 - 64 bytes 0xA000 - 512 bytes John
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