Hi! I'm really new to plc programming and i'm trying to do a very simple task. I want to get the time elapsed from when i send an analog putput signal to when i recieve an analog input signal. I know that the event takes about ~150 ms but when i measure it i get ~300 ms. I think it has something to do with the analog input sampling but i'm not sure.
This is my code:
I start my timer when my output signal goes from 0 to 1 and when my feedback, the analog input reaches above a set value i stop the timer.
So to my question, what is causing my measured time to be 300 ms and not ~150 ms?
For my input module (rockwell's 1756 IF8 analog input) i have set the RTS to 44 ms. It is not possible to set the value any lower, then the program (Studio 5000) says that the value is to low and i must insert a new value.
I have created a trend where i can see these values and there i can see that the time is ~150-200 ms.
This is my code:
Code:
TONR(Timer1);
IF PosFeedback <= PosFeedback_Min & not Timer1.Reset THEN
Timer1.TimerEnable := 0;
FullCloseDeltaTime[1] := Timer1.ACC;
Timer1.Reset := 1;
END_IF;
IF not move & Move_LastScan THEN
//Start timer
Timer1.TimerEnable := 1;
Timer1.Reset := 0;
END_IF;
Move_LastScan := move;
I start my timer when my output signal goes from 0 to 1 and when my feedback, the analog input reaches above a set value i stop the timer.
So to my question, what is causing my measured time to be 300 ms and not ~150 ms?
For my input module (rockwell's 1756 IF8 analog input) i have set the RTS to 44 ms. It is not possible to set the value any lower, then the program (Studio 5000) says that the value is to low and i must insert a new value.
I have created a trend where i can see these values and there i can see that the time is ~150-200 ms.
Last edited: