Skip to content

Commit

Permalink
Removed section about limitations as this is addressed in 7.6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
mwetter committed Mar 26, 2020
1 parent f8c54ca commit 114ebc3
Showing 1 changed file with 0 additions and 98 deletions.
98 changes: 0 additions & 98 deletions specification/source/codeGeneration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -409,101 +409,3 @@ then such an addition must be approved by the customer.
If the customer requires the part of the control sequence that contains this
block to be verified, then the block shall be made available as described in :numref:`sec_cha_sub_cha`.

Handling Limitations of Certain Building Automation Systems
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Some buildings automation systems do not support all capabilities of CDL.
For example, ALC Eikon does not support conditionally removable instances,
propagation of parameter values, and calculations in parameter assignments.
(See :numref:`sec_instantiation` for these CDL constructs).
This section explains how such limitations can be addressed.

Conditionally Removable Instances
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Consider the illustrative example of a composite block shown in
:numref:`fig_exp_ena_dis_ins`.

.. _fig_exp_ena_dis_ins:

.. figure:: img/codeGeneration/EnableDisableInstance/EnaDisIns.*
:width: 500px

Example of a composite control block in which the instances
``u2`` and ``conIns`` can be conditionally removed.

In CDL, this is specified as

.. literalinclude:: img/codeGeneration/EnableDisableInstance/EnaDisIns.mo
:language: modelica
:linenos:

Note that the instance ``conMax`` instantiates the elementary block
``CDL.Continuous.ConditionalMax``, which outputs

.. math::
y = \left\{
\begin{array}{ll}
\max(u_1, u_2), & \text{if input connector } u_2 \text{ is present}, \\
u_1, & \text{otherwise.}
\end{array}
\right.
This elementary block is implemented as

.. literalinclude:: img/codeGeneration/EnableDisableInstance/ConditionalMax.mo
:language: modelica
:linenos:

According to the Modelica language definition, if ``u2_present=false``,
the instances ``u2`` and ``conIns``, the connections between ``u2``
and ``conIns`` and between ``conIns`` and ``conMax``, and the input connector
``conMax.u2`` are removed when generating simulation code.

However, some building automation systems do not allow objects to be removed.
For such cases, a constant input, or a virtual point, with the default value of
``1.5``, as declared by the annotation ``__cdl(default = 1.5)``
(see :numref:`sec_con_rem_ins`) and shown in
:numref:`fig_exp_ena_dis_vir_point`, could be added.
With such a construct, the composite block
``EnaDisIns`` can be translated without requiring removal of any objects,
thereby preserving all inputs and outputs.

.. _fig_exp_ena_dis_vir_point:

.. figure:: img/codeGeneration/EnableDisableInstance/EnaDisIns_virtualPoint.*
:width: 500px

Example of virtual point in translated sequence.

Parameter Propagation
~~~~~~~~~~~~~~~~~~~~~

CDL allows parameter values to be propagated to instances of blocks.
As an illustrative example,
consider the composite control block specified as follows:

.. literalinclude:: img/codeGeneration/ParameterPropagation/Controller.mo
:language: modelica
:linenos:

The value of the parameter ``samplePeriod`` can be specified at the top-level,
and is propagated to blocks inside this controller.
This allows to change the value of ``samplePeriod`` at the top-level,
and propagation of this value to all instances in the controller that require
sampling at this rate.

Building automation systems that do not support such propagation may have to
use a global variable or virtual points.

Calculations in Parameter Assignments
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

CDL allows calculations in the assignment statements of ``parameters``.
If a building automation system does not support such calculations,
then the translator can optionally configured to evaluate such
calculations during the translation.
should extract the assignments as a separate operational
block and feed its outputs to the parameters of the block.
See :numref:`sec_par_eva_tra` for details.

0 comments on commit 114ebc3

Please sign in to comment.