Jump to content
Sign in to follow this  
Simmer

SimConnect: Control CDU

Recommended Posts

Hi all,

I want to control the CDU of the PMDG 737NGX P3Dv4 via SimConnect. As a first test, I would like to connect a ground power unit, so I am sending these events with via SimConnect by writing into the PMDG NGX control area struct:

"EVT_CDU_R_MENU", Value = 1
"EVT_CDU_R_R5", Value = 1
"EVT_CDU_R_L3", Value = 1
"EVT_CDU_R_L2", Value = 1

That is equivalent to "MENU" -> "FS ACTIONS" -> "GROUND CONNECTIONS" -> "GROUND POWER".

This sequence is working exactly once: As I am inserting delays of 1 second between the events, I can see that the CDU inside of the airplane is doing what I expect. If I try to send the sequence for a 2nd time (no matter if I leave the CDU on the page "GROUND CONNECTIONS" or set it back to some other page from inside of the airplane), nothing happens.

I am respecting "PMDG_NGX_Control.Event == 0" for each single event and I am also able to flip some Overhead switches afterwards. So I don't think that it is a communication problem.

Can you help me with this?

Regards,
Martin


Martin Renner

Share this post


Link to post
Share on other sites

Interesting: If I manually press the same sequence from inside of the cockpit (Menu, R5, L3, L2), then I can send the command sequence again via SimConnect.

So it looks like if the CDU buttons get "stuck" in their "1" position and that I have to "reset" them from inside of the cockpit.

Do I have to send something like a "release" command so that the keys are released? But I cannot send a zero for every command, because

"EVT_CDU_R_MENU", Value = 1  // press?
"EVT_CDU_R_MENU", Value = 0  // release?
"EVT_CDU_R_R5", Value = 1    // press?
"EVT_CDU_R_R5", Value = 0    // release?
"EVT_CDU_R_L3", Value = 1    // press?
"EVT_CDU_R_L3", Value = 0    // release?
"EVT_CDU_R_L2", Value = 1    // press?
"EVT_CDU_R_L2", Value = 0    // release?

leads to "MENU pressed, MENU released" -> "FS ACTIONS pressed, FS ACTIONS released" -> "GROUND CONNECTIONS pressed, AIR START UNIT = 0 (!!!)".


Martin Renner

Share this post


Link to post
Share on other sites

Finally resolved my problem. If the correct values are sent, the CDU works like a charm.


Martin Renner

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...