August 21, 200421 yr GoalTo keep the oil temperature needle from falling below ambient air temperature. (vs. going to zero on shutdown).Proposed StrategyUse the needle's call back function and clip the minimum at the current TOTAL_AIR_TEMP.ProblemHow do you access TOTAL_AIR_TEMP while inside the call back function?Could I do this: FLOAT64 FSAPI temp_needle_cb( PELEMENT_STRING pelement ){ FLOAT64 val = pelement->source_var->var_value.n; SINT16 nTemp = 0; MODULE_VAR curr_Temp = {TOTAL_AIR_TEMP}; lookup_var(&curr_Temp); nTemp = curr_Temp.var_value.n; if (val < nTemp) val = nTemp; return val;} inside the call back function?
August 22, 200421 yr Author You can use the 'lookup_var' command anywhere. You may want to move the 'MODULE_VAR' declaration out of the function. I've never tried that - not sure if it will work...Doug
Create an account or sign in to comment