Conversions model
Requirements.Examples.Elementary.LogicalBlocks.Conversions
ยท source
Examples for BooleanToProperty, IntegerToProperty, PropertyToBoolean, PropertyToInteger
Extends Modelica.Icons.Example
Using conversion blocks from package LogicalBlocks as
results in
![]() | |
![]() | |
![]() | |
![]() | |
| simulation results |
booleanTable (true until 1.5 s, false until 3.3 s, true until 4.2 s, then false) is converted by
BtoP1 into a Property (false gives Violated, true Satisfied). integerTable runs through the
Integer values 3, 2, 1, 3, 2 and is converted by ItoP1 into Satisfied, Undecided, Violated, Satisfied,
Undecided. This Property is converted back by PtoB1 (Undecided mapped to false), PtoB2
(Undecided mapped to true) and PtoI1 (Integer code of the Property).
Components and variables
| Name | Type | Description |
|---|---|---|
booleanTable | Modelica.Blocks.Sources.BooleanTable | Boolean signal true until 1.5 s, toggling at 1.5, 3.3 and 4.2 s |
BtoP1 | Requirements.LogicalBlocks.BooleanToProperty | Boolean to Property: false is Violated, true is Satisfied |
integerTable | Modelica.Blocks.Sources.IntegerTable | Integer signal running through the values 3, 2, 1, 3, 2 |
ItoP1 | Requirements.LogicalBlocks.IntegerToProperty | Integer to Property: 1 Violated, 2 Undecided, 3 Satisfied |
PtoB1 | Requirements.LogicalBlocks.PropertyToBoolean | Property to Boolean, Undecided mapped to false |
PtoB2 | Requirements.LogicalBlocks.PropertyToBoolean | Property to Boolean, Undecided mapped to true |
PtoI1 | Requirements.LogicalBlocks.PropertyToInteger | Property to Integer |




