﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
3482	Wrong creation of Clock with real interval	Rüdiger Franke	somebody	"The following model creates a clock with Real interval. It worked if `dt` was constant; it fails if `dt` is a parameter (see e.g. Modelica_Synchronous):
{{{#!mo
model RealParameterClock
  parameter Real dt = 0.1 annotation(Evaluate = true);
  input Real u;
  output Real y(start = 0);
equation
  when Clock(dt) then
    y = previous(y) + u;
  end when;
end RealParameterClock;
}}}

The code attempts to access the non existing `previous(dt)`:
{{{
RealParameterClock_15syn.c:63:53: error: ‘$P$CLKPRE$Pdt’ undeclared (first use in this function)
       data->simulationInfo.clocksData[i].interval = $P$CLKPRE$Pdt;
                                                     ^
}}}

Alternatively in the Cpp runtime (+simCodeTarget=Cpp):
{{{
OMCppRealParameterClock.cpp: In member function ‘virtual void RealParameterClock::getTimeEvent(time_event_type&)’:
OMCppRealParameterClock.cpp:402:45: error: ‘_$CLKPRE_P_dt’ was not declared in this scope
   time_events.push_back(std::make_pair(0.0, _$CLKPRE_P_dt));
                                             ^
}}}
"	defect	closed	high	1.9.4	Backend		duplicate		
