April 20, 200719 yr The return value from the ENGINE_WORKING_TIME token has me stumped. It is supposed to be seconds but it seems not to be. Any insights?This for FS9.Fred
April 21, 200719 yr Hi,Only know:(A:GENERAL ENG ELAPSED TIME, ) Jan"Beatus ille qui procul negotiis..." Jan "Beatus ille qui procul negotiis..."
April 21, 200719 yr Just made a little gauge to test ENGINE_WORKING_TIME and it does indeed count in SECONDS.FLOAT64 FSAPI engine_string_cb( PELEMENT_STRING pelement ){ wsprintf(pelement->string, "%d", (UINT32)pelement->source_var[0].var_value.n); return 0; }MAKE_STRING( engine_string, NULL, NULL, IMAGE_USE_ERASE | IMAGE_USE_TRANSPARENCY | IMAGE_USE_BRIGHT , 0, 50,5, 80,60, 3, ENGINE_WORKING_TIME, MODULE_VAR_NONE, MODULE_VAR_NONE, RGB(239,181,0), RGB(0,0,0), RGB(92,92,92), GAUGE_tuc_att_DEFAULT, GAUGE_WEIGHT_tuc_att, GAUGE_CHARSET_tuc_att, 0, DT_RIGHT | DT_VCENTER | DT_SINGLELINE, NULL, engine_string_cb)PELEMENT_HEADER engine_string_list[]={ &engine_string.header, NULL};Post your code so we can debug it for youregardsjim
April 22, 200719 yr Thanks Jim,My code is essentially the same as yours and if you check it out against a clock you will probably find, as I do, that it is not counting seconds but is slow by about 1/2.If I multiply it by 2 it is close enough for my purpose (Hobbs meter) but it does not appear to be as advertised so I was just wondering if I was handling the return wrong.For Jan,execute_calculator_code("(A:GENERAL ENG ELAPSED TIME:1,seconds)",&val,NULL,NULL); gives identical results tas above.Fred
April 22, 200719 yr Moderator Hobbs counters measure "tenths" of hours, not seconds. It is possible that's the reason for the discrepancy you're seeing... Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
April 22, 200719 yr Fred you're correct. Watching the counter without reference it did seem like seconds. However by comparing it with actual simulator elapsed time I found it was out by a factor of 2.35Can't think of a logical explanation.RegardsJim
April 22, 200719 yr I noticed the same, and I was just wondering if the engine time was running at a speed that was depending on the engine power.It seemed to me that this timer was running slower when the engine was on idle than when it was on full thrust.What do you think?Eric My Web Site
April 22, 200719 yr Yes but this is not yet a Hobbs. I am simply looking at the return which is supposed to be seconds but is not.Fred
April 22, 200719 yr I think you are correct Eric. The more the throttle is opened the faster the engine timeer counts. It would be interesting to know if anyone has actually made a working Hobbs without using file I/O but this ENGINE_WORKING_TIME token seems useless.
April 23, 200719 yr Author Gentlemen, Has the term TBO come up? Me not a "C, C++, C#" type programmer. Could it be engine wear? As you'all said the output came back at higher throttle levels the variable was also higher. Could this be the one one many have been looking for? "too much throttle" = too much damage? there have been damage; A:(read, XML), vars sitting around for awhile (FS02), without it seems, a "firing" var. Guess we have to make 'em ourselves. Unless.... Damage sits inside the .air file. ( I would put $$$ on that ) Ron F. care to inquire? As for a working HOBBS without I/O, sorry, can't be be done, ever..Unless, HAL gets over his cold.Regards,Roman FS RTWR SHRS F-111 JoinFS Little Navmap
May 7, 200719 yr I have found that the following code works well to display the Hobbs time.((A:GENERAL ENG ELAPSED TIME:1, hours) )%!04.1f!It does actually display the time as 02.4, that is the comparison I had with the counter on the Default Cessna 182.Eberhard------------------------------------Eberhard Haberkornhttp://www.focusthink.com/~weather-maker/betatester.jpghttp://www.focusthink.com/~weather-maker/proudsupporter.jpg RegardsEberhard HaberkornBeta tester ~ TongassX • FTX Beta team • Aerosoft
May 10, 200719 yr That variable (as in the Cessna) returns Tach Time and not actual engine hours. Tach Time varies according to engine throttle settings and is not actual running time.When you rent a plane you pay by Hobbs Time (usually) but maintanance is done by Tach Time. If your rental is by Tach Time then you can reduce your costs by keeping the engine revs down.The solution to my original problem was to use CLOCK_TOTAL_SECONDS with an external file to keep track of total time.Fred
May 10, 200719 yr Moderator >The solution to my original problem was to use>CLOCK_TOTAL_SECONDS with an external file to keep track of>total time.Some folks have asked me why I program my own hobbs code (in C) and maintain my own data file... That is precisely why!if ( TURB_ENGINE_1_CORRECTED_N1var.var_value.n > 10 || TURB_ENGINE_2_CORRECTED_N1var.var_value.n > 10 ) { // if six minutes have accumulated, increment tenths digit // and reset accumulator latches if ( minutes == 6 ) { latch = 1 ; start = 1 ; } if ( seconds < 0 && start == 2 ) { seconds = 0 ; start = 1 ; } // capture a starting seconds count and set accumulator latch// to begin measuring elapsed seconds if ( start == 1 ) { initialize_time = CLOCK_TOTAL_SECONDSvar.var_value.n ; start = 2 ; } if ( start == 2 ) { seconds = CLOCK_TOTAL_SECONDSvar.var_value.n - initialize_time ; } else { seconds = 0 ; } if ( start == 2 ) { minutes = ( seconds - fmod(seconds,60.0) ) / 60 ; } else { minutes = 0 ; } // if 60 seconds have elapsed, increment total_time by 0.1// (tenth hour) and reset the accumulator latch if ( start == 2 && minutes == 6 && latch == 1 ) { total_time = total_time + .1 ; latch = 0 ; } } // if both engines are idle, display accumulated timeelse { total_time = total_time ; } Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
May 11, 200719 yr I program everything in C with the rare exception of using XML for knocking something together for a quick test. XML's limitations and illegibility are the reasons.Anyway, here is how I did the Hobbs.In an invisible VC gauge my variable 'hobbs_seconds' is initially read from the file then, if there is voltage and oil pressure, updated with each tick of CLOCK_TOTAL_SECONDS. When the VC gauge is killed 'hobbs_data' is written back to the file.Then in the MAKE_MOVING macros in the Hobbs gauge, as any digit rolls from 9 to 0 the next highest digit rolls with it to it's next value.case PANEL_SERVICE_PRE_DRAW: runtime_hrs = hobbs_seconds/3600; // hours tenths = fmod(runtime_hrs*10,10); // tenths if(tenths > 9.0) //rolling 9->0 add the decimal ones = (fmod(runtime_hrs,10) - fmod(runtime_hrs,1)) + (tenths-UINT32(tenths)); else // only use the integer ones = fmod(runtime_hrs,10) - fmod(runtime_hrs,1); if(ones > 9.0) // add ones decimal tens = ((fmod(runtime_hrs,100) - fmod(runtime_hrs,10))/10) + (ones-UINT32(ones)); else tens = (fmod(runtime_hrs,100) - fmod(runtime_hrs,10))/10; if(tens > 9.0) // add 10s decimal hundreds = ((fmod(runtime_hrs,1000) - fmod(runtime_hrs,100))/100) + (tens-UINT32(tens)); else hundreds = (fmod(runtime_hrs,1000) - fmod(runtime_hrs,100))/100; if(hundreds > 9.0) // add 100s decimal thousands = (fmod(runtime_hrs,10000)-fmod(runtime_hrs,1000))/1000) + (hundreds-UINT32(hundreds)); else thousands = (fmod(runtime_hrs,10000) - fmod(runtime_hrs,1000))/1000;break;Sorry about some of the lines wrappingFred
Create an account or sign in to comment