yvesb Posted December 2, 2022 Report Posted December 2, 2022 Hi Peter, I developed a small Java CDU application for the 737 PMDG from Prepar3D. It works fine using offset 0x5400 for display and offsets 0x3110 and 0x3114 for sending events. My CDU works identically to PMDG's CDU. When I use the 737 MSFS 2020 version of the PMDG, my display works correctly but the sending of events by the buttons no longer works. Is the link via offsets 0x3110 and 0x3114 operational with this 2020 version of 737 ? Have a nice day, Yves
John Dowson Posted December 2, 2022 Report Posted December 2, 2022 7 minutes ago, yvesb said: Is the link via offsets 0x3110 and 0x3114 operational with this 2020 version of 737 ? Those offsets are for sending controls/events and the aircraft loaded does not make any difference to there use - writing to them just sed the control/event to the FS. 11 minutes ago, yvesb said: but the sending of events by the buttons no longer works. The events will be sent, but maybe those events are no longer working in the MSFS version. What events are you sending? Maybe you need to use a preset in the MSFS version instead? You can also send presets using offset 0x3110, but it is easier and recommended to use offset 0x7C50 for this, as you can use the fixed preset name in this offset rather than calculating the control number for the preset, which may also change when the preset list is updated (events.txt file). By the way, Pete retired several years ago, although he still helps out occasionally. John
yvesb Posted December 2, 2022 Author Report Posted December 2, 2022 Oups ! sorry for the wrong first name ! 🙄 The H file 2020 is the same as that of Prepard3D : Prepar3D : #define EVT_CDU_L_INIT_REF (THIRD_PARTY_EVENT_ID_MIN + 546) 2020 : #define EVT_CDU_L_INIT_REF (THIRD_PARTY_EVENT_ID_MIN + 546) 😭 Should Hvar be used as for several 2020 aircrafts to generate events ? Thank you for your always quick response. Yves
John Dowson Posted December 2, 2022 Report Posted December 2, 2022 22 minutes ago, yvesb said: The H file 2020 is the same as that of Prepard3D : Prepar3D : #define EVT_CDU_L_INIT_REF (THIRD_PARTY_EVENT_ID_MIN + 546) 2020 : #define EVT_CDU_L_INIT_REF (THIRD_PARTY_EVENT_ID_MIN + 546) Then the custom control number and the Rotor Brake parameter will be the same. Are you writing the custom control number or the Rotor Brake control number (together with the parameter) to offset 0x3110/0x3114? As the Rotor Brake control us a standard event, it should work the same in MSFS as in P3D. I haven't tested/checked writing custom controls to 0x3110 - it is possible that this is no longer working (if they are wrongly determined to be presets). I can/will check this, but it will take me a few days before I can get around to this (next week sometime). If you could let me know what controls you are writing to that offset that aren't working (i.e. control number + parameter) that would help. 30 minutes ago, yvesb said: Should Hvar be used as for several 2020 aircrafts to generate events ? You need to use what works! Some aircraft make use of hvars, others not. PMDG aircraft mainly use custom controls. However, rather than using hvars or lvars directly, it is far easier to use presets. Please see the MobiFlight HubHop resource (https://hubhop.mobiflight.com/presets/) which is a community effort led by MobiFlight that provides presets for many aircraft. You can also check the code used by the preset, which can contain use lvars, hvars & controls/events (as well as other variable types!). John
yvesb Posted December 2, 2022 Author Report Posted December 2, 2022 Here is my list of events and the Java code I am using. All this works perfectly with PMDG 737 Prepar3D but not with 2020. // CDU #define EVT_CDU_L_L1 (THIRD_PARTY_EVENT_ID_MIN + 534) #define EVT_CDU_L_L2 (THIRD_PARTY_EVENT_ID_MIN + 535) #define EVT_CDU_L_L3 (THIRD_PARTY_EVENT_ID_MIN + 536) #define EVT_CDU_L_L4 (THIRD_PARTY_EVENT_ID_MIN + 537) #define EVT_CDU_L_L5 (THIRD_PARTY_EVENT_ID_MIN + 538) #define EVT_CDU_L_L6 (THIRD_PARTY_EVENT_ID_MIN + 539) #define EVT_CDU_L_R1 (THIRD_PARTY_EVENT_ID_MIN + 540) #define EVT_CDU_L_R2 (THIRD_PARTY_EVENT_ID_MIN + 541) #define EVT_CDU_L_R3 (THIRD_PARTY_EVENT_ID_MIN + 542) #define EVT_CDU_L_R4 (THIRD_PARTY_EVENT_ID_MIN + 543) #define EVT_CDU_L_R5 (THIRD_PARTY_EVENT_ID_MIN + 544) #define EVT_CDU_L_R6 (THIRD_PARTY_EVENT_ID_MIN + 545) #define EVT_CDU_L_INIT_REF (THIRD_PARTY_EVENT_ID_MIN + 546) #define EVT_CDU_L_RTE (THIRD_PARTY_EVENT_ID_MIN + 547) #define EVT_CDU_L_CLB (THIRD_PARTY_EVENT_ID_MIN + 548) #define EVT_CDU_L_CRZ (THIRD_PARTY_EVENT_ID_MIN + 549) #define EVT_CDU_L_DES (THIRD_PARTY_EVENT_ID_MIN + 550) #define EVT_CDU_L_MENU (THIRD_PARTY_EVENT_ID_MIN + 551) #define EVT_CDU_L_LEGS (THIRD_PARTY_EVENT_ID_MIN + 552) #define EVT_CDU_L_DEP_ARR (THIRD_PARTY_EVENT_ID_MIN + 553) #define EVT_CDU_L_HOLD (THIRD_PARTY_EVENT_ID_MIN + 554) #define EVT_CDU_L_PROG (THIRD_PARTY_EVENT_ID_MIN + 555) #define EVT_CDU_L_EXEC (THIRD_PARTY_EVENT_ID_MIN + 556) #define EVT_CDU_L_N1_LIMIT (THIRD_PARTY_EVENT_ID_MIN + 557) #define EVT_CDU_L_FIX (THIRD_PARTY_EVENT_ID_MIN + 558) #define EVT_CDU_L_PREV_PAGE (THIRD_PARTY_EVENT_ID_MIN + 559) #define EVT_CDU_L_NEXT_PAGE (THIRD_PARTY_EVENT_ID_MIN + 560) #define EVT_CDU_L_1 (THIRD_PARTY_EVENT_ID_MIN + 561) #define EVT_CDU_L_2 (THIRD_PARTY_EVENT_ID_MIN + 562) #define EVT_CDU_L_3 (THIRD_PARTY_EVENT_ID_MIN + 563) #define EVT_CDU_L_4 (THIRD_PARTY_EVENT_ID_MIN + 564) #define EVT_CDU_L_5 (THIRD_PARTY_EVENT_ID_MIN + 565) #define EVT_CDU_L_6 (THIRD_PARTY_EVENT_ID_MIN + 566) #define EVT_CDU_L_7 (THIRD_PARTY_EVENT_ID_MIN + 567) #define EVT_CDU_L_8 (THIRD_PARTY_EVENT_ID_MIN + 568) #define EVT_CDU_L_9 (THIRD_PARTY_EVENT_ID_MIN + 569) #define EVT_CDU_L_DOT (THIRD_PARTY_EVENT_ID_MIN + 570) #define EVT_CDU_L_0 (THIRD_PARTY_EVENT_ID_MIN + 571) #define EVT_CDU_L_PLUS_MINUS (THIRD_PARTY_EVENT_ID_MIN + 572) #define EVT_CDU_L_A (THIRD_PARTY_EVENT_ID_MIN + 573) #define EVT_CDU_L_B (THIRD_PARTY_EVENT_ID_MIN + 574) #define EVT_CDU_L_C (THIRD_PARTY_EVENT_ID_MIN + 575) #define EVT_CDU_L_D (THIRD_PARTY_EVENT_ID_MIN + 576) #define EVT_CDU_L_E (THIRD_PARTY_EVENT_ID_MIN + 577) #define EVT_CDU_L_F (THIRD_PARTY_EVENT_ID_MIN + 578) #define EVT_CDU_L_G (THIRD_PARTY_EVENT_ID_MIN + 579) #define EVT_CDU_L_H (THIRD_PARTY_EVENT_ID_MIN + 580) #define EVT_CDU_L_I (THIRD_PARTY_EVENT_ID_MIN + 581) #define EVT_CDU_L_J (THIRD_PARTY_EVENT_ID_MIN + 582) #define EVT_CDU_L_K (THIRD_PARTY_EVENT_ID_MIN + 583) #define EVT_CDU_L_L (THIRD_PARTY_EVENT_ID_MIN + 584) #define EVT_CDU_L_M (THIRD_PARTY_EVENT_ID_MIN + 585) #define EVT_CDU_L_N (THIRD_PARTY_EVENT_ID_MIN + 586) #define EVT_CDU_L_O (THIRD_PARTY_EVENT_ID_MIN + 587) #define EVT_CDU_L_P (THIRD_PARTY_EVENT_ID_MIN + 588) #define EVT_CDU_L_Q (THIRD_PARTY_EVENT_ID_MIN + 589) #define EVT_CDU_L_R (THIRD_PARTY_EVENT_ID_MIN + 590) #define EVT_CDU_L_S (THIRD_PARTY_EVENT_ID_MIN + 591) #define EVT_CDU_L_T (THIRD_PARTY_EVENT_ID_MIN + 592) #define EVT_CDU_L_U (THIRD_PARTY_EVENT_ID_MIN + 593) #define EVT_CDU_L_V (THIRD_PARTY_EVENT_ID_MIN + 594) #define EVT_CDU_L_W (THIRD_PARTY_EVENT_ID_MIN + 595) #define EVT_CDU_L_X (THIRD_PARTY_EVENT_ID_MIN + 596) #define EVT_CDU_L_Y (THIRD_PARTY_EVENT_ID_MIN + 597) #define EVT_CDU_L_Z (THIRD_PARTY_EVENT_ID_MIN + 598) #define EVT_CDU_L_SPACE (THIRD_PARTY_EVENT_ID_MIN + 599) #define EVT_CDU_L_DEL (THIRD_PARTY_EVENT_ID_MIN + 600) #define EVT_CDU_L_SLASH (THIRD_PARTY_EVENT_ID_MIN + 601) #define EVT_CDU_L_CLR (THIRD_PARTY_EVENT_ID_MIN + 602) #define EVT_CDU_L_BRITENESS (THIRD_PARTY_EVENT_ID_MIN + 605) Example : Click INITREF button on the my Java CDU Part of the Java code private final FSAircraft_PMDG_737 pmdg = new FSAircraft_PMDG_737(); private final int THIRD_PARTY_EVENT_ID_MIN = 0x00011000; // equals to 69632 PMDG private void INITREFMouseClicked(java.awt.event.MouseEvent evt) { sendDATAMouseClick(546, evt); } private void sendDATAMouseClick(int valeur, java.awt.event.MouseEvent evt) { // #define MOUSE_FLAG_RIGHTSINGLE 0x80000000 // #define MOUSE_FLAG_MIDDLESINGLE 0x40000000 // #define MOUSE_FLAG_LEFTSINGLE 0x20000000 if (evt.getButton() == MouseEvent.BUTTON1) { pmdg.WriteCommand(THIRD_PARTY_EVENT_ID_MIN + valeur, 0x20000000); } if (evt.getButton() == MouseEvent.BUTTON2) { pmdg.WriteCommand(THIRD_PARTY_EVENT_ID_MIN + valeur, 0x40000000); } if (evt.getButton() == MouseEvent.BUTTON3) { pmdg.WriteCommand(THIRD_PARTY_EVENT_ID_MIN + valeur, 0x80000000); } } The sending to FSUIPC public void WriteCommand(int command, int value) { byte[] data1 = intToByteArray(Integer.reverseBytes(command)); byte[] data2 = intToByteArray(Integer.reverseBytes(value)); fsuipc_wrapper.WriteData(0x3114, 4, data2); fsuipc_wrapper.WriteData(0x3110, 4, data1);
John Dowson Posted December 2, 2022 Report Posted December 2, 2022 Ok, so you are using custom controls as opposed to the Rotor Brake control. I will check the use of custom controls via offset 0x3110 when I get time - most probably next week, and report back. The Java CDU looks good! Is that available anywhere to download and try?
yvesb Posted December 2, 2022 Author Report Posted December 2, 2022 Hello John, It's a personal application and it's tricky to share it: I don't own the image, part of the java class code comes from the java SKDs you provide. As for the code I wrote, there is no problem, it's a hobby for me.
John Dowson Posted December 5, 2022 Report Posted December 5, 2022 I have just checked the use of Custom Control numbers with the PMDG 737 in MSFS and they no longer seem to be working. No idea why, or if this is an issue with PMDG, FSUIPC7 or MSFS. Nothing has change in FSUIPC7 in this area for a while so I suspect PMDG or MSFS... I will look into this further, but I am also surprised that there have not been a lot more support requests om this if the PMDG custom controls are no longer working... I have checked the Rotor Brake method of control and this is still working with MSFS/FSUIPC7. You could switch to using these for MSFS instead, e,g, for #define EVT_CDU_L_PREV_PAGE (THIRD_PARTY_EVENT_ID_MIN + 559) #define EVT_CDU_L_NEXT_PAGE (THIRD_PARTY_EVENT_ID_MIN + 560) you would use control number 66587 (Rotor Brake) with a parameter of 55901 for PREV_PAGE and 56001 for NEXT_PAGE. For details on calculating the parameter for the Rotor Brake control, see John
John Dowson Posted December 5, 2022 Report Posted December 5, 2022 2 hours ago, John Dowson said: I have just checked the use of Custom Control numbers with the PMDG 737 in MSFS and they no longer seem to be working. This is not correct...they are working, I was using the wrong parameters. I tested using the following two simple lua scripts for prev/next page on the left CDU: Prev page: ipc.writeUD(0x3114, 0x20000000) ipc.writeUD(0x3110, 70191) Next page: ipc.writeUD(0x3114, 0x20000000) ipc.writeUD(0x3110, 70192) where #define MOUSE_FLAG_LEFTSINGLE 0x20000000 So I am not sure what your issue is... You could try setting a custom log value in FSUIPC7 of x800 to check the events are being transmitted. You should see lines such as the following logged: 6625734 ExSendEvent(70191, 536870912, 0) 6625734 ... evnum mask=0, preval=0 6625734 ... not intercepted or in options 6625734 Transmitting "????" 70191 [0x1122F], Param 536870912, Priority 1 (Axes flag = 0) 6626313 ExSendEvent(70192, 536870912, 0) 6626313 ... evnum mask=0, preval=0 6626313 ... not intercepted or in options 6626313 Transmitting "????" 70192 [0x11230], Param 536870912, Priority 1 (Axes flag = 0) John
yvesb Posted December 5, 2022 Author Report Posted December 5, 2022 Hello John, Thanks for the research, I'll dig more on my end. Yves
yvesb Posted January 15, 2023 Author Report Posted January 15, 2023 Bonjour John, Happy new year ! The latest PMDG 737 2020 update fixed the bug. My 2020 JavaCDU now works like my Prepar3D JavaCDU! Youppi !
Helmut Posted January 21, 2023 Report Posted January 21, 2023 Hello, can I write values with offset $3110 for the PMDG-Event MCP_CRS_L_Select (70008)? I use SC-Pascal for a SISMO-Solutions MCP and have the 2 Commandlines WriteFSUIPC($3110, 4, value); WriteFSUIPC($3114, 4, 70008); but this don't work. With WriteFSUIPC($3110, 4, 16384); //Mousewheel Up or 8192 for Mousewheel Down WriteFSUIPC($3114, 4, 70008); it works. But I have no function found in SC-Pascal that give me the direction of the encoder, so it is easier for me to work with values. With friendly Regard Helmut Rubick
John Dowson Posted January 21, 2023 Report Posted January 21, 2023 2 hours ago, Helmut said: can I write values with offset $3110 for the PMDG-Event MCP_CRS_L_Select (70008)? Note there are two custom controls for this: Quote #define EVT_MCP_CRS_L_SET (THIRD_PARTY_EVENT_ID_MIN + 14500) // Sets MCP course specified by the event parameter #define EVT_MCP_COURSE_SELECTOR_L (THIRD_PARTY_EVENT_ID_MIN + 376) You are using EVT_MCP_COURSE_SELECTOR_L (70008), but It look like you need to use EVT_MCP_CRS_L_SET instead, i.e. 84132 John
Helmut Posted January 21, 2023 Report Posted January 21, 2023 Hello John, thanks for your answer. I will try the custom control 84132. MfG Helmut
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