Jump to content

IXEG 737 autopilot state dataref and 124thATCv2


ntnll
 Share

Recommended Posts

Good morning,
I'm trying to make 124thATCv2 compatible with this beautiful model. The plugin (an ATC emulator), needs to know the state of autopilot mode for better behave (avoid to flood user with heading instructions while LNAV is active)

With all the models I tested until today, I successful read the autopilot state using SDK dataref with C++:

XPLMFindDataRef("sim/cockpit/autopilot/autopilot_state");

The read result is a int value that change whenever HDG, VNAV, LNAV modes are engaged (default value is 132).

When using IXEG model, this code never change, it keeps to "132" value (the default value), always with VNAV, LNAV or HDG engaged.
In a support ticket, Cameron explained to me that it is not a bug, because IXEG provide its own custom datarefs.

I red the documentation and I can't find out the way to read the autopilot state or LNAV state, I only found these values:

ixeg/733/autopilot/LNAV_mode_toggle
ixeg/733/MCP/mcp_lnav_act

but it doesn't seems to be (as my understanding), the status of LNAV, but rather a writable dataref for toggle LNAV, indeed, I tried to read it via XPLMFindDataRef, and the result is always 0.

Can anyone please explain me the way to know the autopilot state with the IXEG 737?

124thATCv2 is a free project plugin, any help will be very appreciate.

Thanks in advance

Antonello

 

Link to comment
Share on other sites

Hi Rodeo, 

Thanks for reply. Yes as told I'm afraid these are only toggle, I also tried to import like float, but also from doc description looks like writable dataref. So there is not any way to know the autopilot state with the IXEG? I'll open a new ticket to the support

Link to comment
Share on other sites

Hi Antonello, the 737 autopilot is a 100% custom coded system so you will unfortunately not have any use for the default autopilot datarefs. 

If you specify in detail what you need we can possibly put some new datarefs on our to-do list.

 

Link to comment
Share on other sites

3 minutes ago, Slayer said:

ixeg/733/MCP/mcp_lnav_act
 

definately works I use that for my profile  - it's a 0 or 1

Hi all, thanks for your replies. 

Slayer you "read" this dataref via c++ and xplane sdk? I get always 0. You read it as float or int? You are using XPLMDataRef too? 

Link to comment
Share on other sites

I'm using a Goflight Interface Tool for programming my MCP.

I use that dataref but I'm afraid I can't tell you if it's for sure an int as that software handles all the reading and writing internally so I never see it, only the dataref. 

There is a way to read that info though but I'm not a C++ programmer so I can't tell you the method.

Suggest you have a look at the DRT source code , you will find a clue in there .

Edited by Slayer
Link to comment
Share on other sites

Hi guys,

Just had a look and the dataref is working fine... the problem is that this dataref will only show the state of the switch. Due to fact that it's a momentary push button you will only get 1 if you hold down the button. It does not give you the actual state of LNAV. IXEG will have to "expose" more datarefs which will allow you to get the actual state of things behind the scenes.

Link to comment
Share on other sites

@jfjoubert, thanks, it make sense, I'll make some tests.

@Slayer, I'm already reading from mcp_lnav_act,  but the result is always 0. Maybe jfjoubert is right, and the dataref returns 1 only in the moment is pressed, I'll make some tests.

Now I'm reading these datarefs, all results in a 0 value:

    gVNav_IXEG_AutopilotStateRef = XPLMFindDataRef("ixeg/733/MCP/mcp_vnav_act");
    gLNav_IXEG_AutopilotStateRef = XPLMFindDataRef("ixeg/733/MCP/mcp_lnav_act");
    gHdg_IXEG_AutopilotStateRef = XPLMFindDataRef("ixeg/733/MCP/mcp_hdg_select_act");


@Nils, many thanks for your support, I'll try to better explain my problem:

Xplane sdk provides a dataref that represents the autopilot state. When no autopilot, HDG, VNAV etc is engaged, dataref return a int value 132. When you engage LNAV, for example, the int value raise:

Depending on what is enabled, if is climbing, on cruise, if LNAV or VNAV is engaged, etc, the dataref return a differente code. These are some I red up today from other models:

529, 560, 561, 616, 672, 16896, 16897

This datarefs permits to figure if LNAV, HDG, o VNAV is engaged. For my plugin is crucial to understand these informations.

Edited by ntnllxpilot
Link to comment
Share on other sites

Ok to detect LNAV you could probably use  ixeg/733/MCP/mcp_lnav_ann  for most purposes.

Our dataref convention is to suffix dataref names with _act for actuators (e.g. buttons and switches), _ind for indicators (i.e. animated needles) and _ann for annunciators (e.g. the little lights on the mcp buttons).

Link to comment
Share on other sites

reread my post:

ixeg/733/MCP/mcp_lnav_ann

that is the annunciator light so it's only on when lnav is on and active. Sorry for the confusion.

if you want heading select and VNAV those are:

ixeg/733/MCP/mcp_vnav_ann

ixeg/733/MCP/mcp_hdg_ann

Edited by Slayer
Link to comment
Share on other sites

Thanks.

Did another check and the "ixeg/733/MCP/mcp_lnav_ann" dataref is displaying the state of the LNAV annunciator.

Forgot to mention that I'm using XPLMGetDataf. So read it as a float.

Edited by jfjoubert
Update
Link to comment
Share on other sites

Hi all,

thanks for the replies.
mcp_hdg_select_ann is not present in the documentation, where can I found an updated list of datarefs?
Anyway, I just make a lot of tests, and I still get "0" results for all reads:

my code:

XPLMDataRef        gVNav_IXEG_AutopilotStateRef = NULL;
XPLMDataRef        gLNav_IXEG_AutopilotStateRef = NULL;

gVNav_IXEG_AutopilotStateRef = XPLMFindDataRef("ixeg/733/MCP/mcp_vnav_ann");
gLNav_IXEG_AutopilotStateRef = XPLMFindDataRef("ixeg/733/MCP/mcp_lnav_ann");

int             statoVNAV_IXEG;
int             statoLNAV_IXEG;

statoVNAV_IXEG=XPLMGetDatai(gVNav_IXEG_AutopilotStateRef);
statoLNAV_IXEG=XPLMGetDatai(gLNav_IXEG_AutopilotStateRef);


Hi tried with both, int and float type (and XPLMGetDataf), but I will get always 0.

I can't understand, I'm reading tons of dataref from SDK, but I can't read these datarefs, is this syntax correct?

gLNav_IXEG_AutopilotStateRef = XPLMFindDataRef("ixeg/733/MCP/mcp_lnav_ann")


Which type should be used for read these datarefs? I use to rely to sdk dataref table for know it:
http://www.xsquawkbox.net/xpsdk/docs/DataRefs.html

But in the documentation there is any reference to the data type.

 

Edited by ntnllxpilot
Link to comment
Share on other sites

14 hours ago, sparker256 said:

I use this tool.

https://github.com/leecbaker/datareftool/releases

I do not have this plane but have used it with many planes and it has parsed out the datarefs.

Bill

Recent builds of DRT seem to make some incorrect assumptions about the rules regarding array datarefs.

I've seen some junk in log files about it throwing tantrums.

 

I'd fix it but the project started using boost a long time ago and I lost interest.

Link to comment
Share on other sites

Hi guys,

I think I found the reason that is causing the issue, is due to plugin boot order, I'll try to defer dataref initialization, thanks all for replies and to huge Sandy Barbour. This is the post I found that suggest the solution, I hope it could helps others:

http://forums.x-plane.org/index.php?/forums/topic/50889-dataref-x737-help-needed/

Edit: I deferred dataref initialization and solved the issue, definitively a problem of plugin boot order

Link to comment
Share on other sites

On 31 May 2016 at 0:31 PM, Ben Russell said:

Recent builds of DRT seem to make some incorrect assumptions about the rules regarding array datarefs.

Do you know what the issue(s) might be? Maybe someone else can fix them. Or maybe you have a link to one of these junk-filled logs?

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.

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...