NextValueInInterval (FPScript)

21.09.2021

Searches for the next value in a particular interval or for the next void value.

Syntax

NextValueInInterval(DataSet, [ Position ], LowerLimit, UpperLimit, [ Direction = EVENT_RIGHT ], [ DeltaXmin ] [ , DeltaXmax ])

 

The syntax of the NextValueInInterval function consists of the following parts:

Part

Description

DataSet

The data set to be searched.

Permitted data structures are data series und signal. All numeric data types are permitted.

For complex data types the absolute value is formed.

If the argument is a list, then the function is executed for each element of the list and the result is also a list.

Position

If you are searching in a signal, this is the X value where the search is to start. If you are searching a data series, this is the index of the value where the search is to start. Here, a negative index determines a position relative to the end of the data set. If you omit the argument or pass the value Empty, the search starts at the beginning or end of the data set, depending on the direction of the search. The first or last value of the data set is only taken into account if you omit the argument or pass the Empty value.

Permitted data structures are scalar value. All numeric data types are permitted. The unit has to be compatible with that of parameter DataSet.

For complex data types the absolute value is formed.

If the argument is a list, then the function is executed for each element of the list and the result is also a list.

LowerLimit

The lower limit of the interval in which the value must lie. Values that are exactly on the limit are also found.

Permitted data structures are scalar value. All numeric data types are permitted. The unit has to be compatible with that of parameter DataSet.

For complex data types the absolute value is formed.

If the argument is a list, then the function is executed for each element of the list and the result is also a list.

UpperLimit

The upper limit of the interval in which the value must lie. Values that are exactly on the limit are also found.

Permitted data structures are scalar value. All numeric data types are permitted. The unit has to be compatible with that of parameter DataSet.

For complex data types the absolute value is formed.

If the argument is a list, then the function is executed for each element of the list and the result is also a list.

Direction

Specifies the direction of the search in the function.

The argument Direction can have the following values:

Constant

Meaning

EVENT_RIGHT

Search to the right.

EVENT_LEFT

Search to the left.

If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated.

If this argument is omitted, it will be set to the default value EVENT_RIGHT.

DeltaXmin

Optionally determines the minimum duration or number of values that an event must endure to be valid. If you search within a signal, this equals the X range from the first value of the event to the last value of the event. If you search within a data series, this is the minimum number of data points that the event must have.

Permitted data structures are scalar value. All numeric data types are permitted. The unit has to be compatible with that of parameter DataSet.

For complex data types the absolute value is formed.

If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated.

DeltaXmax

Optionally determines the maximum duration or number of values that an event can endure to be valid. If you search within a signal, this equals the X range from the first value of the event to the last value of the event. If you search within a data series, this is the maximum number of data points that the event can have.

Permitted data structures are scalar value. All numeric data types are permitted. The unit has to be compatible with that of parameter DataSet.

For complex data types the absolute value is formed.

If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated.

Remarks

The result always has the data structure scalar value.

If you want to search for a specific value, you must specify this as the upper and lower limit. You can search for void values by setting LowerLimit and UpperLimit to void. If DataSet is a data series, the result is the index of the value found. If DataSet is a signal, then the result is the X value of the Y value found. If no value could be found, the value Empty is output as the result.

Available in

FlexPro Basic, Professional, Developer Suite

Examples

NextValueInInterval(Signal, 5.5 s, 800 mV, 1.2 V, EVENT_LEFT)

Searches within a signal for the next value within the interval [0.8 V, 1.2 V] starting from position X = 5.5 s and heading left. The result is the X value of the value found.

NextValueInInterval(Signal, , ?, ?)

Searches in a signal for the next void value starting from the beginning of the signal and heading right. The result is the X value of the value found.

Signal[[NextValueInInterval(Signal, 4.5 s, 0.6 V, 1.0 V)]]

Searches in a signal for the next value within the interval [0.6 V, 1.0 V] starting from position X = 4.5 s and heading right. The result is the Y value found.

NextValueInInterval(DataSeries, 100, 1.2 V, 1.2 V)

Searches in a data series for the next value 1.2 V starting from the index position 100 and heading right. The result is the index of the value found.

See Also

NextValueAboveLevel Function

NextValueBelowLevel Function

ValuesAboveLevel Function

ValuesBelowLevel Function

ValuesInInterval Function

SearchVoidValues Function

Event Isolation Analysis Object

Share article or send as email:

You might be interested in these articles