mangan

Time between output and input signal

5 posts in this topic

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?

Edited by mangan

Share this post


Link to post
Share on other sites

Which A-B/Rockwell PLC processor are you using?  Using the PLC processor the calculate I/O Scan & Execution Time is not an accurate platform as the inherent latency time to read input status and execute output commands adds time, effectively adding cycle time to measure cycle time.

There are factors that directly affect A-B processor scan time.  Length of PLC program, PLC program functions, number of I/O, etc.  To accurately measure scan/execution time, one will need a reliable, external device.

What is your objective for this test?

Share this post


Link to post
Share on other sites

i'm using 1756 L83E CPU. 

Ok, but anyway, shouldn't the timer precision be better than 50 ms? 

I want to measure the time from when i give a position signal to a pneumatic cylinder until the cylinder have reached it's position.
Any idea's on how I can accomplish that? 

Edited by mangan

Share this post


Link to post
Share on other sites

What is the scan rate of the routine and / or how fast is the PLC scanning the logic?

Share this post


Link to post
Share on other sites

In the mainTask properties under configuration tab i change type to continuous instead of periodic (with 50 ms interval). Now it's working like i wanted to.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now