﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
1261	Modelica.Blocks.Sources.TimeTable does not work (bug in event-handling)	asodja	Lennart Ochel	"In attachment is a test model consisting of only one block of the Modelica.Blocks.Sources.TimeTable component.

The output (TimeTable.y) is zero all the time.


The problem is that the {{initial()}} and {{time >= pre(nextEvent)}} (nextEvent is initalized to 0) never happens, e.g., {{functionDAE_output2()}} is not called at appropriate time so the if-statment is never evaluated to true:
{{{#!c
int functionDAE_output2()
{
  /* ... */
  tmp0 = initial();
  tmp1 = pre($PtimeTable$PnextEvent);
  RELATIONGREATEREQ(tmp2, time, tmp1);
  localData->helpVars[0] = tmp2;
  localData->helpVars[1] = tmp0;
  if (edge(localData->helpVars[0]) || edge(localData->helpVars[1])) {
    real_array_create(&tmp3, &$PtimeTable$Ptable, 2, 7, 2);
    tmp4 = _Modelica_Blocks_Sources_TimeTable_getInterpolationCoefficients(tmp3, $PtimeTable$Poffset, $PtimeTable$PstartTime, time, (modelica_integer)$PtimeTable$Plast, 1e-13);
    $PtimeTable$Pa = tmp4.targ1;
    $PtimeTable$Pb = tmp4.targ2;
    $PtimeTable$PnextEvent = tmp4.targ3;
    $PtimeTable$Plast = tmp4.targ4;
  }
}}}"	defect	closed	high		Simulation Code Generation	1.6.0	fixed		asodja Willi Braun
