I doubt it can be done with an encoder and a PLC, except with very low RPM and a very low number of pulses per RPM. What frequency will the pulses be and what type of input are you using? So, in the end: more information is needed to help.
BTW the formula is very simple: count the pulses during a set time period. Divide the number of pulses by the number of pulses per revolution and the set time period which gives you the RPS (revolutions per second). Multiply by 60 and you get the RPM. The accuracy is dependent on the accuracy of the set time period, the accuracy with which you can count (how much pulses did you fail to see) and the accuracy of the calculation.