Buildings.Controls.OBC.CDL.Logical.Sources
Package with blocks that generate source signals
Information
Package with blocks that generate signals.
Package Content
Name | Description |
---|---|
Constant | Output constant signal of type Boolean |
Pulse | Generate pulse signal of type Boolean |
SampleTrigger | Generate sample trigger signal |
Validation | Collection of models that validate the logical sources blocks of the CDL |
Buildings.Controls.OBC.CDL.Logical.Sources.Constant
Output constant signal of type Boolean
Information
Block that outputs a constant signal y = k
,
where k
is a Boolean-valued parameter.
Parameters
Type | Name | Default | Description |
---|---|---|---|
Boolean | k | Constant output value |
Connectors
Type | Name | Description |
---|---|---|
output BooleanOutput | y | Connector of Boolean output signal |
Modelica definition
block Constant "Output constant signal of type Boolean"
parameter Boolean k "Constant output value";
Interfaces.BooleanOutput y "Connector of Boolean output signal";
equation
y = k;
end Constant;
Buildings.Controls.OBC.CDL.Logical.Sources.Pulse
Generate pulse signal of type Boolean
Information
The Boolean output y is a pulse signal:
Parameters
Type | Name | Default | Description |
---|---|---|---|
Real | width | 0.5 | Width of pulse in fraction of period [1] |
Time | period | Time for one period [s] | |
Time | startTime | 0 | Time instant of first pulse [s] |
Connectors
Type | Name | Description |
---|---|---|
output BooleanOutput | y | Connector of Boolean output signal |
Modelica definition
block Pulse "Generate pulse signal of type Boolean"
parameter Real width(
final min=Constants.small,
final max=1,
final unit = "1") = 0.5 "Width of pulse in fraction of period";
parameter Modelica.SIunits.Time period(
final min=Constants.small) "Time for one period";
parameter Modelica.SIunits.Time startTime=0 "Time instant of first pulse";
Interfaces.BooleanOutput y "Connector of Boolean output signal";
protected
parameter Modelica.SIunits.Time Twidth=period*width
"Width of one pulse";
discrete Modelica.SIunits.Time pulseStart "Start time of pulse";
initial equation
pulseStart = startTime;
equation
when sample(startTime, period) then
pulseStart = time;
end when;
y = time >= pulseStart and time < pulseStart + Twidth;
end Pulse;
Buildings.Controls.OBC.CDL.Logical.Sources.SampleTrigger
Generate sample trigger signal
Information
The Boolean output y is a trigger signal where the output y is only true
at sample times (defined by parameter period
) and is otherwise
false
.
Parameters
Type | Name | Default | Description |
---|---|---|---|
Time | period | Sample period [s] | |
Time | startTime | 0 | Time instant of first sample trigger [s] |
Connectors
Type | Name | Description |
---|---|---|
output BooleanOutput | y | Connector of Boolean output signal |
Modelica definition
block SampleTrigger "Generate sample trigger signal"
parameter Modelica.SIunits.Time period(
final min=Constants.small) "Sample period";
parameter Modelica.SIunits.Time startTime=0
"Time instant of first sample trigger";
Interfaces.BooleanOutput y "Connector of Boolean output signal";
equation
y = sample(startTime, period);
end SampleTrigger;