Engee documentation

Detect Rise Positive

Detection of a rising edge provided that the signal value increases to a strictly positive value and its previous value was non-positive.

detect rise positive

Description

The Detect Rise Positive block determines that the current value of the input signal is greater than zero and its previous value was less than or equal to zero.

  • The output signal takes the value true (1) when the current value of the input signal is greater than zero and its previous value was less than or equal to zero.

  • The output signal takes the value false (0) if the current value of the input signal is less than or equal to zero, or if the input signal is positive and its previous value was also positive.

This block can only be used with discrete solvers.

Ports

Input

Port_1 - input signal
scalar | vector | matrix

Input signal as a scalar, vector or matrix.

Data types: Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Bool.

Output

Port_1 - output signal
scalar | vector | matrix

Output signal as a scalar, vector or matrix.

  • The output signal takes the value true (1) if the current value of the input signal is greater than zero and its previous value was less than or equal to zero.

  • The output signal takes the value false (0) if the current value of the input signal is less than or equal to zero, or if the input signal is positive and its previous value was also positive.

Data types: Bool, UInt8.

Parameters

Initial condition - initial condition of the input signal
0.0 (by default) | scalar | vector | matrix

Sets the initial value of the input signal.

Usage in program code

Block parameter

vinit

Values

scalar | vector | matrix

By default

0

Output data type - output data type
Bool (by default) | UInt8

Set the output data type to Bool or UInt8.

Usage in program code

Block parameter

OutDataTypeStr

Values

Bool | UInt8

By default

Bool

Additional options

C code generation: Yes