modelica-deprecated / Modelica_Synchronous

Free (standard conforming) library to precisely define and synchronize sampled data systems with different sampling rates. It provides convenient to use blocks to utilize the new synchronous language elements introduced in Modelica 3.3.
11 stars 7 forks source link

Real Comparison used in Modelica_Synchronous.BooleanSignals.TickBasedSources.Pulse #12

Closed FrenkelJ closed 7 years ago

FrenkelJ commented 7 years ago

In the Model Modelica_Synchronous.BooleanSignals.TickBasedSources.Pulse in the equation

counter = if previous(counter) == (periodTicks-1) then 0 else previous(counter) + 1; a comparson of Real Values previous(counter) == (periodTicks-1) is used.

Regarding to the specification a comparison of real values should be avoided.

What was the reson to use Real for widthTicks and periodTicks and not Integer?

tbeu commented 7 years ago

MSL or Modelica_Synchronous?

MartinOtter commented 7 years ago

It seems the declaration of widthTicks and of periodTicks must be Integer not Real.

bernhard-thiele commented 7 years ago

Yes, they should be Integer. Don't know how the Real slipped in.