blockTimeTable

Table look-up with respect to time with constant segments

Information

Block that outputs Integer time table values.

The block takes as a parameter a time table of a format:

table = [ 0*3600, 2;
          6*3600, 1;
         18*3600, 8];
period = 24*3600;

where the first column of table is time and the remaining column(s) are the table values. The time column contains Real values that are in units of seconds if timeScale = 1. The parameter timeScale can be used to scale the time values, for example, use timeScale = 3600 if the values in the first column are interpreted as hours.

The values in column two and higher must be of type Integer, otherwise the model stops with an error.

Until a new tabulated value is set, the previous tabulated value is returned.

The table scope is repeated periodically with periodicity period.

Parameters

TypeNameDefaultDescription
Real[:,:]tableTable matrix with time as a first table column (in seconds, unless timeScale is not 1) and Integers in all other columns
RealtimeScale1Time scale of first table column. Set to 3600 if time in table is in hours
RealperiodPeriodicity of table

Connectors

TypeNameDefaultDescription
Buildings.Controls.OBC.CDL.Interfaces.IntegerOutput[nout]yOutput with tabulated values

Contents

NameDescription
getIndexprotectedFunction to get the index for the table look-up

Revisions

  • October 21, 2021, by Michael Wetter:
    Removed writing output value in icon (as it is an array of values).
  • November 12, 2020, by Michael Wetter:
    Reformulated to remove dependency to Modelica.Units.SI.
    This is for Buildings, issue 2243.
  • October 19, 2020, by Michael Wetter:
    Revised to call round() as a function.
    For Buildings, issue 2170.
  • October 7, 2020, by Michael Wetter:
    Revised implementation to add timeSpan and to guard against rounding errors. Refactored to avoid non-needed event-triggering functions. Removed parameter offset as I don't see a use case that justifies this complexity.
  • September 14, 2020, by Milica Grahovac:
    Initial CDL implementation based on continuous time table implementation in CDL.