Jump to content
The simFlight Network Forums

why I cannot get Panel Autobreak Switch Value


Recommended Posts

Hello every one .my name is chatchai. and today I have question about get value from panel PMDG 737ngx. before I write C# FSUIPC for get some value.I will recheck address before.

but I have some problem is when i switch Auto break to max .The Value is "0". it not change. I check value by use FS-Interrogate and pick up address 2F80 to Quick data window 1.

 

1. did i choose true address (2F80)?

2. if i choose wrong. how do i known which address is true?

 

Thank you

Link to comment
Share on other sites

Hi Chatchai,

 

0x2F80 is correct for the default aircraft that come with FSX. Some add-on aircraft do not use the normal systems provided by FSX. PMDG 737NGX is one such aircraft. Many of the system for this plane are handled outside of FSX, therefore it is usual that reading the normal offsets will not give you the correct results.

 

FSUIPC can interface with the 737NGX. There is a separate set of offsets for reading, and controls for writing. This is explained in a document called "Offset Mapping for PMDG 737NGX.pdf". You can find this in the "\Modules\FSUIPC Documents" folder under your main FSX install folder.

 

Paul

Link to comment
Share on other sites

Thank you for your answer. I tried to check follow your advice.That work with with Beech baron58 from fsx.I can get value from Gear status ,Nav Light, etc  and control Gear Up and down , Nav Light on/off.

after that i check value from 737ngx. I can get value from offset 642F LTS_DomeWhiteSw yes!! that's work but i cannot send value to change switch position from 0=DIM to 1=OFF by code 

 

private Offset<byte> DimLight = new Offset<byte>(0x642F,true);

....

 private void btnlight_Click(object sender, EventArgs e)
        {
            try
            {
                DimLight.Value = 1;
                FSUIPCConnection.Process();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, AppTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 
I read offset mapping for pmdg 737ngx.pdf. and put 
[sDK]
EnableDataBroadcast=1   in 737NGX_Options.ini  already
 
1. in document wrote"All offsets are READ ONLY" that's mean I can't control back to "LTS_DomeWhiteSw"?
2.Can i use C# 2010 to control that?
3.I cannot find PMDG_NGX_SDK.h in sdk folder this folder have only NewWeather.h. find wrong folder?
 
 
thank you for your advice again.
 
 
Link to comment
Share on other sites

The offsets for the 737NGX are all read only. To write values you need to send control values to FSUIPC using offset 0x3110 and 0x3114.

 

To send a control you write the control number to 0x3110. If the control has a parameter value you write this to 0x3114. Not all controls have a parameter value.

 

Below is an example of sending the 'Refresh Scenery' control which forces flight sim to reload the scenery.

 

First create the offsets. (Note the order is important. You must create 3114 before 3110).

private Offset<int> controlParameter = new Offset<int>(0x3114, true);
private Offset<int> sendControl = new Offset<int>(0x3110, true); 

Here I define a variable that holds the number 65562, which is the 'refresh scenery' control number.

private readonly int REFRESH_SCENERY = 65562;

In the main code, this will send the command to Flight Sim. Note that refresh scenery doesn't take a parameter value, so it's not included here.

sendControl.Value = REFRESH_SCENERY;
FSUIPCConnection.Process();

To find the correct control numbers to send for the 737NGX you need to look in the 'PMDG_NGX_SDK.h' file. The controls may also be called 'events'. They are the same thing.

 

This file is found in the 737NGX SDK from PMDG. It is not included in the FSUIPC SDK. As a 737NGX customer should be able to download their SDK from the PMDG website. 

 

Paul

Link to comment
Share on other sites

Thank you for your reply. now I can got value from "L Wiper" offset is "6494"  this offset have 4 position " 0: PARK 1: INT 2: LOW 3:HIGH"

So I set wiper position HIGH and got Value "3". and i will control L_Wiper  with this code.This code I applied from above.

 

private Offset<int> controlParameter = new Offset<int>(0x3114, true);

private Offset<int> sendControl = new Offset<int>(0x3110, true);

.....

private readonly int LWiper = 69668;

.....

 private void btnlight_Click(object sender, EventArgs e)
        {
           
            sendControl.Value = LWiper;
            FSUIPCConnection.Process();
        }
.....
 
This code can control Wiper to "PARK" or Value="0". I don't have any idea to change position with my need. Cloud you show me for some example. I'm not good English if don't understand.please tell me.
Thank you.
Link to comment
Share on other sites

Hi,
 
You need to set the controlParameter value to the position you want.
 
I don't have the 737NGX so I can't test this, but it should work:

private void btnlight_Click(object sender, EventArgs e)
        {
            sendControl.Value = LWiper;
            controlParameter.Value = 2; // Set the position value here  This sets to 2 = 'LOW'.
            FSUIPCConnection.Process();
        }
Paul
Link to comment
Share on other sites

I have some question about offset.this came from above. now i can control L_Wiper,AUTOBRAKE_SELECTOR and other if this have variable is "unsigned char". So I tried to control VNav,LNav and other <-- this variable is bool.

I add this 

...

private Offset<bool> controlbit = new Offset<bool>(0x3340, true);

private Offset<int> sendControl = new Offset<int>(0x3110, true);

....

sendControl.Value = EVT_VNAV;
controlbit.Value = true;
.....
 
but don't work 
1. Maybe I choose wrong offset "3340";
2. If have other resource please advice to me.
I'm have fun with this.
 
Thank you.
Link to comment
Share on other sites

I'm not sure why you chose 3340. This is an offset for reading joystick buttons.

 

All controls just use 3011 and 3114. You have to convert any values (parameters) you are writing for the control to a 4-byte integer. So of you want to write boolean, you just write 1 or 0:

private Offset<int> controlParameter = new Offset<int>(0x3114, true);
private Offset<int> sendControl = new Offset<int>(0x3110, true); 
            sendControl.Value = EVT_VNAV;
            controlParameter.Value = 1; // Set to 1 or 'true'. For 'false' set to 0.
            FSUIPCConnection.Process();

Paul

Link to comment
Share on other sites

I use this code "controlParameter.Value = -1;"  I don't why Value "-1" can engage and disengage

This my Code

  private void btnVNAV_Click(object sender, EventArgs e)

        {
            sendControl.Value = EVT_VNAV;
            controlParameter.Value = -1;
            FSUIPCConnection.Process();
        }
Link to comment
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
×
×
  • 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.