TriggeredAdd

Add input to previous value of output, if rising edge of trigger port

    TriggeredAdd

Library

Modelica/Blocks/MathInteger

Description

Add input to previous value of output, if rising edge of trigger port

This block has one Integer input "u", one Boolean input "trigger",an optional Boolean input "reset", an optional Integer input "set", andan Integer output "y".The optional inputs can be activated with the "use_reset" and"use_set" flags, respectively.

The input "u" is added to the previous value of theoutput "y" if the "trigger" port has a rising edge. At the start of thesimulation "y = y_start".

If the "reset" port is enabled, then the output "y" is reset to "set"or to "y_start" (if the "set" port is not enabled), whenever the "reset"port has a rising edge.

The usage is demonstrated, e.g., in exampleModelica.Blocks.Examples.IntegerNetwork1.

Parameters

TriggeredAdd_0

NameLabelDescriptionData TypeValid Values

mo_use_reset

use_reset

= true, if reset port enabled

Number

0
1

mo_use_set

use_set

= true, if set port enabled and used as default value when reset

Number

0
1

mo_y_start

y_start

Initial and reset value of y if set port is not used

Scalar

TriggeredAdd_1

NameLabelDescriptionData TypeValid Values

mo__nmodifiers

Number of Modifiers

Specifies the number of modifiers

Number

mo__modifiers

Modifiers

Add new modifier

Structure

mo__modifiers/varname

Variable name

Cell of strings

mo__modifiers/attribute

Attribute

Cell of strings

'start'
'fixed'

mo__modifiers/value

Value

Ports

NameTypeDescriptionIO TypeNumber

u

implicit

Integer input signal

input

1

y

implicit

Integer output signal

output

1

trigger

implicit

input

2

Port 4

implicit

input

mo_use_reset

Port 5

implicit

input

mo_use_set

See Also