May 23, 200719 yr Does anyone have a working callback that demonstrats how they are capturing a change (delta) in a FS value like an RPM or other FLOAT64 var?I'd like to be able to check on the rate of change of some vars, and not sure the best way to do this.I have tried something like this: FLOAT64 FSAPI TorqueNeedle_cb(PELEMENT_NEEDLE pelement){ previousTorque = currentTorque; currentTorque = pelement->source_var.var_value.n / 163.84; deltaTorque = currentTorque - previousTorque; return currentTorque;}but, of course, the change at 18hz is very small, and I'm not sure this is a good approach.What are others doing?Patrick
May 23, 200719 yr Moderator Well, you could use a timer to set your test interval......alternatively, sometimes a simple 'counter' will suffice! ;)if (count == 20){ count = 0; do_stuff ; count++ ; } Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
May 24, 200719 yr The link I'm givin is all in xml, ( http://forums.avsim.net/dcboard.php?az=sho...33083&mode=full ) Bill was right on.... Sample something (catch the time) then sample again (catch the time), difference in samples over difference in time = Delta Regards,Roman FS RTWR SHRS F-111 JoinFS Little Navmap
May 24, 200719 yr Roman,Thanks, I know the meaning of Deltas in mathmatics.I probably forgot to mention in my original post but I'm working in C/C++, and so I'm looking for how others are doing it in C.But, that is a great topic for those using XML.Patrick
Create an account or sign in to comment