1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Getting the NAV IDENT and NAV NAME

Discussion in 'SimConnect' started by Alphadog, 15 Dec 2006.

  1. Alphadog

    Alphadog Guest

    Hello all.

    I'm getting garbage data when reading the NAV and ADF "strings" available in Aircraft Avionics Data section.

    For example, in my struct, I've defined:

    struct ScAircraftAvionicsData
    CHAR nav_ident[128];

    And, I've added the AddToDataDefinition call which returns S_OK:
    hr = SimConnect_AddToDataDefinition(hSimConnect, DEFINE_ID, "NAV IDENT", "String", SIMCONNECT_DATATYPE_STRING128);

    But, I'm receiving garbage data when copying data into the struct:
    ScAircraftAvionicsData*pS = (ScAircraftAvionicsData*) &pObjData->dwData;

    (i.e. pS->nav_ident contains garbage)

    In addition, I receive the following SIMCONNECT_EXCEPTION data:
    dwSendID = 145 (in this case...)
    dwIndex = 3
    cbData = 24

    What am I doing wrong?
    Last edited by a moderator: 15 Dec 2006
  2. lc0277


    25 Sep 2006
    The dwIndex member of the exception structure tells you what is the argument that caused an error. In that case it's the "String" argument of the AddToDataDefinition(). Generally for variables without units, you don't need to provide something here, a NULL or empty string is just fine.

    Moreover, you'll need to specify the index of the NAV receiver. As usual, you can choose either NAV1 IDENT or NAV IDENT:1

Share This Page