Difference between revisions of "API Scope.FindOutput"

From Flowcode Help
Jump to navigationJump to search
(XML Import to change Variable types into Variable Types)
(XML import of updated API docs)
Line 1: Line 1:
 +
 +
 
<sidebar>API contents</sidebar>
 
<sidebar>API contents</sidebar>
 
Searches back through the output history for a value, returns offset of found sample from TimeUS, 0 if not found
 
Searches back through the output history for a value, returns offset of found sample from TimeUS, 0 if not found
Line 70: Line 72:
 
* Add to a calculation icon: <pre class="brush:[cpp]">result = ::Scope.FindOutput(streamh, timeus, searchmax, value, ::Scope.Find_Lower)</pre>
 
* Add to a calculation icon: <pre class="brush:[cpp]">result = ::Scope.FindOutput(streamh, timeus, searchmax, value, ::Scope.Find_Lower)</pre>
  
''<span style="color:red;">No additional information</span>''
+
''<span style="color:red;">No additional examples</span>''

Revision as of 09:58, 17 June 2013


<sidebar>API contents</sidebar> Searches back through the output history for a value, returns offset of found sample from TimeUS, 0 if not found

Class hierarchy

Scope

FindOutput

Parameters

HANDLE StreamH

The stream that is to be read

LONG TimeUS

The time offset to start the search from, in microseconds

LONG SearchMax

The maximum number of microseconds to look back over, -ve to search backwards

FLOAT Value

The target value to search for

ULONG SearchFlags

A combination of flags to decide how to conduct the search
Typical values for this parameter:
Name Description
Find_Lower Match a search when output is lower than the target value
Find_Equal Match a search when output is equal to the target value
Find_Higher Match a search when output is greater than the target value
Find_LowHigh Match a search when output goes lower to higher than the target
Find_HighLow Match a search when output goes higher to lower than the target


Return value

LONG

Returns offset of found sample from TimeUS, 0 if not found


Detailed description

This call allows transitions in the stream to be detected.

The user can specify a time offset (TimeUS), which is typically negative, as an offset from the present time.

The search can either step forwards or backwards, based on the sign of SearchMax, and will search within the range of the SearchMax provided - a value of zero will mean the search never succeeds.

The Value is a reference point. Either an exact match is required, an inequality, or a transition of values spanning the reference point. This criteria is decided by SearchFlags, which may be a combination of the available constants.

If the call fails to find a match then it will return 0 - an offset from the specified TimeUS which should otherwise not be returned.


Examples

Calling in a calculation

  • Declare a variable 'result' of type LONG
  • Add to a calculation icon:
    result = ::Scope.FindOutput(streamh, timeus, searchmax, value, ::Scope.Find_Lower)

No additional examples