NextValueBelowLevel (FPScript)

21.09.2021

Searches for the next value below a certain level.

Syntax

NextValueBelowLevel(DataSet, [ Position ], Level, [ Direction = EVENT_RIGHT ], [ DeltaXmin ] [ , DeltaXmax ])

 

The syntax of the NextValueBelowLevel 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. The value itself is not included in the search. If you are searching a data series, this is the index of the value where the search is to start. The index itself is not included in the search. 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.

Level

The level below which the value must lie. Values that are exactly on the level 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 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

NextValueBelowLevel({2, 3, 4, 3, 2}, , 3)

Results in 0L. Searches in the data set from the beginning for the next value to the right that amounts to at most 3.

NextValueBelowLevel({2, 3, 4, 3, 2}, 0, 3)

Results in 1L. Searches in the data set starting from the index for the next value to the right that amounts to at most 3. The result is index 1, since the search stops at position 0.

NextValueBelowLevel(Signal, 5.5 s, 0.8 V, EVENT_LEFT)

Searches within a signal for the next value, which is at most 0.8 V, from position X=5.5 s and heading left. The result is the X value of the value found.

Signal[[NextValueBelowLevel(Signal, 4.5 s, 0.6 V)]]

Searches within a signal for the next value, which is at most 0.6 V, from position X=4.5 s and heading to the right. The result is the Y value found.

NextValueBelowLevel(DataSeries, 100, 1.2 V)

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

See Also

LevelCrossings Function

NextValueInInterval Function

NextValueAboveLevel Function

ValuesAboveLevel Function

ValuesBelowLevel Function

ValuesInInterval Function

Event Isolation Analysis Object

Share article or send as email:

You might be interested in these articles