blockTriggeredAdd
Extends from Modelica.Blocks.Interfaces.PartialIntegerSISO (Partial block with a IntegerInput and an IntegerOutput signal).
Information
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", and an 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 the output "y" if the "trigger" port has a rising edge. At the start of the simulation "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 example Modelica.Blocks.Examples.IntegerNetwork1.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Boolean | use_reset | false | = true, if reset port enabled |
| Boolean | use_set | false | = true, if set port enabled and used as default value when reset |
| Integer | y_start | 0 | Initial and reset value of y if set port is not used |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Blocks.Interfaces.IntegerInput | u (from PartialIntegerSISO) | Integer input signal | |
| Modelica.Blocks.Interfaces.IntegerOutput | y (from PartialIntegerSISO) | Integer output signal | |
| Modelica.Blocks.Interfaces.BooleanInput | trigger | ||
| Modelica.Blocks.Interfaces.BooleanInput | reset | ||
| Modelica.Blocks.Interfaces.IntegerInput | set |