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
Help AVSIM continue to serve you!
Please donate today!

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