Difference between revisions of "API Scope.FindOutput"

From Flowcode Help
Jump to navigationJump to search
(XML import API changes)
(XML import)
 
(7 intermediate revisions by the same user not shown)
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 10: Line 10:
  
 
==Parameters==
 
==Parameters==
[[Variable types|HANDLE]] ''StreamH''
+
[[Variable Types|HANDLE]] ''StreamH''
 
:The stream that is to be read
 
:The stream that is to be read
  
[[Variable types|LONG]] ''TimeUS''
+
[[Variable Types|LONG]] ''TimeUS''
 
:The time offset to start the search from, in microseconds
 
:The time offset to start the search from, in microseconds
  
[[Variable types|LONG]] ''SearchMax''
+
[[Variable Types|LONG]] ''SearchMax''
 
:The maximum number of microseconds to look back over, -ve to search backwards
 
:The maximum number of microseconds to look back over, -ve to search backwards
  
[[Variable types|FLOAT]] ''Value''
+
[[Variable Types|FLOAT]] ''Value''
 
:The target value to search for
 
:The target value to search for
  
[[Variable types|ULONG]] ''SearchFlags''
+
[[Variable Types|ULONG]] ''SearchFlags''
:Bit 0 is find lower, bit 1 is equal, 2 is find higher
+
:A combination of flags to decide how to conduct the search
 
:''Typical values for this parameter:''
 
:''Typical values for this parameter:''
 
::{| class="wikitable" width="65%"
 
::{| class="wikitable" width="65%"
Line 48: Line 48:
  
 
==Return value==
 
==Return value==
[[Variable types|LONG]]
+
[[Variable Types|LONG]]
  
 
Returns offset of found sample from TimeUS, 0 if not found
 
Returns offset of found sample from TimeUS, 0 if not found
Line 54: Line 54:
  
 
==Detailed description==
 
==Detailed description==
''<span style="color:red;">No additional information</span>''
+
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.
  
  
Line 62: Line 70:
 
* 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>''

Latest revision as of 15:57, 16 January 2014

<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