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
Output change. Often connected to the OutChange of a
Pid object.
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).
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).
Program cycle period in seconds.
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).
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.
When the MaxTim, in seconds, has elapsed without any
output signal Acc is set equal to 0.
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.
Indicates an active timer.
Points to the next element in the timer queue.
Number of remaining ticks.
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.
Delay, in seconds, is set in run time. Specifies when
the outputs have to be reset.
Dummy. If TimerDoDum does not point to a Do or Dv
object it points to this attribute.
Identity of this object is set at load file creation.
Used by the run time system.
Accumulated control error - in time form.
Accumulated time without output signals.
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.
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.