Hi!
I just started with PLC programming. I am trying to get the time between a output signal and a input signal. The problem is that the time is ~200 ms but when i measure it with this code:
TONR(Timer1);
IF PosFeedback <= PosFeedback_Min & not Timer1.Reset THEN
Timer1.TimerEnable := 0;
FullCloseDeltaTime[1] := Timer1.ACC;
Timer1.Reset := 1;
END_IF;
IF (move & not Move_LastScan) THEN
//Start timer
Timer1.TimerEnable := 1;
Timer1.Reset := 0;
END_IF;
Move_LastScan := move;
i only get even values in intervalls of 50 ms like 150, 200 and 250 ms. I have changed the real time sample rate to 11 ms so i don't understand why i don't get a more exact result. And i can see in my trend that the time isn't exactly 150, 200 or 250 each time.
I i tried and time my own click on a button and i see the problem is the timer, i only get values in an interval of 50 ms. Is there a way to make the timer more exact?