GetDataStatus( "A" )
Here's the return values:
StatusOk = 0
NoDataAvailable = 1
DataNotYetAvailable = 2
EquationError = 3
Which return value would be a better indicator of stale data? 1 or 2?
So I can build an equation like this:
GetDataStatus( "A") == 1 ? TRUE : FALSE
Thus of the statement is true (==1), then the data is stale. Am I understanding this correctly? Can I conversely utilize "1" or "0" instead of "TRUE" or "FALSE"? How many previous points is this fuction sampling before the data is considered "stale"?
I also came across this funciton in another discussion:
AIsStale ? Prev(A,1)*3.14 : A * 3.14
I am not certain how to interpret this. According to this statement, if the parameter "A" has been stale for the previous point, then multiply the parameter by 3.14. Is that a correct interpretation? All I am trying to produce is a parameter to indicate stale data and drop it on the "visible" property of the control. So I am not really sure if I need this statement.
Thanks for your help!
The Variance function is used to determine if a parameter has changed during a given range of time or number of data points. Of course, this could be accomplished using the FirstDerivative function also, but Variance is based on the average of the data values that it's calculating over, so it's easier to "tune" the threshold (for this example 0.1) to get consistent results.
Syntax
Variance(Parameter, nPoints)
We could use this function to determine if the pilot held the aileron/flap/elevon position (or airspeed) steady for a given amount of time. We could also use this function to detect the point at which the weapons doors (or landing gear) opened or closed (or detect whenever they are in motion).
IsParameterChanging = Variance(Param, GetUpdateRate(Param)*Ns ) > 0.1 ? TRUE : FALSE Where Ns is the number of seconds to detect change over.. For example, Is_ParmA_Changing = Variance(ParmA, GetUpdateRate(ParmA)*0.25 ) > 0.1 ? TRUE : FALSE
DidPilotHoldAirpeedSteadyForLastNSeconds = Variance(Param, GetUpdateRate(Param)*Ns) < 0.1 ? TRUE : FALSE Where Ns is the number of seconds
Mike