Class Inc3P
Version 1.0
Modified 08-MAR-2026 11:05:32.00
Code rt_plc_pid.c
 Incremental 3-point output with dead zone. Incremental
 comes from the type of input and the digit 3 of the
 output, which can have three distinct values, e.g. open
 / close / 0 but also with the meaning of up / down / 0
 or right / left / 0 or increase / decrease / 0 etc. The
 outputs are time-proportional to the input.

 The input signal OutChange is regarded as a control
 error. This error is transformed into a time by
 multiplication with Gain. The product is added to
 accumulator Acc. The absolute value of Acc is limited
 to MaxWindup.

 If the absolute value of Acc > MinTim either the output
 Open or Close is set. If Acc > MinTim an incremental
 signal is set (= Open) as long as Acc ³ 0 , if, on the
 other hand, Acc < - MinTim a decrease signal (= Close)
 is set as long as Acc £ 0. The value of Acc is counted
 down respectively up with a time amount of ScanTime, at
 every scanning when an increment or decrement signal
 has been set.

 To avoid ripple on the outputs, which may be
 destructive to the actuator at small control errors,
 the absolute value of the Acc-attribute has to exceed
 the adjustable dead zone MinTim, before any control
 signal is set. The Acc-attribute is cleared if the
 value of Acc does not exceed the dead zone during a
 time specified by MaxTim; the integration is turned off
 at small control errors.
 Output Signals from an Inc3P

 So-called timer control, also used by Pos3P objects on
 page 3-287, is discussed in the example below.
 Exactly as for Pos3P it is possible to govern by means
 of the outputs Open / Close and/or the signals named by
 DoOpen/DoClose. The outputs and the signals can be set
 by a frequency determined by the PlcPgm object. But
 only the signals may be reset by the timer control.

Example



Timer Control of Outputs

 Suppose a flow control with an electrically-activated valve
 with increment/decrement control. The flow signal ( here kalle2)
 exists. One solution is shown in figure below. Note, the
 incremental output of the Pid object is used.
 Three step Control without Position Feedback

 The last segment names of the signals named by DoOpen and DoClose
 are shown in the symbol of INC3P0; here Do2 and Do1.


RtBody attributes pwr_sClass_inc3p
Float32 OutChange OC Output change. Often connected to the OutChange of a
Pid object.
Boolean Open ope Specifies order to open or not. FALSE means no action;
TRUE means open ( up, increment, right, or what else
may be relevant to this output).
Boolean Close clo Specifies order to close or not. FALSE means no action;
TRUE means close ( down, decrement, left, or what else
may be relevant to this output).
Pointer to Float32 ScanTime ScanTime Program cycle period in seconds.
Float32 Gain Gain Gain, in seconds, per control signal unit. Often the
control signal is in the range 0 - 100 %. Suppose it is
possible to measure the running time, for example, the
time to drive a valve from completely open to
running time / divided by the range; ( here 100 - 0).
Float32 MinTim MinTim The dead zone in seconds; see the description above. If
the absolute value of Acc is less than MinTim no output
at all is set.
Float32 MaxTim MaxTim When the MaxTim, in seconds, has elapsed without any
output signal Acc is set equal to 0.
Float32 MaxWindup MaxWindup Maximum windup in seconds
The absolute value of Acc will never be greater than MaxWindup
Typically less or equal than running time from open to closed
Default 30 seconds. Lessor equal to zero means no limitation.
Pointer to Boolean OpenP  
Pointer to Boolean CloseP  
Boolean TimerFlag   Indicates an active timer.
Pointer to Boolean TimerNext   Points to the next element in the timer queue.
UInt32 TimerCount   Number of remaining ticks.
Pointer to Boolean TimerDO   Points to a Do, or Dv object or, if these are not used,
to TimerDoDum. After a time of TimerTime the signal
specified by TimerDo is cleared.
Float32 TimerTime   Delay, in seconds, is set in run time. Specifies when
the outputs have to be reset.
Boolean TimerDODum   Dummy. If TimerDoDum does not point to a Do or Dv
object it points to this attribute.
Objid TimerObjDId   Identity of this object is set at load file creation.
Used by the run time system.
Float32 Acc Acc Accumulated control error - in time form.
Float32 AccTim AccTim Accumulated time without output signals.

DevBody attributes 
AttrRef DoOpen   Name of an external signal e.g. Do, or Dv (
corresponding to Open) at timer control.
Also if DoOpen specifies a signal Open is
handled by the object.
AttrRef DoClose   Name of an external signal e.g. Do, or Dv object (
corresponding to Close) at timer control.
Also if DoClose specifies a signal Close is
handled by the object.
PlcNode PlcNode  


GraphPlcNode
object_type 153
parameters[0] 1
parameters[1] 0
parameters[2] 2
parameters[3] 0
subwindows 0
graphmethod 2 (standard, two textfield)
graphindex 0
default_mask[0] 1
default_mask[1] 3
segname_annotation 3
devbody_annotation 1
compmethod 23
compindex 0
connectmethod 0
executeordermethod 2
objname Inc3P
graphname Inc3P
debugpar


Template Object
Gain 1.0
MaxWindup 30.0


Attributes detail


OutChange Input
Class Input
Type Float32
Flags STATE | NOEDIT | REDUTRANSFER
GraphName OC
Body RtBody
 Output change. Often connected to the OutChange of a
 Pid object.

Open Output
Class Output
Type Boolean
Flags STATE | NOEDIT | REDUTRANSFER
GraphName ope
Body RtBody
 Specifies order to open or not. FALSE means no action;
 TRUE means open ( up, increment, right, or what else
 may be relevant to this output).

Close Output
Class Output
Type Boolean
Flags STATE | NOEDIT | REDUTRANSFER
GraphName clo
Body RtBody
 Specifies order to close or not. FALSE means no action;
 TRUE means close ( down, decrement, left, or what else
 may be relevant to this output).

ScanTime Intern
Class Intern
Type Pointer to Float32
Flags INVISIBLE | POINTER | PRIVATE
GraphName ScanTime
Body RtBody
 Program cycle period in seconds.

Gain Intern
Class Intern
Type Float32
Flags
GraphName Gain
Body RtBody
 Gain, in seconds, per control signal unit. Often the
 control signal is in the range 0 - 100 %. Suppose it is
 possible to measure the running time, for example, the
 time to drive a valve from completely open to
 running time / divided by the range; ( here 100 - 0).

MinTim Intern
Class Intern
Type Float32
Flags
GraphName MinTim
Body RtBody
 The dead zone in seconds; see the description above. If
 the absolute value of Acc is less than MinTim no output
 at all is set.

MaxTim Intern
Class Intern
Type Float32
Flags
GraphName MaxTim
Body RtBody
 When the MaxTim, in seconds, has elapsed without any
 output signal Acc is set equal to 0.

MaxWindup Intern
Class Intern
Type Float32
Flags
GraphName MaxWindup
Body RtBody
 Maximum windup in seconds
 The absolute value of Acc will never be greater than MaxWindup
 Typically less or equal than running time from open to closed
 Default 30 seconds. Lessor equal to zero means no limitation.

OpenP Intern
Class Intern
Type Pointer to Boolean
Flags POINTER | PRIVATE | STATE | NOEDIT | INVISIBLE
Body RtBody

CloseP Intern
Class Intern
Type Pointer to Boolean
Flags POINTER | PRIVATE | STATE | NOEDIT | INVISIBLE
Body RtBody

TimerFlag Intern
Class Intern
Type Boolean
Flags STATE | INVISIBLE | REDUTRANSFER
Body RtBody
 Indicates an active timer.

TimerNext Intern
Class Intern
Type Pointer to Boolean
Flags POINTER | STATE | INVISIBLE | PRIVATE
Body RtBody
 Points to the next element in the timer queue.

TimerCount Intern
Class Intern
Type UInt32
Flags STATE | INVISIBLE | REDUTRANSFER
Body RtBody
 Number of remaining ticks.

TimerDO Intern
Class Intern
Type Pointer to Boolean
Flags POINTER | STATE | INVISIBLE | PRIVATE
Body RtBody
 Points to a Do, or Dv object or, if these are not used,
 to TimerDoDum. After a time of TimerTime the signal
 specified by TimerDo is cleared.

TimerTime Intern
Class Intern
Type Float32
Flags
Body RtBody
 Delay, in seconds, is set in run time. Specifies when
 the outputs have to be reset.

TimerDODum Intern
Class Intern
Type Boolean
Flags STATE | INVISIBLE
Body RtBody
 Dummy. If TimerDoDum does not point to a Do or Dv
 object it points to this attribute.

TimerObjDId Intern
Class Intern
Type Objid
Flags INVISIBLE
Body RtBody
 Identity of this object is set at load file creation.
 Used by the run time system.

Acc Intern
Class Intern
Type Float32
Flags STATE | NOEDIT | INVISIBLE
GraphName Acc
Body RtBody
 Accumulated control error - in time form.

AccTim Intern
Class Intern
Type Float32
Flags STATE | NOEDIT | INVISIBLE
GraphName AccTim
Body RtBody
 Accumulated time without output signals.

DoOpen Intern
Class Intern
Type AttrRef
Flags
Body DevBody
 Name of an external signal e.g. Do, or Dv (
 corresponding to Open) at timer control.
 Also if DoOpen specifies a signal Open is
 handled by the object.

DoClose Intern
Class Intern
Type AttrRef
Flags
Body DevBody
 Name of an external signal e.g. Do, or Dv object (
 corresponding to Close) at timer control.
 Also if DoClose specifies a signal Close is
 handled by the object.

PlcNode Buffer
Class Buffer
Type PlcNode
Flags INVISIBLE
Body DevBody