Ladder Logic Compute Function

KronoTech

PLC

Ladder Logic

Basic

Counters

Timer

Arithmetic

Comparison

Functions

ABS

CLR

CPT

SCL

SCP

SQR

SWP

XPY

Trig Functions

RSLogix 5000

Structured Text

HMI

Instruments

CPT - Compute

When 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.

  • Compute is used to convert from type of numbers to another.
  • To manipulate numbers.

Example

Equation: F8:131 = N7:131 * (F8:130 ** 2) + N7:132 * F8:130 + N7:33

(AX² + BX + c), where A = 3, B =2, C = 1 and X = 2

Ladder Logic Solution

CPT - SLC 500 Beginners Guide

Note

  • During the computation if any part results in an overflow value the minor error bit will be set. This error should be cleared to avoid a major error.
  • Notice the use of ( ** ) which is equivalent to power.

Example

Equation: N7:130 = N7:134 * ABS(N7:135)

CPT - SLC 500 Beginners Guide

Note

  • Compute takes more time than a simple math instruction.
  • Expression can be up to 255 characters.
  • All math instructions could be included in the Expression.

Quick Links

PLC Languages

Ladder Logic
Function Block
Structure Text
SFC
Mnemonic

Ladder Logic

Basic
Counters
Timer
Arithmetic
Comparison
Functions
Trig Functions

Instruments

Switches

HMI

Advantages
Alarms
Trends

Other

Bottle Application