OK Khalil, let's use your example of 10 PPR on a motor turning at 1200 RPM. That's 20 revolutions per second, 200 pulses per second.
Using the first method (pulses per timebase) set up a one-shot that gets triggered every 100 milliseconds. You also need a counter to accumulate the pulses. Each time the one-shot gets triggered, transfer the accumulated count to a work register. This value has units of counts per 100 milliseconds. Multiply it by 600 (100 milliseconds per minute) and divide by 10 (counts per revolution) to obtain RPM. For example if you accumulate 20 counts in 100 milliseconds your speed is (20 * 600)/10 = 1200 RPM.
Now you can reasonably expect to see a variance of at least plus or minus one count per sample period. 19 counts would result in a calculated speed of 1140 RPM. 21 counts gives you 1260 RPM. If you need to measure more closely, you need more counts per revolution or a longer sample period.
Say you use a sample period of 250 milliseconds. Now 1200 RPM is 50 counts per 250 milliseconds. 49 counts in 250 milliseconds would give you 1176 RPM; 51 counts gives you 1224 RPM.
Using the second method, lets say you keep track of the time to acculmulate 50 counts. You set up a counter with a preset of 49 that resets itself. You also set up a timer that's always timing. Each time the counter reaches it's preset, copy the timer's accumulated value to a work register, and then reset the timer.
Fifty counts equals 5 revolutions, so the timer value has units of milliseconds per 5 revolutions. You divide 60000 (milliseconds per minute) by the timer value, and multiply the result by 5 to get RPM. In this case, your timer value can be no more accurate than the PLC's scan time. If your scan time is 5 milliseconds then you could conceivably measure as much as 255 milliseconds for 50 counts even if the motor was running at a constant 1200 RPM. 255 milliseconds would give you a calculated speed of 1176 RPM.
This brings up an important point about trying to bring encoder pulses into a PLC through a standard discrete input. The example I've been using (10 pulses per revolution at 1200 RPM) gives you one pulse every 5 milliseconds. Assuming that the pulse train is a perfect square wave, that's 2.5 milliseconds on, 2.5 milliseconds off. Your PLC scan time has to be faster than that to be able to avoid missing any pulses. It should be at least twice as fast. If the PLC is not fast enough, then you need to use a High Speed Counter module, which, as I mentioned before, will probably do the speed calculation for you.