August 11, 20178 yr Commercial Member 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)", °C, NULL, NULL); return degC; }
August 11, 20178 yr 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, °C, 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
August 11, 20178 yr Author Commercial Member Arghhh!! It had to be a typo, didn't it?? Thanks Doug. -Dai
August 12, 20178 yr Author Commercial Member 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.
Archived
This topic is now archived and is closed to further replies.