Specifications

SIMATIC Instructions
9-93
S7-200 Programmable Controller System Manual
C79000-G7076-C233-01
Error Conditions
When it is time to compile, the CPU will generate a compile error (range error) and
the compilation will fail if the loop table start address or PID loop number operands
specified in the instruction are out of range.
Certain loop table input values are not range checked by the PID instruction. You
must take care to ensure that the process variable and setpoint (as well as the bias
and previous process variable if used as inputs) are real numbers between 0.0 and
1.0.
If any error is encountered while performing the mathematical operations of the
PID calculation, then SM1.1 (overflow or illegal value) will be set and execution of
the PID instruction will be terminated. (Update of the output values in the loop table
may be incomplete, so you should disregard these values and correct the input
value causing the mathematical error before the next execution of the loop’s PID
instruction.)
Loop Table
The loop table is 36 bytes long and has the format shown in Table 9-19.
Table 9-19 Format of the Loop Table
Offset
Field Format Type Description
0 Process variable
(PV
n
)
Double word - real in Contains the process variable, which must be
scaled between 0.0 and 1.0.
4 Setpoint
(SP
n
)
Double word - real in Contains the setpoint, which must be scaled
between 0.0 and 1.0.
8 Output
(M
n
)
Double word - real in/out Contains the calculated output, scaled between
0.0 and 1.0.
12 Gain
(K
C
)
Double word - real in Contains the gain, which is a proportional
constant. Can be a positive or negative number.
16 Sample time
(T
S
)
Double word - real in Contains the sample time, in seconds. Must be
a positive number.
20 Integral time or
reset (T
I
)
Double word - real in Contains the integral time or reset, in minutes.
Must be a positive number.
24 Derivative time
or rate (T
D
)
Double word - real in Contains the derivative time or rate, in minutes.
Must be a positive number.
28 Bias
(MX)
Double word - real in/out Contains the bias or integral sum value
between 0.0 and 1.0.
32 Previous
process variable
(PV
n-1
)
Double word - real in/out Contains the previous value of the process
variable stored from the last execution of the
PID instruction.