Engee documentation

Hit Crossing

Detection of a signal crossing the set value.

hit crossing

Description

The Hit Crossing block determines when the input signal reaches the Hit crossing offset in the direction specified by the Hit crossing direction parameter.

The output port on the block icon is displayed if the Show output port checkbox is selected. If the output port display is disabled, the block operates as Terminator.

Ports

Input

Port_1 - input signal
scalar | vector | matrix

An input signal for which the unit detects that the set value has been reached in the specified direction.

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

Output

Port_1 - output signal
scalar | vector

Output indicating whether the input signal has crossed the set value.

This port is visible only when the Show output port checkbox is selected.

Data types: Float64.

Parameters

Hit crossing offset - the value whose crossing is to be detected
0 (by default) | real values

The value whose crossing in the direction specified by Hit crossing direction is detected by the block.

Usage in program code

Block parameter

HitCrossingOffset

Values

real values

By default

0

Hit crossing direction - direction in which the input signal crosses a given value
either (by default) | falling | rising

The direction from which the input signal approaches the set value for crossing detection.

If set to `either', the block behaves as a approximately equal (non-existent) block, which can be useful for circumventing the limitations of finite mathematics and computational accuracy. In such cases, using the Hit Crossing block may be more convenient than adding additional logic to the model.

When the Hit crossing direction property is set to either and the model uses a constant step solver, the block behaves as follows. If the output is 1, the block sets the output to 0 at the next time step, unless the input is equal to a given value.

Usage in program code

Block parameter

HitCrossingDirection

Values

either | falling | rising

By default

either

Show output port - show output port
On (By default) | Off

Select this check box to enable the block output port.

Usage in program code

Block parameter

ShowOutputPort

Values

off | on

By default

enabled