MultiSwitch

Set Boolean expression that is associated with the first active input signal

    MultiSwitch

Library

Modelica/Blocks/MathBoolean

Description

The block has a vector of Boolean input signals u[nu] and a vector of(time varying) Boolean expressions expr[:]. The output signal y isset to expr[i], if i is the first element in the input vector u that is true.If all input signals are false, y is set to parameter "y_default" or theprevious value of y is kept if parameter use_pre_as_default = true:

// Conceptual equation (not valid Modelica)i = 'first element of u[:] that is true';y = if i==0 then (if use_pre_as_default then pre(y)                                        else y_default)    else expr[i];

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

Parameters

MultiSwitch_0

NameLabelDescriptionData TypeValid Values

mo_expr

expr

Sets y = if u[i] then expr[i] else y_default (time varying)

Vector

true
false

mo_use_pre_as_default

use_pre_as_default

Set true to hold last value as default (y_default = pre(y))

Scalar

true
false

mo_y_default

y_default

Default value of output y if all u[i] = false

Scalar

true
false

mo_nu

nu

Number of input connections

Scalar

MultiSwitch_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

'firstActiveIndex'

mo__modifiers/attribute

Attribute

Cell of strings

'start'
'fixed'

mo__modifiers/value

Value

Ports

NameTypeDescriptionIO TypeNumber

u

implicit

Set y = expr[i], if u[i] = true

input

1

y

implicit

Output depending on expression

output

1

See Also