Jump to content
The simFlight Network Forums

PMDG 777 - Glareshield ACPT RJCT Buttons state


The Captain
 Share

Recommended Posts

Hi Paul,

I've been working on a CPDLC extension for the PMDG 777 , something that simmers like myself have been hopelessly waiting for for year with no avail . Here is a preview of the work done so far. You will notice that it was designed  to be a seamless integration with the aircraft , and here comes my question. 

 

 

Is there any possible way to get the status of the glareshield buttons ACPT, CANC, RJCT used to handle received ATC CPDLC messages? I'm fairly new to FSUIPC world and pretty much clueless about offests , lvars, etc..  I've spent the last 2 days trying to figure it out with no success.

Thank you in advance!

Amine.

 

 

 

Edited by The Captain
Link to comment
Share on other sites

15 hours ago, The Captain said:

Is there any possible way to get the status of the glareshield buttons ACPT, CANC, RJCT used to handle received ATC CPDLC messages?

I don't know, but if using the PMDG 777, you should look at the PMDG SDK for that aircraft to see if the information is held in the PMDG-specific offsets.
First thing to do is to check the PMDG_777X_SDK.h file to see if anything in there looks like what you need.

John

Link to comment
Share on other sites

Hi Amine,

The PMDG interface to which is used by FSUIPC doesn't have any way to tell if the pilot pressed those buttons.

When those buttons are pressed on the glareshield they should generate a custom flightsim control (also known as an event). However, the FSUIPC interface doesn't have any way to track events happening in the Sim.

The only way I can see to do this is to use a Lua plugin:

The FSUIPC Lua library has a way of intercepting controls with the event.control function which might work. If those switches in the cockpit generate a control (event) number then you should be able to trap it with Lua.

Turn on the Event logging (or control logging - I can't remember which terminology is used) in the FSUIPC logging tab. Send the log to a console and operate the switches in the PMDG aircraft. If the events are logged then you can proceed. Note down the event/control number which you will need for your Lua function.

Very briefly, the idea is to set up a Lua plugin to run a function when the control from those switches is sent. For this you use the event.control function. This function would update one of the free user offsets (using the ipc.write function) which you would then read from your VB application as normal.

Using Lua requires users to have a registered copy of FSUIPC.

The Lua documentation and examples are in the modules/fsuipc documents folder.

If you can trap the events in the fsuipc log and you want to give this a go let me know and I can help you with the Lua part if you're new to Lua.

Paul

 

Link to comment
Share on other sites

Thank you Paul and John for the quick answer!

 

According to this document https://dokumen.tips/documents/pmdg-737ngx-custom-event-ids-for-use-with-fsuipc-and-fsx-fsx-se-or-prepar3d.html , these three button do have cutom evenIDs associated to them, these are 69810,69811 and 69812. When going through PMDG_777X_SDK.h, there is no var for the buttons in the PMDG_777X_Data structure, but events exit.

Now when used the FSUIPC logging as you suggested, I couldn't see such events. As a matter of fact, the is no  events when operating  any PMDG switch, except for NAV lights and Beacon light, which I guess are P3d default events. does this  it mean it's a dead end? is FSUIPC supposed to be able to capture Custom events at all?

5 hours ago, Paul Henty said:

If you can trap the events in the fsuipc log and you want to give this a go let me know and I can help you with the Lua part if you're new to Lua.

Really appreciate you willingness to help!

 

Thank you,

Amine

Link to comment
Share on other sites

Quote

 does this  it mean it's a dead end?

I'm afraid so; the control events in Lua won't work if FSUIPC isn't seeing them.

I can't remember if the PMDG aircraft use LVars. You can try listing the LVars and see if there is anything that looks useful...

In the buttons or keypresses tab of FSUIPC you can bind the command "List Local Panel Vars". If you press this key/joystick button with the log being displayed in a console window you'll be able to see all the available Lvars and their current values. If any look promising you can read them with FSUIPCConnection.ReadLVar().

Other than that I can't think of any other way of detecting the operation of those buttons.

 

Quote

is FSUIPC supposed to be able to capture Custom events at all?

Maybe not. @John Dowsoncan confirm.

Paul

Link to comment
Share on other sites

16 hours ago, The Captain said:

these three button do have cutom evenIDs associated to them, these are 69810,69811 and 69812.
...

Now when used the FSUIPC logging as you suggested, I couldn't see such events. As a matter of fact, the is no  events when operating  any PMDG switch, except for NAV lights and Beacon light, which I guess are P3d default events. does this  it mean it's a dead end?

The events should be logged, and you should be able to intercept them using the event.control lua function, as Paul said.

I don't know why you are not seeing those (or any) events logged...maybe they aren't being used?
Try assigning a button press to those events, and see if they are logged when you send them.

John

Link to comment
Share on other sites

Hey,

What I came to realize is that these custom PMDG events are not fired when you interact with the VC with the mouse , but are rather control events that are logged only if they are sent by a third party app to control the aircraft (e.g, FS2CREW)  or from FSUIPC it self by binding the control to a key press or a joystick button. By doing so , I was able to intercept these calls with LUA and write to a user offset whenever the button is pressed, then read the offset with vb.net . It's not exactly what I wanted in the beginning but came pretty close!

Thank you both for you help and suggestions ! I definitely learned a thing or two in the process.

Cheers,

Amine.

 

 

Link to comment
Share on other sites

On 12/6/2021 at 3:02 PM, The Captain said:

these custom PMDG events are not fired when you interact with the VC with the mouse , but are rather control events that are logged only if they are sent by a third party app to control the aircraft (e.g, FS2CREW)  or from FSUIPC it self by binding the control to a key press or a joystick button.

Strange, as they should be fired regardless of how triggered, but that must be due to the PMDG implementation.
I guess its ok for you as long as you only change the state via 3rd party apps that use the custom control.
You could check to see if any lvars hold the states you require, as suggested by Paul, which would be more reliable (if there are any!).

John

Link to comment
Share on other sites

Hey,

On 12/6/2021 at 10:14 AM, John Dowson said:

You could check to see if any lvars hold the states you require, as suggested by Paul, which would be more reliable (if there are any!).

I did try Lvars as per Paul's suggestion but could not find anything helpful. I guess PMDG never intended for these buttons to be used and are just dummy buttons sitting in the cockpit with no real function.

For now,  users with registered FSUIPC will have the option to use the LUA and bind the controls to joystick buttons of their choice. For remaining users, they will have to assign joystick or keyborad keys to virtual buttons within the app and use them to acpt, rjct or canc message (which i'm still trying to figure out how to do using Paul's DLL). These users won't see the buttons being pushed in the cockpit though.  Subtle you may say, but it make quite a difference for immersion/realism freaks like my self 🙂

Thank you for you support

Amine.

 

 

 

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • 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.