|
||
Ladder Logic Functions |
IntroductionWe have started with PLC Math instructions the next step is to have a look at some of the Math functions. These functions do some specific but rather more frequently used Math functions. Anything done in these functions could be achieved by simple combination of math instructions. DefinitionThe following is a list of the Math Functions in SLC 500:
CLR - ClearSymbolDefinitionWhen Clear instruction is executed it sets all bits of a word to zero. Upon execution of this instruction, all arithmetic status bits are reset SQR - Square RootSymbolDefinitionWhen rung conditions are true, this output instruction calculates the square root of the absolute value of the source and places the rounded result in the destination. This instruction calculates the square root of a negative number without overflow or faults. SCP - Scale with ParametersSymbolDefinitionProduces a scaled output value that has a linear relationship between the input and scaled values. The scaled result is returned to the address indicated by the output parameter. SCL - Scale DataSymbolDefinitionUse this instruction to scale data from your analog module and bring it into the limits prescribed by the process variable or another analog module. When rung conditions are true, this instruction multiplies the source by a specified rate. The rounded result is added to an offset value and placed in the destination. ABS - Absolute ValueSymbolDefinitionAbsolute value |x| of a number x is itself, if x is positive or zero, but if x is negative, then its absolute value |x| is its negation x, that is, the corresponding positive value. For example, |-1| = 1, but |2| = 2. The absolute value function strips a number of its sign. CPT - ComputeSymbolDefinitionWhen compute is executed then copy, arithmetic, logical, or conversion operation residing in the expression field of this instruction is performed and the result is sent to the destination. The execution time of a Compute instruction is longer than that of a single arithmetic operation and uses more instruction words. SWP - SwapSymbolDefinitionSwaps the low and high bytes of a specified number of words in a bit, integer, ASCII, or string file. XYP - X to the Power of YSymbolDefinitionWhen this instruction is executed then it will calculate X to the power of Y and stores the result in the destination. |
|