Class Sum
Version 1.0
Modified 08-MAR-2026 11:05:32.00
Code rt_plc_arithm.c
 Summator.

 Weighted summing unit for up to 8 inputs. Used inputs
 have to be chosen consecutively with beginning from
 In1, which is the upper input.

 Each input has its own weighting factor, FVect0, FVect1
 etc.
 A constant value, Const, can be added to the sum.

Example

 1. To calculate 2.2 + IN1 + 2 IN2 - 1.5 IN3
    - Mark the three first inputs Used in a Sum object
    - Connect the three inputs
    - Set Const = 2.2
    - Set the weighting factors FVect to 1.0, 2.0 and -1.5

 2. To calculate the average of 5 signals
    - Mark the five first inputs Used in a Sum object
    - Connect the five inputs
    - Set the weighting factors FVect to 0.2

 3. The following objects accumulate the value of an analog signal.


RtBody attributes pwr_sClass_sum
Float32 In1 IN1 Value of input signal 1, input signal 2, ..., input
signal 8.
Float32 In2 IN2
Float32 In3 IN3
Float32 In4 IN4
Float32 In5 IN5
Float32 In6 IN6
Float32 In7 IN7
Float32 In8 IN8
Float32 ActVal VAL The weighted sum
Float32 Const Const A constant value added to the sum.
Array of Float32 FVect FVect ActVal = Const + ( Fvect[0] * In1 + ... + Fvect[7] * In8)
Int32 AccConst AccConst The operator's authorities to change Const.

0 -- Changes not allowed.
!= 0 -- Changes allowed.
Float32 MinConst MinConst The minimum and maximum allowed value of Const at
changes made by an operator.
Float32 MaxConst MaxConst
Array of Int32 AccFact AccFact The operator's authorities to change FVect[]
0 -- Changes not allowed.
!= 0 -- Changes allowed.
Array of Float32 MinFact MinFact The minimum and maximum allowed value of the weighting
factors Fvect[] at changes made by an operator.
Array of Float32 MaxFact MaxFact

DevBody attributes 
PlcNode PlcNode  


GraphPlcNode
object_type 120
parameters[0] 8
parameters[1] 0
parameters[2] 1
parameters[3] 0
subwindows 0
graphmethod 1 (standard, common attributes)
graphindex 0
default_mask[0] 3
default_mask[1] 1
segname_annotation 1
compmethod 28
compindex 0
tracemethod 0
traceindex 0
executeordermethod 2
objname Sum
graphname Sum
debugpar


Template Object
FVect[0] 1.0
FVect[1] 1.0
FVect[2] 1.0
FVect[3] 1.0
FVect[4] 1.0
FVect[5] 1.0
FVect[6] 1.0
FVect[7] 1.0


Attributes detail


In1 Input
Class Input
Type Float32
Flags STATE | NOEDIT | REDUTRANSFER
GraphName IN1
Body RtBody
 Value of input signal 1, input signal 2, ..., input
 signal 8.

In2 Input
Class Input
Type Float32
Flags STATE | NOEDIT | REDUTRANSFER
GraphName IN2
Body RtBody

In3 Input
Class Input
Type Float32
Flags STATE | NOEDIT | REDUTRANSFER
GraphName IN3
Body RtBody

In4 Input
Class Input
Type Float32
Flags STATE | NOEDIT | REDUTRANSFER
GraphName IN4
Body RtBody

In5 Input
Class Input
Type Float32
Flags STATE | NOEDIT | REDUTRANSFER
GraphName IN5
Body RtBody

In6 Input
Class Input
Type Float32
Flags STATE | NOEDIT | REDUTRANSFER
GraphName IN6
Body RtBody

In7 Input
Class Input
Type Float32
Flags STATE | NOEDIT | REDUTRANSFER
GraphName IN7
Body RtBody

In8 Input
Class Input
Type Float32
Flags STATE | NOEDIT | REDUTRANSFER
GraphName IN8
Body RtBody

ActVal Output
Class Output
Type Float32
Flags STATE | NOEDIT | REDUTRANSFER
GraphName VAL
Body RtBody
 The weighted sum

Const Intern
Class Intern
Type Float32
Flags
GraphName Const
Body RtBody
 A constant value added to the sum.

FVect Intern
Class Intern
Type Array of Float32
Flags ARRAY
Elements 8
GraphName FVect
Body RtBody
 ActVal = Const + ( Fvect[0] * In1 + ... + Fvect[7] * In8)

AccConst Intern
Class Intern
Type Int32
Flags
GraphName AccConst
Body RtBody
 The operator's authorities to change Const.

    0   -- Changes not allowed.
    != 0 -- Changes allowed.

MinConst Intern
Class Intern
Type Float32
Flags
GraphName MinConst
Body RtBody
 The minimum and maximum allowed value of Const at
 changes made by an operator.

MaxConst Intern
Class Intern
Type Float32
Flags
GraphName MaxConst
Body RtBody

AccFact Intern
Class Intern
Type Array of Int32
Flags ARRAY
Elements 8
GraphName AccFact
Body RtBody
 The operator's authorities to change FVect[]
    0   -- Changes not allowed.
    != 0 -- Changes allowed.

MinFact Intern
Class Intern
Type Array of Float32
Flags ARRAY
Elements 8
GraphName MinFact
Body RtBody
 The minimum and maximum allowed value of the weighting
 factors Fvect[] at changes made by an operator.

MaxFact Intern
Class Intern
Type Array of Float32
Flags ARRAY
Elements 8
GraphName MaxFact
Body RtBody

PlcNode Buffer
Class Buffer
Type PlcNode
Flags INVISIBLE
Body DevBody