The Modelica.Blocks.Discrete.UnitDelay does not delay the input as described in its documents.
Given an example model as below, where the unitDelay_MSL is the delay block from MSL and the unitDelay_Corrected is the one with correction.

It has the results as:

The unitDelay_MSL.y is the same as the output from the sampling block, while the unitDelay_Corrected .y is the expected one.
The
Modelica.Blocks.Discrete.UnitDelaydoes not delay the input as described in its documents.Given an example model as below, where the


unitDelay_MSLis the delay block from MSL and theunitDelay_Correctedis the one with correction.It has the results as:
The
unitDelay_MSL.yis the same as the output from the sampling block, while theunitDelay_Corrected .yis the expected one.