BinarySearch Step In-Place Editing

  A BinarySearch statement uses a loop variable to search over a continuous interval by selecting the middle element in the interval, thus progressively closing in on a sought value. For every pass, a user-defined condition is evaluated, the interval is reduced and, depending on whether the search condition is met or not, the lower or upper interval is selected as the current interval for the next pass. When the search condition is met, the loop variable value corresponding to the current pass is stored.

  When the values interval becomes smaller than a user-defined resolution value, the BinarySearch operation completes executing the current iteration and then ends.

To edit a BinarySearch script step:

  1. Select the step in the Script Steps table.
  2. Edit the step parameters as follows:
    • Session: This column displays no session at all.
    • Return Variable: This step type does not return any variable.
    • Command String: Depending on the statement, initial or ending, the following is displayed:
      • BinarySearch statement: Displays the loop variable, the initial value, the end value, and the increment.

Click into the column and edit in-place the variable name or the looping condition values.

      • SearchCondition statement: Displays the search condition.
      • Click into the column and define an expression by editing it in-place.

        Alternatively, click the button and create a valid expression using the Expression Builder GUI, as described in Using the Composer Expression Builder.

Example:

  BinarySeach frameRate in (10 100 100 0.1)
    Configure FrameRateSet ports="1.1.1" streamno="1"
    rate="$frameRate" rateMode=streamRateModePercentRate
    Transmit Start ports=1.1.1""
    fL Get Stat ports="1.1.2" stats=frameLoss
    SearchCondition $fL == 0
 EndBinarySearch