BooleanTable
Generate a Boolean output signal based on a vector of time instants
Library
Modelica/Blocks/Sources
Description
The Boolean output y is a signal defined by parameter vector table.In the vector time points are stored.The table interpolation has the following properties:
- At every time point, the output y changes its value to the negated value of the previous one.
- Values outside of the table range, are computed by extrapolation according to the setting of parameter extrapolation:
extrapolation = 1: Hold the startValue or last value of the table, if outside of the table scope. = 2: Extrapolate by using the derivative at the first/last table points if outside of the table scope. (This setting is not suitable and triggers an assert.) = 3: Periodically repeat the table data (periodical function). = 4: No extrapolation, i.e. extrapolation triggers an error
- Via parameter shiftTime the curve defined by the table can be shifted in time. The time instants stored in the table are therefore relative to shiftTime.
- If time < startTime, no interpolation is performed and false is used as ordinate value for the output.
The precise semantics is:
if size(table,1) == 0 then y = startValue;else // time < table[1]: y = startValue // table[1] ≤ time < table[2]: y = not startValue // table[2] ≤ time < table[3]: y = startValue // table[3] ≤ time < table[4]: y = not startValue // ...end if;
Parameters
Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|
mo_table | table | Vector of time points. At every time point, the output y gets its opposite value (e.g., table={0,1}) | Vector | |
mo_startValue | startValue | Start value of y. At time = table[1], y changes to 'not startValue' | Scalar | true |
mo_extrapolation | extrapolation | Extrapolation of data outside the definition range | Structure | |
mo_extrapolation/choice1 | Modelica.Blocks.Types.Extrapolation.HoldLastPoint | Number | 0 | |
mo_extrapolation/choice2 | Modelica.Blocks.Types.Extrapolation.LastTwoPoints | Number | 0 | |
mo_extrapolation/choice3 | Modelica.Blocks.Types.Extrapolation.Periodic | Number | 0 | |
mo_extrapolation/choice4 | Modelica.Blocks.Types.Extrapolation.NoExtrapolation | Number | 0 | |
mo_startTime | startTime | Output = false for time < startTime | Scalar | |
mo_shiftTime | shiftTime | Shift time of table | Scalar | |
mo_n | n | Number of table points | Scalar |
Name | Label | Description | Data Type | Valid 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' | |
mo__modifiers/value | Value |
Ports
Name | Type | Description | IO Type | Number |
---|---|---|---|---|
y | implicit | Connector of Boolean output signal | output | 1 |