9/30/2009 6:53 AM | |
Joined: 10/7/2005 Last visit: 1/17/2025 Posts: 3030 Rating: (1058) |
Hello dangerous I haven't "played" with S7-1200's yet (and promised myself I won't until this "toy" PLC supports STL, but that's another story and we are drifting away from the subject) but whatever "general" Timer related accuracy issues may exists, they will be compounded by the way you are using the Timer. Put simple, you are usinga self triggering Timer which leads tothe following chain of events: Scan X: One second haselapsed -> TON Timer OutputON Scan X+1: Call Timer with a ZERO RLO at it "IN" input -> TON Timer OutputOFF (and add one to your Double Integer counter, no need for the P_TRIG instruction by the way, your Timer output is only ON for one scan). Scan X+2: Start TON Timer again. What this means is that there will beTWO "surplus"cylces which will make every TON second count equate to "1 second + two scan cycle times" (which is "normal" for self triggering timers). I hope this helps. |
Last edited by: fritz at: 9/30/2009 12:27 PMCorrected last statement as there are actual two "empty" scans Cheers |
|
9/30/2009 1:14 PM | |
Joined: 10/7/2005 Last visit: 1/17/2025 Posts: 3030 Rating: (1058) |
Hello again dangerous I would think too that doing the increment right after the TON should have worked, but as said, I haven't used the 1200's yet so who knows why it didn't work. Anyway, I just editedmy previous post as I realised that you will actually have two"empty" PLC scans which need to be added to the1 second time. Either way, cyclic OB usage will (should hopefully) give you a more accurate result, it will certainly elimate the "empty scans" issue with the self triggering TON. Since youare busy testing, I suggest you also try a test using the CPU clock memory byte(simple rising edge count on the 1Hz bit will do the job). Assuming theCPU clock memory byte is based on the internal real time clock you should get the accuracy of the real time clock (+/- 60 sec per month as per technical spec). Food for thought anyhow and good luck. |
Cheers |
|
Follow us on