Problem with scripting discrete estimator

Dear Wolfgang,

Thank You very much for Your answer.

I’m not really sure if division by zero is the problem here. I tested the discrete esimator (in this C-script) outside my original control structure. In fact, I used my continuos estimator in the control structure and I just took the signals to the discrete estimator and looked a his outputs with displays. I didn’t give me any error, and I got the same values as I would get with the continuos estimator.

But when I delete the continuos one, a implement the discrete one in my control structure it gives me an error. :confused:

Now I did all these calculations in major steps by adding if (IsMajorStep) before these calulations, and it work everything without an error but the signals are not very precise. :confused: