Sign in to follow this  
Followers 0
jpam

exact timer 1 second

13 posts in this topic

Hello, I need to set a 1 second timer in a TSX 572623 plc with pl7 pro, the question is that using %s6 bit (1 second pulse) the timer is not exact enough, the program is 98 kb, not too big I think, I use the %s6 attaching to a positive pulse auxiliar mark in one section of the program and i use this mark %M in the rest of the program, but as i said, it is not quite exact, measuring the time displayed in a HMI connected to the plc, 40 seconds in the program (displayed in a HMI), it´s 47 seconds in a chronometer, it is not exact at all as I said, how can I solve this problem, can anyone help me? Thanks

Share this post


Link to post
Share on other sites
The %S6 bit is quite accurate. But it goes al the time so if you just use it for som time it will not be correct. Then you can make your own timer if you set cycletime to periodic anf f.eks 20ms. Then you can add 1 for each cycle and you know this is 20ms (50 cycles and you have one second) Or you can use timers with 10ms timebase. Also quite accurate (+-10ms undependant of time present)

Share this post


Link to post
Share on other sites
I have used a 10 ms timebase timer with 100 as setpoint (1 second), but it´s the same, it is not exact, maybe it can be done with a fast task? or maybe is it possible to reduce the scan time? can anyone help me?

Share this post


Link to post
Share on other sites
What you are saying is not what PlcRuine suggested. Read his post again

Share this post


Link to post
Share on other sites
The problem is not the timer who is not accurate. It is the way you pick up the signal afterwards who is the problem. Yes you can do the same I suggested in Fast to get a lower timebase if you make the timer yourself. But you need to adress the way you pick ut the sinals. (How many programscans you use and add this values also)

Share this post


Link to post
Share on other sites
I don´t understand what you are saying and it´s quite urgent for me, please, what I do, is using a timer with timebase 10 ms and preset of 100 (1 second) that attaches an auxiliar mark that produces a pulse, I use this mark in other two tasks for counting the number of seconds of working of two different machines, and as I said, the fault of accuracy, I think is due to the scan cycle, please PLC rune or Chud could you explain what you suggest, maybe an example or image. Thank you very much

Share this post


Link to post
Share on other sites
If you use a timer with 10ms tb and 100 preset it will as you say be 1 sec. But if you use the same signal for restarting the timer you use first one propramscan to reset the timer and one cycle to start the timer again. I don't know how you have made this. But if you du like this you have to remove cycletime*numbers of cycles you use from your preset time..

Share this post


Link to post
Share on other sites
yes that´s how i do it the same mark is for resetting the timer, so according to you, what i should do is adjust the preset time according to the scan time, is like that? the scan time is always the same?

Share this post


Link to post
Share on other sites
If you set the timescan for mast task to periodic it is always the same. Then you can take this time and substract fro your preset value. If 20ms cycle and only one read it will be 80 instead of 100. Follow my thinking?

Share this post


Link to post
Share on other sites
how can I set the timescan to periodic in pl7 pro? thanks in advance

Share this post


Link to post
Share on other sites
hello, i have found how to set the timescan to periodic, but, can anyone tell me how can i set to periodic in unity pro (thats because I want to check it in the simulator (only available in unity pro)

Share this post


Link to post
Share on other sites
I have set periodic task with period of 10 ms, and I have set 90 ms as setpoint and 10 ms as timebase, anyway it is not accurate, it is more accurate, but it has about 7% error

Share this post


Link to post
Share on other sites
Ok lets go back to the beginning. What are you trying to time?

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
Sign in to follow this  
Followers 0