Internet PLC Forum

General => Technical support => Topic started by: WLH on November 19, 2005, 04:56:31 PM

Title: Logarithm of a value
Post by: WLH on November 19, 2005, 04:56:31 PM
Is there a way to compute the Log (base 10) of a measured or computed value?

WLH
Title: Re:Logarithm of a value
Post by: support on November 19, 2005, 06:25:26 PM
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.
Title: Re:Logarithm of a value
Post by: WLH on November 20, 2005, 12:59:27 PM
Thanks for the good advice.  I think a look up table will work best for me.  Please point me towards any app. notes on constructing a matrix table for two independent variables.

WLH
Title: Re:Logarithm of a value
Post by: support on November 20, 2005, 08:03:59 PM
Please see the following thread:

http://www.tri-plc.com/yabbse/index.php?board=1;action=display;threadid=727;start=msg2048#msg2048