Since the PLC does not support floating point there is no simple function for computing logarithm. If the range of interest is small you can use a look up table with predefined values in a certain range to accomplish this. Alternatively, you may use a mathamatical formula such as Taylor or Maclaurin Series to compute for an approximae value but this can be quite computationally intensive, and you have to bear in mind that since the PLC does not support floating point, you have to use fixed point arithmetics to perform the computation to one or two decimal places of accuracy.