Author Topic: Logarithm of a value  (Read 10796 times)

WLH

  • Newbie
  • Posts: 2
  • I'm a llama!
    • View Profile
Logarithm of a value
« 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

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Logarithm of a value
« Reply #1 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.
« Last Edit: November 19, 2005, 06:34:30 PM by support »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

WLH

  • Newbie
  • Posts: 2
  • I'm a llama!
    • View Profile
Re:Logarithm of a value
« Reply #2 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

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Logarithm of a value
« Reply #3 on: November 20, 2005, 08:03:59 PM »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS