Siemens PLC Mathematical function transformation instruction

Mathematical functions transform comprises the square root, natural logarithm, exponential, trigonometric functions and so on.
 
(1) Square Root (SQRT) instruction: 32-bit real number (IN) taking the square root, and produces a 32-bit real number result, the output from the designated storage unit OUT.
 

(2) natural logarithm (LN) instruction: IN values in natural logarithm, and place the result in the storage unit specified by OUT.
Hours of seeking to base 10, with the natural logarithm by 2.302585 (approximately equal to the natural logarithm of 10).
 

(3) Exponential (EXP) instruction: IN will take the base e exponential, and place the result in the storage unit specified by OUT.
“Natural index” command and “natural logarithm” instruction combination can be implemented in any number for the end, any number of index calculation. Seeking yx, enter the following instruction: EXP (x * LN (y)).
For example: seeking 23 = EXP (3 * LN (2)) = 8; 3-th root of 27 = 271/3 = EXP (1/3 * LN (27)) = 3.
 

(4) instructions for trigonometric functions: a real number of radians are seeking IN SIN, COS, TAN, get real arithmetic result output from the designated storage unit OUT.

So ENO = 0 error condition: 0006 (indirect address), SM1.1 (overflow) SM4.3 (run-time)
On flag: SM1.0 (zero), SM1.1 (overflow), SM1.2 (negative)

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.