Conversions model

Requirements.Examples.Elementary.LogicalBlocks.Conversions  ยท source

Icon of Conversions

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

NameTypeDescription
booleanTableModelica.Blocks.Sources.BooleanTableBoolean signal true until 1.5 s, toggling at 1.5, 3.3 and 4.2 s
BtoP1Requirements.LogicalBlocks.BooleanToPropertyBoolean to Property: false is Violated, true is Satisfied
integerTableModelica.Blocks.Sources.IntegerTableInteger signal running through the values 3, 2, 1, 3, 2
ItoP1Requirements.LogicalBlocks.IntegerToPropertyInteger to Property: 1 Violated, 2 Undecided, 3 Satisfied
PtoB1Requirements.LogicalBlocks.PropertyToBooleanProperty to Boolean, Undecided mapped to false
PtoB2Requirements.LogicalBlocks.PropertyToBooleanProperty to Boolean, Undecided mapped to true
PtoI1Requirements.LogicalBlocks.PropertyToIntegerProperty to Integer