Jump to content
Sign in to follow this  
dragonflightdesign

RECIP CARBURETOR TEMPERATURE returns 0?

Recommended Posts

Got to be me, but the following piece of code always returns zero at all altitudes and throttle settings. Just on the offchance I tried the SINT32 slot too but that also returned zero. Anyone any idea what I've missed/done wrong?

 

//**************************************************************************
//  Carburetor air temperature
//**************************************************************************
double getCarbTemp(double engine)
{
    double degC=0;
    execute_calculator_code("(A:RECIP CARBURETOR TEMPERATURE,engine)", &degC, NULL, NULL);
    return degC;
}

Share this post


Link to post
Share on other sites

Maybe this:

double getCarbTemp(int engine)
{
    double degC = 0;
    char var_name[48] = { 0 };
    sprintf_s(var_name, "(A:RECIP CARBURETOR TEMPERATURE:%i, celsius)", engine);
    execute_calculator_code(var_name, &degC, NULL, NULL);
    return degC;
}

You need to separate the index from the name with a colon, and you need units for an xml A:var.

 

Doug

 

Share this post


Link to post
Share on other sites

That's definately gone into the 'if it doesn't work, try Doug's method' pile. Doug's Method (capitalised and bold) just fixed a long-standing problem with GENERAL ENG GENERATOR SWITCH too. :biggrin:

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