APT - Programming Reference Manual - Graphics & Math
APT - Programming Reference Manual - Graphics & Math
APT - Programming Reference Manual - Graphics & Math
Programming Reference
(Graphics/Math)
Manual
! WARNING
WARNING indicates a potentially hazardous situation that, if not avoided, could
result in death or serious injury, and/or property damage.
! CAUTION
CAUTION used with a safety alert symbol indicates a potentially hazardous situ-
ation that, if not avoided, could result in minor or moderate injury.
CAUTION
CAUTION used without the safety alert symbol indicates a potentially
hazardous situation that, if not avoided, could result in property damage.
NOTICE
NOTICE indicates a potential situation that, if not avoided, could result in an
undesirable result or state.
Reproduction, transmission, or use of this document or contents is not permitted without express consent of Siemens Energy &
Automation, Inc. All rights, including rights created by patent grant or registration of a utility model or design, are reserved.
Since Siemens Energy & Automation, Inc., does not possess full access to data concerning all of the uses and applications of
customer’s products, we do not assume responsibility either for customer product design or for any infringements of patents or rights
of others which may result from our assistance.
MANUAL PUBLICATION HISTORY
SIMATIC APT Programming Reference (Graphics/Math) Manual
Order Manual Number: PPX:APT--8102--10
Refer to this history in all correspondence and/or discussion about this manual.
Cover/Copyright Tenth
History/Effective Pages Tenth
Trademarks/Copyrights Tenth
iii — xxiii Tenth
1-1 — 1-10 Tenth
2-1 — 2-45 Tenth
3-1 — 3-28 Tenth
4-1 — 4-28 Tenth
5-1 — 5-7 Tenth
6-1 — 6-24 Tenth
7-1 — 7-16 Tenth
8-1 — 8-25 Tenth
9-1 — 9-15 Tenth
10-1 — 10-32 Tenth
11-1 — 11-72 Tenth
12-1 — 12-31 Tenth
13-1 — 13-20 Tenth
A-1 — A-48 Tenth
B-1 — B-16 Tenth
C-1 — C-19 Tenth
Index-1 — Index-9 Tenth
Registration Tenth
Trademarks and Copyrights
S5t is a trademark, and STEPr, SIMATICr, and SINECr are registered trademarks, of Siemens AG.
PCSt, 386/ATMt, APTt, Series 500t, Series 505t, TISOFTt, TISTARt, TIWAYt, Thermocouplet, and UNILINKt are
trademarks of Siemens Energy & Automation, Inc.
Motorolar is a registered trademark of Motorola, Incorporated.
Windowsr, Windowsr95, Windows NTr, Windowsr2000, Microsoftr, and MS-DOSr are registered trademarks of Microsoft Corporation.
UNIXr is a registered trademark of Novell, Inc.
Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii
Chapter 1 Continuous Function Charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1
1.1 Understanding Continuous Function Charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
Continuous Function Chart Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
CFC Scope and Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3
1.2 Continuous Function Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4
Categories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4
Availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4
Configuring CFBs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-6
Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-8
Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9
Error-Code Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-10
Chapter 2 Standard Control Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1
2.1 Understanding Standard Control Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
Availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
Loop Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
2.2 PID Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3
Availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3
Standard PID Algorithm (Position Algorithm) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4
Velocity Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4
PID Loop CFB and Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5
Process Variable Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-9
Process Setpoint Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11
Output Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-13
Controller Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-15
Error Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-15
Direct/Reverse Acting Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-15
Freeze Bias . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-16
Associated Math . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-17
Tuning Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-19
PID Commands and Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-21
Loops in Manual Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-22
Loops in Automatic Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-22
Loops in Cascade Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-22
PID Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-23
Availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-23
PID V-Flag and C-Flag Extension Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-25
Loop Status Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-27
Reset Windup Protection and the .AWS Extension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-28
Map Tuning and Alarm Data to 505 S-Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-29
RTD and Thermocouple Module Extensions for Series 505 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-31
Contents iii
2.3 On/Off Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-32
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-32
Availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-32
Block Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-32
On/Off Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-35
On/Off Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-36
2.4 Analog Alarm Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-38
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-38
Availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-38
Analog Alarm Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-40
Analog Alarm Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-40
Analog Alarm V-Flag and C-Flag Extension Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-42
Associated Math . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-43
S-Memory Variables (Series 505 only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-44
iv Contents
3.6 Derivative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-20
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-20
Availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-20
Block Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-21
Commands and Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-22
Contents v
4.6 Ratio Station . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-25
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-25
Availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-25
Block Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-25
Commands and Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-27
vi Contents
6.5 Low Selector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-14
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-14
Availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-14
Block Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-14
Commands and Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-16
6.6 Median Selector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-17
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-17
Availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-17
Block Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-17
Commands and Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-18
6.7 Outswitch Selector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-19
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-19
Availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-19
Block Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-19
Commands and Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-21
6.8 Threshold Selector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-22
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-22
Availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-22
Block Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-23
Commands and Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-24
Contents vii
7.5 Valve Sequencer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-13
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-13
Availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-13
Block Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-14
Commands and Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-16
viii Contents
8.9 Subtractor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-22
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-22
Availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-22
Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-23
8.10 Summer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-24
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-24
Availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-24
Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-25
Contents ix
10.2 Identifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-7
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-7
User-defined Identifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-7
System-defined Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-8
User-defined Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-8
10.3 Direct Memory Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-9
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-9
10.4 Data Types and Arithmetic Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-10
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-10
Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-11
Integers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-12
Real Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-13
Boolean Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-14
10.5 Math Block Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-16
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-16
Code Specifier Section (Series 505 only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-18
Declaration Section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-19
Using a Declaration Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-20
Formatting a Declaration Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-20
Using a Locally-Declared Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-22
Executable Section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-23
10.6 Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-24
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-24
Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-24
Assignment Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-25
Procedure Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-26
Function Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-26
Command Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-26
Print Statement (Series 505 only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-26
IF Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-28
WHILE Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-30
Safety Guidelines for WHILE Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-31
Special SFC Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-31
Special CFB Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-32
x Contents
11.2 Function and Procedure Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-7
ABS Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-7
ARCCOS Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-8
ARCSIN Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-9
ARCTAN Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-10
BCDBIN Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-11
BINBCD Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-12
BIT_ASSIGN Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-13
BITCLEAR Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-14
BITSET Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-15
BITS_TO_INT Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-16
BITTEST Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-18
CLEAR Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-19
COPY_BYTES Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-20
COPY_DIRECT Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-22
COS Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-24
EDGE Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-25
EXP Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-26
FRS Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-27
FRAC Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-28
INTERPOLATE Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-30
INT_TO_BITS Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-32
INT_TO_REAL Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-34
IREAD Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-35
IWRITE Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-36
LATCH Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-37
LEAD_LAG Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-38
LEFTSHIFT Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-40
LIMIT Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-41
LOAD_ARRAY Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-42
LOOKUP_TABLE Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-44
LN Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-46
LOG Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-47
MAX Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-48
MIN Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-49
MINMAX Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-50
ON Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-51
PACK_BITS Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-52
PBITS_TO_INT Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-53
PROUND Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-54
PTRUNC Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-55
RIGHTSHIFT Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-56
ROUND Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-57
SCALE Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-58
Using SCALE for a Series 505 Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-60
Using SCALE for an S5 Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-60
Compensating for the Bit Shift (S5 only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-61
SETSSI Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-62
SIN Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-64
SQRT Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-65
Contents xi
11.2 Function and Procedure Definitions (continued)
TAN Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-66
TRUNC Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-67
UNPACK_BITS Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-68
UNSCALE Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-70
Using UNSCALE for a Series 505 Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-71
Using UNSCALE for an S5 Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-71
Viewing UNSCALE Results in Debug (S5 only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-72
Compensating for the Bit Shift (S5 only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-72
xii Contents
Chapter 13 Safe-State SFCs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-1
13.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-2
Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-2
Safe-State Priority . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-2
Safe-State SFC Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-3
Contents xiii
B.2 Using Direct Addresses (Series 505 Controllers) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-4
Reserved Memory for Series 505 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-4
Other Reserved Locations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-7
Direct Addressing Guidelines for Series 505 Controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-10
B.3 Using Direct Addresses (S5 Controllers) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-11
Reserved Memory for S5 Controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-11
Direct Addressing Guidelines for S5 Controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-16
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Index-1
xiv Contents
List of Figures
Contents xv
List of Figures (continued)
xvi Contents
9-4 Correlated Lookup Table Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-11
9-5 Scale Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-14
Contents xvii
List of Figures (continued)
xviii Contents
12-14 Irregular Parallel Branches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-19
12-15 Parallel Branching Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-21
12-16 A Simple Selection Branch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-22
12-17 A More Complex Selection Branch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-23
12-18 Two Convergences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-24
12-19 Selection and Parallel Branches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-24
12-20 Divergence of a Selection Branch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-25
12-21 Selection Branches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-27
12-22 An “Expanded” Calling Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-30
12-23 Subordinate SFC Execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-31
Contents xix
List of Tables
xx Contents
4-7 Feedforward Setpoint Adjust Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-23
4-8 Feedforward Setpoint Adjust Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-23
4-9 Ratio Station Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-27
4-10 Ratio Station Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-27
Contents xxi
List of Tables (continued)
B-1 Direct Addresses Supported by APT for Series 505 Controllers . . . . . . . . . . . . . . . . . . . . . . . . B-8
B-2 Direct Addresses Supported by APT for S5 Controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-13
xxii Contents
Preface
New Features of SIMATIC Application Productivity Tool — APT is a software package that
APT you can use to design and implement a solution to your process control
problem. The capabilities of APT have been enhanced in Software
Release 1.9A. The documented differences between APT Release 1.9 and
Release 1.9A are indicated by change bars in the manual page margins.
Controller Families APT continues to support two controller families, the Series 505 and the
SIMATIC S5. Most programming tasks, like writing a program,
downloading, or debugging, are handled the same way in APT regardless of
your controller type. The way APT treats direct memory addressing and I/O
is determined by whether you have an S5 or a Series 505 controller.
Using APT The APT manual set is organized to make it easy both to use the manuals
Documentation and to follow the program design process that is appropriate for APT. The
APT manual organization is described below.
The APT manual set is available both in paper form (APT--8200--T) and
in electronic form on CD-ROM (APT--8200--CD).
NOTE: Unless otherwise specified, the term “OSx” is used throughout this
manual to designate SIMATIC TISTAR Releases 1.x and 2.x in addition to
SIMATIC PCS Release 3.x and SIMATIC PCS 7 OSx Release 4.x.
A CFB can represent an analog alarm, a PID loop, a limiter, a selector, etc.
To configure a CFB, you define its characteristics by completing the
associated form. In addition, you can include Math Language statements
that provide additional control within the CFB.
Most CFBs have inputs and/or outputs, which are graphically represented
as arrows. These indicate the flow of data to or from the CFB. To indicate
that an output of one CFB serves as an input to another CFB, you draw a
line to connect the output and input arrows of the respective CFBs.
One CFB can reference another CFB only if both reside in the same unit.
CFBs in the same unit can also communicate with each other through
variables and objects that reside at the Program Content Level or at the
Unit Content Level for that unit. CFBs in different units must communicate
with each other through variables and objects created at the program
content level.
Most CFBs can be enabled and disabled to operate only when you need
them. You can enable blocks from SFC steps or from other CFBs. Two CFBs,
the interlock block and the active math block, run continuously and cannot
be disabled.
The three operating states of a CFB are shown in Figure 1-1. You can use
the “Not ready” state to interlock the execution of the CFB to some external
conditions. When the CFB is Not ready, the CFB is forced to the disabled
state. To return the CFB to the enabled state, you must not only set the
“Not ready” (.NRDY) extension to false, but also re-enable the CFB (set
.ENABL to true).
.ENABL=false
Enabled Disabled
.ENABL=true
.NRDY=false .NRDY=false
.ENABL=true .ENABL=false
.NRDY=true .NRDY=true
Not ready
Categories The 45 continuous function blocks available in APT are grouped into eight
categories. Each category represents one basic type of control. The CFB
categories follow.
Standard blocks include basic PID loops, analog alarm, and on/off
functions.
Selector blocks include seven types of blocks that allow you to select
from multiple inputs.
Availability Table 1-1 lists all of the CFBs available in APT. All CFBs are supported for
Series 505 and S5 controllers. The math block and the interlock block are
the only CFBs allowed for the SIMATIC 560/560T CPUs.
Configuring CFBs After you place a CFB on the Continuous Function Chart, you are prompted
to enter a name. The name can contain up to eight characters and can be
any combination of letters, digits, and underscores. At least one character
must be a letter.
The name that you enter in the dialogue window is used to create default
variables for the block. For example, the CFB pictured in Figure 1-2 is a
split range block named sr01. The block has one input and two outputs. The
default names for these are sr01.IN, sr01.OUT1, and sr01.OUT2.
IN
SR01.IN
SPLIT
RANGE
SR01
OUT1 OUT2
SR01.OUT1 SR01.OUT2
-- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
When you edit the CFB form, the default names appear in the appropriate
fields. The other entry fields depend on the type of block. In some cases,
entry fields depend on other selections that you make in the form. For
example, if you select “limit output” for a PID loop, entry fields for minimum
and maximum values appear on the screen. If you do not select “limit
output,” these fields do not appear.
PV
SP SP
P I D
PID01
OUT
PV
PV 1ST ORDER
SP SP LAG
P I D SIMULATE
PID02
OUT
OUT
Graphically, some CFBs (such as the PID blocks in Figure 1-3) appear to
have two setpoint (SP) inputs, one on each side of the block; however, these
blocks actually have only one setpoint input. The two arrows make it easy
for you to connect a line to either side of the block. Because the two input
arrows actually represent a single setpoint input, you cannot connect lines
to both setpoints.
If you draw a connection from the input of one CFB to the output of another
CFB, the input changes its name to the same name as the output. As long
as a graphic connection exists between the two, the only way to change the
name of the input is to edit the output; you cannot edit the input name
directly.
The algorithm that controls object download affects the execution flow of
CFBs, not the apparent order indicated by the graphical connections.
Although the exact order in which blocks are executed is not predictable, the
order does not change from download to download.
Commands CFBs have associated commands to manipulate the blocks from the parallel
section of an SFC step, or from a math block that generates RLL
(Series 505) or STL (S5) code. Table 1-2 lists the CFB commands with the
corresponding blocks. These commands are explained in subsequent
chapters, within the description of each block.
The commands that are associated with the CFB control the extension
variables that are associated with the CFB, that is, they control the APT
flags and boolean mode variables.
Some extensions are classified as “read-only”: you can read the value of the
extension variable, but you cannot change its value. Other extensions are
classified as “read/write”: you can both read and change the value of that
extension variable.
You can control the mode of the CFB in the following ways:
Method Example
Use a command in an SFC Auto pid_1;
Use a command in Math Auto pid_1;
Use an APT flag On pid_1.RAUTO;
Use a boolean extension pid_1.GAUTO := true;
The command manipulates the APT flag and the boolean extensions in
order to control the CFB. Use the command, rather than the extensions, to
control the mode of the block, because APT can overwrite the boolean mode
extensions. Use the APT flags and boolean extensions to monitor the status
of the block. If you use an APT flag extension, you must use the LATCH,
ON, and CLEAR math procedures, described in Chapter 11, “Math
Functions and Procedures.”
NOTE: S5 users are familiar with the term “flag” used to refer to a single
digital point. However, an APT flag is more than this; it is a construct of
several points, with logic that you can manipulate by using the LATCH, ON,
and CLEAR commands.
The CFB extensions are listed with the description of each block in
Chapters 2 through 9 of this manual. The “OSx Tag Translation” appendix
in the SIMATIC APT Applications Manual contains information about how
these extensions are translated to OSx.
Error-Code All CFBs have extensions that provide information about any errors that
Extensions can occur. When an error occurs in a Series 505 controller, it is
automatically stored in these error extensions. Although the extensions are
also present for CFBs programmed into an S5 controller, they contain no
meaningful information.
The .IID extension identifies the SFPGM associated with the block.
The .SNUM extension contains the SFPGM line number that contains
the error.
Table 1-3 lists the error codes that are provided by a Series 505 controller
when it executes SFPGM code, and the associated number that appears in
the .ECODE extension for Series 505 controllers.
Code
Meaning
Hex Decimal
02 02 Address out of range
03 03 Requested data not found
09 09 Incorrect amount of data sent with request
11 17 Invalid data
43 67 Control block does not exist
4A 74 Attempt to access an integer variable as a real
4B 75 Attempt to access a real variable as an integer
4E 78 Attempt to write to a read-only variable
4F 79 Invalid variable data type for this operation
52 82 Invalid returned value
Attempt to use lead-lag procedure in event or continuous
53 83
math block
58 88 Stack overflow while evaluating IF...THEN statement
5A 90 Arithmetic overflow
5B 91 Invalid operator in an IF...THEN statement
5D 93 Attempt to divide by zero
60 96 Invalid data type code (usually in IF...THEN statement)
On/off blocks incorporate a high-gain PID loop and convert the output
to a boolean value.
Availability All of the standard control blocks are supported for Series 505 and S5
controllers. The standard control blocks are not supported for the 560/560T
controllers.
Loop Control Figure 2-1 shows the basic operation of a continuous process loop.
+ Output
Error signal Control
Setpoint
(desired Controller device
value) -- Process
Controlled variable
Process variable
(sensed value)
M = Kc E + Mx
where
∆output
K c = gain =
∆input
In integral control, the output is based on the integral of the error with
respect to time. Integral mode can be combined with proportional
control or with proportional and derivative control. Integral control
uses the formula:
Ts n
M= Σ Ej
T i J=0
T d dPV
M = ---
T s dt
where T s = sample time, T d = rate time, PV = process variable
Availability PID loops are available for both Series 505 and S5 controllers; however, for
the Series 505, the PID loop is part of the firmware, while for the S5 the
loop has been implemented through code. Consequently, the S5 PID loop has
several distinctive features:
The Series 505 S-memory mapping feature is not supported for S5.
For all standard control blocks, you must specify a sample time that
determines how often the loop is updated. This sample time is a real
number between 0.1 and 1.67772x106 seconds for Series 505 controllers,
and for S5 controllers it is a real number between 0.1 and 3276.7 seconds.
APT provides the following two algorithms that are available with PID
blocks.
Standard PID In a position algorithm, the position of the device being controlled is
Algorithm (Position computed based on the error. The algorithm computes the value of the
Algorithm) output for each loop calculation. For example, if the position algorithm
calculates that the valve needs to be 50% open, the output is 50%.
The position algorithm is the most commonly used and is based on the
formula:
À Ã
n
T T
Mn = Kc E n + s Σ E j − d (PV n − PV n−1) + M x
T i J=0 Ts
Velocity Algorithm A velocity algorithm computes the change in the device position based on
the error. The algorithm generates a change in output based on the current
position. For example, if you want the valve 50% open and the current
position is 40%, the output is 10%.
À
∆M n = M n − M n−1 = Kc En − E n−1 +
Ts
E −
Ti n
Td
Ts
(PV n − 2PV n−1 + PV n−2) Ã
Use the velocity algorithm only when you have a good understanding of the
digital control problem. You can only use the velocity algorithm with
actuators that move by percentage. For example, an output of zero means
that you hold to your current position.
APT provides blocks for the following combinations: PI, P, PID, I, and PD. In
the following discussion of the PID block, PID refers to any of these
combinations.
PID Loop CFB and Figure 2-2 shows the PID Loop CFB graphic.
Form
PID loop
PV
SP SP
P I D xxxxxx.PV
xxxxxx PV
OUT
SP P
I
xxxxxx D
OUT
xxxxxx.OUT
Figure 2-3 shows the PID form with default values and default names that
are based on the name that you enter when you create the CFB graphic.
The shaded entries in the form depend on a previous selection and are not a
part of the initial display.
The details of each entry are explained on page 2-9 for process variable
information, page 2-11 for process setpoint information, page 2-13 for output
information, page 2-15 for controller options, page 2-17 for associated math,
and page 2-19 for tuning parameters.
The various fields in the PID form are described below and on subsequent
pages.
Sample time: The sample time in seconds determines how often the loop,
the deviation alarm bits, and the associated math are evaluated and
updated; default is 1; the value is measured in tenth-of-a-second
increments, between 0.1 and 1.67772 ⌠ 106 for Series 505 controllers, or
between 0.1 and 3276.7 for S5 controllers.
Algorithm type: POSITION or VELOCITY; default is POSITION.
PLC address (automatic or user assigned): (Series 505 only) Default is
automatic. Automatic allows APT to assign a loop address. User assigned
allows you to specify the loop address, e.g., %loop1.
Reserved address: (Series 505 only) This is the starting controller address
for the specified loop, e.g., %loop1. You do not have to reserve Series 505
S-memory, but you must reserve a loop in the Compiler Control file.
Process variable: For Series 505, the name of the analog input, integer,
scaled integer, or real input that represents the process variable. For S5, the
name of the scaled analog input or real input that represents the process
variable. Integer inputs are not allowed for S5.
Output Information -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Output name: xxxxxx.OUT S
{if ANALOG OUTPUT}
Energize closed (air-to-close) output []
Limit output between 0% and 100%? [ ]
Minimum output (%): 0.0
Maximum output (%): 100.0
Controller Options -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Error algorithm type? NORMAL SQUARED DEADBAND
Reverse acting? []
Freeze bias for output out of range? []
Associate math on PV cycle? [ ] (Press F10 to edit math text)
Associate math on auto? []
Associate math on cascade? []
Associate math on output? []
Tuning Parameters -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Loop type: PI P PID I PD
Proportional gain: 1.0
Integral time (reset time): 999.99 min
Derivative time (rate): 0.0 min
Derivative gain limiting? [ ]
Limiting coefficient: 10.0
Alarm Monitoring -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Disable low-low/high-high alarms? [ ]
Disable low/high alarms? [ ]
Disable deviation alarms? [ ]
Disable rate of change alarm? [ ]
Disable broken transmitter alarm? [ ] } Series 505 only
Memory Mapping -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Map tuning & alarm data to 505 S-memory? [ ] Series 505 only
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Low range: Real number in engineering units that is the low range of the
PV. Used for alarming; for Series 505, also used to scale an integer PV. If PV
is an analog input, this value is taken from the values that you entered in
the I/O Table. For Series 505, if PV is a scaled integer, this value is taken
from the value entered in the Declaration Table.
High range: Real number in engineering units that is the high range of the
PV. Used for alarming; for Series 505, also used to scale an integer PV. If PV
is an analog input, this value is taken from the values that you entered in
the I/O Table. For Series 505, if PV is a scaled integer, this value is taken
from the value entered in the Declaration Table.
Eng. units: Optional documentation field to describe units of final, scaled
value (eight characters maximum); appears only if AI or SI is selected as
input.
Alarm deadband: Real number in engineering units; prevents the alarm
from changing when the process variable is within the deadband.
Low low alarm: Real number in engineering units; must be less than or
equal to low alarm value and greater than or equal to low range of PV.
Low alarm: Real number in engineering units; must be less than or equal
to high alarm value of PV.
High alarm: Real number in engineering units; must be less than or equal
to high high alarm value of PV.
High high alarm: Real number in engineering units; must be greater than
or equal to high alarm value and less than or equal to high range of PV.
Rate of change alarm: Real number in engineering units/minute that is
used to set rate-of-change alarm.
Setpoint source: CASCADED, COMPUTED, or NONE; default is NONE.
Loop name: Name of PID loop that holds setpoint (SP) input if setpoint
source is cascaded.
Setpoint name: Name of real variable that indicates setpoint (SP) input if
setpoint source is computed.
Minimum setpoint: Real number that indicates minimum value of
setpoint; must be greater than or equal to the low range of the PV.
Maximum setpoint: Real number that indicates maximum value of
setpoint; must be less than or equal to the high range of the PV.
Yellow deviation alarm: Value that indicates the maximum allowable
error (SP -- PV) for the yellow deviation zone is reached.
Orange deviation alarm: Value that indicates the maximum allowable
error (SP -- PV) for the orange deviation zone is reached.
Output name: Name of the output variable.
Process Variable The process variable to the PID block is automatically designated
Information cfb_name.PV. If you have a Series 505 controller, you can change this to the
name of any analog, integer, scaled integer, or real input that you define in
the I/O Name or Declaration Tables, described in the SIMATIC APT
Programming Reference (Tables) Manual. If you have an S5 controller, you
can change the name of the PV to any scaled analog input or real input that
you have defined. S5 controllers must have real PVs; integer PVs are not
processed. If you want to use integers for PVs, see the SIMATIC APT
Applications Manual, Chapter 2, for programming hints about
incorporating integer inputs for an S5 PID. If the block is graphically
connected to another block, the process variable name is inserted
automatically.
High and low limits for the process variable are used to set the high and
low range for a real number input. For Series 505 controllers, they can also
be used to scale an integer variable input.
If the input is a real (S5 or Series 505) or integer (Series 505 only)
variable, you specify the high and low values in the PID form.
If the input is an analog input or scaled integer, the high and low
ranges are automatically those that you specify when you define the
analog input in the I/O Symbolic Name Table, or when you define the
scaled integer in the Declaration Table.
Alarm definitions allow you to monitor the process variable for deviation
outside a specified range. The standard control blocks provide low-low, low,
high, and high-high alarms; see Figure 2-4. If the process variable is outside
the limits of the alarms, you may use the alarms to generate warnings and
shutdown procedures for the process equipment itself.
The alarm deadband prevents the alarm from changing when the process
variable is within the specified deadband of each alarm zone.
These alarms are monitored at the lesser frequency: every 2 seconds or the
sample time. To change the alarm values, you write to the corresponding
extension variables listed in Table 2-2 on page 2-23.
High-high alarm
Alarm dead band
High alarm
Alarm dead band
Process
variable
Process Setpoint Three options are available for designating the setpoint, or target value, for
Information a PID block:
Computed setpoint: the setpoint is the name of any real variable that
you define in the I/O Name or Declaration Tables or the output from
any CFB other than a PID.
Minimum and maximum setpoint values define the range of the setpoint
value. These values must be within the range of the process variable.
The alarm deadband that you specified for the process variable alarms
operates around the deviation alarms also.
The deviation alarms can be used as indicators to show how well the loop is
controlling, or they can be used as limits to activate some procedure.
Orange deviation
Yellow deviation
dead band
Setpoint
dead band
Yellow deviation
dead band
Output Information The output from the PID block is automatically designated cfb_name.OUT. If
you have a Series 505 controller, you can change this to the name of any
real, integer, analog output variable, or cfb_name.IOUT. If you have an S5
controller, you can change this to the name of any real variable or analog
output; the S5 PID does not process integers. If the output is an analog
output (AO) variable, the PID automatically provides the appropriate
scaling that you defined in the I/O Name Table.
If your analog output is air-to-close, you can specify that the output be
energize-closed by placing X in the Energize Closed Output field. The output
signal is inverted such that zero to one becomes one to zero. This option does
not invert the sign of the error term as does a reverse acting loop.
You can specify other values as the minimum and maximum outputs by
placing X in the Limit Output field. The values that you specify must be
within the normal range for the corresponding algorithm. These limits only
apply when the loop is in the AUTO or CASCADE modes.
Limit Output: X indicates that you wish to change the minimum and
maximum output values from their defaults. The values must be between 0
and 100 for the position algorithm and --100.0 to 100.0 for the velocity
algorithm. Marking this field automatically gives you the Freeze Bias
option, even though it is not marked.
Output Information -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Output name: xxxxxx.OUT
{if ANALOG OUTPUT}
Energize Closed (air--to--close) Output [ ]
Limit output between 0% and 100%? [X]
Minimum output (%): 0.0
Maximum output (%): 100.0
You cannot edit the Limit Output field if you have already marked the PID
block for OSx tag translation.
Controller Options When you define the PID block, you have the following controller options:
an error algorithm, direct or reverse control, freeze bias for an out-of-range
output, and associated math.
Direct/Reverse The control calculation in the PID CFB can be either direct- or
Acting Control reverse-acting:
Direct-acting control means that when you increase the setpoint, the
output increases, and when you decrease the setpoint, the output
decreases. The control action is relative to the change in loop error. If
the error increases, then the controller increases the output.
Freeze Bias Reset windup occurs in a PID loop whenever the output of the loop is no
longer able to change the process variable by adjusting the output. In this
situation, the integral mode continues to increase or decrease the output:
this action has no effect on the controlled variable.
The controller has built-in reset windup protection for the PID loop that
monitors the output and detects an attempt to move the output beyond 0.0
or 100.0 percent.
If you select the Freeze bias option, the anti-reset windup algorithm
stops the integral mode from changing the bias whenever the output
exceeds the high or low limit. This freeze bias is also available
automatically if you select Limit output between 0 and 100%.
If you do not select the Freeze bias option, the algorithm uses bias
backtracking and computes what the bias needs to be in order to make
the output equal to the high or low output limit.
If you need to limit the output further, you can provide additional anti-reset
windup protection by writing directly to the .AWS extension (explained on
page 2-28).
Associated Math To expand the capability of the PID blocks, you can append Math
computations to the operation. This is referred to as associated math in the
form. For Series 505, this math compiles as SFPGM; for S5 controllers,
associated math compiles as STL.
This section executes either every two seconds or at the sample time,
whichever is quicker.
Associate math on auto? This math code executes only when the
controller is in automatic mode. Special computations on the setpoint
occurs in this section.
To modify the setpoint in the loop, manipulate the .LSP (internal loop
setpoint) extension, not the .SP (setpoint) extension. APT loads the .SP
value into the .LSP extension before executing the associated math and
uses the .LSP extension in the computations.
To modify the setpoint in the loop, manipulate the .LSP extension, not
the .RSP (remote setpoint) extension. APT loads the .RSP value into the
.LSP extension before executing the associated math and uses the .LSP
extension in the computations.
For Series 505 controllers, the .IPV extension variable contains the scaled
integer representation of the internal process variable. The .ISP variable
contains the scaled integer representation of the internal setpoint. These
variables can be used in associated math to convert the corresponding value
to a fractional value (.ISP -- .IPV / 100.0) without concern for engineering
units. The .IPV and .ISP extension variables are not available for S5
controllers.
If you want to modify the output after the loop computation, but before
the field update, manipulate the .LMN (internal loop output) extension,
not the .OUT extension. APT performs the loop calculation and then
loads the .LMN extension into the .OUT extension. For air-to-close on
analog output, .LMN goes from zero to one for the associated math on
output and one to zero after the associated math on output is complete.
Use the internal loop variables, .LPV, .LSP, and .LMN, only within the
associated math for the loop. In all other areas of APT, use the .PV (for S5 or
Series 505) or .IPV (Series 505 only) extension to access the process variable
for the loop and the .OUT (for S5 or Series 505) or .IOUT (Series 505 only)
extension to access the output; to access the setpoint, use the .SP extension
in automatic mode and the .RSP extension in cascade mode.
Associated math does not support direct addressing for S5, except in an
inline assembly math statement. (See Appendix C for a discussion of
the inline assembly math statement.) Some direct addressing is
permitted for Series 505.
%T1 through %T9 are reserved for special purposes, but Series 505
controllers can use %T10 through %T15 as local variables.
Associated math is SFPGM-only for Series 505; you cannot use any
RLL-only functions in associated math if you have a Series 505
controller.
Tuning Parameters Your selection of a loop type, such as P or PI, determines which values are
forced into the loop tuning constants.
When the loop type is not PID, APT continuously supplies an appropriate
value in the controller. When the loop type has no proportional (P) term, the
extension .KC is zero. When the loop type has no integral (I) term, the
extension .TI is 1.0 ⌠ 1018. When the loop type has no derivative (D) term,
the extension .TD is zero.
Figure 2-7 shows the tuning parameters for a PID Loop. Figure 2-8 shows
tuning parameters for the other combinations of proportional, integral, and
derivative control.
Tuning Parameters -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Loop type: PI P PID I PD
Proportional gain: 1
Integral time (reset time): 999.99 min
Derivative time (rate): 0.0 min
Derivative gain limiting? [X]
Limiting coefficient? 10.0
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
To solve this problem, the controller allows you the option of selecting a
derivative gain limiting coefficient (Kd). The use of this coefficient enables
the process variable to be filtered with a time constant that is proportional
to the derivative time (Td). The PID equations with the derivative gain
limiting coefficient are shown on the following page (top box):
M = Kc × e n − Kr (Y n − Y n−1) + Mx
Tuning Parameters -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Loop type: PI P PID I PD
Tuning Parameters for I Loop Integral time (reset time): 999.99 min
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Tuning Parameters -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Loop type: PI P PID I PD
Tuning Parameters for P Loop Proportional gain: 1
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Tuning Parameters -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Loop type: PI P PID I PD
Proportional gain: 1
Tuning Parameters for PD Loop Derivative time (rate): 0.0 min
Derivative gain limiting? [ ]
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Tuning Parameters -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Loop type: PI P PID I PD
Proportional gain: 1
Tuning Parameters for PI Loop Integral time (reset time): 999.99 min
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
PID Commands Table 2-1 lists the commands, APT flags, and boolean extensions that you
and Flags can use in the parallel section of an SFC step or a math section in SFC or a
CFB to monitor and control a PID block.
Boolean
Command APT Flag Description
Extension
AUTO .RATO .GAUTO Places loop in automatic mode.
Places loop in manual mode;
MANUAL (MAN) .RMAN .GMAN
deactivates PID calculation.
CASCADE (CAS) .RCAS .GCASC Places loop in cascade mode.
The commands manipulate the APT flags and the boolean extensions in
order to control the loop. Use the commands, rather than the extensions, to
control the mode of the loop, because APT can overwrite the boolean mode
extensions. Use the APT flags and boolean extensions to monitor the status
of the loop. If you use an APT flag extension, you must use the LATCH, ON,
and CLEAR math procedures, described in Chapter 11, “Math Functions
and Procedures.”
When the .NRDY extension is set to true, no data is written to .OUT (or .LMN
for a Series 505, when Map tuning and alarm data to S-memory field is
selected), and you cannot place the loop into automatic or cascade mode. If
either .GAUTO or .GCASC is held true in controller logic when .NRDY is also
true, the loop cycles back and forth between manual mode and the alternate
(automatic or cascade) mode.
Loops in Manual In manual mode, the loop computations are not performed, and the control
Mode program or operator can manipulate the output directly by writing to the
.OUT (output) extension. For Series 505 controllers, you can also write to the
.LMN (loop output) extension when Map tuning and alarm data to S-memory is
selected (marked with X).
Loops in Automatic In automatic mode, the loop takes the setpoint from the .SP (setpoint)
Mode extension. Loop calculations are then performed, and the controller output
is updated.
Loops in Cascade In cascade mode, the setpoint is provided by an external source. This source
Mode can be the output of another CFB, a declared real variable, or the output
from another PID block.
If you want to connect the output of another loop to the setpoint, select
CASCADED in the Setpoint Source field of the form. In this case, for
Series 505, the setpoint is taken from the scaled integer output (0 to 32000)
from the PID source block. For S5, the setpoint is taken from the normalized
output (0--1) of the PID source block and is scaled to the engineering units of
the PV of the cascaded loop.
In order to put a loop in cascade mode, you must follow this sequence.
1. Set the source (master) loop’s output to the desired value (the setpoint
for the slave loop).
The master loop then feeds its output to the slave loop’s setpoint. If a slave
loop is switched out of cascade, then all of its master loops are placed in
manual. A request to place a master loop in auto or cascade is denied unless
the slave loop is in cascade.
If the setpoint source is any other real output, select COMPUTED in the
Setpoint Source field of the form. In this case, the setpoint is taken from the
variable that you entered in the form.
You cannot edit the Setpoint Source field if you have already marked the
PID block for OSx tag translation.
PID Extensions A full list of all the PID extension variables that you can use to monitor
and/or control a PID block is contained in Table 2-2. More information is
provided concerning some of these extensions on the pages that follow.
Availability All PID extensions are available for Series 505 controllers. Since S5
controllers must have real inputs and real outputs, the following integer
extensions are not provided for S5: .IPV, .IIN, .ISP, .IMN, .IOUT, and .IBIAS.
PID V-Flag and The PID .VFLAG extension variable includes the boolean extension variables
C-Flag Extension that are listed in Table 2-3. Figure 2-9 shows the .VFLAG bits.
Variables
read/write read-only
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 X
The controller maintains a set of C-flag bits that contain additional loop
operational data. While V-flag bits are held in one 16-bit extension variable
(.VFLAG), it takes two (the .CFL and .CFH extensions) to contain the C-flag
bits. See Figure 2-10.
The C-flag bits contained in the .CFL and .CFH extensions are initialized as
shown in Table 2-4.
.CFH .CFL
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Loop Status The boolean extensions .IMAN (in manual), .IAUTO (in automatic), and .ICASC
Extensions (in cascade) indicate the internal state of the loop. These bits do not,
however, indicate whether the loop computations have completed
initialization.
The .SMODE (status mode) extension provides information about the loop
status. During loop operation, .SMODE can assume any one of the following
seven integer values.
0: The program has just been downloaded into the controller, but the
controller has not been switched to run mode.
1: The loop has just transitioned into manual mode from either
automatic or cascade; or the loop has just transitioned into manual
mode when the controller has just switched to run mode after a
program download.
2: The loop is in manual mode and has been in this mode for at least
one operation of the loop calculations, or for two seconds, whichever is
less.
3: The loop has just transitioned into automatic mode from either
manual or cascade, and the .SP (setpoint) and .LSP (loop setpoint)
extensions have been initialized to the current value of the process
variable. This makes the loop error equal to zero; the loop output does
not change to provide a bumpless transfer.
4: The loop is in automatic mode and has been in this mode for at
least one operation of the loop calculations. Normal control
computations based on the setpoint and process variable are being
performed.
5: The loop has just transitioned into cascade mode, and setpoint
initialization is complete with a bumpless transfer to the .RSP
extension.
6: The loop is in the remote or cascaded setpoint mode and has been
in this mode for at least one operation of the loop calculations, and
normal loop computations are being performed on the .RSP extension.
NOTE: Wait until .SMODE equals 3, 4, 5, or 6 before you change the loop
setpoint from an SFC step, math, debug, or OSx; otherwise, the loop may
overwrite the value with the process variable. To determine loop status,
always check the value of the .SMODE extension, not the value of .IMAN,
.IAUTO, or .ICASC. The loop always changes mode before APT finishes the
calculation.
Reset Windup The .AWS extension defines the anti-reset windup status and can have any
Protection and the one of the following values during operation of the loop:
.AWS Extension
0: The output is within the constraints defined by .HLIM (high limit)
and .LLIM (low limit) extensions.
3: The block is no longer integrating, and the loop does not have a
control path to the controlled variable. The output may still change if
the process variable changes and gain > 0.
If you use external reset windup protection (See “Other Control Blocks”
Chapter 9), or if you select Limit output between 0% and 100%, the .AWS
extension indicates the status of the loop. However, you can write a 3 to the
.AWS extension at any time to freeze the integral mode. Any other value in
the .AWS extension resumes the integral mode.
Map Tuning and The S5 controllers store loop parameters in data blocks. However, for Series
Alarm Data to 505 505 controllers, all loop parameters are stored in S-memory. Table 2-5 lists
S-Memory the PID extensions and their associated variables in Series 505 S-memory.
The n portion of the Series 505 S-memory variable name is the integer
number of the loop. For example, LPV24 is the Series 505 S-memory
variable that contains the process variable data for loop #24.
For Series 505 controllers, you can use more than one extension to read
some S-memory variables, e.g., the LMXn variable. Whether you use an
integer or a real extension depends on how the corresponding variable has
been declared.
When the Map tuning and alarm data to S-memory option is not selected for a
Series 505 controller, APT maps the loop tuning parameters and alarm data
to V-memory. APT also maps the .SP (setpoint) and .OUT (output). Table 2-6
lists the PID extensions in Series 505 V-memory that APT copies. APT
writes over these Series 505 S-memory extensions with the contents of their
associated V-memory extensions as quickly as possible. Any user-entered
data to the Series 505 S-memory extensions is written over, effectively
making S-memory extensions read-only.
When the Map tuning and alarm data to S-memory option is selected for a
Series 505 controller, APT uses the loop tuning parameters and alarm data
for that loop directly from S-memory. Using this option can save twelve
V-memory locations per loop and the time required to move the data from
V-memory to S-memory. This selection reduces CPU loading and allows
non-OSx operator interfaces (such as CVU and the loop access module) to
readily interact with the loop. You can use this feature by entering X in the
Map tuning and alarm data to S-memory field of the PID form. This option
makes the extensions, listed in Table 2-6, operate as read/write Series 505
S-memory locations, and causes the .SP extension to map to S-memory. Most
of the time this option should be selected (X).
When you have an analog output that requires the energized closed
(air-to-close) output option for a Series 505 controller, then the Map tuning
and alarm data to S-memory option is not selected. In this manner, the .OUT
can be manipulated before it is sent to the field because APT will use the
.OUT extension in Series 505 V-memory to invert the signal. For air-to-close
on analog output, .LMN goes from zero to one for the associated math on
output and .OUT goes from one to zero after the associated math on output is
complete.
You cannot edit the Map tuning and alarm data to S-memory field if you have
already marked the PID block for OSx tag translation.
RTD and For Series 505 controllers, the status of Series 500/Series 505 RTD and
Thermocouple Thermocouple modules is reported by the .IERR and .INBTA extensions. For
Module Extensions S5 controllers, the status of RTD and Thermocouple is reported in the AI
for Series 505 extension (.BTA) for the RTD or Thermocouple, not in the loop extensions.
For Series 505, the .INBTA extension becomes true when the associated
module has an error, for example, a broken transmitter.
For Series 505, the .IERR extension normally equals the internally scaled PV
of the the RTD or thermocouple input. The .IERR extension contains the
module error code when:
Overview The on/off block shown in Figure 2-11 is essentially a high-gain proportional
control block that contains a PID loop. If the absolute value of the loop error
is greater than or equal to the value of the yellow deviation alarm, a
discrete output (cfb_name.DOUT or a device) is manipulated.
The output from an on/off block can be any one of the following: digital
output, boolean variable, or the name of a device (VSS, VMD, VSD, VSN,
VDD, MDN, MSN, MSS).
If the output is the name of a device, the block expects the device to be in a
locked state. (See the chapter on devices in the SIMATIC APT Programming
Reference (Tables) Manual for information about locking devices.)
Availability On/off blocks are available for Series 505 and S5 controllers. They are not
supported for the 560/560T controllers.
ON/OFF
PV
SP PI D ON/ SP
OFF
xxxxxx.PV
xxxxxx PV
OUT
SP ON/OFF P
I
xxxxxx D
OUT
xxxxxx.DOUT
If the controller is direct-acting, the output is set to true when the error
is beyond the low yellow deviation. The output remains true until the
PV passes through the positive yellow deviation as shown in
Figure 2-12.
The .IOUT extension manipulates .DOUT and is read only when the
block is in auto or cascade and read/write when the block is in manual.
.DOUT is true when .IOUT = 1, and false when .IOUT = 0.
.DOUT = true
Yellow deviation
Error
Setpoint
Yellow deviation
Orange deviation
.DOUT = true
Figure 2-13 shows the form that you use to define an on/off block. The
shaded entries in the form depend on a previous selection. The information
on the form is the same as for the PID block except that you cannot have an
analog output or associated math on the output. See page 2-9 for process
variable information, page 2-11 for process setpoint information, page 2-13
for output information, page 2-15 for controller options, and page 2-23 for
PID extensions and for a description of the options that apply to the on/off
block.
Output Information -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Output name: xxxxxx.DOUT
Controller Options -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reverse acting? []
Associate math on PV cycle? [ ] (Press F10 to edit math text)
Associate math on auto? []
Associate math on cascade? []
Alarm Monitoring -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Disable low-low/high-high alarms? [ ]
Disable low/high alarms? [ ]
Disable deviation alarms? [ ]
Disable rate of change alarm? [ ]
Disable broken transmitter alarm? [ ] } Series 505 only
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
On/Off Commands Table 2-7 lists the commands that determine the mode of operation for the
on/off block: MANUAL (MAN), AUTO, and CASCADE (CAS). These
commands operate the same way that they do for the PID block. See
page 2-21 for PID commands.
Command Description
On/Off Extensions Table 2-8 lists the extensions that you can use to monitor and control and
on/off block. See page 2-23 for PID extensions and for details about these
extensions. The V-flag and C-flag extension variables that are available for
the on/off block operate the same way as those for the PID block; see
Table 2-3 and Table 2-4.
Overview The analog alarm block offers the same types of alarms as the other
standard control blocks. You can use it to monitor a process variable, but
not to control it. (The analog alarm block does not have an output nor does
it have tuning parameters.) If you select an analog alarm, you use the
high/low alarm capability of the loops and you are also able to set a setpoint
and use the orange and yellow deviations from the setpoint as alarms.
If you select a setpoint source of value, you specify the actual value of
the setpoint when you define the block. This value can be changed only
by editing the CFB form.
Figure 2-14 shows the form that you use to define an analog alarm block.
The shaded entries in the form depend on a previous selection. The
information on the form is the same as for the PID block, except that you
have only one associated math section and it is always enabled. See
page 2-9 for process variable information, and page 2-11 for process
setpoint information and for a description of the options that apply to the
analog alarm block.
Availability Analog alarm blocks are available for both Series 505 and S5 controllers;
however, for the Series 505, the analog alarm block is part of the firmware,
while for the S5 the block has been implemented through code.
Consequently, the S5 analog alarm block has several distinctive features:
The Series 505 S-memory mapping feature is not supported for S5.
ANALOG ALARM
PV
SP SP
ANALOG
ALARM
xxxxxx.PV
xxxxxx PV
.05 ANALOG
ALARM
SP
xxxxxx
Alarm Monitoring -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Disable low-low/high-high alarms? [ ]
Disable low/high alarms? [ ]
Disable deviation alarms? [ ]
Disable rate of change alarm? [ ]
Disable broken transmitter alarm? [ ] } Series 505 only
Memory Mapping -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Map alarm data to 505 S-memory? [ ] Series 505 only
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Analog Alarm Table 2-9 lists the commands that determine the mode of operation for the
Commands analog alarm block: ENABLE (ENA) and DISABLE (DIS). Note that
associated math is always executed.
Command Description
ENABLE (ENA) Turns on, or activates, the alarming.
DISABLE (DIS) Turns off, or deactivates, the alarming.
Analog Alarm Table 2-10 lists the extensions that you can use to monitor and control the
Extensions analog alarm block.
The .SMODE extension defines the current status of the block and differs
from the .SMODE extension for the PID.
1: The deviation alarms are executing. Transitions can check for a 1 in the
.SMODE variable to determine that the setpoint has been updated.
See page 2-23 for details about the other PID extensions.
Analog Alarm The analog alarm .VFLAG extension variable includes the boolean extension
V-Flag and C-Flag variables that are listed in Table 2-11. Figure 2-15 shows the .VFLAG bits.
Extension The .VFLAG value is updated when the block is enabled.
Variables
read/ read-only
write
1 1 1 1 1 1 1 1 1 1 1 1 X X X X
Bit 1 Binary equivalent of .VFLAG integer Bit 16
Read Only
y 8 1=PV in orange deviation alarm .INODA
12 1=enabled .ENABL 2
The .CFL and .CFH extensions are initialized as shown in Table 2-12.
.CFH .CFL
1 1 1 1 1 1 1 1 x x x x x x x x x x x x 1 x 1 1 1 1 1 1 1 1 1 1
Associated Math To expand the capability of the analog alarm block, you can append Math
computations. For Series 505, the math compiles as SFPGM; for S5,
associated math compiles as STL.
You can use the associated math to enable the block using
Name.ENABL := true; in the associated math section.
NOTE: The associated math for the analog alarm CFB always executes
even when the block is not enabled.
S-Memory Table 2-13 lists the analog alarm extensions and their associated variables
Variables in Series 505 S-memory. The n portion of the S-memory variable is the
(Series 505 only) integer number of the analog alarm. For example, APV55 is the S-memory
variable that contains the process variable data for analog alarm #55.
You can use more than one extension to read some Series 505 S-memory
variables, e.g., APVn.
Read/Write Integer
Extension S-Memory
.AL_RECORD.CFH ACFHn.
.AL_RECORD.CFL ACFLn.
.AL_RECORD.IHA AHAn.
.AL_RECORD.IHHA AHHAn.
.AL_RECORD.ILA ALAn.
.AL_RECORD.ILLA ALLAn.
.AL_RECORD.IPA APVn.
.AL_RECORD.ISP ASPNn.
.AL_RECORD.VFLAG AVFn.
.CFH ACFHn.
.CFL ACFLn.
.IPV APVn.
.ISP ASPn.
.VFLAG AVFn.
Table 2-14 lists the analog alarm extensions in Series 505 V-memory that
APT maps to Series 505 read-only S-memory. APT writes over these
Series 505 S-memory locations with the contents of their associated
V-memory locations as quickly as possible. Any user-entered data to the
Series 505 S-memory extensions is written over, effectively making these
extensions read-only. You can disable this feature by entering X in the Map
tuning and alarm data to S-memory field of the analog alarm form. This
option makes these extensions (.HA, .HHA, .LA, etc.) read/write S-memory
locations, and causes the .SP extension to map to Series 505 S-memory only,
not to V-memory.
You cannot edit the Map alarm data to S-memory field if you have already
marked the analog alarm block for OSx tag translation.
Overview The APT dynamic blocks provide a means to create simulations and to build
models for complex control strategies. APT provides three basic types of
dynamic blocks:
The derivative block simply computes the rate of change of the input.
To determine this rate, the block computes the change in the input from
the last sample time and then divides this change value by the sample
time.
Availability Dynamic blocks are available for Series 505 and S5 controllers. They are not
supported for the 560/560T controllers.
A B C D
xxxxxx
E F G H
cfb_name.ENABL := true;
Enable cfb_name;
To deactivate the block, use the DISABLE command with the block name or
set the .ENABL extension to false.
All dynamic blocks have a boolean extension (.NRDY) that you can use to
interlock the execution of the block to some external conditions.
If you set the .NRDY extension to true, the block is forced to the disabled
state.
To return the block to the enabled state you must not only set the .NRDY
extension to false but also re-enable the block with a command or an
assignment statement.
Initialization Two types of initialization are available with the simulation blocks. Forward
initialization allows straight simulations; backward initialization supports
model base control where the actual process variable defines the initial
value of the output. No initialization of the output or input is done for the
derivative blocks.
The output is set to the value that you specify as the initial output
(.OUTIC); this value serves as a bias that is added to an internal variable
in the simulation block.
The current input value is stored internally (.INIC) in the block as the
initial input. Changes in the output are then computed relative to
changes in the difference between the new, current input and the value
stored as the initial input.
The bottom part of Figure 3-2 shows backward initialization, which operates
as follows:
The current value of the output from the block is stored as the initial
output (.OUTIC).
+ +
b: Backward Initialization
.OUTIC
.GAIN .OUTIC
-- --
.OUTIC
.GAIN Gain .OUT
+ +
All simulation calculations are relative to the difference between the input
and the .INIC extension variable. This means that after an initialization,
either the input or the .INIC must change before the output can start to
change.
NOTE: The dynamic block does not update the output until the second
sample time following initialization.
Simulation Following initialization, the first and second order lags and first and second
Equations order lead lags function as follows.
Each sample time after the initialization scan, the block updates the
delay table using the following simulation formula:
The values of B1, B2, A1, and A2 depend on the type of simulation
block (first order lag, second order lag, etc.) and the steady-state gain
that you specify in the form.
The next output from the simulation block is determined by the table
entry computed n samples ago where n is the ratio of delay time to
sample time.
NOTE: The ratio of dead time to sample time should not exceed 62. The
dead time table that simulates the delay has a length of 62 entries.
The delayed output of the block is always available as the output name that
you enter in the form. The intermediate output without the delay is also
available as cfb_name.DMOUT.
If you choose a first or second order lag, or a first or second order lead lag,
APT creates three extensions that you can use to control the response to the
change in input. These extensions are .TAU1, .TAU2, and .TLEAD.
If you choose a first order lag, .TAU1 contains the value that you enter as
the first time constant; the system initializes .TAU2, and .TLEAD to 0.
If you choose a second order lag, .TAU1 and .TAU2 contain the values that
you enter as the first and second time constants; the system initializes
.TLEAD to 0.
If you choose a first-order lead lag, .TAU1 and .TLEAD contain the values
that you enter as the lag time and lead time; the system initializes .TAU2
to 0.
If you choose a second-order lead lag, .TAU1, .TAU2, and .TLEAD contain the
values that you enter as the first and second time constants and the
lead time.
NOTE: Before you change the input or use the output of a dynamic block,
check the status of the .ENABLD extension to be certain that the value is true.
Overview The second order lead lag block simulates a dynamic process in which
specified constants determine the relationship between an immediate
change in the input and a gradual, corresponding change in the output.
Figure 3-3 shows the formula that is used for a second order lag block.
input ∆ input
∆ output dead
gain =
∆ input time
∆ output
output
Gain specifies the ratio of the change in output to the change in input
at a steady state.
τ1, τ2, and τ3 determine the characteristic “S” shape of the output
response to a change in input. τ1, τ2, and τ3 are the first order time
constant, the second order time constant and the lead time constant,
respectively.
Availability Second order lead lag blocks are available for Series 505 and S5 controllers.
They are not supported for the 560/560T controllers.
Block Figure 3-4 shows the form that you use to define a second order lead lag
Configuration block.
xxxxxx
OUT
xxxxxx.OUT
Commands and Table 3-1 lists the commands that determine the mode of operation for the
Extensions second order lead lag block.
Command Description
ENABLE (ENA) Turns on, or activates, the block.
DISABLE (DIS) Turns off, or deactivates, the block.
Table 3-2 lists the extensions that you can use to monitor and control a
second order lead lag block.
Overview The second order lag block simulates a dynamic process in which specified
time constants determine the relationship between an immediate change in
the input and a gradual corresponding change in the output.
Figure 3-5 shows the formula that is used for a second order lag block.
input ∆ input
∆ output dead
gain = time
∆ input
∆ output
output
Gain specifies the ratio of the change in output to the change in input
at a steady state.
Availability Second order lag blocks are available for Series 505 and S5 controllers. They
are not supported for the 560/560T controllers.
Block Figure 3-6 shows the form that you use to define a second order lag block.
Configuration
xxxxxx
OUT
xxxxxx.OUT
Commands and Table 3-3 lists the commands that determine the mode of operation for the
Extensions second order lag block.
Command Description
ENABLE (ENA) Turns on, or activates, the block.
DISABLE (DIS) Turns off, or deactivates, the block.
Table 3-4 lists the extensions that you can use to monitor and control a
Second Order Lag block.
Overview The first order lead lag block simulates a dynamic process in which specified
time constants determine both lead and lag times.
The output depends on the ratio of lead to lag as explained below. Assume
the following values in each example:
2.0
n = 0 1 2 3 4
If TLead / TLag is less than 1.0, then the initial response undershoots
the steady-state output value.
n = 0 1 2 3 4
n = 0 1 2 3 4
Figure 3-7 shows the formula that is used for a first order lead lag block.
Gain specifies the ratio of the change in output to the change in input
at a steady state.
Availability First order lead lag blocks are available for Series 505 and S5 controllers.
They are not supported for the 560/560T controllers.
Block Figure 3-8 shows the form that you use to define a first order lead lag block.
Configuration
xxxxxx
OUT
xxxxxx.OUT
Commands and Table 3-5 lists the commands that determine the mode of operation for the
Extensions first order lead lag block.
Command Description
ENABLE (ENA) Turns on, or activates, the block.
DISABLE (DIS) Turns off, or deactivates, the block.
Table 3-6 lists the extensions that you can use to monitor and control a first
order lead lag block.
Overview The first order lag block simulates a dynamic process in which a specified
first order time constant determines the relationship between an immediate
change in the input and a gradual corresponding change in the output.
Figure 3-9 shows the formula that is used for a first order lag block.
∆ input
input
dead
time
∆ output 63.2%
gain = ∆ output
∆ input
output
Gain specifies the ratio of the change in output to the change in input
at a steady state.
τ specifies the time in seconds required to reach 63.2 per cent of the
final output after a change in the input. It is the time constant.
Availability First order lag blocks are available for Series 505 and S5 controllers. They
are not supported for the 560/560T controllers.
Block Figure 3-10 shows the form that you use to define a first order lag block.
Configuration
xxxxxx
OUT
xxxxxx.OUT
Commands and Table 3-7 lists the commands that determine the mode of operation for the
Extensions first order lag block.
Command Description
ENABLE (ENA) Turns on, or activates, the block.
DISABLE (DIS) Turns off, or deactivates, the block.
Table 3-8 lists the extensions that you can use to monitor and control a first
order lag block.
3.6 Derivative
Overview The derivative block computes the rate of change in the input by using the
following formula:
∆ input
Rate of change =
sample time
Figure 3-11 shows the formula that you use to define a derivative block.
The result of this calculation is placed in the output field of the derivative
block.
input
input input (t j) − input (t j−1) output
st
output
You can use the derivative block to calculate the rate of change of a variable.
You can set a flag if the rate of change exceeds a predetermined limit.
cfb_name.ENABLD = true;
3. If the rate of change becomes too great, set a flag that identifies the
condition.
Availability Derivative blocks are available for Series 505 and S5 controllers. They are
not supported for the 560/560T controllers.
Block Figure 3-12 shows the form that you use to define a derivative block.
Configuration
DERIVATIVE
PV
DERIV--
ATIVE
xxxxxx.IN
xxxxxx PV
OUT DERIVATIVE
xxxxxx
OUT
xxxxxx.OUT
Derivative (continued)
Commands and Table 3-9 lists the commands that determine the mode of operation for the
Extensions derivative block.
Command Description
ENABLE (ENA) Turns on, or activates, the block.
DISABLE (DIS) Turns off, or deactivates, the block.
Table 3-10 lists the extensions that you can use to monitor and control a
derivative block.
Overview The dead time delay block simulates a dynamic process with a specified
time delay between a change in the input and a corresponding change in the
output. This block operates like the other dynamic blocks except for the
update equation:
Figure 3-13 shows the formula that is used for a Dead Time Delay block.
∆ input
input
input output dead
gain e−θs time
∆ output
output
Gain specifies the ratio of the change in output to the change in input
at a steady state.
Dead time is the interval between the input change and the start of the
response.
Availability Dead time delay blocks are available for Series 505 and S5 controllers. They
are not supported for the 560/560T controllers.
Block Figure 3-14 shows the form that you use to define a dead time delay block.
Configuration
xxxxxx
OUT
xxxxxx.OUT
Commands and Table 3-11 lists the commands that determine the mode of operation for the
Extensions dead time delay block.
Command Description
ENABLE (ENA) Turns on, or activates, the block.
DISABLE (DIS) Turns off, or deactivates, the block.
Table 3-12 lists the extensions that you can use to monitor and control a
dead time delay block.
3.8 Integrator
Overview The integrator block produces an output that is proportional to the integral
of the input (or the sum of the inputs) with respect to the sample time.
The integrator block uses the following formula to update the delay table:
1.0
table entry = (table entry1 ) + * (input --- initial input) * sample time
steady ---state gain
The steady-state gain (.TAU1) controls the rate of change of the output. A
large gain produces a slow integrator; a small gain produces a fast
integrator.
Figure 3-15 shows the formula that is used for an integrator block.
∆ input
input
input output delay
e −θs or dead
gain * s time
output
1 ∆ input
line slope = τ * sample time
The integrator then changes the output based on the change of the
current input from the initial input.
3. Set cfb_name.INIC = 0
Availability Integrator blocks are available for Series 505 and S5 controllers. They are
not supported for the 560/560T controllers.
Block Figure 3-16 shows the form that you use to define an integrator block.
Configuration
INTEGRATOR
PV
INTE--
GRATOR
xxxxxx.IN
xxxxxx PV
OUT INTEGRATOR
xxxxxx
OUT
xxxxxx.OUT
Integrator (continued)
Commands and Table 3-13 lists the commands that determine the mode of operation for the
Extensions integrator block.
Command Description
ENABLE (ENA) Turns on, or activates, the block.
DISABLE (DIS) Turns off, or deactivates, the block.
Table 3-14 lists the extensions that you can use to monitor and control an
integrator block.
Overview The advanced control blocks provide a combination of PID and dynamic
control.
The dead time compensator removes the effect of dead time from the
setpoint response of a single input/output process.
The dual mode block combines PID control with on/off control.
The ratio station block keeps a constant ratio between two variables.
Availability Advanced control blocks are available for Series 505 and S5 controllers.
They are not supported for the 560/560T controllers.
PID Functions The advanced control blocks have the basic functionality of the PID loops.
See the appropriate section of Chapter 2, “Standard Control Blocks,” for an
explanation of the operation of the PID block. The external anti-reset
windup protection can also be used with dynamic blocks. See Chapter 9,
“Other Control Blocks,” for information about these control blocks.
Dynamic Functions Some of the advanced control blocks incorporate the lead and lead-lag
functions of the dynamic blocks. Refer to Chapter 3 for details on dynamic
control blocks to determine the parameters for first order lag, first order
lead-lag, second order lag, and second order lead-lag.
Overview The dead time compensator block removes the effect of dead time from the
setpoint response of a single input, single output process.
The dead time compensator includes a PID loop and has the same basic
options and operating characteristics as those listed in Chapter 2 on
standard control blocks. However, you cannot include any associated math
and you must configure the dynamic model.
The model is driven by the output of the PID that also controls the input
variable. The output is sent through a model with a dead time block and is
subtracted from the process input to generate an error. The error and the
model output are added together and sent to the PID loop as the process
signal.
Two extension variables are used to compute the process signal: .MOUT
(model output including the delay) and .DMOUT (model output without the
delay). The signal is based on the following formula.
This value can also be monitored with the .SPV (“seen” process variable)
extension.
Availability Dead time compensator blocks are available for Series 505 and S5
controllers. They are not supported for the 560/560T controllers.
Block Figure 4-1 shows the dead time compensator CFB graphic.
Configuration
PV
SP P I D SP
DEAD
TIME
xxxxxx
OUT DEAD TIME COMPENSATOR
Block Name: xxxxxx
XXXXXX.SPV
SP P I D
xxxxxx.OUT
MODEL
+
OUT
XXXXXX.DMOUT xxxxxx.OUT
+
DELAY
xxxxxx.MOUT
--
xxxxxx.PV +
PV
Figure 4-2 shows the form that you use to define the dead time compensator
block. The shaded entries in the form depend on the previous selection. The
information on the form is the same as the PID block except that you cannot
have associated math. See page 2-9 for process variable information,
page 2-11 for process setpoint information, page 2-13 for output information,
page 2-15 for controller options, and pages 2-21 to 2-23 for PID commands
and extensions and for a description of the PID options that apply to the
dead time compensator block. Also see Section 3.2, “Second Order Lead
Lag,” Section 3.3, “Second Order Lag,” Section 3.4, “First Order Lead Lag,”
and Section 3.5, “First Order Lag,” for a description of the dynamic options
that apply to the dead time compensator block.
Output Information -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Output name: xxxxxx.OUT S
Limit output between 0% and 100%? [ ]
Minimum output(%): 0.0
Maximum output(%): 100.0
Controller Options -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Error algorithm type? NORMAL SQUARED DEADBAND
Reverse acting? []
Freeze bias for output out of range? []
Tuning Parameters -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Loop type: PI P PID I PD
Proportional gain: 1.0
Integral time (reset time): 999.99 min
Derivative time (rate): 0.0 min
Derivative gain limiting? [ ]
Limiting coefficient: 10.0
Dynamic Function -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Dynamic function type: 1st ORDER LAG 2nd ORDER LAG
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Commands and Table 4-1 lists the commands that determine the mode of operation for the
Extensions dead time compensator block. These commands operate the same way that
they do for the PID block. See page 2-21 for PID commands.
Command Description
Table 4-2 lists the extensions that you can use to monitor and control a dead
time compensator block. See page 2-23 for PID extensions.
Overview The dual mode block provides a mechanism to start up a process variable in
a minimum amount of time and with a minimum amount of overshoot.
The dual mode block combines PID control with on/off control. The PID loop
must be in auto or cascade mode before you enable the dual mode block. The
PID loop has the same options and operating characteristics as those listed
in Chapter 2, “Standard Control Blocks.” You cannot include associated
math on the output because the dual mode block operates on the output of
the PID loop.
To properly control the dual mode block, include these steps in an SFC:
2. After the loop is in the appropriate mode, enable the dual mode block.
3. Change the setpoint to the desired value to move the process variable
into orange deviation.
When the dual mode block is enabled, the .DMODE extension is set to 1 and
retains that value until the PID loop takes control. When the process
deviation crosses the orange deviation line, the following steps occur
(Figure 4-3):
1. The output is set to 100% until the process re-crosses the orange
deviation line.
2. The output is set to 0% for the first time interval that you specify
(Delay time 1).
3. The output is set to the preset value for the second time interval that
you specify (Delay time 2).
4. The bias is set to the preset value, and control is returned to the PID
loop.
The orange deviation and the delay times are the critical tuning constants
for proper operation of the dual mode block. The block assumes that the
process variable starts at a point below the orange deviation limit. Initial
setpoint change must be large enough to push the error into orange
deviation.
After the loop gets control of the process, you can change the deviation
limits by writing to the appropriate extension variables.
Orange deviation
Yellow deviation
Setpoint
Error
Yellow deviation
Orange deviation
100%
Output
Preset
0%
Loop control takes over
error crosses
orange deviation
delay delay
error re-crosses time 1 time 2
orange deviation
.DMODE = 1 .DMODE = 0
Availability Dual mode blocks are available for Series 505 and S5 controllers. They are
not supported for the 560/560T controllers.
Enabling and The dual mode CFB must be activated with the ENABLE command or with
Disabling Blocks an assignment statement that sets the .ENABL extension to true. See
Figure 4-4. The dual mode block can also be enabled from an assignment
statement wherever you can use the Math language, for example, SFC
steps, CFBs, etc.
A B C D
xxxxxx
E F G H
cfb_name.ENABL := true;
Enable cfb_name;
To deactivate the dual mode CFB, use the DISABLE command with the
block name or set the .ENABL extension to false.
The dual mode block has a boolean extension (.NRDY) that you can use to
interlock the execution of the block to some external conditions:
If you set the .NRDY extension to true, the block is forced to the disabled
state.
To return the block to the enabled state you must not only set the
.NRDY extension to false, but you must also re-enable the block with a
command or an assignment statement.
PV
SP P I D SP
DUAL
MODE
xxxxxx
OUT DUAL MODE
xxxxxx.PV
PV
SP DUAL MODE P
I
xxxxxx D
OUT
xxxxxx.DOUT
Figure 4-6 shows the form that you use to define the dual mode block. The
shaded entries in the form depend on the previous selection. The
information on the form is the same as the PID block except that you cannot
have associated math on the output and you must enter the dual mode
parameters. See page 2-9 for process variable information, page 2-11 for
process setpoint information, page 2-13 for output information, page 2-15 for
controller options, and pages 2-21 to 2-23 for PID commands and extensions
and for a description of the PID options that apply to the dual mode block.
Output Information -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Output name: xxxxxx.OUT S
Limit output between 0% and 100%? [ ]
Minimum output(%): 0.0
Maximum output(%):: 100.0
Controller Options -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Error algorithm type? NORMAL SQUARED DEADBAND
Reverse acting? []
Freeze bias for output out of range? []
Associate math on PV cycle? [ ] (Press F10 to edit math text)
Associate math on auto? []
Associate math on cascade? []
Tuning Parameters -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Loop type: PI P PID I PD
Proportional gain: 1.0
Integral time (reset time): 999.99 min
Derivative time (rate): 0.0 min
Derivative gain limiting? [ ]
Limiting coefficient: 10.0
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Commands and Table 4-3 lists the commands that determine the mode of operation for the
Extensions dual mode block. These commands operate the same way that they do for
the PID block. See page 2-21 for PID commands.
Command Description
Table 4-4 lists the extensions for the dual mode block. See page 2-23 for PID
extensions.
Overview The feedforward output adjust block uses two independent control blocks, a
PID loop and a dynamic simulation block, to drive a single output. The
function of the feedforward output adjust block is to incorporate the features
of a dynamic block and a PID block into a single block so that the output is
always updated correctly. The feedforward output adjust uses the velocity
algorithm where the output spans --100.0 to 100.0.
On each update, the block adds the contribution of the dynamic block.
If the output has exceeded a limit, the block sets the output to the limit
value.
The PID output is then used for further adjustment. If the PID is
pushing the block beyond a limit, the output is set to the limit value,
and the .AWS (anti-reset windup status) extension is set as explained in
Chapter 2, “Standard Blocks.”
If the dynamic block is pushing the output beyond a limit while the
loop is moving it away, the loop has final control; and the output is
moved away from the limit.
The PID block has control of the output which is updated each loop scan or
every two seconds, whichever is faster.
NOTE: Because of the dynamic portion of the block, the dynamic sample
time should be between 0.5 and 4095.5 seconds in half-second increments.
The sample time of the PID loop should match the dynamic sample time.
The ENABLE and DISABLE commands control the dynamic block. (See
page 4-9.) The PID block responds to the standard PID commands. You can
monitor .FMODE (feedforward mode) to determine the status of the block: 1
indicates that the block is executing; 0 indicates that the block is disabled; 3
indicates that the block is initializing.
Availability Feedforward output adjust blocks are available for Series 505 and S5
controllers. They are not supported for the 560/560T controllers.
Block Figure 4-7 shows the feedforward output adjust CFB graphic.
Configuration
PV DV
SP P I D SP
FDFWD
OUT. ADJ.
xxxxxx
OUT FEEDFORWARD OUTPUT ADJUST
Block Name: xxxxxx
xxxxxx.WPV xxxxxx.PV
DV PV
DYNAMIC SP P I D
OUT
xxxxxx.OUT
Figure 4-8 shows the form that you use to define the feedforward output
adjust block. The shaded entries in the form depend on the previous
selection. The information on the form is the same as the PID block except
that you cannot have associated math. See page 2-9 for process variable
information, page 2-11 for process setpoint information, page 2-13 for output
information, page 2-15 for controller options, and pages 2-21 to 2-23 for PID
commands and extensions and for a description of the PID options that
apply to the feedforward output adjust block. Also see Section 3.2, “Second
Order Lead Lag,” Section 3.3, “Second Order Lag,” Section 3.4, “First Order
Lead Lag,” and Section 3.5, “First Order Lag,” for a description of the
dynamic options that apply to the feedforward output adjust block.
Controller Options -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Error algorithm type? NORMAL SQUARED DEADBAND
Reverse acting? []
Freeze bias for output out of range? []
Tuning Parameters -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Loop type: PI P PID I PD
Proportional gain: 1.0
Integral time (reset time): 999.99 min
Derivative time (rate): 0.0 min
Derivative gain limiting? [ ]
Limiting coefficient: 10.0
Dynamic Function -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Disturbance variable: xxxxxx.WPV
Dynamic sample time: 1.0 sec
Dynamic function type:
LAG LEAD LAG 2ND ORDER LAG 2ND ORDER LEAD LAG
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Commands and Table 4-5 lists the commands that determine the mode of operation for the
Extensions feedforward output adjust block. These commands operate the same way
that they do for the PID block. See page 2-21 for PID commands.
Command Description
Table 4-6 lists the extensions that you can use to monitor and control and
feedforward output adjust block. See page 2-23 for PID extensions.
Overview The feedforward setpoint adjust block allows you to insert a dynamic block
between the output of a segment of math and the setpoint of a PID loop. The
dynamic block is not required; however, without it, this block has the same
effect as a PID block with associated math in cascade mode. Associated
math is also optional, and you must select it on the form if your application
requires a math section.
Because the feedforward setpoint adjust CFB operates on the output of the
loop, you cannot associate math on the output.
With the dynamic block, the feedforward setpoint adjust block has the
following operation.
When the PID goes into cascade mode (.SMODE = 5), the dynamic block
is initialized using the backward initialization algorithm. (The current
output becomes the initial simulated output condition, and the initial
simulated input condition is computed as the output divided by the
gain.)
After initialization (.SMODE = 6), the block executes the math and
sends the output through the dynamic block. The output of the dynamic
block is used by the PID as the setpoint.
Availability Feedforward setpoint adjust blocks are available for Series 505 and S5
controllers. They are not supported for the 560/560T controllers.
Block Figure 4-9 shows the feedforward setpoint adjust CFB graphic.
Configuration
PV IN
P I D FDFWD
S.P. ADJ.
FEEDFORWARD SETPOINT ADJUST
xxxxxx
Block Name: xxxxxx
OUT
xxxxxx.MTHI
IN
MATH
xxxxxx.PV
PV
DYNAMIC
P I D
OUT
xxxxxx.OUT
Figure 4-10 shows the form that you use to define the feedforward setpoint
adjust block. The shaded entries in the form depend on the previous
selection. The information on the form is the same as the PID block except
that you cannot have associated math. See page 2-9 for process variable
information, page 2-11 for process setpoint information, page 2-13 for output
information, page 2-15 for controller options, and pages 2-21 to 2-23 for PID
commands and extensions and for a description of the PID options that
apply to the feedforward setpoint adjust block. Also see Section 3.2, “Second
Order Lead Lag,” Section 3.3, “Second Order Lag,” Section 3.4, “First Order
Lead Lag,” and Section 3.5, “First Order Lag,” for a description of the
dynamic options that apply to the feedforward setpoint adjust block.
Math Parameters -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Math input name: xxxxxx.MTHI
Math output name: xxxxxx.MTHO
Associate math on cascade? [ ] Press F10 to edit math text
Dynamic Function -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Dynamic function type:
NONE LAG LEAD LAG 2ND ORDER LAG 2ND ORDER LEAD LAG
Second Order Lead Lag -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steady state gain: 1.0 Lead time constant: 5.0
Dead time: 0.0 Time constant: 10.0
2nd time constant: 5.0
Loop Information -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Algorithm type: POSITION VELOCITY
Output Information -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Output name: xxxxxx.OUT S
Limit output between 0% and 100%? [ ]
Minimum output(%): 0.0
Maximum output(%): 100.0
Controller Options -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Error algorithm type? NORMAL SQUARED DEADBAND
Reverse acting? []
Freeze bias for output out of range? []
Tuning Parameters -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Loop type: PI P PID I PD
Proportional gain: 1.0
Integral time (reset time): 999.99 min
Derivative time (rate): 0.0 min
Derivative gain limiting? [ ]
Limiting coefficient: 10.0
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Commands and Table 4-7 lists the commands that determine the mode of operation for the
Extensions feedforward setpoint adjust block. These commands operate the same way
that they do for the PID block. See page 2-21 for PID commands.
Command Description
Table 4-8 lists the extensions that you can use to monitor and control a
feedforward setpoint adjust block. See page 2-23 for PID extensions.
Overview The ratio station block is used to keep a constant ratio between two process
variables. The setpoint to the block is the ratio that you want to maintain
between a controlled variable and an uncontrolled (wild) process variable.
To ensure a bumpless transfer, the algorithm keeps the setpoint and the
output unchanged during the transition from manual or automatic to
cascade mode. Thereafter, the loop uses the following formula to compute
the loop setpoint and bring the process variable to the appropriate value:
When you configure the analog input for the ratio station block, do not
select the No Scaling option for the uncontrolled process variable for a ratio
station block. You can, however, select No Scaling for the controlled process
variable.
Availability Ratio station blocks are available for Series 505 and S5 controllers. They are
not supported for the 560/560T controllers.
Block Figure 4-11 shows the graphic for a ratio station CFB.
Configuration
WPV PV
SP P I D SP
RATIO
STATION
xxxxxx
OUT RATIO STATION
Block Name: xxxxxx
xxxxxx.WPV
WPV
uncontrolled
variable
xxxxxx.RSP AXB xxxxxx.PV
PV
SP controlled
ratio variable
setpoint
+
OFFSET
+
P I D
loop
setpoint xxxxxx
OUT
xxxxxx.OUT
Figure 4-12 shows the form that you use to define the ratio station block.
The shaded entries in the form depend on the previous selection. The
information on the form is the same as the PID block except that you cannot
have associated math.
See page 2-9 for process variable information, page 2-11 for process setpoint
information, page 2-13 for output information, page 2-15 for controller
options, and pages 2-21 to 2-23 for PID commands and extensions and for a
description of the PID options that apply to the the ratio station block.
Loop Information -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Algorithm type: POSITION
Output Information -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Output name: xxxxxx.OUT S
Limit output between 0% and 100%? [X]
Minimum output(%): 0.0
Maximum output(%: 100.0
Controller Options -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Error algorithm type? NORMAL SQUARED DEADBAND
Reverse acting? []
Freeze bias for output out of range? []
Tuning Parameters -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Loop type: PI P PID I PD
Proportional gain: 1.0
Integral time (reset time): 999.99 min
Derivative time (rate): 0.0 min
Derivative gain limiting? [X]
Limiting coefficient: 1 0.0
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Commands and Table 4-9 lists the commands that determine the mode of operation for the
Extensions ratio station block. These commands operate in the same way that they do
for the PID block. See page 2-21 for PID commands.
Command Description
Table 4-10 lists the extensions that you can use to monitor and control and
ratio station block. See page 2-23 for PID extensions.
Overview The APT limiter blocks provide a means to limit the value of an output that
is based on an input. Two basic types of limiter blocks are available:
The output-limiter block checks for an out-of-range input and keeps the
output of the block within the high and low limits that you specify.
Availability Limiter blocks are available for Series 505 and S5 controllers. They are not
supported for the 560/560T controllers.
Inputs and Outputs The input to a limiter block can be a real number, an integer, or an analog
input.
The output responds to the input. If the output is an analog value, APT
assumes that the input is a real number limited to the range of 0.0 to 1.0,
and automatically scales the output to the correct format (zero offset, 20%
bias, or bipolar). If an input is outside this range, the output is set to the
maximum or minimum value of the subtype.
Enabling and All limiter CFBs must be activated with the ENABLE command or with an
Disabling Blocks assignment statement that sets the .ENABL extension to true. See
Figure 5-1. Limiter blocks can also be enabled from an assignment
statement in a math CFB.
A B C D
xxxxxx
E F G H
cfb_name.ENABL := true;
Enable cfb_name;
To deactivate the block, use the DISABLE command with the block name or
set the .ENABL extension to false.
All limiter blocks have a boolean extension (.NRDY) that you can use to
interlock the execution of the block to some external conditions.
If you set the .NRDY extension to true, the block is forced to the disabled
state.
To return the block to the enabled state you must not only set the
.NRDY extension to false but also re-enable the block with a command
or an assignment statement.
Overview The output limiter block limits the value of a variable to within a specified
range.
If the value of the input is less than the value of the low limit, the
output limiter block assigns the value of the low limit to the output.
If the value of the input is greater than the value of the high limit, the
output limiter block assigns the value of the high limit to the output.
Availability Output limiter blocks are available for Series 505 and S5 controllers. They
are not supported for the 560/560T controllers.
Block When you define an output limiter CFB with the form that is shown in
Configuration Figure 5-2, you have the following options.
Add new names: declared variables or dot extensions from other blocks.
OUTPUT LIMITER
IN
OUTPUT
LIMITER
xxxxxx.IN
xxxxxx IN
OUTPUT
OUT LIMITER
xxxxxx
OUT
xxxxxx.OUT
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Input name (IN): name of analog, real, or integer input; default is cfb_name.IN.
Output name (OUT): name of analog, real, or integer output that represents
limited value of the input; default is cfb_name.OUT.
Low limit: value of the low limit; default is zero. The value of the output is never
less than the value of the low limit.
High limit: value of the high limit; default is one. The value of the output is never
greater than the value of the high limit.
Commands and Table 5-1 lists the commands that determine the mode of operation for the
Extensions output limiter block.
Command Description
ENABLE (ENA) Turns on, or activates, the block.
DISABLE (DIS) Turns off, or deactivates, the block.
Table 5-2 lists the extensions that you can use to monitor and control a
output limiter block.
Overview The rate limiter block can be used as a ramp function to restrict the rate of
change of an input.
The rate limiter block executes at the sample rate defined in the form. On
each execution, the block compares the input to the output. If the values of
the input and output are not equal, the rate limiter block lowers or raises
the value of the output to decrease the difference between the two. The rate
at which the value of the output changes is determined by the rate limit
that you specify.
For example, if the initial value of the output is 140.0, the rate limit is 1.0
units/sample, the sample time is 1.0 seconds, and the input is 150.0, the
maximum change each second that the block executes is 1. Therefore, it
takes 10 executions, or 10 seconds, for the output to reach the steady-state
value of the input at 150.0.
If the output is advancing from 140 to 145 in increments of two, the output
sequence is
To ramp an output variable from the current value to another, change the
input value to the desired output. The output then changes to the input at
the rate that you specify.
When the two values are equal, the block sets the .EQ extensions to true.
NOTE: To ensure a bumpless transfer, assign the value of the input to the
output before you enable the block.
Availability Rate limiter blocks are available for Series 505 and S5 controllers. They are
not supported for the 560/560T controllers.
Block When you define a rate limiter CFB with the form that is shown in
Configuration Figure 5-3, you have the following options.
You can use the default names that appear in the form.
You can add new names: declared variables or dot extensions from
other blocks.
RATE LIMITER
IN
RATE
LIMITER
xxxxxx.IN
xxxxxx IN
RATE
OUT LIMITER
xxxxxx
OUT
xxxxxx.OUT
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Input name (IN): name of analog, real, or integer input; default is cfb_name.IN.
Output name (OUT): name of analog, real, or integer output; default is
cfb_name.OUT.
Rate limit: rate of change, in units per sample rate; contains maximum change that
is allowed in the output per execution; default is 1.
Sample rate: specifies, in seconds, how often the block is executed; default is 1. The
range is 0.5 to 4095.0 seconds.
Commands and Table 5-3 lists the commands that determine the mode of operation for the
Extensions rate limiter block.
Command Description
ENABLE (ENA) Turns on, or activates, the block.
DISABLE (DIS) Turns off, or deactivates, the block.
Table 5-4 lists the extensions that you can use to monitor and control a rate
limiter block.
Overview The APT selector blocks provide a means to select one signal from a set of
up to four signals. Four basic types of selector blocks are available:
High, low, and inswitch selectors allow you to choose from four inputs
and send the selected signal to an output.
Median and average selectors allow you to choose from three inputs
and send the median or average value to an output.
The outswitch selector allows you to send an input signal to one of four
outputs.
Availability Selector blocks are available for Series 505 and S5 controllers. They are not
supported for the 560/560T controllers.
If the inputs are integers, APT sends the appropriate value to the
output.
If any inputs are a combination of real and integer values and the
output is an analog value, the selected input is sent directly to the
output with no scaling.
For the high, low, inswitch, and outswitch selector blocks, if the inputs
are all real numbers and the output is an analog value, APT assumes
that the inputs are limited to the range of 0.0 to 1.0 and automatically
scales the output to the correct format (zero offset, 20% offset, or
bipolar). If an input is outside this range, the output is set to the
maximum or minimum value of the subtype.
Enabling and All selector CFBs must be activated with the ENABLE command or with an
Disabling Blocks assignment statement that sets the .ENABL extension to true. See
Figure 6-1. Selector blocks also can be enabled from an assignment
statement in a math CFB.
A B C D
xxxxxx
E F G H
cfb_name.ENABL := true;
Enable cfb_name;
To deactivate the block, use the DISABLE command with the block name or
set the .ENABL extension to false.
All selector blocks have a boolean extension (.NRDY) that you can use to
interlock the execution of the block to some external conditions.
If you set the .NRDY extension to true, the block is forced to the disabled
state.
To return the block to the enabled state you must not only set the
.NRDY extension to false, but you must also re-enable the block with a
command or an assignment statement.
Overview The average selector block computes the numerical average of three inputs.
Before the block performs its calculation, it adds and subtracts from the
median of the three inputs the value that you specify as the maximum
deviation. If an input is outside of this range, that input is not used in the
calculation (the average is computed from the remaining values).
For example, assume three inputs as shown in Figure 6-2: 155, 150, and 160
with a maximum deviation of 2. The median value is 155; the other two
values are outside the range of 155 +/-- 2; therefore, only one value is used
and the output is 155. If, however, the inputs are 155, 162, and 160, the
output would be 161: the average of 160 and 162.
A B C A B C
OUT OUT
155 161
Availability Average selector blocks are available for Series 505 and S5 controllers. They
are not supported for the 560/560T controllers.
Block When you define an average selector CFB with the form that is shown in
Configuration Figure 6-3, you have these options:
You can use the default names that appear in the form. The default
extensions must correspond to the correct slot; i.e., .IN1 or .IIN1 must be
input A, etc.
You can add new names: declared variables or dot extensions from
other blocks.
AVERAGE SELECTOR
A B C
AVERAGE xxxxxx.IN1
SELECT xxxxxx.IN2
xxxxxx.IN3
xxxxxx A B C
OUT AVERAGE
SELECT
xxxxxx
OUT
xxxxxx.OUT
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Input A: name of analog, real, or integer that is first input (A); default is
cfb_name.IN1.
Input B: name of analog, real, or integer that is second input (B); default is
cfb_name.IN2.
Input C: name of analog, real, or integer that is third input (C); default is
cfb_name.IN3.
Output name: name of analog, real, or integer output (OUT) that represents
average of values of inputs that are within maximum deviation of median input;
default is cfb_name.OUT.
Maximum deviation: value of maximum deviation. If the absolute value of the
difference between the median input and any other input is greater than the value
of the maximum deviation, that input is not used in the average calculation.
Commands and Table 6-1 lists the commands that determine the mode of operation for the
Extensions average selector block.
Command Description
ENABLE (ENA) Turns on, or activates, the block.
DISABLE (DIS) Turns off, or deactivates, the block.
Table 6-2 lists the extensions that you can use to monitor and control a
average selector block.
Overview The high selector block selects the highest of up to four enabled inputs and
moves it to the output.
The block automatically enables only those inputs for which you either
enter names or draw graphic connections. Inputs that are neither named
nor graphically connected are automatically disabled. You can also enable
an input by setting the corresponding .SW extension to 1, or you can disable
it by setting the .SW extension to 0.
Availability High selector blocks are available for Series 505 and S5 controllers. They
are not supported for the 560/560T controllers.
Block When you define a high selector CFB with the form shown in Figure 6-4,
Configuration you have the following options:
You can use the default names that appear in the form. The default
extensions must correspond to the correct slot; i.e., .IN1 or .IIN1 must be
input A, etc.
You can add new names: declared variables or dot extensions from
other blocks.
HIGH SELECTOR
A B C D
HIGH xxxxxx.IN1
xxxxxx.IN2
SELECT
xxxxxx.IN3
xxxxxx xxxxxx.IN4
A B C D
OUT
HIGH
SELECTOR
xxxxxx
OUT
xxxxxx.OUT
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Input A: name of analog, real, or integer that is first input (A); default is
cfb_name.IN1; field can be empty.
Input B: name of analog, real, or integer that is second input (B); default is
cfb_name.IN2; field can be empty.
Input C: name of analog, real, or integer that is third input (C); default is
cfb_name.IN3; field can be empty.
Input D: name of analog, real, or integer that is fourth input (D); default is
cfb_name.IN4; field can be empty.
Output name: name of analog, real, or integer output (OUT) that represents value
of highest of enabled inputs; default is cfb_name.OUT.
Commands and Table 6-3 lists the commands that determine the mode of operation for the
Extensions high selector block.
Command Description
ENABLE (ENA) Turns on, or activates, the block.
DISABLE (DIS) Turns off, or deactivates, the block.
Table 6-4 lists the extensions that you can use to monitor and control a high
selector block.
Overview The inswitch selector block allows you to select from among four inputs.
You select the input by setting the value of the .POS (position) extension.
You can set the value of the .POS extension either directly or by using the
SWITCH command in an SFC step.
For example, both of these instructions produce the same result, namely,
they send the input signal C to the output.
block_name .POS := 3;
SWITCH block_name C;
Availability Inswitch selector blocks are available for Series 505 and S5 controllers.
They are not supported for the 560/560T controllers.
Block When you define an inswitch selector CFB with the form in Figure 6-5, you
Configuration have the following options:
You can use the default names that appear in the form. The default
extensions must correspond to the correct slot; i.e., .IN1 or .IIN1 must be
input A, etc.
You can add new names: declared variables or dot extensions from
other blocks.
INSWITCH SELECTOR
A B C D
INSWITCH xxxxxx.IN1
SELECT xxxxxx.IN2
xxxxxx.IN3
xxxxxx xxxxxx.IN4
A B C D
OUT
INSWITCH
SELECT
xxxxxx
OUT
xxxxxx.OUT
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Input A: name of analog, real, or integer that is first input (A); default is
cfb_name.IN1; field can be empty.
Input B: name of analog, real, or integer that is second input (B); default is
cfb_name.IN2; field can be empty.
Input C: name of analog, real, or integer that is third input (C); default is
cfb_name.IN3; field can be empty.
Input D: name of analog, real, or integer that is fourth input (D); default is
cfb_name.IN4; field can be empty.
Output name: name of analog, real, or integer output (OUT) that represents value
of selected input; default is cfb_name.OUT.
Commands and Table 6-5 lists the commands that determine the mode of operation for the
Extensions inswitch selector block.
Command Description
ENABLE (ENA) Turns on, or activates, the block.
DISABLE (DIS) Turns off, or deactivates, the block.
Selects input A, B, C, or D and sends to output; for example
SWITCH
SWITCH block_name A; sends input A to output.
Table 6-6 lists the extensions that you can use to monitor and control a
inswitch selector block.
Overview The low selector block selects the lowest of up to four enabled inputs and
moves it to the output.
The block automatically enables only those inputs for which you either
enter names or draw graphic connections. Inputs that are neither named
nor graphically connected are automatically disabled. You can also enable
an input by setting the corresponding .SW extension to 1, or you can disable
it by setting the .SW extension to 0.
Availability Low selector blocks are available for Series 505 and S5 controllers. They are
not supported for the 560/560T controllers.
Block When you define a low selector CFB with the form that is shown in
Configuration Figure 6-6, you have the following options.
You can use the default names that appear in the form. The default
extensions must correspond to the correct slot; i.e., .IN1 or .IIN1 must be
input A, etc.
You can add new names: declared variables or dot extensions from
other blocks.
LOW SELECTOR
A B C D
LOW xxxxxx.IN1
SELECT xxxxxx.IN2
xxxxxx.IN3
xxxxxx xxxxxx.IN4
A B C D
OUT
LOW
SELECT
xxxxxx
OUT
xxxxxx.OUT
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Input A: name of analog, real, or integer that is first input (A); default is
cfb_name.IN1; field can be empty.
Input B: name of analog, real, or integer that is second input (B); default is
cfb_name.IN2; field can be empty.
Input C: name of analog, real, or integer that is third input (C); default is
cfb_name.IN3; field can be empty.
Input D: name of analog, real, or integer that is fourth input (D); default is
cfb_name.IN4; field can be empty.
Output name: name of analog, real, or integer output (OUT) that represents value
of lowest of enabled inputs; default is cfb_name.OUT.
Commands and Table 6-7 lists the commands that determine the mode of operation for the
Extensions low selector block.
Command Description
ENABLE (ENA) Turns on, or activates, the block.
DISABLE (DIS) Turns off, or deactivates, the block.
Table 6-8 lists the extensions that you can use to monitor and control a low
selector block.
Overview The median selector block selects the numerical median of three inputs.
Availability Median selector blocks are available for Series 505 and S5 controllers. They
are not supported for the 560/560T controllers.
Block When you define a median selector CFB with the form in Figure 6-7, you
Configuration have the following options:
You can use the default names that appear in the form. The default
extensions must correspond to the correct slot; i.e., .IN1 or .IIN1 must be
input A, etc.
You can add new names: declared variables or dot extensions from
other blocks.
MEDIAN SELECTOR
A B C
MEDIAN xxxxxx.IN1
SELECT xxxxxx.IN2
xxxxxx.IN3
xxxxxx A B C
OUT MEDIAN
SELECT
xxxxxx
OUT
xxxxxx.OUT
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Input A: name of analog, real, or integer that is first input (A); default is
cfb_name.IN1.
Input B: name of analog, real, or integer that is second input (B); default is
cfb_name.IN2.
Input C: name of analog, real, or integer that is third input (C); default is
cfb_name.IN3.
Output name: name of analog, real, or integer output (OUT) that represents value
of median of enabled inputs; default is cfb_name.OUT.
Commands and Table 6-9 lists the commands that determine the mode of operation for the
Extensions median selector block.
Command Description
ENABLE (ENA) Turns on, or activates, the block.
DISABLE (DIS) Turns off, or deactivates, the block.
Table 6-10 lists the extensions that you can use to monitor and control a
median selector block.
Overview The outswitch selector block allows you to send an input signal to any one of
four outputs. You select the output by setting the value of the .POS
extension. You can set the value of the .POS extension directly or you can
use the SWITCH command in an SFC step.
For example, both of these instructions produce the same result, namely,
they send the input signal to output C.
block_name .POS := 3;
SWITCH block_name C;
Availability Outswitch selector blocks are available for Series 505 and S5 controllers.
They are not supported for the 560/560T controllers.
Block When you define an outswitch selector CFB with the form in Figure 6-8, you
Configuration have the following options:
You can use the default names that appear in the form. The default
extensions must correspond to the correct slot; i.e., .OUT1 or .IOUT1
must be output A, etc.
You can add new names: declared variables or dot extensions from
other blocks.
APT, also allows you to write directly to the unselected output; e.g., if the
switch is set to A, you can write to the B, C, and D .PVx extensions.
OUTSWITCH SELECTOR
IN
OUTSWITCH xxxxxx.IN
SELECT IN
xxxxxx OUTSWITCH
SELECT
A B C D
xxxxxx
A B CD
xxxxxx.OUT4
xxxxxx.OUT3
xxxxxx.OUT2
xxxxxx.OUT1
Input name (IN): name of analog, real, or integer input; default is cfb_name.IN.
Output A (A): name of analog, real, or integer that is first output; default is
cfb_name.OUT1; field can be empty.
Output B (B): name of analog, real, or integer that is second output; default is
cfb_name.OUT2; field can be empty.
Output C (C): name of analog, real, or integer that is third output; default is
cfb_name.OUT3; field can be empty.
Output D (D): name of analog, real, or integer that is fourth output; default is
cfb_name.OUT4; field can be empty.
Commands and Table 6-11 lists the commands that determine the mode of operation for the
Extensions outswitch selector block.
Command Description
ENABLE (ENA) Turns on, or activates, the block.
DISABLE (DIS) Turns off, or deactivates, the block.
Selects input A, B, C, or D and sends to output; for example
SWITCH
SWITCH block_name A; sends input to output A.
Table 6-12 lists the extensions that you can use to monitor and control a
outswitch selector block.
If you select a low threshold, a boolean output becomes true if the input
value is less than or equal the limit value.
Availability Threshold selector blocks are available for Series 505 and S5 controllers.
They are not supported for the 560/560T controllers.
Block When you define a threshold selector CFB with the form in Figure 6-9, you
Configuration have the following options:
You can use the default names that appear in the form.
You can add new names: declared variables or dot extensions from
other blocks.
THRESHOLD SELECTOR
A
THRESHLD
SELECT
xxxxxx.IN
xxxxxx IN
OUT THRESHOLD
SELECTOR
xxxxxx
OUT
xxxxxx.DOUT
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Input name: name of analog, real or integer input (A); default is cfb_name.IN.
Output name: name of digital output or boolean variable that is output (OUT);
default is cfb_name.DOUT.
Threshold: HIGH or LOW; the default is HIGH.
Threshold value: integer or real value of limit; value must be same type (integer
or real) as input.
Commands and Table 6-13 lists the commands that determine the mode of operation for the
Extensions threshold selector block.
Command Description
ENABLE (ENA) Turns on, or activates, the block.
DISABLE (DIS) Turns off, or deactivates, the block.
Table 6-14 lists the extensions that you can use to monitor and control a
threshold selector block.
The motor position control block allows you to set a motor driven valve
in an intermediate position, neither fully opened or fully closed.
The split range block allows you to use analog outputs for valve control.
The valve sequencer allows you to control two valves with one output.
Availability All valve blocks are available for Series 505 and S5 controllers. They are not
supported for the 560/560T controllers.
Enabling and All valve CFBs must be activated with the ENABLE command or with an
Disabling Blocks assignment statement that sets the .ENABL extension to true. See
Figure 7-1. Valve blocks can also be enabled from an assignment statement
in a math CFB.
A B C D
xxxxxx
E F G H
cfb_name.ENABL := true;
Enable cfb_name;
To deactivate the block, use the DISABLE command with the block name, or
set the .ENABL extension to false.
All valve blocks have a boolean extension (.NRDY) that you can use to
interlock the execution of the block to some external conditions.
If you set the .NRDY extension to true, the block is forced to the disabled
state.
To return the block to the enabled state you must not only set the
.NRDY extension to false, but you must also re-enable the block with an
enable command or an assignment statement.
Overview The motor position control block is used to drive a motor-driven valve to an
intermediate position between 0 and 100%. The motor-driven valve is a
device (VMD) that you define in the Device Definition Table.
The input to the block is a feedback signal that indicates the position of the
valve. The setpoint should be a real value between 0.0 and 1.0. The
algorithm compares the input to the setpoint.
If the difference between the input and the setpoint is outside the
range specified by the dead zone, the signals that open and close the
valve are manipulated.
If the difference between the input and the setpoint is within the dead
zone, no control action is taken.
The dead zone is entered in the form as a percentage (0 to 100). If you want
to change the dead zone from the program, write a value that is between 0.0
and 1.0 to the .DBAND (dead band) extension.
The motor position control block expects the valve to be in a locked state.
(See the “Devices” chapter in the APT Programming Reference (Tables)
Manual for information about locking a motor-driven valve.) If the block is
enabled and the valve is not locked, the block does not execute until the
valve is locked. The block does not check any other status bits that are
associated with the valve. Every time the block is enabled, the value of the
input is copied to the setpoint, effecting a “bumpless” transfer.
Availability The motor position control block is supported for Series 505 and S5
controllers, but not the 560/560T controllers.
Block When you define a motor position control CFB with the form in Figure 7-2,
Configuration you have the following options:
You can use the default names that appear in the form.
You can add new names: declared variables or dot extensions from
other blocks.
xxxxxx
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Position feedback: name of analog or real input (PV) that represents position
feedback of valve as a scaled value between 0 and 1; default is cfb_name.IN.
Setpoint: name of real variable (SP) that represents setpoint (desired position of
valve) as a scaled value between 0 and 1; default is cfb_name.SP.
Device: name of motor-driven valve (type VMD) that is to be controlled by this
block; device is configured in Device Definition Table.
Dead zone(%): size of dead zone as a percentage (0 to 100); default is 0.1.
Commands and Table 7-1 lists the commands that determine the mode of operation for the
Extensions motor position control block.
Command Description
ENABLE (ENA) Turns on, or activates, the block.
DISABLE (DIS) Turns off, or deactivates, the block.
Table 7-2 lists the extensions that you can use to monitor and control a
motor position control block.
Overview The proportional time control block is used to make an on/off device act like
a continuous device. This block allows you to set an output to true for a
specified fraction of its duty cycle and to false the rest of the time.
The input to the block specifies the fraction of the time that the control
output should be true (open or running for devices). The duty cycle specifies
how often the algorithm should re-evaluate the on/off time of the output.
For example, if the duty cycle is 10 seconds and the input variable is 0.5, the
output is true for five seconds and false for five seconds. At the end of each
ten-second period, the input is re-evaluated to determine the on/off time for
the output.
Any device except a two-speed or reversible motor can be used with the
proportional time control block. See the “Devices” chapter in the APT
Programming Reference (Tables) Manual for information about these
devices.
Availability The proportional time control block is supported for both Series 505 and S5
controllers, but not for the 560/560T controllers.
Block When you define a proportional time control CFB with the form that is
Configuration shown in Figure 7-3, you have the following options:
You can use the default names that appear in the form.
You can add new names: declared variables or dot extensions from
other blocks.
xxxxxx
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Input name: name of real input (IN) that represents fraction of duty cycle during
which the output is true; value must be between 0.0 and 1.0; default is cfb_name.IN.
Output name: name of output (OUT); name can be boolean or discrete variable or
name of device (VSS, VMD, VSD, VSN, VDD, MDS, MDN, MSN, MSS). The
specified output becomes true for the fraction of the duty cycle specified by input; it
has a value of false for the remainder of the duty cycle; default is cfb_name.DOUT.
Duty cycle: duration of duty cycle, in seconds; value depends on the timer
compiled. An initial value 32 seconds generates a fast timer. A fast timer has a
range of 0.001 to 32.767 seconds in 0.001 second increments. An initial value > 32
seconds generates a slow timer. A slow timer has a range of 0.1 to 3276.7 seconds in
0.1 second increments. If you have an S5 controller, APT automatically assigns you
the slow timer.
During operation, the range for the duty cycle dot extension value is limited to the
range of the timer generated. Although you can enter a specific duty cycle, the
execution time of the CFB is determined in part by how fast the associated SFPGM
for Series 505 can be executed, or how fast the scan time is for S5 controllers.
! WARNING
APT allows the duty cycle of the proportional time control block to be changed
while the block is enabled. The new duty cycle value does not take effect
immediately.
Changing the value could cause unpredictable and/or unsafe process operation
that could result in death or serious injury to personnel, and/or equipment
damage.
Always disable the proportional time control block before changing the value of
the duty cycle.
Commands and Table 7-3 lists the commands that determine the mode of operation for the
Extensions proportional time control block.
Command Description
ENABLE (ENA) Turns on, or activates, the block.
DISABLE (DIS) Turns off, or deactivates, the block.
Table 7-4 lists the extensions that you can use to monitor and control a
proportional time control block.
Overview The split range block allows you to split an input signal into two output
signals. The input must be a real number between 0 and 1.
As the input signal changes from 0.0 to 1.0, the two outputs change. When
you define the block, you enter the input range that specifies the input at
which each output first reaches the 0.0% state.
When the input is 0.0, the first output (A) is 100% (1.0); the second
output (B) is 0.0% (0.0). If the reverse scaling option is selected, both
outputs (A and B) are 0.0% (0.0). See Figure 7-4.
When the input is 1.0, the first output (A) is 0.0% (0.0); the second
output (B) is 100.0% (1.0). If the reverse scaling option is selected, both
outputs (A and B) are 100% (1.0). See Figure 7-4.
Breakpoints can overlap so that at some time both outputs are non-zero
over some range of input values. Also, the breakpoint ranges can be set so
that there is a band of input ranges over which both outputs are 0.0.
If either output is an analog output, the split range block scales the outputs
to the appropriate ranges that you specify for the analog outputs. An
extension is also created (.OUT) that contains the scaled real value (0.0 to
1.0) of the output.
When the split range block is not active, the outputs are not updated by the
split range block.
If you want to modify the outputs when the block is disabled, you must
write the correct values to the analog outputs. For example, if the first
output is a 20% offset signal, then you must write the appropriate
value to the analog variable to force the signal to its zero value. For
Series 505 controllers the value is 6400; for S5 controllers, the value is
512.
For Output 1, to use the split range with a reverse-acting activator (i.e., air
to close), place an X in the Reverse Scaling field, shown in the dialogue
window below.
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
In the scale block, specify that “as the input changes from 1.0 to 0.0,
the output changes from 0.0 to 1.0.”
Define the output of the scale block as the desired analog output
variable.
Availability The split range block is supported for both Series 505 and S5 controllers,
but not for the 560/560T controllers.
Block When you define a split range CFB with the form that is shown in
Configuration Figure 7-5, you have the following options:
You can use the default names that appear in the form.
You can add new names: declared variables or dot extensions from
other blocks.
SPLIT RANGE
IN
SPLIT
RANGE xxxxxx.IN
IN
xxxxxx
SPLIT
OUT1 OUT2 RANGE
xxxxxx
OUT1 OUT2
xxxxxx.OUT2
xxxxxx.OUT!
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Input name: name of real input (IN); value must be between zero and one; default
is cfb_name.IN.
Output 1: name of analog, integer or real that is first output (OUT1); default is
cfb_name.OUT1.
Output 2: name of analog, integer or real that is second output (OUT2); default is
cfb_name.OUT2.
As the input changes from 0% to _____ output 1 changes from 100% to 0%:
breakpoint of the first range; that is, the percentage of input at which the value of
the first output is zero; default is 49.5. If the reverse scaling option is selected, the
first output (A) is 100% (1.0); the second output (B) is 0% (0.0). If you want Output 2
to do reverse-scaling, connect the real output of the split-range block to a scale
block.
As the input changes from _____ to 100% output 2 changes from 0% to 100%:
breakpoint of the second range; that is, the percentage of input at which the value of
the second output is zero; default is 50.5.
Is Output 1 Air-to-close (reverse scaling): output 1 changes from 0% to 100% as
input changes from 0% to_____%.
Commands and Table 7-5 lists the commands that determine the mode of operation for the
Extensions split range block.
Command Description
ENABLE (ENA) Turns on, or activates, the block.
DISABLE (DIS) Turns off, or deactivates, the block.
Table 7-6 lists the extensions that you can use to monitor and control a split
range block.
Overview The valve sequencer block manipulates two continuous control valves with a
single output. A control I/O point determines which valve responds to the
output signal.
The output of the valve sequencer block controls two valves: one must be an
“energize open” (EO) valve, and the other must be an “energize close” (EC)
valve.
One valve is associated with the false value of the control I/O point and the
other with the true value. When the output signal reaches the increasing
switch point, the “false” valve is fully open. When the output signal reaches
the decreasing switch point, the “true” valve is at a fully closed position.
You can select valve action of either direct or reverse if the output is an
integer or an analog output.
input
output =
Z + ((1 − Z) × input)
where Z = ¯rangeability
1
Availability The valve sequencer block is supported for Series 505 and S5 controllers,
but not the 560/560T controllers.
Block When you define a valve sequencer with the form that is shown in
Configuration Figure 7-6, you have the following options:
You can use the default names that appear in the form.
You can add new names: declared variables or dot extensions from
other blocks.
VALVE SEQUENCER
IN
VALVE
SEQUENCR
xxxxxx.IN
xxxxxx IN
OUT VALVE
SEQUENCER
xxxxxx
xxxxxx.OUT
OUT
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Commands and Table 7-7 lists the commands that determine the mode of operation for the
Extensions valve sequencer block.
Command Description
ENABLE (ENA) Turns on, or activates, the block.
DISABLE (DIS) Turns off, or deactivates, the block.
Table 7-8 lists the extensions that you can use to monitor and control a
valve sequencer block.
Overview The APT math control blocks provide continuous math operations. Three
basic types of math control blocks are available:
The math block is similar to the interlock block except that it can be
enabled and disabled. If you want to solve an involved equation, use
this math block instead of combining arithmetic blocks.
PV IN
SP SP
SCALE
P I D
xxxxxx xxxxxx
OUT OUT
A B
(A+B)
xxxxxx
PV
OUT SP SP
P I D
xxxxxx
OUT
To ensure that math is executed synchronously with a PID, make sure that you
include math for a PID within the associated math section for that PID.
The scale and summer CFBs in this example can be replaced by math statements in
the associated math section of the PID CFB in the top left corner.
See Chapter 10 for more information about how APT compiles math blocks
into STL, RLL, and SFPGM code.
Inputs and Outputs The inputs to math control blocks can be analog inputs, integers, or real
numbers.
If the .OUT extension variable is an integer and the inputs are not
integers, .OUT is assigned the appropriate value rounded to the nearest
integer.
Overview The absolute value block computes the absolute value of a variable.
When you define an absolute value CFB with the form in Figure 8-2, you
have the following options:
You can use the default names that appear in the form.
You can add new names: declared variables or dot extensions from
other blocks.
ABSOLUTE VALUE
A
|A|
xxxxxx.IN
xxxxxx A
OUT |A|
xxxxxx
OUT
xxxxxx.OUT
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Availability The absolute value block is supported for Series 505 and S5 controllers, but
not for the 560/560T controllers.
Extensions Table 8-1 lists the extensions that you can use to monitor and control an
absolute value block.
8.3 Divider
Overview The divider block divides one input variable by another input variable.
When you define a divider CFB with the form that is shown in Figure 8-3,
you have the following options:
You can use the default names that appear in the form.
You can add new names: declared variables or dot extensions from
other blocks.
DIVIDER
A B
(A/B) xxxxxx.IN1
xxxxxx.IN2
xxxxxx A B
(A/B)
OUT
xxxxxx
OUT
xxxxxx.OUT
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Input A: name of analog, integer, or real input (A) that is dividend; default is
cfb_name.IN1.
Input B: name of analog, integer, or real input (B), which represents divisor; default
is cfb_name.IN2.
Output name: name of analog, integer, or real output (OUT), which represents
quotient of inputs; default is cfb_name.OUT.
Availability The divider block is supported for Series 505 and S5 controllers, but not for
the 560/560T controllers.
Divider (continued)
Extensions Table 8-2 lists the extensions that you can use to monitor and control a
divider block.
8.4 Interlock
Overview The interlock block allows you to use the Math Language to create a CFB
that executes continuously. The interlock block is a continuous block that
has no inputs or outputs and that cannot be disabled.
NOTE: If you place an INIT section in an interlock block, the INIT section
executes only on the first scan following a transition to RUN mode after
download (one time only).
High-priority interlocks are executed before SFCs, other CFBs, and devices.
Low-priority interlocks are executed after devices. Refer to Chapter 2 in the
SIMATIC APT Applications Manual for more details.
Figure 8-4 shows the form that you use to define an interlock block.
INTERLOCK
INTERLOCK
xxxxxx
INTERLOCK
xxxxxx
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Interlock (continued)
The following math code insures that the valve is always closed unless
the motor is running.
valve1.NRDY := motor1.STPPD
The .NRDY bit of the valve depends on the state of the motor (running
or stopped).
NOTE: For Series 505 controllers, a high or low priority affects an interlock
block only if that block is composed entirely of RLL code. If a block contains
any SFPGM code, the selection of high or low priority has no effect on the
execution of that block. (See page 10-4 in Chapter 10, “Math Language
Overview,” for more information on RLL and SFPGM code.)
8.5 Math
Overview The math block allows you to use the full power and flexibility of the Math
Language to write your own controller code. See Chapter 10, “Math
Language Overview,” and Chapter 11, “Math Functions and Procedures,” for
an explanation of the Math Language.
Controlling Speed A math block executes only when enabled. The speed of execution is
of Series 505 Math determined both by the controller and by the type of code generated. All
Execution programming is done in STL for S5 controllers. However, if you have a
Series 505 controller, your execution speed depends on the type of code used
to perform your math operations. RLL executes more quickly than SFPGM.
For a Series 505 controller, RLL is generated for the block if all
operations are boolean, integer, or real number assignments, as shown
in the following examples:
real_variable := 5.0 ;
real_variable1 := real_variable2;
array1[1] := 5;
For a Series 505 controller, SFPGM code is generated when you use
any real-number operations, or when you use any SF address types,
such as T-memory direct addresses, as shown in the following
examples:
If you have a Series 505 controller, balance your code between RLL and
SFPGM in order to maximize controller utilization.
Math (continued)
Figure 8-5 shows the form that you use to define a math block. You can
select from the following types: continuous, event, sampled, or active.
A sampled block executes at intervals that you specify. The sample time
is a compiled variable that cannot be changed at run time. The sample
time is a read-only real value that is stored at address “%T4” for a
Series 505 controller performing an SFPGM math operation, or at
address CFBname.NNL.PRE for an S5 controller or a Series 505
controller performing an RLL math operation. For S5 controllers, the
sample time value is in tenths of seconds.
! WARNING
An event math block will be queued for execution if the enable for the block was
set when the controller transitions to the RUN mode.
Control devices can operate in an unpredictable manner and fail in an unsafe
condition that could result in death or serious injury to personnel, and/or
damage to equipment.
The enable for the event math block needs to be reset to false immediately after
the block finishes execution. Design your code to handle enabling and
disabling of the math block enable after a transition to RUN mode.
MATH
A B C D
MATH
A B C D
xxxxxx MATH
E F G H
xxxxxx
E F G H
Input A: name of real, integer, boolean, or APT flag variable that is input (A).
Input B: name of real, integer, boolean, or APT flag variable that is input (B).
Input C: name of real, integer, boolean, or APT flag variable that is input (C).
Input D: name of real, integer, boolean, or APT flag variable that is input (D).
Output E: name of real, integer, boolean, or APT flag variable that is output (E).
Output F: name of real, integer, boolean, or APT flag variable that is output (F).
Output G: name of real, integer, boolean, or APT flag variable that is output (G).
Output H: name of real, integer, boolean, or APT flag variable that is output (H).
NOTE: You can enter extension variables in the fields on the form and
avoid defining these variables in the Declaration Table. For example, enter
cfb_name.IN1 for Input A, cfb_name.IN2 for Input B, etc.
Math (continued)
Enabling and All math CFBs, except for active types, must be activated with the ENABLE
Disabling Blocks command or with an assignment statement that sets the .ENABL extension
to true. See Figure 8-6. Math blocks can also be enabled from an assignment
statement in a math CFB.
A B C D
xxxxxx
E F G H
cfb_name.ENABL := true;
enable cfb_name;
To deactivate the block, use the DISABLE command with the block name or
set the .ENABL extension to false. Active-type math CFBs cannot be
deactivated.
All math blocks have a boolean extension (.NRDY) that you can use to
interlock the execution of the block to some external conditions.
If you set the .NRDY extension to true, the block is forced to the disabled
state.
To return the block to the enabled state you must not only set the
.NRDY extension to false, but you must also re-enable the block with a
command or an assignment statement.
Commands and Table 8-3 lists the commands that determine the mode of operation for the
Extensions math block.
Command Description
ENABLE (ENA) Turns on, or activates, the block.
DISABLE (DIS) Turns off, or deactivates, the block.
Table 8-4 lists the extensions that you can use to monitor and control a
math block.
8.6 Multiplier
Overview The multiplier block multiplies one input variable by another input
variable.
When you define a multiplier CFB with the form in Figure 8-7, you have the
following options:
You can use the default names that appear in the form.
You can add new names: declared variables or dot extensions from
other blocks.
MULTIPLIER
A B
(AxB) xxxxxx.IN1
xxxxxx.IN2
xxxxxx A B
(AxB)
OUT
xxxxxx
OUT
xxxxxx.OUT
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Input A: name of analog, integer, or real that is first input (A), which represents
multiplicand; default is cfb_name.IN1.
Input B: name of analog, integer, or real that is second input (B), which represents
multiplier; default is cfb_name.IN2.
Output name: name of analog, integer, or real output (OUT), which represents
product of inputs; default is cfb_name.OUT.
Availability The multiplier block is supported for Series 505 and S5 controllers, but not
for the 560/560T controllers.
Extensions Table 8-5 lists the extensions that you can use to monitor and control a
multiplier block.
8.7 Square
When you define a square CFB with the form in Figure 8-8, you have the
following options:
You can use the default names that appear in the form.
You can add new names: declared variables or dot extensions from
other blocks.
SQUARE
A
A2
xxxxxx.IN
xxxxxx A
OUT A2
xxxxxx
OUT
xxxxxx.OUT
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Input name: name of analog, integer, or real input (A); default is cfb_name.IN.
Output name: name of analog, integer, or real output (OUT) that represents
square of input; default is cfb_name.OUT.
Availability The square block is supported for Series 505 and S5 controllers, but not for
the 560/560T controllers.
Extensions Table 8-6 lists the extensions that you can use to monitor and control a
square block.
Overview The square root block computes the square root of a variable. The input
must be a positive real number; otherwise,the output is invalid.
When you define a square root CFB with the form in Figure 8-9, you have
the following options:
You can use the default names that appear in the form.
You can add new names: declared variables or dot extensions from
other blocks.
SQUARE ROOT
A
A
xxxxxx.IN
xxxxxx A
OUT A
xxxxxx
OUT
xxxxxx.OUT
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Input name: name of analog, integer, or real input (A); default is cfb_name.IN.
Output name: name of analog, integer, or real output (OUT), which represents
square root of the input; default is cfb_name.OUT.
Availability The square root block is supported for Series 505 and S5 controllers, but not
for the 560/560T controllers.
Extensions Table 8-7 lists the extensions that you can use to monitor and control a
square root block.
8.9 Subtractor
Overview The subtractor block subtracts one input variable from another input
variable.
When you define a subtractor CFB with the form in Figure 8-10, you have
the following options:
You can use the default names that appear in the form.
You can add new names: declared variables or dot extensions from
other blocks.
SUBTRACTOR
A B
(A--B) xxxxxx.IN1
xxxxxx.IN2
xxxxxx A B
(A--B)
OUT
xxxxxx
OUT
xxxxxx.OUT
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Input A: name of analog, integer, or real that is first input (A), which represents
minuend; default is cfb_name.IN1.
Input B: name of analog, integer, or real that is second input (B), which represents
subtrahend; default is cfb_name.IN2.
Output name: name of analog, integer, or real output (OUT), which represents
difference of inputs; default is cfb_name.OUT.
Availability The subtractor block is supported for Series 505 and S5 controllers, but not
for the 560/560T controllers.
Extensions Table 8-8 lists the extensions that you can use to monitor and control a
subtractor block.
8.10 Summer
Overview The summer block adds one input variable to another input variable.
When you define a summer CFB with the form in Figure 8-11, you have the
following options:
You can use the default names that appear in the form.
You can add new names: declared variables or dot extensions from
other blocks.
SUMMER
A B
(A+B) xxxxxx.IN1
xxxxxx.IN2
xxxxxx A B
(A+B)
OUT
xxxxxx
OUT
xxxxxx.OUT
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Input A: name of analog, integer, or real that is first input (A), which represents the
first addend; default is cfb_name.IN1.
Input B: name of analog, integer, or real second input (B), which represents the
second addend; default is cfb_name.IN2.
Output name: name of analog, integer, or real output (OUT), which represents the
sum of the inputs; default is cfb_name.OUT.
Availability The summer block is supported for Series 505 and S5 controllers, but not for
the 560/560T controllers.
Extensions Table 8-9 lists the extensions that you can use to monitor and control a
summer block.
Overview APT provides several other functions that are available as continuous
function blocks.
The scale block converts an input value to an output that is within the
specified range.
Availability All of the functions above are supported for Series 505 and S5 controllers.
None of the functions listed above are supported for the 560/560T
controllers.
Enabling and These CFBs must be activated with the ENABLE command, or with an
Disabling Blocks assignment statement that sets the .ENABL extension to true. See
Figure 9-1. These blocks can also be enabled from an assignment statement
in a math CFB.
A B C D
xxxxxx
E F G H
cfb_name.ENABL := true;
Enable cfb_name;
To deactivate the block, use the DISABLE command with the block name, or
set the .ENABL extension to false.
These control blocks have a boolean extension (.NRDY) that you can use to
interlock the execution of the block to some external conditions.
If you set the .NRDY extension to true, the block is forced to the disabled
state.
To return the block to the enabled state you must not only set the
.NRDY extension to false, but you must also re-enable the block with a
command or an assignment statement.
Overview The anti-reset windup protection/constraint type block protects the integral
mode of a PID loop from windup by ensuring that a monitored variable
remains within specified limits.
This block can be used when constraints within the control loop can be
reached without being detected by the anti-reset windup protection that is
internal to the PID block. This block is useful when you have two cascaded
loops and the output of the source loop is greater than the output of the
second loop.
The input to the block is the analog or real value that you want to monitor.
When the protected PID is in automatic or cascade mode and the constraint
block is enabled, the block compares the monitored variable (input) with the
high and low limits that you specify when you define the constraint block.
The block freezes the bias (the integral term) of the protected PID as
follows:
If the monitored variable is within the limits, the current value of the
.BIAS (bias) extension is stored internally; and the .AWS (anti-windup
status) extension is set to 0 to indicate normal loop operation.
If the monitored variable goes below the value of the .LLIM (low limit)
extension while the loop is still trying to decrease the output, the
constraint block freezes the bias at the last recorded value; and the
.AWS extension is set to 1.
If the monitored variable exceeds the value of the .HLIM (high limit)
extension while the loop is still trying to increase the output, the
constraint block freezes the bias at the last recorded value before the
constraint was exceeded; and the .AWS extension is set to 2.
NOTE: If the PID loop executes faster than the anti-reset windup
protection/constraint CFB, then the CFB cannot protect the loop from
windup. In this case, you must write code in the associated math section of
the PID to provide the windup protection.
Block Figure 9-2 shows the form that you use to define the constraint type of
Configuration anti-reset windup protection.
IN
ANTI-RESET WINDUP (CONSTRAINT TYPE)
EARWP
CONSTRAIN
xxxxxx IN
EARWP
CONSTRAINT
xxxxxx
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Name: unique name that identifies block (eight characters maximum); default is
name that you entered when you created the CFB graphic.
Description: 30 characters maximum (optional)
Monitored variable: name of analog or real input that is monitored variable (.IN).
Protected loop: name of PID loop that is protected by this block.
Low limit: real number below which the monitored variable must not fall.
High limit: real number above which the monitored variable must not rise.
Commands and Table 9-1 lists the commands that determine the mode of operation for this
Extensions anti-reset windup block.
Command Description
ENABLE (ENA) Turns on, or activates, the block.
DISABLE (DIS) Turns off, or deactivates, the block.
Table 9-2 lists the extensions that you can use to monitor and control this
anti-reset windup block.
Overview The anti-reset windup protection/select type block protects the integral
mode of a PID loop from windup by ensuring that the output of the PID loop
remains equal to the value of a monitored variable.
This block can be used when a PID loop does not have a direct path to the
controlled variable. For example, if you have a selector block monitoring the
output of two PID blocks, you can use two select type anti-reset windup
blocks to compare the output of the selector block with each PID output.
The input to the block is the analog or real value that you want to monitor.
When the protected PID loop is in automatic or cascade mode and the select
block is enabled, the block compares the monitored variable (input) to the
output of the loop that you specify.
The block freezes the bias (the integral term) of the protected PID as
follows:
If the monitored variable and output do agree, the current value of the
.BIAS (bias) extension is stored internally; and the .AWS (anti-windup
status) extension is set to 0 to indicate normal loop operation.
If the monitored variable and output do not agree, the select block sets
the bias equal to the monitored variable; and the .AWS extension is set
to 3.
NOTE: If the PID loop executes faster than the anti-reset windup
protection/select CFB, then the CFB cannot protect the loop from windup.
In this case, you must write code in the associated math section of the PID
to provide the windup protection.
Block Figure 9-3 shows the form that you use to define the select type of anti-reset
Configuration windup protection.
IN
ANTI-RESET WINDUP (SELECT TYPE)
EARWP
SELECT
xxxxxx IN
EARWP
SELECT
xxxxxx
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Name: unique name that identifies block (eight characters maximum); default is
name that you entered when you created the CFB graphic.
Description: 30 characters maximum (optional)
Monitored variable: name of analog, integer, or real input that is monitored input
(IN).
Protected loop: name of PID loop that is protected by this block.
Commands and Table 9-3 lists the commands that determine the mode of operation for this
Extensions anti-reset windup block.
Command Description
ENABLE (ENA) Turns on, or activates, the block.
DISABLE (DIS) Turns off, or deactivates, the block.
Table 9-4 lists the extensions that you can use to monitor and control this
anti-reset windup block.
Overview The correlated lookup table block determines an output value based on the
relationship between an input value and a specified range of values.
If the input is a real number and the output is an analog value, APT
assumes that the input is limited to the range of 0.0 to 1.0 and
automatically scales the output to the correct format (zero offset, 20%
bias, or bipolar). If an input is outside this range, the output is set to
the maximum or minimum value of the subtype.
The input and output arrays must contain 11 elements. The values in
the input array must be arranged in ascending order.
Availability The correlated lookup table type block is supported for Series 505 and S5
controllers, but not for the 560/560T controllers.
If the input value is equal to the value of an element of the input array,
the output is assigned the value of the same element number in the
output array.
If the input value is not equal to the value of an element of the input
array, the block uses the value of the highest element of the input array
that is not greater than the input value. The output is assigned the
value of the same element number in the output array.
If the input value is less than the value of the first element of the input
array, the output is assigned the value of the first element of the output
array.
If the input value is greater than the value of any element of the input
array, the output is assigned the value of the last element of the output
array.
If you select Interpolation, the block first compares the input value to the
values in the input array. The block determines the value of the output with
one of the following techniques:
If the input value is equal to the value of an element of the input array,
the output is assigned the value of the same element number in the
output array.
If the input value falls between the values of two elements of the input
array, the output is assigned a value between the values of the same
two element numbers in the output array. The value assigned to the
output is interpolated between the values of the elements of the output
array using the linear relationship calculated between the input value
and the values of the elements of the input array.
If the input value is less than the value of the first element of the input
array, the output is assigned a value less than the value of the first
element of the output array. The value assigned to the output is
extrapolated from the values of the first two elements of the output
array using the linear relationship calculated between the input value
and the values of the first two elements of the input array.
If the input value is greater than the value of the last element of the
input array, the output is assigned a value greater than the value of the
last element of the output array. The value assigned to the output is
extrapolated from the values of the last two elements of the output
array using the linear relationship calculated between the input value
and the values of the last two elements of the input array.
When you define a correlated lookup table CFB with the form that is shown
in Figure 9-4, you have the following options:
You can use the default names that appear in the form.
You can add new names: declared variables or dot extensions from
other blocks.
OUT LOOKUP
TABLE
xxxxxx
OUT
xxxxxx.OUT
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Commands and Table 9-5 lists the commands that determine the mode of operation for this
Extensions correlated lookup table block.
Command Description
ENABLE (ENA) Turns on, or activates, the block.
DISABLE (DIS) Turns off, or deactivates, the block.
Table 9-6 lists the extensions that you can use to monitor and control this
correlated lookup table block.
9.5 Scale
Overview The scale block transforms an input value to an output value by scaling the
value between specified input and output ranges.
If the input is a real number and the output is an analog value, APT
assumes that the input is limited to the input range and automatically
scales the output to the correct format (zero offset, 20% bias, or
bipolar). If an input is outside this range, the output is set to the
maximum or minimum value of the subtype.
The scale block allows you to define an input range and an output range.
The block converts an input value to an output value by using the formula:
The initial values of the high and low ranges are defined in the form and
stored in extension variables that can be changed from the program.
A scale block can be used to change a 0.0 to 1.0 range signal to a 1.0 to 0.0
signal. For example, if you want to use the output from a block to drive a
reverse-acting control valve, you can use a scale block to provide the correct
inversion. For reverse-acting block execution, set the values in the scale
form for the input to range from 1 to 0, and the values for the output to
range from 0 to 1.
For Series 505 controllers, the analog output always ranges from 0 to 32000
(zero offset), from 6400 to 32000 (20% bias), or from --32000 to +32000
(bipolar). For S5 controllers, the analog output ranges are from 0 to 1024
(zero offset), or from --1024 to 1024 (bipolar).
Availability The scale block is supported for Series 505 and S5 controllers, but not for
the 560/560T controllers.
Block When you define a scale CFB with the form that is shown in Figure 9-5, you
Configuration have the following options:
You can use the default names that appear in the form.
You can add new names: declared variables or dot extensions from
other blocks.
Scale (continued)
SCALE
IN
SCALE
xxxxxx.IN
IN
xxxxxx
SCALE
OUT
xxxxxx
OUT
xxxxxx.OUT
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Commands and Table 9-7 lists the commands that determine the mode of operation for this
Extensions scale block.
Command Description
ENABLE (ENA) Turns on, or activates, the block.
DISABLE (DIS) Turns off, or deactivates, the block.
Table 9-8 lists the extensions that you can use to monitor and control this
scale block.
Math Blocks The Math Language is a text-based programming language that you use to
perform arithmetic calculations and logical operations. A sequence of Math
Language statements is called a “math block.” You can use math blocks in
two different areas of APT:
A B C D E F G H I J K L M N O P Q R S T U V W X Y
10
A B C D
MATH
TOL_CAL
E F G H
TOL_CAL LINE 4
Types of Math For S5 controllers, APT compiles all math blocks into STL (Statement List)
Block Code code. However, for Series 505 controllers, math blocks can be compiled into
either RLL (Relay Ladder Logic) code or SFPGM (Special Function
Program) code. Certain Math Language statements can be compiled only
into RLL code; other statements can be compiled only into SFPGM code; and
some are non-exclusive and can be compiled into either type of code.
If you have a Series 505 controller, bear in mind that you cannot mix
RLL-only statements and SFPGM-only statements in the same math block.
For example, a math block that contains an RLL-only statement cannot also
contain an SFPGM-only statement. You can include non-exclusive
statements in any math block. Use the PRAGMA statement, described later
in this chapter, when you intend a math block to be only RLL or only
SFPGM code. Table 11-1 and Table 11-2 in Chapter 11 list the math
procedures and functions and identify whether they are for RLL only,
SFPGM only, or both.
Key Words Used by The Math Language described in this chapter includes key words APT
APT defines for one and only one purpose.
Data types are declared in a math block by using key words such as
BOOLEAN, INTEGER, REAL.
User-defined When you name a program, unit, SFC, or CFC, you are creating a
Identifiers user-defined identifier. Identifiers that you use in a math block are created
in one of the following ways:
You can use the Declaration Editor to declare APT flags, constants,
variables, arrays, timers, and counters that you want to have available
at the program or unit level.
You can use the I/O Symbolic Name Table, Device Definition Table,
Recipe Usage Table, and Continuous Function Chart (CFC) Editor to
name objects in APT.
System-defined APT defines extensions that are associated with APT objects: programs,
Extensions units, devices, I/O points, and CFBs. You can use the names of these objects
with an extension as identifiers in the Math Language. For a list of
extensions associated with objects see the chapter containing information
about the object.
unit1.ENABL
User-defined System-defined
identifier extensions
valv10.OPND
User-defined APT allows you to create user-defined extensions in a recipe. You can use
Extensions these extensions with recipe variables in the Math Language. See the
“Recipes” Chapter in the SIMATIC APT Programming Reference (Tables)
Manual for information about recipes and user-defined extensions.
Overview APT allows you to access memory addresses directly by using a percent sign
(%) prefix. The types of direct memory addressing available depend on the
kind of controller you have.
Reserved memory (S5 and Series 505) Allows you to use memory
locations that you reserve before compiling the program.
Status word memory (Series 505 only) Allows you to read status
words that contain operational information about your Series 505
controller.
System Data Area (RS) memory (S5 only) Allows you to read the
internal system parameters that contain operational information about
your S5 controller.
Series 505 controllers can use direct memory addresses in the Math
language. S5 controllers cannot, except in the IN_ASM math statements,
which are described in Appendix C, “Inline Assembly Code.” See Appendix B
of this manual for a discussion of how direct memory addressing works in
APT for Series 505 and S5 controllers.
Overview The Math Language is a “strongly typed” language; that is, you must
declare the type of each constant and variable in the program. The following
are valid numeric data types in the Math Language: INTEGER, REAL
(floating point), and BOOLEAN. See the “APT Declarations” chapter in the
SIMATIC APT Programming Reference (Tables) Manual for an explanation
of the naming conventions for constants and variables.
The procedures and functions described in this chapter accept only certain
types of values as parameters; specifying a value with an invalid type
causes an error.
1 ( )
2 unary --, unary +, NOT
3 ** (power)
4 *, /, MOD,
5 +, --
6 <, <=, >, >=, =, <>
7 AND
8 XOR
9 OR
10 := (assignment)
Precedence Numeric
Operator Operation Example
Level Result
* Multiplication 4 4*6 24
/ Division 1 4 3/2 1
MOD Modulo 4 27 MOD 12 3
+ Addition 5 4+6 10
-- Subtraction 5 4 -- 6 --2
AND Logical AND 7 #2#1100 AND #2#0101 01002
XOR Exclusive OR 8 #2#1100 XOR #2#0101 10012
OR Logical OR 9 #2#1100 OR #2#0101 11012
1 Division with integers results in a truncated value.
NOTE: All integer math uses 16-bit words with 16-bit word intermediate
results, regardless of whether you have a Series 505 or an S5 controller.
The valid range for a real number is dependent on controller type. For a
Series 505, the range is --9.223372 E+18 to +9.223372 E+18, and any value
except 0.0 that falls between --2.710501 E --20 and +5.421011 E --20 generates
a controller error. For an S5 controller, the valid range is --1.701412E+38 to
+1.701412E+38, and any value except 0.0 that falls between --1.469368E --39
to +1.469368E --39 generates a controller error.
A real number can be expressed in any of four ways but must always
include a decimal point; it does not need to include the fractional portion. If
the sign is omitted, it is assumed to be a positive sign (+).
A value with a decimal point and the fractional portion followed by the
letter E and an exponent: 12.0E--3 (12.0 ⌠ 10 --3)
Table 10-3 lists the operators available in APT to be used with real
numbers; they are supported by all controllers except the 560/560T
controllers.
Precedence Numeric
Operator Operation Example
Level Result
Boolean expressions can include both relational and logical operators. The
relational operators in Table 10-4 all have equal precedence.
Precedence
Operator Operation Example
Level
Precedence Evaluates to
Operator Example
Level True if
NOT mcv_1.OPND term is False
NOT 2
NOT (X=2) term is False
all terms are
AND 4 mcv_1.CLSD AND mcv_2.CLSD
True
any term is
OR 5 mcv_3.OPND OR (pt101 < 14.9)
True
Overview A math block consists of a code specifier section, a declaration section, and
an executable section. The code specifier and declaration sections are
optional.
The word MATH marks the beginning of the math section in an SFC
step. The key word MATH is not used in a CFB math block or a
subroutine.
For Series 505 controllers, you can use the optional code specifier
section to indicate certain controller-dependent information about how
your math block compiles. The word PRAGMA indicates the beginning
of this section.
If you have a declaration section, each statement begins with one of the
following terms: BOOLEAN, INTEGER, REAL, TIMER, or ARRAY.
The word BEGIN marks the end of the declaration section and the
beginning of the executable section in the math block. The only
statements that can precede a BEGIN statement are declaration
statements and the code specifier section.
MATH {Marks beginning of math section in an SFC step; not used in a CFB or subroutine.}
PRAGMA{Optional code specifier section for a subroutine, SFC, or CFB math section. Only
used by Series 505 controllers.}
Code Specifier The code specifier section of a math block is an optional section that begins
Section with the word PRAGMA. S5 controllers do not use the PRAGMA statement.
(Series 505 only)
For a Series 505 controller, you can use PRAGMA to specify whether you
want the math to be compiled exclusively in either RLL, RLL cyclic, RLL
interrupt, or SFPGM code. The use of the PRAGMA statement does not
force the type of compile; you must still follow the conventions described on
page 10-4 to determine how the code is actually compiled. However, to alert
you, PRAGMA causes a compile error to be generated if you inadvertently
use SFPGM code in math that you intend to be RLL only, or vice versa.
If you use PRAGMA for a Series 505 controller, the code specifier section
must precede the declaration section for subroutines, SFC or CFB math
sections (Figure 10-4).
PRAGMA <type> ;
The type can be RLL, SF, RLL_CYCLIC, or RLL_INTERRUPT. The types are
described in Table 10-6.
NOTE: APT flags must be declared with the Declaration Editor; you cannot
declare APT flags as local variables in a math block.
{Declaration section}
{Statements each declare one variable as the specified type.}
BOOLEAN: bool1;
INTEGER: int1;
REAL: r1;
BOOLEAN RETENTIVE: boolr1;
TIMER FAST: tmr1;
ARRAY (1..19) OF REAL: array1;
{Statements each declare a list of variables as the specified type.}
BOOLEAN: bool2, bool3;
INTEGER: int2, int3, int4;
REAL: length, width, area;
BOOLEAN RETENTIVE: boolr2, boolr3;
TIMER FAST: tmr1, tmr2;
ARRAY (1..27) OF BOOLEAN: array2, array3;
{Statements each declare variable(s) as the specified type and assign an initial value to each
variable in the list.}
BOOLEAN: bool4 := TRUE;
INTEGER: int5, int6 := 5;
REAL: r2,r3,r4 := 6.0;
BOOLEAN RETENTIVE: boolr4, boolr5:= FALSE;
TIMER SLOW: tmr2, tmr3:=0,10,true,false ;
ARRAY (1..11) OF INTEGER: array4, array5:= 75;
BEGIN {Reserved word marks end of Declaration section and beginning of
executable section.}
Formatting a The following examples illustrate how to format a declaration statement for
Declaration a variable, timer variable, or array.
Statement
To declare boolean, integer, and real variables, follow this format. Substitute
boolean, integer, or real for type.
All booleans are retentive for S5 controllers. You do not need to specify
“retentive.” However, for Series 505 controllers, booleans can be either
retentive or non-retentive, and so if you do not specify that a boolean is
retentive, it will be treated as non-retentive. To indicate a retentive
boolean for Series 505, use this format.
NOTE: If you have an S5 controller, you cannot locally declare a fast timer
in the declaration section of a block. However, you can declare both fast and
slow timers for S5 when you use the Declaration Table.
For an array, use this format. The array type can be real, integer, or
boolean.
If you assign a constant to the declaration, all elements in the array are
set to the same value.
Using a Variables can be declared in two ways. They can be declared in the program
Locally-Declared or unit declaration table, or they can be declared within the declaration
Variable section of a math block. Variables that are declared from within a math
block are considered locally-declared variables.
CFB_name.NNL.Local_Variable <.timer_extension>
$SFC_name.SMATHx.Local_Variable <.timer_extension>
! WARNING
Locally-declared variables in an SFC step contain the step number as part of
the variable name. Resequencing the SFC may change the step number of the
locally declared variable.
Resequencing an SFC that contains locally-declared variables could cause your
application to operate in an unpredictable manner, or fail in an unsafe condition,
resulting in death or serious injury to personnel, and/or damage to equipment.
If you use locally declared variables, do not resequence the SFC.
Do not use the INC and DEC commands with locally-declared integers.
Every math block must contain one and only one BEGIN statement. The
only statements in a math block that can precede the BEGIN statement are
PRAGMA and the declaration statements (BOOLEAN, INTEGER, REAL,
etc.).
{Declaration section}
REAL: length, width, area;
INIT marks the beginning of the initialization portion of a math block. This
portion executes only the first time that the math block executes. INIT
executes every time the SFC step is entered.
BODY marks the beginning of the body portion of a math block. This portion
does not execute the first time that the block executes; however, the body
portion executes each subsequent time that the block executes and
continues to execute as long as the block remains active.
Figure 10-7 shows a math section with both an INIT and a BODY portion.
Overview The executable section of a math block consists of one or more statements
that can be any of the following: a comment, an assignment statement, a
procedure statement, a print statement, or a conditional statement.
{ This is a comment. }
A comment that begins with a left brace must end with a right brace; a
comment that begins with a parenthesis/asterisk must end with an
asterisk/parenthesis.
You can nest one comment within another comment if you use different
delimiters. For example, the following comments are valid:
The following comment is not valid because both comments use braces as
delimiters:
identifier := expression;
{Declaration section}
BOOLEAN: bool1, bool2, bool3, bool4;
INTEGER: int1, int2, int3;
REAL: length, width, area;
command object;
Print Statement The PRINT statement is an SFPGM procedure that allows you to send text
(Series 505 only) to Port 1 on the 545, 545L (545 Lite), 555, or 575, or one or both of the
output ports on the 565T/565P card. The PRINT statement is not available
for 560/560T or S5 controllers.
Use the following format for a PRINT statement. Each function statement
must end with a semicolon ( ; ).
PRINT(port-number,text);
The text can be one or more character strings that specify the
information to be printed. If the text includes more than one character
string, the strings are separated by commas.
The text must be enclosed in double quotes and can be any combination
of uppercase and lowercase letters. For example, “This is a text string.”
However, some operator interfaces require the use of all uppercase
letters.
The text may include one or more of the special codes listed in
Table 10-7. These special codes can be in either upper or lower case.
Figure 10-9 shows examples of print statements that all produce the same
text including a tab (\t) and a carriage return and line feed (\n).
{Prints to Port 1}
PRINT(1, ”PRESSURE= ”,pt101,”\t TEMPERATURE= ”,tt101,”\n”);
{Prints to Port 2}
PRINT(2, ”PRESSURE= ”,pt101,
”\t TEMPERATURE= ”,tt101,”\n”);
ELSE
ENDIF ;
NOTE: The SFPGM math language of the Series 505 controller specifically
supports the IF/THEN/ELSE construct. The RLL language, for Series 505,
and STL, for S5, do not. APT must generate code to skip over the clause(s)
in the IF/THEN/ELSE construct that should not be executed. This can lead
to inefficient code. Avoid using ELSE and ELSIF in RLL or STL code.
IF (chrg_path = 1) THEN
chrg_sp := wpw1.c_setpoint + tare_wt;
ENDIF;
IF (chrg_path = 1) THEN
chrg_sp := wpw1.c_setpoint + tare_wt;
ELSE
chrg_sp :=wpw1.d_setpoint + tare_wt;
ENDIF;
IF (chrg_path = 1) THEN
chrg_sp := wpw1.c_setpoint + tare_wt;
ELSIF (chrg_path = 2) THEN
chrg_sp := wpw1.d_setpoint + tare_wt;
ELSE
chrg_sp :=wpw1.e_setpoint + tare_wt;
ENDIF;
IF (chrg_path = 1) THEN
chrg_sp := wpw1.c_setpoint + tare_wt;
ELSIF (chrg_path = 2) THEN
chrg_sp := wpw1.d_setpoint + tare_wt;
ELSIF (chrg_path = 3) THEN
chrg_sp := wpw1.e_setpoint + tare_wt;
ELSE
chrg_sp :=wpw1.f_setpoint + tare_wt;
ENDIF;
IF ((%V8. <= %V10.) OR (%V12. > 0.0)) THEN {Only Series 505 controllers}
charg_path := 1; {can use direct addresses}
ELSE {in Math language.}
charg_path := 0;
ENDIF;
IF (B1) THEN
work_req := 2;
ELSE
work_req := 1;
ENDIF;
WHILE Statement The WHILE statement allows you to program the multiple execution of
math statements according to a specific condition. The WHILE statement
can be used with S5 controllers and with the following Series 505
controllers: the 545, 545L, 555, 565/565T/565P, and 575 controllers. For
Series 505 controllers, the WHILE statement is an SFPGM-only statement.
Use the following format for the WHILE statement. Enclose the boolean
expression in parentheses.
END LOOP ;
When the step containing the WHILE is active, or the math block
containing the WHILE is enabled, the WHILE statement acts as follows.
When the boolean expression in the WHILE clause is true, all the math
language statements execute in order.
CHK := 1;
WHILE (CHK <= 4) LOOP
FILL_ARRAY[CHK] := 100;
CHK := CHK + 1;
END LOOP;
Initialize all variables associated with the WHILE for every execution
of the loop.
! WARNING
Use of the WHILE loop in APT programs can either stop program execution or
degrade controller performance.
The WHILE statement is powerful, and misuse of it could cause unpredictable
operations that could result in death or serious injury to personnel, and/or
damage to equipment.
Be sure to use the WHILE statement correctly. Follow the above Safety
Guidelines for WHILE Loops to ensure that controller performance is not
adversely affected.
Special SFC When you use a WHILE statement in a step, the WHILE statement is
Considerations executed to completion before any statements below the END statement are
executed.
You can place a WHILE statement in any part of the math section of a step,
including the INIT section. A WHILE that is located in the INIT section of a
step runs to completion the first time the step is executed.
Special CFB When you use a WHILE statement in a CFB, the WHILE statement is
Considerations executed to completion before any statements below the END statement are
executed.
The CFB .ENABLD bit does not turn on until all the statements in the CFB
have been executed at least once. Therefore, an extensive WHILE can cause
a delay between the time a CFB begins executing and the setting of the CFB
.ENABLD bit.
Understanding APT provides 20 functions that you can use in a program. A function
Functions appears on the right-hand side of an assignment statement, or in a boolean
expression. Table 11-2 lists the functions available in APT.
Availability All math procedures are supported for the Series 505 controllers, using
either RLL, or SFPGM, or both. All math procedures except for SETSSI and
COPY_BYTES are supported for S5 controllers, using STL. The SFPGM
code-type procedures are not supported for the 560/560T controllers.
All math functions are supported for Series 505 controllers, using either
RLL, or SFPGM, or both. All math functions are supported for S5
controllers, using STL. SFPGM code-type functions are not supported for
the 560/560T controllers.
Procedure
Procedure (Parameters) Code Type Page
Type
FRS(boolean expression, boolean); STL RLL 1 11-27
SETSSI(boolean); RLL 1 11-62
Boolean
UNPACK_BITS(boolean array, variable); STL RLL 1 11-68
INT_TO_BITS(boolean array, variable); STL RLL/SFPGM 11-32
Boolean
B l to
t PACK_BITS(boolean array, variable); STL RLL 1 11-52
Integer
PBITS_TO_INT(variable, integer); STL SFPGM 11-53
CLEAR(flag_variable); STL RLL 1 11-19
LATCH(flag_variable); STL RLL 1 11-37
APT Flag
ON(flag_variable); STL RLL 1 11-51
BCDBIN(variable, variable); STL RLL/SFPGM 11-11
BINBCD(variable, variable); STL RLL/SFPGM 11-12
BIT_ASSIGN(variable, integer, expression); STL RLL 1 11-13
Integer BITCLEAR(variable, integer); STL RLL/SFPGM 11-14
BITSET(variable, integer); STL RLL/SFPGM 11-15
IREAD(variable); STL RLL 1 11-35
IWRITE(variable); STL RLL 1 11-36
1 For Series 505: RLL-only procedures cannot be used in the same math block as SFPGM procedures.
Procedure
Procedure (Parameters) Code Type Page
Type
INTERPOLATE(in1, out1, array1, array2); STL SFPGM 11-30
LEAD_LAG(in1, lastin, out2, lead, lag, gain); STL SFPGM 2 11-38
Real
LOOKUP_TABLE(in1, out1, array1, array2); STL SFPGM 11-44
COPY_BYTES(integer source, source offset, integer
RLL 1 11-20
destination, destination offset, # of bytes);
COPY_DIRECT(destination, source, integer); STL RLL/SFPGM 11-22
Real or Integer
g LIMIT(in1, out1, low,high); STL SFPGM 11-41
( ll values
(all l off LOAD_ARRAY(in1, array); STL RLL/SFPGM 11-42
same type)
MAX(in1, max); STL SFPGM 11-48
MIN(in1, min); STL SFPGM 11-49
MINMAX(in1, max, min); STL SFPGM 11-50
Integer to Real SCALE(in1, out1, type, low, high); STL SFPGM 3 11-58
PROUND(integer, real); STL SFPGM 11-54
Real to Integer PTRUNC(integer, real); STL SFPGM 11-55
UNSCALE(in1, out1, type, low, high); STL SFPGM 3 11-70
1 For Series 505: RLL-only procedures cannot be used in the same math block as SFPGM procedures.
2 Gain, lead, and lag must be real variables or real numbers; input and output variables (in1, lastin, and
out2) can be integer or real, but all three must be of same type.
3 Low and high values must be real numbers.
Using Functions As a normal part of its operation, a Series 505 controller handles a
and Procedures in subroutine that has been compiled into SFPGM code in the following ways:
Subroutines
(Series 505) In some situations, APT allocates locations in Series 505 V-Memory to
be used as compiler internal temporary variables by the subroutine.
The combination of these two events can cause a loss of data: the temporary
variables of the first subroutine may be overwritten during execution of the
subsequent subroutine.
In consequence, if you have a Series 505 controller, you need to observe the
following guidelines for math statements used in a subroutine, in order to
avoid the possibility of creating temporary variables that risk being
overwritten during the subroutine’s interruption.
NOTE: The EDGE function also stores data temporarily by using internal
memory locations. Therefore, if you have a Series 505 controller, avoid using
EDGE in user-defined subroutines.
ABS Function The ABS function is a real or integer function that is available in STL for S5
controllers and is available in both RLL and SFPGM for Series 505; ABS
can be used with all controllers. ABS returns the positive value of the
expression in parentheses.
ABS(expression)
STL and SFPGM can use real or integer functions, but the expression
must match the returned type. See Figure 11-1.
Series 505 RLL can use only integer; refer to Figure 11-2.
Key word
num4 := ABS(4--22);
Key word
ARCCOS Function The ARCCOS function is a real function that is available in STL for S5
controllers and is available only in SFPGM for Series 505. ARCCOS can be
used with the S5 controller family and the 545, 545L, 555, 565, 565T/565P,
and 575 controllers. ARCCOS returns the inverse cosine of the expression in
parentheses. The ARCCOS function is the inverse of the COS function.
ARCCOS(expression)
angle1 := ARCCOS(.50);
Key word
ARCSIN Function The ARCSIN function is a real function that is available in STL for S5
controllers and is available only in SFPGM for Series 505 controllers.
ARCSIN can be used with the S5 controller family and the 545, 545L, 555,
565, 565T/565P, and 575 controllers. ARCSIN returns the inverse sine of the
expression in parentheses. The ARCSIN function is the inverse of the SIN
function.
ARCSIN(expression)
angle2 := ARCSIN(.50);
Key word
ARCTAN Function The ARCTAN function is a real function that is available in STL for S5
controllers and is available only in SFPGM for Series 505 controllers.
ARCTAN can be used with the S5 controller family and the 545, 545L, 555,
565, 565T/565P, and 575 controllers. ARCTAN returns the inverse tangent
of the expression in parentheses. The ARCTAN function is the inverse of the
TAN function.
ARCTAN(expression)
angle3 := ARCTAN(1.0);
Key word
BCDBIN Procedure The BCDBIN procedure is available in STL for S5 controllers and is
available in both RLL and SFPGM for Series 505 controllers. BCDBIN can
be used with all controllers. BCDBIN converts a BCD (binary-coded
decimal) value to an integer. After APT converts the BCD value to an
integer, you can use the integer in math calculations, whereas you could not
use the original BCD value.
BCDBIN(variable,variable);
The first variable in the parentheses contains the four-digit BCD value
that is to be converted. Notice that the BCD value is in hex format, and
the digits range from 0 to 9 (no A to F).
BCDBIN(int1,int2);
Key word
BCD
0 0 9 9
value
int1: 0 0 0 0 0 0 0 0 1 0 0 1 1 0 0 1
binary value
Decimal equivalent of
BCD value when int1 = 153.
int2: 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 1
binary value
Decimal equivalent of
integer value when int2 = 99.
BINBCD Procedure The BINBCD procedure is available in STL for S5 controllers and is
available in both RLL and SFPGM for Series 505 controllers. BINBCD can
be used with all controllers. BINBCD converts an integer value to a BCD
(binary-coded decimal) value. Notice that the BCD value is in hex format,
and the digits range from 0 to 9 (no A to F).
BINBCD (variable,variable);
NOTE: To avoid using the BINBCD procedure to send a value out to an I/O
point, consider declaring the I/O as a BO (instead of a WO). This way, the
conversion is handled automatically for you.
BINBCD(int2,int3);
Key word
Decimal equivalent of
integer value when int2 = 43.
int2: 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 1
binary value
Decimal equivalent of
BCD value when int3 = 67.
int3:
binary value 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 1
BCD 0 0 4 3
value
The variable in the parentheses is the integer that contains the bit you
want to set based on the boolean expression. This integer is treated as
a binary value with bits numbered 1 (the most significant bit) to 16 (the
least significant bit).
The integer specifies which bit in the binary equivalent of the integer
variable is the one that you want to set. The value must be a number
between 1 and 16.
Figure 11-8 shows the format used to enter the BIT_ASSIGN procedure.
BIT_ASSIGN(switch_bank,13,bexpr);
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 1
BITCLEAR (variable,integer);
The variable in the parentheses is the integer that contains the bit you
want to reset to 0. This integer is treated as a binary value with bits
numbered 1 (the most significant bit) to 16 (the least significant bit).
The integer specifies which bit in the binary equivalent of the integer
variable is the one that you want to clear. The value must be a number
between 1 and 16. See the example in Figure 11-9.
Integer variable
Integer
BITCLEAR(switch_bank,9);
Key word
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 1
Resets bit 9 to 0
BITSET Procedure The BITSET procedure is available in STL for S5 controllers and is
available in both RLL and SFPGM for Series 505 controllers. BITSET can
be used with all controllers. BITSET sets a specified bit in an integer
variable to true or on (1).
BITSET (variable,integer);
The variable in the parentheses is the integer that contains the bit you
want to set to 1. This integer is treated as a binary value with bits
numbered 1 (the most significant bit) to 16 (the least significant bit).
The integer specifies which bit in the binary equivalent of the integer
variable is the one that you want to set. The value must be a number
between 1 and 16. See the example in Figure 11-10.
Integer variable
Integer
BITSET(switch_bank,13);
Key word
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 1
Sets bit 13 to 1
BITS_TO_INT(variable)
The BITS_TO_INT procedure moves the first element of the array into the
most significant bit of the integer (see Figure 11-11). The PACK_BITS
procedure moves the first element of an array into the least significant bit of
the integer.
binvalue := BITS_TO_INT(binarray);
Key word
[ 16 ]
[ 15 ]
[ 14 ]
[ 13 ]
[ 12 ]
[ 11 ]
[ 10 ]
[9]
binarray
[8]
[7]
[6]
[5]
[4]
[3]
[2]
[1]
0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 1
MSB LSB
binvalue = 147
BITTEST Function The BITTEST function is a boolean function that is available in STL for S5
controllers and is available only in RLL for Series 505 controllers. BITTEST
can be used with all controllers. BITTEST checks the status of a specified
bit. BITTEST can be used in an SFC transition.
BITTEST(variable,integer)
The variable in parentheses must be the integer that contains the bit
that you want to check. This integer is treated as a binary value with
bits numbered 1 (the most significant bit) to 16 (the least significant
bit).
The integer specifies which bit in the binary equivalent of the integer
variable is the one that you want to test. The value must be a number
between 1 and 16.
Integer variable
Boolean variable
bit12 := BITTEST(switch_bank,12);
Bit 12 = TRUE
Switch_bank = 147
0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
CLEAR Procedure The CLEAR procedure is available in STL for S5 controllers and is available
only in RLL for Series 505. It can be used with all controllers. CLEAR sets
the APT flag value to off (false) after the procedure is executed. The APT
flag remains off, even if the block is disabled, until a LATCH or ON sets it to
on. CLEAR takes precedence over ON or LATCH.
CLEAR (flag_variable);
The variable in the parentheses is the APT flag that is turned off
(false). See the example in Figure 11-13.
CLEAR (Flag_A);
Key word
Source Identifies the starting integer address for the source. It can be
either a direct address or a declared integer variable. For Series 505
controllers, you can use V, G, VMS, or VMM word memory.
Source Offset The integer value may either be 0, for no offset, or 1, for an
offset of one byte.
! WARNING
The COPY_BYTES procedure allows you to copy large amount of data to
specified memory locations within the controller. APT does not check to see if
these memory locations are currently in use by other sections of the APT
program.
Overwriting controller memory could cause unpredictable operation, which
could result in death or serious injury to personnel and/or equipment.
Be sure to reserve the appropriate amount of memory in the Compiler Control
File and use only those memory locations in this procedure.
In Figure 11-14, 32 bytes are copied from the Series 505 address,
%VMM0F000, and there is no offset to the VMM address of the declared
variable, TABLE. This example uses a Series 505 direct address.
COPY_BYTES (%VMM0F000,0,table,0,32);
COPY_DIRECT(destination,source,integer);
Integer Indicates the number of elements that you want to copy from the
beginning of the array into the specified controller memory locations.
! WARNING
The COPY_DIRECT procedure allows you to copy large amount of data to
specified memory locations within the controller. APT does not check to see if
these memory locations are currently in use by other sections of the APT
program.
Overwriting controller memory could cause unpredictable operation, which
could result in death or serious injury to personnel and/or equipment.
Be sure to reserve the appropriate amount of memory in the Compiler Control
File and use only those memory locations in this procedure.
Destination Source
Key word Number of elements to be copied
The real array in the examples above is used as the source; it supplies data to a destination.
For the Series 505 example, %V100 is used as the destination. For the S5 example, TANK_LVLS is the destination.
The integer array in the examples above is used as the destination; it receives data from a source location.
For the Series 505 example, %V200 is used as the source. For the S5 example, TANK_HT is the source.
Assume TANK_LVLS
starts at DB7:DW100
Data is moved from the real array (source) to the Series 505 or S5 controller memory locations.
Assume TANK_HT
starts at FW200
Data is moved from the Series 505 or S5 controller memory locations to the integer array (destination).
COS Function The COS function is a real function that is available in STL for S5
controllers and is available only in SFPGM for Series 505 controllers. COS
can be used with the S5 controller family and the 545, 545L, 555, 565,
565T/565P, and 575 controllers. COS returns the cosine of the expression in
parentheses. The COS function is the inverse of the ARCCOS function.
COS(expression)
The returned value is a real number between --1 and 1. For example, in
Figure 11-16, the value of the variable, angle1, is 0.50.
Key word
EDGE Function The EDGE function is a boolean function that is available in STL for S5
controllers and is available only in RLL for Series 505. It can be used with
all controllers. EDGE detects a change from false to true in the value of a
boolean expression. EDGE can be used in an SFC transition.
EDGE(expression)
When that expression changes from false to true, the returned value of
the function becomes true and remains true for one scan of the
controller.
In Figure 11-17, assume that bool1 and bool2 are declared as boolean
values. In the first example, bool2 detects a false to true transition in bool1.
In the second example, bool2 detects a true to false transition in bool1.
Key word
Boolean variable Boolean expression
bool2 := EDGE(bool1);
bool2 := EDGE(NOT(bool1));
EXP Function The EXP function is a real function that is available in STL for S5
controllers and is available only in SFPGM for Series 505 controllers. EXP
can be used with the S5 controller family and the 545, 545L, 555, 565,
565T/565P, and 575 controllers. EXP returns the value of e (2.71828) raised
to the power represented by the expression in parentheses. (The EXP
function is the inverse of the LN function.)
EXP(expression)
The returned value is also a real number. For example, in Figure 11-18,
the value of the variable, real1, is 2.7.
Real-type variable
Real number, variable, or
expression
real1 := EXP(1.0);
Key word
FRS Procedure The Forced Role Swap (FRS) procedure is available in STL for S5
controllers, and is available only in RLL for Series 505 controllers. FRS can
be used with the S5 948R and the SIMATIC 560, 560T, 565, 565T, and 565P
controllers. This procedure allows you to change the roles of the controllers
so that the current standby unit becomes active and the current active unit
becomes the standby.
FRS (bexpr,out_bit);
Boolean
expression
FRS (bexpr,out_bit);
NOTE: For S5 controllers, APT uses FW0 (FY0 and FY1) as the H-flag word
for redundant control.
FRAC Function The FRAC function is a real function that is available in STL for S5
controllers and is available only in SFPGM for Series 505 controllers. FRAC
can be used with S5 controllers and with the 545, 545L, 555, 565,
565T/565P, and 575 controllers. FRAC returns the fractional portion of the
expression in parentheses.
FRAC(expression)
The returned value is also a real number. For example, in Figure 11-20,
the value of the variable, real2, is 0.25.
Real-type variable
Real number, variable, or
expression
real2 := FRAC(25.0/4.0);
Key word
INTERPOLATE first locates an input value an input array and then uses
one of the following techniques to determine the output.
If the input is less than the value of the first element in the input
array, the output is assigned a value less than the value of the first
element in the output array. This value is based on the relationship
calculated between the input value and the values of the first two
elements in the input array.
If the input is greater than the value of the last element of the input
array, the output is assigned a value greater than the value of the last
element of the output array. This value is based on the relationship
calculated between the input value and the values of the last two
elements in the input array.
When you declare the arrays that you want to use in an INTERPOLATE
procedure, you must specify 11 as the number of elements in each array.
The output variable is a real variable that stores the result of the
INTERPOLATE procedure. See the example in Figure 11-21.
Input array
of real values
Real variable
Output array
of real values
INTERPOLATE (xin,xout,inarray,outarray);
INT_TO_BITS(variable,variable);
Boolean array
variable
Integer or
integer variable
INT_TO_ BITS(binarray,147);
Key word
The INT_TO_BITS procedure moves the most significant bit of the integer
into the first element of the array, as shown in Figure 11-23. The
UNPACK_BITS procedure moves the least significant bit of the integer into
the first element of an array.
Boolean array
variable
Integer or
integer variable
INT_TO_ BITS(binarray,147);
Key word
Integer = 14710
MSB LSB
0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 1
[ 16 ]
[ 15 ]
[ 14 ]
[ 13 ]
[ 12 ]
[ 11 ]
[ 10 ]
[9]
[8] binarray
[7]
[6]
[5]
[4]
[3]
[2]
[1]
INT_TO_REAL The INT_TO_REAL function is a real function that is available in STL for
Function S5 controllers and is available only in SFPGM for Series 505 controllers.
INT_TO_REAL can be used with the S5 controller family and the 545, 545L,
555, 565, 565T/565P, and 575 controllers. INT_TO_REAL converts an
integer to a real number.
Converting a value from an integer to a real number does not change its
value; it does, however, allow you to use that value in a function that
requires real input values.
INT_TO_REAL(expression)
The returned value is a real number. For example, in Figure 11-24, the
value of the variable, real2, is 25.0.
real2 := INT_TO_REAL(25);
Key word
IREAD Procedure The IREAD procedure is available in STL for S5 controllers and is available
only in RLL for Series 505 controllers. It can be used with the S5 controller
family and the 545, 545L, 555, and 575 controllers. IREAD performs an
immediate read of a digital or word input from a module to the image
register. Any reference to the associated I/O point gets the updated field
value. Refer to the SIMATIC TI505 Programming Reference Manual for a
list of Series 505 modules that support this procedure. All digital input
modules for S5 support the IREAD procedure.
IREAD(Variable)
IREAD(Count);
Key word
! WARNING
For Series 505 controllers, the IREAD procedure is only available for input
points of a supported module in base 0 (zero). APT cannot determine whether
the input points meet these requirements.
Failure to use the IREAD procedure correctly can cause your Series 505
controller to operate in an unpredictable manner, or to fail in an unsafe
condition that could result in death or serious injury and/or equipment damage.
Do not use the IREAD procedure unless you are certain that the input points
meet the stated requirements.
IWRITE Procedure The IWRITE procedure is available in STL for S5 controllers and is
available only in RLL for Series 505 controllers. It can be used with the S5
controller family and with the 545, 545L, 555, and 575 controllers. IWRITE
performs an immediate write of a digital or word output to a module from
the image register. Any manipulations to the associated I/O point
immediately update the field value. Refer to the SIMATIC TI505
Programming Reference Manual for a list of Series 505 modules that
support this procedure. All digital output modules for S5 support the
IWRITE procedure.
IWRITE(Variable)
IWRITE(Result);
Key word
! WARNING
For Series 505 controllers, the IWRITE procedure is only available for output
points of a supported module in base 0 (zero). APT cannot determine whether
the output points meet these requirements.
Failure to use the IWRITE procedure correctly can cause your Series 505
controller to operate in an unpredictable manner, or to fail in an unsafe
condition that could result in death or serious injury and/or equipment damage.
Do not use the IWRITE procedure unless you are certain that the output points
meet the stated requirements.
LATCH Procedure The LATCH procedure is available in STL for S5 controllers and is available
only in RLL for Series 505 controllers. It can be used with all controllers.
LATCH sets the APT flag value to on (true) after the procedure is executed
in the math block. The APT flag remains on, even if the block is disabled,
until a CLEAR sets it to off (false).
LATCH (flag_variable);
The variable in the parentheses is the APT flag that is turned on (true).
See the example in Figure 11-27.
LATCH (Flag_A);
Key word
The output variable is the variable that stores the result of the
LEAD_LAG procedure.
Lag (TLag ) specifies the time in minutes required to reach 63.2 percent
of the final output after a change in the input.
Gain specifies the ratio of the change in output to the change in input
at a steady state, as shown in the following equation.
∆ output
Gain =
∆ input
Saves previous
input value Lead time
Key word
Lag time
LEAD_LAG (in1,lastin,out1,tlead,tlag,k);
Yn = Æ T Lag
T Lag + T s
É
Y n−1 + GainÆT Lead + T s
T Lag + T s
É
X n − Gain Æ
T Lead
T Lag + T s
É
Xn−1
If TLead / TLag is greater than 1.0, then the initial response overshoots the
steady-state output value.
2.0
n = 0 1 2 3 4
If TLead / TLag is less than 1.0, then the initial response undershoots the
steady-state output value.
n = 0 1 2 3 4
n = 0 1 2 3 4
LEFTSHIFT The LEFTSHIFT function is an integer function that is available in STL for
Function S5 controllers and is available only in SFPGM for Series 505 controllers.
LEFTSHIFT can be used with the S5 controller family and the 545, 545L,
555, 565, 565T/565P, and 575 controllers. LEFTSHIFT moves the bits of an
integer to the left (from the least significant bit toward the most significant
bit).
LEFTSHIFT(expression,expression)
The first expression is the integer that contains the bits that you want
to shift to the left.
Integer,
Integer variable integer variable, or
expression
int3 := LEFTSHIFT(147,3);
Integer,
Key word integer variable, or
expression
0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 1
0 0 0 0 0 1 0 0 1 0 0 1 1 0 0 0
LIMIT Procedure The LIMIT procedure is available in STL for S5 controllers and is available
only in SFPGM for Series 505 controllers. LIMIT can be used with the S5
controller family and the 545, 545L, 555, 565, 565T/565P, and 575
controllers. The LIMIT procedure restricts the value of a variable. LIMIT
copies the input value to the output variable and ensures that the output is
between the specified high and low limits.
The input and output variables and the limit variables can be either
real or integer values; but all of the values in the parentheses must be
the same type. For example, if the input is a real value, the output
variable and limit variables must also be real.
If the input is greater than or equal to the low limit and less than or
equal to the high limit, the output is assigned the input value. For
example, in Figure 11-30, if you assume the values under each variable
in the first procedure, test1 is 4.2.
If the input is greater than the high limit, the output is assigned the
high-limit value.
If the input is less than the low limit, the output is assigned the
low-limit value. For example, in Figure 11-30, if you assume the values
under each variable in the second procedure, test2 is --3.
High-limit variable
Input value
or variable
Key word Array variable
array1 array2
If the input is less than the first element in the input array, the output
is assigned the value of the first element in the output array.
If the input is greater than any element in the input array, the output
is assigned the value of the last element in the output array.
When you declare the arrays that you want to use in a LOOKUP_TABLE
procedure, you must specify 11 as the number of elements in each array.
The output variable is a real variable that stores the result of the
LOOKUP_TABLE procedure. See the example in Figure 11-32.
LOOKUP_TABLE (xin,xout,inarray,outarray);
Key word
LN Function The LN function is a real function that is available in STL for S5 controllers
and is available only in SFPGM for Series 505 controllers. LN can be used
with the S5 controller family and the 545, 545L, 555, 565, 565T/565P, and
575 controllers. LN returns the natural logarithm (base e) of the expression
in parentheses. The LN function is the inverse of the EXP function.
LN(expression)
The returned value is also a real number. For example, in Figure 11-33,
the value of the variable, real2, is 1.2.
Real-type variable
real2 := LN(3.4);
Key word
LOG Function The LOG function is a real function that is available in STL for S5
controllers and is available only in SFPGM for Series 505 controllers. LOG
can be used with the S5 controller family and the 545, 545L, 555, 565,
565T/565P, and 575 controllers. LOG returns the common logarithm (base
10) of the expression in parentheses.
LOG(expression)
Real-type variable
real3 := LOG(100.0);
Key word
MAX Procedure The MAX procedure is available in STL for S5 controllers and is available
only in SFPGM for Series 505 controllers. It can be used with the S5
controller family and the 545, 545L, 555, 565, 565T/565P, and 575
controllers. MAX is used to track the maximum value of a variable over
time. When the MAX procedure executes, the input value is assigned to the
maximum value. As a result, when the value of the input changes, the
maximum value can also change. See the example in Figure 11-35.
If the new input value is greater than the current maximum, this new
input is assigned to the maximum value.
MAX (in1,max1);
Key word
in1 max1
1 1
2 2
1 2
0 2
3 3
MIN Procedure The MIN procedure is available in STL for S5 controllers and is available
only in SFPGM for Series 505 controllers. It can be used with the S5
controller family and the 545, 545L, 555, 565, 565T/565P, and 575
controllers. MIN is used to track the minimum value of a variable over time.
When the MIN procedure executes, the input value is assigned to the
minimum value. As a result, when the value of the input changes, the
minimum value can also change. See the example in Figure 11-36.
If the new input value is less than the current minimum, this new
input is assigned to the minimum value.
MIN (in2,min2);
Key word
in2 min2
2 2
1 1
2 1
0 0
3 0
MINMAX Procedure The MINMAX procedure is available in STL for S5 controllers and is
available only in SFPGM for Series 505 controllers. It can be used with the
S5 controller family and the 545, 545L, 555, 565, 565T/565P, and 575
controllers. MINMAX is used to track the minimum and maximum values of
a variable. When the MINMAX procedure executes, the input value is
assigned to the minimum and maximum values. As a result, when the input
value changes, the minimum and maximum values can also change. See the
example in Figure 11-37.
The variables in parentheses can be either real or integer, but all of the
values in the parentheses must be the same type. For example, if the
input is a real value, the minimum and maximum values must also be
real.
If the new input value is less than the current minimum, this new
input is assigned to the minimum value.
If the new input value is greater than the current maximum, this new
input is assigned to the maximum value.
Maximum
variable
Input variable Minimum
variable
MINMAX (in3,max3,min3);
Key word
2 2 2
1 1 2
2 1 2
0 0 2
3 0 3
ON (flag_variable);
The variable in the parentheses is the APT flag that is turned on (true).
See the example in Figure 11-38.
ON (Flag_A);
Key word
Do not assign an initial value when you declare an APT flag that you intend
only to use in an ON procedure. The value of the APT flag is always zero
outside the step or CFB in which the ON procedure is located.
When you define the boolean array for this procedure in the Declaration
Table, the size of the array that you specify determines the number of bits
moved into the integer variable.
PACK_BITS(variable,variable);
The second variable is the integer that receives the elements of the
boolean array. All bits in the variable are set to 0 before the values of
the array are shifted into the integer.
Boolean
array
variable Integer variable
PACK_ BITS(binarray,int1);
Key word
binarray[2] = 1
binarray[3] = 0
binarray[4] = 0
binarray[5] = 1
binarray[6] = 0
0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
int1: value = 19
PBITS_TO_INT(variable, integer)
PBITS_TO_INT(binarray, binvalue);
Key word
[ 16 ]
[ 15 ]
[ 14 ]
[ 13 ]
[ 12 ]
[ 11 ]
[ 10 ]
[9]
binarray
[8]
[7]
[6]
[5]
[4]
[3]
[2]
[1]
0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 1
MSB LSB
binvalue = 147
The integer value is the rounded result of the real variable. For
example, in Figure 11-41, the value of the variable, int2, is 4 when the
variable temp_1 is 3.5.
Integer variable
Real variable
PROUND(int2, temp_1)
Key word
PTRUNC Procedure The PTRUNC procedure is available in STL for S5 controllers and is
available only in SFPGM for Series 505 controllers. PTRUNC can be used
with the S5 controller family and the 545, 545L, 555, 565, 565T/565P, and
575 controllers. PTRUNC returns the integer portion of the variable in
parentheses; that is, it truncates a real number by eliminating its fractional
portion and returning only its integer portion.
The returned value is the truncated result of the real variable. For
example, in Figure 11-42, the value of the variable, int2, is 2 when the
variable temp_1 is 2.718.
Integer variable
Real variable
PTRUNC(int2, temp_1)
Key word
RIGHTSHIFT(expression,expression)
The first expression is the integer that contains the bits that you want
to shift to the right.
The vacated bits on the left are set to the value of the most significant
(sign) bit.
int3 := RIGHTSHIFT(--32621,3);
Integer,
Key word integer variable, or
expression
1 0 0 0 0 0 0 0 1 0 0 1 0 0 1 1
1 1 1 1 0 0 0 0 0 0 0 1 0 0 1 0
ROUND Function The ROUND function is an integer function that is available in STL for S5
controllers and is available only in SFPGM for Series 505 controllers.
ROUND can be used with the S5 controller family and the 545, 545L, 555,
565, 565T/565P, and 575 controllers. ROUND changes a real number to the
nearest integer. Values with the decimal portion equal to or greater than .50
are rounded to the higher integer; values less than .50 are rounded to the
lower integer.
NOTE: For Series 505 controllers, the ROUND function cannot be used in
user-defined subroutines. Use the PROUND procedure instead. S5
controllers can use ROUND function in user-defined subroutines.
ROUND(expression)
Integer variable
int2 := ROUND(3.50)
Key word
SCALE Procedure The SCALE procedure is available in STL for S5 controllers and is available
only in SFPGM for Series 505 controllers. SCALE can be used with the S5
controller family and the 545, 545L, 555, 565, 565T/565P, and 575
controllers. SCALE converts an integer to a real value between the low and
high limits that you specify.
The SCALE procedure anticipates an input that has the same format as an
analog input. If you are not scaling an analog input, consider using the scale
CFB.
Bipolar The valid range for a Series 505 integer input is --32,000 to
32,000. The valid range for an S5 integer input is --2048 to 2048.
Twenty-percent offset The valid range for a Series 505 integer input is
6,400 to 32,000. The valid range for an S5 integer input is 512 to 2560.
Zero bias The valid range for a Series 505 integer input is 0 to 32,000.
The valid range for an S5 integer input is 0 to 2048.
The input variable is an integer within the range specified by the type.
The output variable is the real variable that stores the result of the
SCALE procedure. See the examples in Figure 11-45 and Figure 11-47.
The low limit is a real number that specifies the lower boundary of the
scaling range.
The high limit is a real number that specifies the upper boundary of
the scaling range.
Using SCALE for a The operation of the SCALE procedure depends on the type of controller.
Series 505 For a Series 505 controller, SCALE simply takes the input value and
Controller converts it from an integer to a real value. See Figure 11-45.
Using SCALE for If you have an S5 controller, the SCALE procedure automatically shifts your
an S5 Controller input value to the right by 3 bits before scaling it from an integer to a real.
This shifting occurs because S5 analog inputs are 16-bit numbers, with 12
bits of resolution, and the 3 least significant bits contain error information.
Figure 11-46 shows the bit shift that is performed before your value is
scaled.
For S5 controllers, the SCALE procedure shifts your input three bits to the right.
Single Scan
Most significant bit
Broken Transmitter
0 0 0 1 0 0 0 0 0 0 0 1 0 0 1 0 ¦ 2048
Compensating for If you want to scale something other than an analog input, you must
the Bit Shift compensate for the bit shift that is automatically performed when you use
(S5 only) the SCALE procedure. Either use the scale CFB instead, since the CFB does
not perform a bit shift, or else multiply your input value by 8 before you use
the SCALE procedure. Do not use the LEFTSHIFT procedure; you lose the
sign bit Figure 11-47 shows how to use the SCALE procedure for different
types of input values if you have an S5 controller.
NOTE: If you test the SCALE procedure using AI.RAW, you must multiply
your input value by 8 before you send it to SCALE. However, if you send
AI.RAW to SCALE from an S5 analog input card, the input does not need to
be multiplied in order to be read correctly by SCALE.
SETSSI Procedure The SETSSI procedure is not supported for S5 controllers; it is available
only in RLL for Series 505 controllers. It can be used only with the
560/560T/565/565T/565P controllers. SETSSI sets or resets the 560
scan-inhibit bit in Status Word 1, shown in Figure 11-48. This procedure
allows you to control the synchronization of an active controller with a
standby controller. See the SIMATIC TI505 Programming Reference
Manual for additional information about this procedure.
SETSSI(boolean expression);
Boolean value,
variable, or
expression
SETSSI(TRUE);
Key word
Status Word 1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 1
Scan-inhibit bit:
1 inhibits synchronization
0 allows synchronization
! WARNING
The SETSSI procedure, when active, will not allow the standby controller to
synchronize with an active controller in a hot backup configuration. If the active
controller fails, the standby unit cannot assume control of the process.
With neither controller online, the process could execute in an unexpected
manner that could result in death or serious injury and/or damage to
equipment.
Be judicious in your use of the SETSSI procedure, and be sure that your
program logic is correct. Minimize the amount of time that the SETSSI
procedure is active within your program.
SIN Function The SIN function is a real function that is available in STL for S5
controllers and is available only in SFPGM for Series 505 controllers. SIN
can be used with the S5 controller family and the 545, 545L, 555, 565,
565T/565P, and 575 controllers. SIN returns the sine of the expression in
parentheses.
SIN(expression)
The returned value is also a real number between --1 and 1. For
example, in Figure 11-49, the value of the variable, angle1, is 0.50.
Key word
SQRT Function The SQRT function is a real function that is available in STL for S5
controllers and is available only in SFPGM for Series 505 controllers. SQRT
can be used with the S5 controller family and the 545, 545L, 555, 565,
565T/565P, and 575 controllers. SQRT returns the square root of the
expression in parentheses.
SQRT(expression)
Real variable
Real number, variable,
or expression
real1 := SQRT(144.0)
Key word
TAN Function The TAN function is a real function that is available in STL for S5
controllers and is available only in SFPGM for Series 505 controllers. TAN
can be used with the S5 controller family and the 545, 545L, 555, 565,
565T/565P, and 575 controllers. TAN returns the tangent of the expression
in parentheses.
TAN(expression)
The returned value is also a real number. For example, in Figure 11-51,
the value of the variable, angle1, is 1.0.
Key word
TRUNC Function The TRUNC function is an integer function that is available in STL for S5
controllers and is available only in SFPGM for Series 505 controllers.
TRUNC can be used with the S5 controller family and the 545, 545L, 555,
565, 565T/565P, and 575 controllers. TRUNC returns the integer portion of
the expression in parentheses; that is, it truncates a real number by
eliminating its fractional portion and returning only its integer portion.
NOTE: For Series 505 controllers, the TRUNC function cannot be used in
user-defined subroutines. Use the PTRUNC procedure instead. S5
controllers can use TRUNC function in user-defined subroutines.
TRUNC(expression)
Integer variable
int2 := TRUNC(2.71828)
Key word
When you define the boolean array for this procedure in the Declaration
Table, the size of the array that you specify determines the number of bits
that are moved from the integer variable.
UNPACK_BITS(variable,variable);
The second variable is the integer that contains the bits to be moved.
Boolean array
variable
Integer variable
UNPACK_ BITS(binarray,int2);
Key word
binarray[2] = 1
binarray[3] = 0
binarray[4] = 0
binarray[5] = 1
binarray[6] = 0
0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
int2: value = 19
Bipolar For a Series 505 controller, bipolar unscales the real value to an
integer between --32,000 and 32,000. For an S5 controller, bipolar unscales
the real value to an integer between --1024 and 1024.
Zero bias For a Series 505 controller, zero bias unscales the real value to
an integer between 0 and 32,000. For an S5 controller, zero bias unscales
the real value to an integer between 0 and 1024.
The input variable is a real value within the range specified by the low
and high limits.
The output variable is the integer variable that stores the result of the
UNSCALE procedure.
The low limit is a real number that specifies the lower boundary of the
scaling range.
The high limit is a real number that specifies the upper boundary of
the scaling range.
Using UNSCALE The UNSCALE procedure generates an output that has the same format as
for a Series 505 an analog output. The operation of the UNSCALE procedure depends on the
Controller type of controller that you have. For a Series 505 controller, UNSCALE
simply takes the input value and converts it from a real value to a scaled
integer. See Figure 11-54.
Integer variable
Type
Real variable Low limit Real
High limit numbers Final result
of UNSCALE
Using UNSCALE If you have an S5 controller, the UNSCALE procedure converts a real value
for an S5 Controller to a scaled integer and then shifts the integer by 4 bits to the left. This
shifting occurs because S5 analog outputs are 16-bit numbers, with 11 bits
of resolution, and the 4 least significant bits are irrelevant. Figure 11-55
shows the bit shift that UNSCALE performs after converting your real
value to a scaled integer, in order to put the output variable in a format that
can be properly interpreted by an S5 analog output module.
Most significant bit For S5 controllers, the UNSCALE procedure shifts the scaled integer output 4 bits to the left.
0 1 0 1 0 0 0 1 1 1 0 0 x x x x á16384
215 214 213 212 211 210 29 28 27 26 25 24 23 22 21 20
This shifted value is the final result of the UNSCALE procedure. UNSCALE sends it out in
the output variable.
Viewing UNSCALE If you have an S5 controller and use Debug to view the result of UNSCALE,
Results in Debug the output variable falls in the range of 0--16384 (zero bias) or á16384
(S5 only) (bipolar). This is because the value has been shifted by four bits, which is
equivalent to multiplying it by a factor of 16. An S5 analog module reads
these values as falling within the range 0--1024 (zero bias) or á1024
(bipolar). Take this into account when you analyze what you are shown in
Debug.
Integer variable
Type
Real variable Low limit Real Final result
High limit numbers of UNSCALE
Compensating for If you want to use the output from the UNSCALE procedure for something
the Bit Shift other than an S5 analog output module, you must compensate for the bit
(S5 only) shift that is automatically performed when you use the UNSCALE
procedure. Either divide the value in the output variable by 16 after you
perform UNSCALE, or else, if the value is positive, send the output variable
to the RIGHTSHIFT procedure to shift it back (4 bits to the right). If your
output variable value is negative, the RIGHTSHIFT procedure does not give
you the correct result; RIGHTSHIFT takes the sign bit and assigns that
value to the vacated four bits.
Overview As part of the process of developing an APT program, you create a structure
that specifies the sequence of events in your control process. This structure
is called a Sequential Function Chart (SFC).
The main SFC starts the execution of program logic for a unit. Each
unit has only one main SFC. You can designate any SFC as the main
SFC by using the Promote option.
Parallel branches allow you to follow a single transition with more than
one step.
Selection branches allow you to follow a single step with more than one
transition condition.
Step 1 Step 1
ACTIVE inactive
Expression in
Transition 1 FALSE Transition 1 TRUE Transition 1
becomes TRUE.
Step 2 Step 2
inactive ACTIVE
You can control the operation of any SFC by toggling the .ENABL extension
of the unit or program. If the prog_name.ENABL bit is true and you set it to
false, all SFCs are turned off and all devices are set to an unlocked state
(manual mode). When you set the prog_name.ENABL bit back to true, the
first step of the main SFC is activated. All devices can then be placed in the
locked state (automatic mode) with the appropriate command or assignment
statement. The unit_name.ENABL extension works similarly for unit SFCs
and devices.
If the controller loses power, all units become inactive and remain inactive
until the power returns. When power returns, each unit and/or program
starts up in the initial step of the main SFC. One exception to this case is
safe-state SFCs. If a retentive safe-state SFC was armed before the power
failure and its trigger becomes true after the power returns, the safe-state
activates and re-enables the unit. Chapter 13 of this manual contains the
details about safe-state SFCs.
! WARNING
If you have an S5 controller, some or all of your program variables, step
transition expressions, and safe-state triggers can retain their value upon a
return from power failure. This could cause unexpected program behavior,
because SFC steps or safe-states could become active.
Unexpected program behavior can cause death or injury to personnel, and/or
damage to equipment.
Carefully consider what happens to your program variables, step transition
expressions, and safe-state triggers during power failure. The way you handle
your operating system defaults determines whether some memory is retentive
or not. Do not leave a variable set to true if that value could jeopardize program
operation upon return from a power failure. See the chapter called “Compiling
an APT Program” in the SIMATIC APT User Manual more information about
setting operating system defaults.
SFC Scope Like CFCs, SFCs are available at both the Unit Content Level and at the
Program Content Level. The availability of SFCs at the Unit Content Level
allows you to establish and maintain independent control of each unit. SFCs
at the Program Content Level allow high-level sequence control across unit
boundaries.
You can create any number of SFCs at both the Program Content and Unit
Content levels. However, if you have a Series 505 controller and want to use
the Step Logger option in the Debug Utility, you cannot have more than 64
SFCs in a unit. (Step Logger is not currently supported for S5.) One SFC
can call a subordinate SFC only if both SFCs are in the same unit.
SFCs in the same unit can also communicate with each other through
variables and objects residing at the Program Content Level or at the Unit
Content Level for that unit. SFCs residing in different units can
communicate with each other only through variables and objects residing at
the Program Content Level. An SFC in a unit cannot access a subordinate
SFC or safe-state SFC in another unit or at the global level. Global SFCs
cannot access subordinate or safe-state SFCs that are defined in units.
Overview Each step in an SFC can contain one or more commands that represent a
stage in the solution of a problem. A step is entered from the top and exited
from the bottom. An SFC can contain from 2 to 500 steps. APT
automatically numbers each step with a unique label from S1 to S500.
Types Figure 12-2 shows the three types of steps: initial, end, and regular.
The initial step is the step that is activated when an SFC is enabled. Each
SFC must contain one and only one initial step.
The end step specifies the actions that occur when the execution of an SFC
is complete. There can be no steps or transitions following an end step. An
active end step remains active until the SFC is disabled or aborted. An SFC
can have more than one end step.
A regular step is any step that is neither an initial step nor an end step.
Sections The statements within a step can be divided into two sections: the parallel
section and the math section. A step can include a parallel section, a math
section, both, or neither. (You can create a step that does not include any
statements). If a step includes both a parallel section and a math section,
the parallel section must precede the math section.
command object;
The commands used with individual APT objects are listed with the
explanation of each object. For example, see the chapter on devices for
an explanation of device commands.
identifier := identifier;
Both identifiers are the same type of value (real, integer, boolean,
array, etc.). These identifiers can be extension variables that are
created by the system, names that were defined in the “APT
Declarations” chapter in the SIMATIC APT Programming Reference
(Tables) Manual, or numerical values.
The word MATH marks the end of the parallel section and indicates
that the remainder of the step is a math section.
command object;
The commands that can be used with individual APT objects are listed
with the explanation of each object. For example, see the chapter on
devices for an explanation of device commands.
Figure 12-3 illustrates a step that includes both a parallel section and a
math section.
S3
Parallel
pit101.HHA := 24.7; Section
START a101;
AUTO tic101;
Overview An SFC can contain from 1 to 500 transitions. APT automatically numbers
each transition in an SFC with a unique label from T1 to T500.
A transition statement contains one and only one boolean expression that
determines when program control within an SFC passes from one step to
another.
Operator Example
= pt201 = 14
<> pt101 <> 14.0
Relational < pt201 < 13
<= pt101 <= 14.5
> pt101 > 14.9
>= pt201 >= 15
NOT NOT mcv103.OPND
Logical AND mcv201.CLSD AND mcv202.CLSD
OR mcv103.OPND OR (pt101 < 14.9)
S3 MATH
BEGIN
T3 Temp_hi:=(temperature > = 211.5);
temp_hi
S4
T4 edge (pulsed) or (bittest (slot, 12) and man_mode)
Evaluation A transition is entered from the top and exited from the bottom. Transitions
are evaluated according to the following rules:
If the transition condition is false, the step remains active and the
statements are executed again before the transition is re-evaluated.
S3 OPEN mcv201;
T3 mcv201.OPND
S4 MANUAL tic101;
S2 math_done := false;
T2 true
S3 MATH
BEGIN
real1 := real2 *ABS( real3);
T3 math_done SCALE(in1,out1,B,0.0,1000.0);
math_done := true;
S4
Initial and End The following rules for steps and transitions are illustrated in Figure 12-7.
Steps
Each SFC must contain one and only one initial step.
The initial step does not necessarily have to be placed at the top of the
chart. Regardless of its physical location, the execution of an SFC
always begins with its initial step.
Because an SFC can include branches, an SFC can contain more than
one end step.
S1
S3
S1 S2 S3 S4
S2
S5 S6
The same step cannot both follow and precede the same transition; that
is, the path leading from the step cannot loop directly back to the
transition that preceded that step.
The same transition cannot both follow and precede the same step; that
is, the path leading from a transition cannot loop directly back to the
step that preceded the transition.
S1 S1
S2 S2
S3 S3
Lines All symbols must be connected properly to ensure that the flow of control is
continuous. When you use the drawing icons in the SFC editor (especially
the macros), you can accidentally leave unconnected areas between the
various structures that you create. Use the line-draw icon to connect the
unconnected symbols.
S3 S3
Missing line
corrected
with Line-draw
Missing line icon
segment
S4 S5 S6 S4 S5 S6
NOTE: Lines in an SFC cannot cross each other. See page 12-16 for a
method to avoid this problem.
You cannot use arrows to change the direction of flow, only to document the
direction of flow in the program. Arrows are checked for accuracy when you
compile the program, and all arrows must point in the correct direction. For
example, all of the arrows in the SFC on the right side of Figure 12-10 point
in incorrect directions and are errors that prevent the program from
compiling.
S1 S1
S2 S3 S2 S3
Graphic SFCs that include many lines sometimes become cluttered and difficult to
Connections interpret, especially when they involve looping structures.
The graphic connection icon allows you to transfer control to a specified step
without drawing a connecting line. This makes it possible to avoid
intersecting lines in an SFC. For example, the graphic connection in
Figure 12-11 transfers control to Step S7 without crossing any other lines.
S1 S1
S2 S3 S4 S5 S2 S3 S4 S5
S6 S7 S6 S7
S8 S8
S7
Parallel Branching Parallel branching allows you to designate steps that execute at the same
time as other steps. A parallel branch begins with a single transition,
always contains a top crossbar, and can end with a bottom crossbar.
The top crossbar follows a single transition and leads to two or more
steps.
The left side of Figure 12-12 shows the top crossbar leading to two parallel
steps. When Transition T2 becomes true, Steps S3 and S4 both become
active; each step remains active until its corresponding transition becomes
true.
The right side of Figure 12-12 shows two parallel steps leading to a bottom
crossbar that returns to a single transition. Both Steps S3 and S4 (after
they become active) remain active until Transition T3 becomes true, at
which time End Step S5 becomes active.
S1 S1
T1 T1
S2 S2
T2 T2
S3 S4 S3 S4
T3 T4
T3
. .
. .
. . S5
Step S1 is active.
S1
T1
S2 S3 S4 S5
T2
T3
S7 T4
T5
S8
S1
T1
S2 S4 S10 S13
T2 T3 T7 T9
S3 S5 S11
T10 T12
S6
S15
T11
S7
S12
S16
T5
S8
S18 S20
T13
T6
S9
T8
Parallel Branching Although the SFC Language allows you a great deal of flexibility, there are
Rules a few rules that you must observe when you implement a parallel branch:
The top crossbar of a parallel branch can have only one entrance path,
which must enter from above the crossbar.
The top crossbar of a parallel branch must have at least two exit paths,
which must exit downward from the crossbar.
Each path exiting the top crossbar of a parallel branch must begin with
a single step or a graphic connection.
Each path entering the bottom crossbar of a parallel branch must end
with a single step.
The bottom crossbar of a parallel branch can have only one exit path,
which must exit downward from the crossbar.
! WARNING
APT allows the use of parallel end steps (that is, end steps in a parallel branch
structure). When any end step is encountered in a sub-SFC, control returns to
the parent SFC. If any other steps in the parallel branch are currently active
when an end step is reached, they remain active.
Having multiple active SFC steps could cause unpredictable operation of the
controller, which can result in death or serious injury to personnel, and/or
damage to equipment.
Avoid the use of parallel end steps in any but the Main SFC.
Selection Selection branching allows you to “divert” SFC execution to one of several
Branching paths depending on the value of transition conditions. The paths may or
may not subsequently converge.
A selection branch begins with a single step, contains a divergence line, and
can end with a convergence line.
The divergence line follows a single step and leads to two or more
transitions.
The left side of Figure 12-16 shows a divergence line leading to two
transitions. Step S2 (after it becomes active) remains active until either T2
or T3 becomes true. SFC execution then proceeds to the step following that
transition. If more than one transition from a divergence line becomes true
simultaneously, SFC execution continues through the path of the leftmost
true transition.
The right side of Figure 12-16 shows a convergence line that leads to End
Step S5 when either Transition T4 or T5 becomes true.
S1 Divergence line S1
T1 T1
S2 S2
T2 T3 T2 T3
S3 S4 S3 S4
T4 T5 T4 T5
S5 S6
S5
Convergence
line
Divergence line
S1
T1
S2
T2 T3 T4
S3 S4 S5
T5 T6
S6
Convergence line
Figure 12-18 shows an SFC with two convergences and loops. Figure 12-19
shows an SFC with both selection branches and parallel branches. Try to
avoid drawing very complex or irregular SFCs connections.
Divergence line
S1
Convergence line
T1 T3 T5 T8
S4 S6
T6 T9
S2 S3
S7
T10
T2 T4
S5
T7
Convergence line
S1
T1 T3 T5 T8 T10
S2 S3 S5 S8 S11
T4 T6 T9 T11
S4
S6
S12
T7 S10
T2
S7
T12
S9
The rules that you must observe when you implement the divergence of a
selection branch follow:
A divergence can have only one entrance path, which must enter from
above the divergence line.
A divergence must have at least two exit paths, each of which must
begin at a different point on the divergence line.
The rules that you must observe when you implement the convergence of
selection branches follow:
A convergence can have only one exit path, which must exit downward
from the convergence line.
Main SFC The main SFC starts the execution of program logic for a unit. Before you
compile a unit, you must use the Promote option to designate one (and only
one) SFC as the main SFC for that unit.
APT automatically promotes the first SFC that you enter. If you enter
additional SFCs and determine that one of these should be the main SFC,
promote that SFC using the Promote option.
If the unit_name.ABORT variable is set to true, all SFC steps are forced
inactive. SFC execution does not resume when unit_name.ABORT returns to
false.
To restart the SFC in the initial step of the main SFC, you must set the
unit_name.ENABL bit to false and then to true.
The one exception to this is the case of a safe-state SFC that was
triggered before unit_name.ABORT was set to true. In this situation the
safe-state SFC does start up when unit_name.ABORT goes to false. (See
Chapter 13 for information on safe-state SFCs.)
A subordinate SFC is one that is “called” from another SFC. The calling
SFC and the subordinate SFC must both reside in the same unit; that is,
one SFC cannot call a subordinate SFC in a different unit.
You can “nest” subordinate SFCs; that is, one subordinate SFC can call
another subordinate SFC. There is no limit to the number of levels to which
you can nest subordinate SFCs.
A subordinate SFC can be called from only one step in only one SFC. In
other words, two different SFCs cannot call the same subordinate SFC, nor
can the same subordinate SFC be called from two different steps within an
SFC.
SFC sfc_name;
A subordinate SFC can be called from only one step in only one SFC.
You can use the SFC command only in initial steps and regular steps,
not in end steps.
The SFC statement must be the only statement in the step. That is, a
step that contains an SFC statement cannot contain any other
statements except comments.
The initial step of the subordinate SFC becomes active, and the calling
step in the calling SFC remains active.
The end step of the subordinate SFC and the calling step of the calling
SFC remain active until the transition following the calling step
becomes true.
When that transition becomes true, the end step of the subordinate
SFC and the calling step of the calling SFC simultaneously become
inactive; the step following the transition becomes active.
Calling SFC
T7
S8 SFC cool;
T8
S1
T1
S2
T2
S3
Step S8 of SFC, r01_cntl, calls the subordinate SFC cool. The execution
of the calling SFC, r01_cntl, pauses at Step S8.
The subordinate SFC cool, begins to execute from its initial step, S1,
and continues to execute through its end step, S4.
T1
T8 temp <65;
{true if reactor cooled}
S2
S9 T2
S3
T3
S4 {End step}
Types A safe-state SFC is a special SFC that is designed to interrupt the execution
of other SFCs. A safe-state SFC can execute an emergency procedure, or it
can perform special processing out of the normal flow of control.
Safe-State Priority Each main and subordinate level safe-state SFC must be assigned one of
five priority levels, numbered 1 through 5, or a local priority. Level 1
safe-state SFCs have the highest priority and override all other safe-state
SFCs. Local safe-state SFCs have the lowest priority.
Only one local safe-state of any given SFC can be active at one time.
However, multiple local safe-state SFCs can be active if they belong to
different SFCs. It is possible for two local SFCs in the same subordinate
path to become active at the same time if the lowest subordinate SFC
becomes active first.
! WARNING
Do not use the safe-state SFC as a replacement for a hardwired mechanical
emergency stop function.
Doing so could cause unpredictable operations that could result in death or
serious injury to personnel, and/or damage to equipment.
Any safety-critical operations must always be wired independently of any solid
state computer-controlled operation. It is acceptable to use the safe-state SFC
for supplemental protective purposes if, and only if, hard-wired backup is also
used in the event of any computer malfunction.
Overview Seven APT commands are related to safe-state SFCs. Four of the commands
can be used only in a safe-state SFC, as is explained below.
The initial step of a safe-state SFC must contain the following two
commands:
The SSDEFINE command sets the priority (Level 1--5 or local) of the
safe-state SFC.
Each end step of the main SFC in level safe-state SFC network must
contain one of the following commands:
Each end step of the main SFC in a local safe-state SFC network must
contain only the SSRETURN command, and it must return to the SFC
named in the SSDEFINE statement. The SSABORT command cannot be
used in a local safe-state SFC.
The SSARM command indicates that you want to begin monitoring the
trigger condition so that you can interrupt the process if necessary.
The SSENTRY command specifies a step where you want to restart the
process when the safe-state SFC is completed. The SSENTRY
command is used only in a non-safe-state SFC.
Command Restrictions
Use only in the end step of a main-level safe-state SFC; must
SSABORT
be the only statement in the step.
SSARM (no restrictions)
Use only in the initial step of a safe-state SFC; must be the
SSDEFINE
first statement in the step.
SSDISARM (no restrictions)
Use only in a “normal” (non-safe-state) SFC; must be the
SSENTRY first statement in the step or immediately following another
SSENTRY; maximum of 10 per step.
Use only in the end step of a main safe-state SFC. A main
SSRETURN safe-state SFC can have more than one SSRETURN but
these must be the only statements in the step.
Use only in the initial step of a main safe-state SFC; must
SSTRIGGER immediately follow an SSDEFINE or another SSTRIGGER
statement.
Table 13-2 summarizes the steps in safe-state SFCs that have requirements
concerning the step commands that they must contain.
SSENTRY The SSENTRY command defines a label that you use to indicate where the
Command program returns when a safe-state issues the appropriate SSRETURN
command.
SSENTRY label;
The SSENTRY command identifies the step in the normal SFC that
you want to use to restart the processing after a safe-state has
completed execution.
The SFC containing the step identified by the SSENTRY label must
reside in the same unit as the SFC containing the SSRETURN
statement that uses that label.
SSRETURN label;
You can use the SSRETURN only in the end step of a main safe-state
SFC.
The SFC containing the step identified by the SSENTRY label must
reside in the same unit as the SFC containing the SSRETURN
statement that uses that label.
! WARNING
APT allows you to specify any step as a return point for a safe state. Do not
program a safe-state condition to return to a single step within a parallel
structure.
If your return point is a single step within a parallel structure, this step is the
only one that is active when you return, and your program is unable to advance
past the parallel structure. The consequence is unpredictable operations that
could result in death or serious injury to personnel, and/or damage to
equipment.
Figure 13-1 illustrates the type of safe-state return condition that you must
avoid.
S1
S2 S4 S5
S3 S6 Safe-state returns to S6
S7
SSDEFINE The SSDEFINE command defines an SFC as a safe-state SFC and specifies
Command the priority of a safe-state SFC.
The initial step of every safe-state SFC must contain one and only one
SSDEFINE statement, which must be the first statement in that step.
The SFC name is the normal SFC with which the local safe-state SFC
is associated.
Only one local safe-state of any given SFC can be active at one time.
However, multiple local safe-state SFCs can be active if they belong to
different SFCs. It is possible for two local safe-state SFCs in the same
subordinate path to become active at the same time if the lowest
subordinate SFC becomes active first.
A subordinate safe-state SFC must have the same priority level or the
same normal SFC name (local safe-state SFCs) as the SFC that calls it.
If you define a safe-state SFC with the RETENTIVE option, you do not
have to enable the unit to restart the process.
For Series 505 controllers, the step must consist of RLL statements
only; this restriction does not apply to S5 controllers, into which only
STL is loaded.
SSTRIGGER The SSTRIGGER command specifies a condition that triggers the execution
Command of a main safe-state SFC.
The identifier is the name of a digital I/O point or a boolean or APT flag
variable that triggers the execution of the safe-state SFC when it
becomes true.
When a safe-state SFC is armed and its trigger condition becomes true,
it interrupts the execution of the currently executing SFC. A safe-state
SFC can interrupt a “normal” (non-safe-state) SFC or a safe-state SFC
with a lower priority.
The initial step of every main safe-state SFC must contain at least one
SSTRIGGER, which must appear immediately following the
SSDEFINE.
You can use any number of SSTRIGGER statements in the initial step
of a main safe-state SFC, but all statements must immediately follow
the SSDEFINE statement and precede any other types of statement.
SSARM Command The SSARM command “arms” a safe-state SFC and, thus, makes it possible
for the safe-state SFC to interrupt the processing if the trigger becomes
true.
SSARM sfc_name;
When you use the SSARM command to arm a safe-state SFC, the
program starts to monitor the conditions that are specified in the
SSTRIGGER statement.
SSDISARM The SSDISARM command “disarms” a safe-state SFC and, thus, does not
Command allow a safe-state SFC to interrupt SFC processing.
SSDISARM sfc_name;
NOTE: When a unit is first enabled, all safe-state SFCs are initially
disarmed.
SSABORT The SSABORT command suspends SFC execution in the current unit.
Command
For the SSABORT command, use the format:
SSABORT;
The SSABORT statement must be the only statement in the step; that
is, a step that contains an SSABORT statement cannot contain any
other statements.
When you use the SSABORT command to suspend unit execution, all SFCs
in the current unit become inactive. The SFCs in the unit remain inactive
until you re-enable the unit.
The SSABORT command does not actually disable the unit but
deactivates the current step and leaves no steps active in any SFCs in
the unit.
The SSABORT command does not disarm any armed safe-state SFCs;
therefore, it is possible for an aborted unit to become active again if the
trigger of an armed safe-state becomes true.
The SSABORT command does not affect CFBs, devices, etc. in the unit.
To re-enable the unit and reactivate the main SFC after an SSABORT has
executed, you must set the unit_name.ENABL bit to false and then set it
back to true. You can do this with any one of the following methods.
! WARNING
If you shut down an SFC using the SSABORT command, the safe-state SFC
remains armed. It can be reactivated and cause other portions of your SFC to
begin again through the SSRETURN command.
If your safe-state SFC is still armed when your SFC reactivates, it could cause
unexpected operation of your application, resulting in death or serious injury to
personnel, and/or damage to equipment.
When you use SSABORT, always disarm your safe-state SFC.
Emergency A main SFC named chrg_raw controls the charging of raw material into a
Procedures reactor. The pressure in the reactor increases during this procedure. If the
pressure becomes too high, an emergency procedure must be performed; the
safe-state SFC named hiprs_rw controls this emergency procedure.
Figure 13-2 illustrates the sequence of events that occurs when chrg_raw is
interrupted by hiprs_rw. The control flow follows:
Since the safe-state SFC is now armed, the program begins to monitor
the status of the trigger condition.
At this point, APT checks the priority of hiprs_rw (2) against the levels
of any other currently executing safe-state SFCs. If no Level 1 or
Level 2 safe-state SFCs are executing, hiprs_rw can interrupt the
process.
When chrg_raw reaches its end step (S4), hiprs_rw is disarmed. The
status of its trigger condition is no longer monitored, so hiprs_rw can
no longer interrupt normal processing.
SFC: chrg_raw
S1 SSARM hiprs_rw;
T1
S2 SSENTRY hi_pres_lvl;
S3 S1 SSDEFINE LEVEL 2;
SSTRIGGER pit101.INHHA;
T3 T1
S4 SSDISARM hiprs_rw;
{end step}
S8 SSRETURN hi_pres_lvl;
ss2 is a level 2 safe-state SFC that triggers when the temperature is too
high.
ss1 is a level 1 safe-state SFC that triggers when the pressure is too
high.
ss4 is a level 4 safe-state SFC that triggers when the pressure is too
low.
Each of the safe-state SFCs is designed to return control to the initial step
of main.
While ss2 is executing, the pressure becomes too high. As a result, ss1
(a Level 1 safe-state SFC) interrupts ss2 (a Level 2 safe-state SFC).
After ss1 completes execution and returns control to main
(Figure 13-3b).
Because the temperature remains too high, ss2 interrupts main as soon
as the return step in the main SFC completes one execution. While ss2
is executing, the pressure becomes too low. However, ss4 (a Level 4
safe-state SFC), cannot interrupt ss2 (a Level 2 safe-state SFC). When
ss2 completes execution, control returns to main (Figure 13-3c).
Because the pressure remains too low, ss4 interrupts main as soon as
the return step in the main SFC completes one execution
(Figure 13-3d).
.. SS2 .. ..
. . .
..
.
b Main SS2
SS1 SS4
..
.
.. .. ..
. . .
c
Main SS2 SS1 SS4
.. .. .. ..
. . . .
d Main SS4
SS2 SS1
.. ..
. .
.. ..
. .
Overview After you compile a program, APT displays one of the following messages:
Compiling with If you compile a Debug version of your program, the messages are not
Debug affected. The Debug Version does, however, require more controller memory.
When you select the Debug version, APT creates additional code to the
object so that the Debug utility options are available.
Overview When the Compile operation completes successfully, you can receive one the
following messages:
You cannot use the APT Debug utility until you have a successful compile.
! WARNING
APT provides compiler warnings whenever something is detected that might
cause problems. These warnings are not compiler errors and do not stop you
from downloading your program to the controller.
If you download your program to the controller without taking compiler
warnings into consideration, your process could be adversely affected.
Unpredictable operation of the controller can result in death or serious injury to
personnel, and/or damage to equipment.
Read each compiler warning carefully and take appropriate action to correct
warning conditions before you download the compile object file into your
controller. A list of compiler errors and warnings, in numerical order, is
provided in Table A-1.
Overview The compile operation may not complete for several reasons:
This message indicates that you have aborted your compile by pressing
ESC . No object file has been created.
This message indicates that you have not changed your APT program
since your last successful compile. If you want to recompile, select
Force Compile in the Compiler Control File.
NOTE: Be certain that you keep track of any warnings that exist in your
program. A recompile that results in this message creates a new
COMPILE.RPT without listing the warnings.
2. Correct all of the errors that you know how to fix, and re-compile your
program.
Some mistakes within your program can cause more than one error in
the COMPILE.RPT. There are errors that, when identified during the
compile, can cause a compile phase to be discontinued. Thus, if you fix
an error of this type, the next compile continues further into your
program but identifies other errors that were not yet encountered.
NOTE: The APT Validate option can be run from various levels in the
hierarchy to check individual areas of your program for syntax-related
errors. This can save you time.
The APT Validate option cannot find all problems that relate to using
functions/options not supported by a specific controller model. This is
identified in a later phase of the compile operation.
Repeat Steps 1 and 2 until you complete a successful compile. If you cannot
fix all your problems following these steps, compile your program with the
Force Compile selected in your Compiler Control File.
If you have followed the above steps and you still receive an Internal Error,
call the Siemens Energy & Automation, Inc., Technical Services Group in
the U.S.A. at (800) 333--7421. Outside the U.S.A., call 49--911--895--7000.
Table A-1 contains a list of errors that can appear in the COMPILE.RPT
file. Many of these errors can be detected if you use the Validate option
while you are building your program.
The line numbers for errors that occur in SFC Steps, Transitions and Math
CFBs are calculated as accurately as possible but can be off by one or two
lines.
x .. y means that the value must be greater than or equal to x and less
than or equal to y.
x >. y means that the value must be greater than x and less than or
equal to y.
x .< y means that the value must be greater than or equal to x and less
than y.
x >< y means that the value must be greater than x and less than y.
Number/Error Explanation
The cross reference files were corrupted. A force compile is
Corrupt cross reference files. Force
compile occurring to recover data. required. You will not be able to incrementally compile or
download and you may have to retranslate marked tags.
You made changes in the Compiler Control File requiring a force
Force compile occurring due to
controller record being updated. compile. You will not be able to incrementally compile or download
and you may have to retranslate marked tags.
The APT program was never compiled, the object code was deleted,
Force compile occurring due to no or the archive that this program was restored from was archived
previous object information existing. with the source only. You will not be able to incrementally compile
or download and you may have to retranslate marked tags.
Unit was unmarked or deleted since A unit was unmarked in the Compiler Control File or a unit was
previous compilation. deleted from the hierarchy.
Additional objects were marked for translate and the
New information was marked and
translate flag is set ”YES”. Build Translate table option in the Compiler Control File was set
to YES.
Change in the module editor For Series 505, additional I/O points were added to addresses
requires reallocation of overflow previously used as overflow CRs. The overflow CRs must start
CRs. after the last configured I/O address for each channel.
Translate build flag changed to YES The Build Translate table option in the Compiler Control File was
from NO or APPEND states. changed to YES from NO or APPEND.
Changes in APT require a force compile for phase 6 only. You will
Assembly force compile is required. not be able to incrementally compile or download and you may
have to retranslate marked tags.
Number/Error Explanation
The program has units, but they are not marked for compile. The
2003 Program compiled with no
units marked. information in all units will not be compiled and will not exist in
the controller.
An SFC needs to be promoted in this unit. Each unit within your
2007 Unit ... contains no main SFC. program must have one and only one main (promoted) SFC, which
is used as the starting point of all sequential control for that unit.
Number/Error Explanation
3003 No address assigned No controller address was assigned, but the variable is being used
... must be addressable by the program. Check that the variable is not declared with the
cannot use non-addressable objects NONE attribute under the controller address.
...Cannot be constant and must be Trying to change a variable that was declared a constant or that
addressable accesses a variable that has no controller address. Check to see
whether the variable is declared ‘constant’ or the NONE attribute
under the controller address was selected.
...Cannot be a WI, BI, or constant Trying to change a variable that was declared a WI, BI, or a
and must be addressable constant or that accesses a variable that has no controller address.
Check to see whether the variable is a WI, BI, or constant, or
whether the NONE attribute under the controller address was
selected.
...must be an array of size 11 When using a correlated look-up table or value sequencer, the
and must be addressable array size for the input value array and the output value array is
eleven elements. Also, the array must contain controller addresses.
Cannot copy a constant recipe A constant recipe cannot be copied, moved, selected, cleared, or
Cannot move a constant recipe unblocked because it cannot be written to. A constant recipe does
Cannot select a constant recipe not use any of the recipe extensions. Check that the recipe was not
Cannot unblock a constant recipe declared constant.
Cannot clear a constant recipe
Parameters must have same recipe Cannot copy to a recipe that does not use the same recipe
template template. The destination recipe and source recipe must be made
from the same recipe template. Check that they are using the
same recipe template.
Address type must be WX For AI, RT, WI, BI, and TC input modules, the address must be
WX for Series 505 controllers.
Address type must be WY For an AO, BO, and WO output modules, the address must be WY
for Series 505 controllers.
Address type must be X For a DI, the address must be X for Series 505 controllers.
Address type must be Y For a DF or DO the address must be Y for Series 505 controllers.
Cannot filter with no scale range Cannot select the No Scale option with the Filter option. Check
selected attributes of your analog input and see if both are selected and
choose only one.
Only discrete modules are valid over The 545 release 2.x and greater can have 2048 discrete points.
addresses 1024 for this controller Check that only discrete I/O modules are used in the second 1024.
Controller type and block type are The 560T does not have the capability of handling floating point
incompatible numbers (reals). The CFB you are using uses floating point
numbers in its calculations. This error also occurs with an S5
controller when you try to use an unsupported CFB.
Scan time must be 0 for variable If you select the scan time for the controller to be VARIABLE
scan type (which is the default), the total scan time must be set to 0 msec in
order for the variable scan time to work properly. Check total scan
time on the Compiler Control File to see that it is set to 0.
Number/Error Explanation
3003 Cannot give both U-memory file If you want to use U-memory you must either allocate U-memory
name and a U-memory value or give a U-memory filename; you cannot do both. Check the
Compiler Control File to see if you have entered both, and use only
one. Refer to the appropriate Series 505 programming reference
manual in the section on External Subroutine Development.
U-memory file does not exist You entered a U-memory file name on the Compiler Control File,
but you do not have a U-memory file in the
APT \PROGRAM\program_name\PRR subdirectory. The U-memory file
is in S-record format for the Motorola CPUs. Check to see that it is
in the APT\PROGRAM\program_name\PRR subdirectory. Refer to the
appropriate Series 505 programming reference manual, External
Subroutine Development for details on the U-memory file.
Value must be less than high range Check that the value entered is within the range of the variable. It
Value must be greater than low must be less than the high range and greater than the low range.
range
Value must be between ... and ... Check the value entered is not greater than the upper limit or less
than the lower limit.
Controller type and I/O type are I/O types: RT and TC are not supported for S5 controllers.
incompatible
PW addr. range is 0 ... 254; You have entered an I/O input that is outside the supported
OW addr. range is 0 ... 254; address range for S5. Check your address.
IW addr. range is 0 ... 126;
PW addr. range is 0 ... 254; You have entered an I/O output that is outside the supported
OW addr. range is 0 ... 254; address range for S5. Check your address.
QW addr. range is 0 ... 126;
I addr. range is 0 ... 127; Digital inputs for S5 controllers must be in the 0--127 range. Check
your address.
Q addr. range is 0 ... 127; Digital outputs for S5 controllers must be in the 0--127 range.
Check your address.
3004 ... In ..., near line ... The listed error occurred near the specified line of a file.
3005 ... not defined The specified object has not been defined. It is referencing itself
indirectly, or is at the wrong scoping level.
... not defined type should be ... An object’s scoping level is determined by where it is defined in the
hierarchy. Objects defined at the unit level can reference other
... not defined type should be ...
In ..., near line ... objects defined within the unit and objects defined globally, but not
objects defined within other units. Objects defined globally cannot
reference objects defined at the unit level.
Number/Error Explanation
3006 ... type should be ... The specified object or verb parameter was of the wrong type. It
... not defined must be one listed in the error message. If the object is defined, its
in object ... , field ... type is listed.
... type should be ...
It is possible for the type to be one of the listed types and still fail
in object ... , field ... validation. When this is the case, the error message lists the
reasons.
... type should be ...
... was ...
in object ... , field ...
... type should be ... (This message is displayed only if you are
No value entered, executing an action on an object using a verb.
substituted default value ... The message lists the reason for the error.)
in object ..., field ...
3008 ... value ... not in range ...
in object ... , field ... (The message lists the reason for the error.)
In ... , near line ...value
... not in range ...
in object ... , field ...
value ... not in range ...
The value is not in the correct range. The specified value is for the
value ... not in range ... object’s field or verb parameter must be within the correct range.
in ... , near line ...
Number/Error Explanation
3014 Object missing for verb or function ... The object of the verb was not specified.
3015 Invalid verb ... for object ...
Invalid verb ... for object ... The specified verb is not valid for the specified object.
In ..., near line ...
3018 Value ... cannot be a constant Value in specified field cannot be a constant boolean.
boolean.
Number/Error Explanation
5018 field was <empty>, type should The field of the specified object is empty. It must contain one of the
be ... in object ..., field ... types listed in the message.
5019 ... type should be ... literal in The field of the specified object must contain a literal of the type
object ... , field ... listed in the message.
For Series 505, integers require one memory location and real
numbers require two memory locations. For example, V1. refers to
both V1 and V2. For S5 controllers, integers require two flag
5020 Real addresses require ... memory memory locations and real numbers require four flag memory
locations locations. For example, FD1 refers to FY1, FY2, FY3, and FY4. For
data memory in DB/DXs in S5 controllers, integers require one
memory location and real numbers require two memory locations.
For example, DB3:D1. refers to both D1 and D2.
5021 I/O name ... has no address The specified I/O object was not assigned an address in the module
assigned. table.
5022 No value entered, substituted The problem usually occurs on a restored program from a previous
default value ... release. This goes away after the first compile.
5023 No value entered, no default value The problem usually occurs on a restored program from a previous
to substitute. release. The field must be initialized with a value.
User-defined math was selected but no math statements were
5024 Math was selected but not defined entered. If this message is displayed as a warning, the compile will
in object ... , field ... not fail. If this message is displayed as an error, you must enter
the math statements before the program will compile.
5026 Constant value ... assigned to
recipe element ... in recipe ... has A problem was encountered assigning a constant value to the
not been declared. specified recipe element. It was not declared, not the correct type,
Constant value ... assigned to or does not exist at the correct scoping level. Scoping level is
recipe element ... in recipe ... is not defined under Error 3005.
of the correct type.
The address format is incorrect. It must be preceded with a % sign,
5030 Address format ... is invalid. contain an address type (e.g., V, C, K, etc., for Series 505 and FW,
(Start with “%”, no “ . ” allowed). DW, SW, etc., for S5), and be followed by the address offset. It
cannot contain any trailing characters, including a trailing period.
The address type was not valid (i.e., VMX instead of VMM), the
5031 ... is an invalid address in object ...,
field ... format was incorrect (i.e. %VMMFF00 instead of %VMM0FF00),
and/or the address was not an odd VMM or VMS offset.
5032 ... requiring ... locations is out of All elements of an array with a user defined address must be
range (... reserved) within the reserved address range.
in object ..., field ...
... requiring ... locations is out of The specified range in the message is the closest valid range based
range (... reserved) on the starting address and array length. For Series 505 boolean
value ... not in range ... arrays, requested array range may cross retentive/non-retentive
returned address cross boundary.
retentive/non-retentive boundary
in object ..., field ...
Number/Error Explanation
The object field requires a float value. The integer was
5058 Converted value ... in float field to ... automatically converted to a float. This goes away after the first
compile.
5059 Cannot specify an address for You cannot assign a user address to a recipe if any of the elements
recipe ... if it contains boolean
elements. are boolean.
Number/Error Explanation
7000 The Sub-SFC ... that is called from ... The SFC references a Sub-SFC that does not exist. Correct the
doesn’t exist. spelling or create the named SFC.
7001 SFC ... is called from more than one
SFC (... and ...). An SFC can only be referenced from one SFC.
7002 SFC ... is not called. An SFC must be a main SFC or referenced by another SFC.
7003 SFC ... and Sub-SFC ... are different
level safe-state SFCs. All safe-state sub-SFCs must be the same level as the calling SFC.
7011 Duplicate safe-state entry point ... in An SSENTRY point is defined more than one time. Remove
SFCs ... and ... duplicate SSENTRY points.
An SSRETURN statement has a label that does not exist or cannot
7012 Safe-state entry point ... referenced be found. Check for typographical errors or a label that is more
in SFC ... does not exist. than 12 characters; verify that a valid SFC contains the proper
SSENTRY statement.
7013 Maximum SFCs of 64 exceeded in
unit ... You can have no more than 64 SFCs in any one unit.
7014 The local SFC ... identified in A local safe-state must reference a normal SFC. Correct the
safe-state ... does not exist. spelling or create the named SFC.
An SSRETURN statement of a local safe-state SFC must return to
7015 The ssreturn ... in SFC ... does not
return to the local-to SFC ... the SFC to which it is local. Change the SSRETURN statement so
that it points to an entry point inside the LOCAL-TO SFC.
7016 SFC ... is not local to the same SFC
as its parent ... All safe-state sub-SFCs must be the same level as the calling SFC.
Number/Error Explanation
8000 [Graphical Error] Destination step An SFC graphical GOTO is not properly defined. A graphical
S... of goto at tile ... not defined. GOTO must have a destination step.
8001 [Graphical Error] Invalid symbol at
location .... An unrecognized or invalid symbol is found.
8002 [Graphical Error] Line leads off top A line leads off the top of Row 1. This can occur if you delete the
of SFC. top row of the SFC.
8003 [Graphical Error] Line leads off
bottom of SFC. A line leading off the bottom of Row 100.
Number/Error Explanation
8017 [Graphical Error] No initial step for
SFC. Each SFC must have one and only one Initial Step.
8019 [Graphical Error] Incomplete An incomplete structure is found. Be certain that all lines are
graphics tile in input at location .... connected.
8020 [Graphical Error] Step S... at In an SFC, the path from a transition cannot lead to the step
location ... has the transition T... both immediately preceding that transition. Check for a graphical
before and after. GOTO or a line that loops back to the step it exits.
Two SFC steps are incorrectly connected. The following situations
8021 [Graphical Error] Illegal connection cause this error: illegal divergence lines, illegal loop backs, lines
at location .... not connected to transitions or steps, a graphical GOTO not
following a transition.
8022 [Graphical Error] A transition follows This error is caused by an invalid SFC construction. A path traced
transition at location .... from one step to another must pass through a single transition.
8023 [Graphical Error] A transition This error is caused by an invalid SFC construction. A path traced
precedes transition at location .... from one step to another must pass through a single transition.
8024 [Graphical Error] Maximum Only 500 steps / transitions are allowed in a single SFC. This is
step / transition label exceeded at
location ... usually resolved by resequencing the SFC.
8050 Duplicate step S... at location ... A duplicated step is found. Use Resequence option to correct.
8051 Duplicate transition T... at location ... A duplicated transition is found. Use Resequence option to correct.
8052 Left parenthesis missing. A left parenthesis is expected in the described location.
8053 Right parenthesis missing. A left parenthesis appears without a right parenthesis.
8054 Parenthesis mismatch. An odd number of parentheses occurs within a verb operation.
8055 Right bracket missing. An array reference appears without a right bracket.
Number/Error Explanation
A direct controller address has been found that is invalid. Be
8061 Invalid direct controller identifier ....
certain that the syntax of the identifier and the controller size are
correct. An example of an invalid address is %WW97. (WW is not a
valid controller address type.)
The closing delimiter for a comment is not found. Comments
8062 Comment not closed. should be enclosed with one of the following delimiters: {...} or
(*...*).
Number/Error Explanation
8077 Invalid real number .... An invalid real number or real number expression is found.
8078 No SSABORT or SSRETURN allowed An SSABORT or SSRETURN statement appears in a
in
step. non-safe-state SFC end step.
Number/Error Explanation
You can use braces { } or parentheses with asterisks (* *) as
delimiters for comment statements. However, you cannot use the
8097 Embedded comment detected. same opening delimiter twice in succession.
For example, { {This comment is illegal} }.
{ (*This comment is permitted.*) }.
8098 Label ... is too long: 12 characters is The maximum number of characters allowed for a safe-state
maximum allowed. return label is twelve.
8099 Integer ... is not in range The value of the unsigned integer indicated must be within the
[0..65535]. range shown.
Error is caused by defining a safe-state SFC as local but giving the
8100 TO keyword missing following
keyword LOCAL. syntax incorrectly. Make sure the keyword TO follows the word
LOCAL in the initial step of the safe-state SFC.
Error is caused by defining a safe-state SFC as local but giving the
8101 SFC name missing following
LOCAL TO command. syntax incorrectly. Make sure an SFC name follows the key words
LOCAL TO in the initial step of the safe-state SFC.
An attempt was made to execute an SSABORT from a local
8102 SSABORT is not valid from a local
safe-state SFC. safe-state SFC. An SSABORT can only be executed from a level
safe-state SFC. Use SSRETURN in local safe-state SFCs.
Number/Error Explanation
A variable has been declared twice. This occurs typically in an SFC
9000 Illegal/Duplicate declaration.
step declaration or after copying an external unit into your
program. This error also occurs if you use an APT keyword in your
declaration.
Number/Error Explanation
Use braces { } or parentheses with asterisks (* *) as delimiters for
comment statements. You cannot use an opening delimiter twice in
9022 Possible nested comment. succession.
For example, { {This comment is illegal} }.
{ (*This comment is permitted.*) }.
9023 Beginning of poorly formed Typically, this message is displayed when a comment is opened but
comment. not closed.
9024 Illegal mixing of types near One or more items in the expression are of the wrong type or need
expression.... to be of the same type.
A Math function or procedure is incorrectly programmed. Typically,
9026 Bad argument for function or
procedure call. a typographical error exists or an invalid variable type has been
used.
A Math function or procedure is incorrectly programmed. Typically,
9027 Undefined/illegal function or
procedure call. a typographical error exists or an invalid variable type has been
used.
9028 Array not proper size. The statement requires the array used to be of a specific size.
Number/Error Explanation
When a locally-declared timer is initialized, values for all four
elements of the timer must be specified, and they must be assigned
in the following order:
timer <type>: variable, variable,...:= constant1, constant2, constant3, constant4; The
9040 Invalid initial value for timer variable. timer type can be fast or slow.
Constant1 is an integer and contains the current value of the timer.
Constant2 is an integer and contains the preset value of the timer.
Constant3 is a boolean that resets the timer.
Constant4 is a boolean that enables the timer.
9041 Array index range must start at 1, When an array is declared locally, the starting index range value
and its length must be >= 1. must be 1.
The initial value for the Timer/Counter Current (TCC) or
9042 Timer initial values out of range. Timer/Counter Preset (TCP) is out of range. The valid range for
these elements is 0--32767.
9043 Identifier is APT keyword. Assign a different name to the identifier.
9056 Array index must be an integer. An array variable appears without an index.
Number/Error Explanation
9063 Endif, elsif or else not contained
within if statement at location ..., The IF/THEN/ELSIF/ELSE construct is incorrect. Refer to
step ..., near line ... in object ..., Chapter 10 of this manual for the correct syntax.
near line ...
9078 INCREMENT/DECREMENT are not Increment and decrement verbs are not allowed with a user
allowed in a user defined subroutine. subroutine.
Step, transition, or Math CFB includes statement that cannot be
10001 : line ... structure too large for
assignment on target machine. compiled. This error also occurs when using an integer array size
greater than 32767 or a real array size greater than 16383.
10002 Blockname.name should not be
accessed in parser Recompile with the force option set.
10003 : line... no closing brace... on Closing delimiter for a comment is not found. Comments should be
comment starting near line... enclosed with one of the following delimiter types: {...} or (*...*).
10006 Identifier error. Recompile with the force option set.
10007 INCOMPLETE production : direct
address. Recompile with the force option set.
Number/Error Explanation
10010 Digit ... not valid for base. Recompile with the force option set.
10014 Invalid block/subroutine definition. Recompile with the force option set.
10015 Subroutine declaration error. Recompile with the force option set.
10016 User defined types not supported. Recompile with the force option set.
10017 Unary minus not supported. Recompile with the force option set.
Phase 4 cannot check if the retentive or non-retentive C-memory
10018 Reserved range for C memory
locations above ... not checked. locations are reserved correctly in the Compiler Control File. You
are responsible.
10020 Duplicate declaration of block ... Recompile with the force option set.
10021 Duplicate declaration of
subroutine ... Recompile with the force option set.
10023 Multiply declared identifier ... Recompile with the force option set.
10024 Multiply declared public identifier ... Recompile with the force option set.
10025 Block ... not declared. Recompile with the force option set.
Phase 4 cannot check if the retentive C-memory locations are
10026 Range not checked on retentive C
memory locations. reserved correctly in the Compiler Control File. You are
responsible.
10027 Emit rll compare error. Recompile with the force option set.
10028 Range not checked. Recompile with the force option set.
10030 Unit ... not declared. Recompile with the force option set.
10031 Object of assign.array not
accessible. Recompile with the force option set.
10032 Boolean xor not supported. Recompile with the force option set.
10033 Variable.variable not accessible. Recompile with the force option set.
10034 Object of assign.id not accessible. Recompile with the force option set.
10042 Function can not return complex
type. Recompile with the force option set.
Number/Error Explanation
10044 Initial value not supported for ...
subtype. Recompile with the force option set.
10046 Symbol table interface error. Recompile with the force option set.
The maximum number of characters permitted is 38. This message
10047 : line ... symbol table error : applies to all symbol names. For example, this number includes
symbol ... name too long the SFC name (preceded by $), the step name, the user-declared
variable name, and periods separating them.
10048 Cannot add table ... Recompile with the force option set.
10050 Could not open unit and global
tables. Recompile with the force option set.
10051 ... ms table not found. Recompile with the force option set.
10052 No block name. Recompile with the force option set.
10053 Must be declaration section. Recompile with the force option set.
The compiler has run out of memory (i.e., an operating system
limitation). This occurs when a step, transition, or Math CFB
includes compound statement that cannot be converted into the
10054 : line ... FATAL error out of memory.
target control during a compile. If you receive this error, divide the
identified statement into several smaller statements without
changing the intended logic.
10056 Internal symbol table error. Recompile with the force option set.
10057 ... must be a block name. Recompile with the force option set.
10058 ... does not exist. Recompile with the force option set.
Variable on the indicated line has not been declared or generated,
10060 : line ... cannot check status of ... and, therefore, its status cannot be checked. Check the source or
the variable (Declaration Tables, I/O, object extensions, etc.).
10061 Variable or array extension not
accessible. Recompile with the force option set.
10062 Line ... arrays have different Arrays used in the statement on the indicated line must have
dimensions identical dimensions.
10066 Array length must be positive. Recompile with the force option set.
10067 Array index must be one. Recompile with the force option set.
10068 Formal actual parameter mismatch. Recompile with the force option set.
10070 : line ... illegal array index : Boolean arrays can be indexed only by literal values such as 5,7, 9,
boolean array indexed by
expression 16, etc.
10072 Operand type conflict. Recompile with the force option set.
Number/Error Explanation
10073 Semantic error. Recompile with the force option set.
10074 INCOMPLETE nnl production :
records Recompile with the force option set.
not supported.
10076 Multi-dimensional arrays are not
supported. Recompile with the force option set.
10080 Line ... object of assignment A read-only variable, e.g., a WI-type, a DI-type, is placed on the
statement not an assignable
location. right side of an assignment statement.
10102 Cannot open file ... Recompile with the force option set.
Number/Error Explanation
10103 Cannot open assembly.apd file ... Recompile with the force option set.
10104 Internal error : unable to open
system file nnl.dat. Recompile with the force option set.
10106 Cannot open file ... Recompile with the force option set.
10107 Cannot open work list. Recompile with the force option set.
10108 Path error ... Recompile with the force option set.
10110 Unexpected end of file encountered
in work list. Recompile with the force option set.
10111 Parameter type clash. Recompile with the force option set.
10112 Number of actual/formal
parameters not the same. Recompile with the force option set.
10114 Line ... value or converted value of The value of the indicated based number cannot be represented on
based number ... is out of range. the target controller.
10116 NNL too many errors, compilation
terminated! Recompile with the force option set.
Number/Error Explanation
A PRINT statement has an illegal port value. The number should
be 1 (for Port 1 of the 565/565T/565P Loop CPU card or the 545,
10124 Line ... port number must be 1,2, or 3. 545L, 555, or 575 controllers), or 2 (for Port 2 of the 565/565T/565P
Loop CPU card), or 3 (for both Ports 1 and 2 of the 565/565T/565P
Loop CPU card).
10125 Function ... not defined/supported. Recompile with the force option set.
10126 Actual parameter mode does not
correspond to formal parameter Recompile with the force option set.
mode.
10127 No memory allocated for array. Recompile with the force option set.
10128 Work list error. Recompile with the force option set.
An event block executes only once. To repeat the execution of an
event block, you must disable and then enable the block again. You
10130 Only init section will execute for might use an event block to generate a report or to total the
event math block ... ingredients at the end of a batch. This type of Math block should
not contain an INIT section, because the INIT section is the only
one that would execute.
10150 Unit name... is reserved word. The unit name is a reserved word. Rename the unit.
10151 Possible divide/mod by zero near ... The denominator of the expression cannot be zero.
Number/Error Explanation
10153 Possible array size constraint The array size for certain firmware procedure parameters must
violation. not exceed a specified size.
10156 ... record component not accessible. Recompile with the force option set.
10157 Statement too long. Break up expression into smaller statements.
10158 Function return must have a value Value returned by a user-defined subroutine is invalid.
10160 Array length too large. Recompile with the force option set.
10177 (...) Invalid type ... for ... Recompile with the force option set.
Number/Error Explanation
10181 This instruction is not allowed in the Refer to Chapter 1 of the SIMATIC APT Programming Reference
controller release specified. (Tables) Manual for a table of controller-supported features.
10182 Parameter must have an I/O address The procedure or function requires a valid I/O address as a
type. parameter.
10183 Subroutine must be declared with an A math block declared with pragma RLL_CYCLIC must call
RLL_CYCLIC pragma. subroutines that are also declared pragma RLL_CYCLIC.
10184 Subroutine is declared with an
RLL_CYCLIC pragma. The block
must
A subroutine declared with pragma RLL_CYCLIC must be called
also be declared with an from a math block that is also declared pragma RLL_CYCLIC.
RLL_CYCLIC pragma.
10185 Subroutine must be declared with an A math block declared with pragma RLL_INTERRUPT must call
RLL_INTERRUPT pragma. subroutines that are also declared pragma RLL_INTERRUPT.
10186 Subroutine is declared with an A subroutine declared with pragma RLL_INTERRUPT must be
RLL_INTERRUPT pragma. The block
must also be declared with an called from a math block that is also declared pragma
RLL_INTERRUPT pragma. RLL_INTERRUPT.
10187 Direct Address type ... not allowed The controller specified in the Compiler Control Files does not
on controller specified. support the address specified.
10188 Unable to read opcode table. Recompile with the force option set.
10189 Literal number cannot be accessed A literal value cannot be accessed by byte addressing. The index
by byte addressing, index is
assumed to be zero. will be replaced with a 0.
Number/Error Explanation
10200 . . has no image register, operation If you do not have the image register selected, you cannot do an
has no effect. IREAD or an IWRITE to the I/O point.
Number/Error Explanation
An invalid number appears for the number of 560/560T
12000 Number of RCCs listed in .... 565/565T/565P RCCs. 1, 2, 3, or 4 RCCs can be used; each RCC has
two I/O channels.
The APT program requires more retentive CRs than your
controller supports.
If you receive this error for a 560/560T/565/565T/565P controller,
be certain that the number of RCCs in your Compiler Control File
indicates the correct number of RCCs in your controller.
12045 Out of retentive CRs. Symbol = If you receive this error for any controller, you must do one of the
... in ... following:
Reduce the number of boolean variables (including arrays)
that are declared as retentive in your program.
Reduce the amount of retentive CR memory reserved in the
Compiler Control File.
For a 560/560T/565/565T/565P, you can increase the
number of RCCs in your system (maximum=4).
The APT program requires more non-retentive CRs than your
controller supports. If the compiler runs out of non-retentive CRs,
it uses Ys that are unused after the last configured I/O point on
each channel.
If you receive this error for a 560/560T/565/565T/565P controller,
be certain that the number of RCCs in your Compiler Control File
indicates the correct number of RCCs in your controller.
If you receive this error for any controller, you must do one of the
12046 Out of nonretentive CRs and following:
unused I/O locations. Reduce the number of boolean variables (including arrays)
Symbol = ... in .... that are declared as non-retentive in your program.
Reduce the amount of non-retentive CR memory reserved in
the Compiler Control File.
Reduce the value of the last I/O module starting point on
each I/O channel (i.e., remove any gaps containing unused I/O
addresses). This can be done in the I/O Module Editor and does
not require the physical relocation of I/O modules.
For a 560/560T/565/565T/565P, you can increase the
number of RCCs in your system (maximum=4).
In certain instances when you do a force compile, or when an
assembly force compile occurs, APT cannot fix the addresses of
Boolean elements in recipes that contain Boolean arrays. When
12058 Cannot re-allocate address for
structure element x. this occurs, the assembler generates error 12058 during program
compilation. You must then recompile your program with
Translate set to Yes and re-install your tags to the operator
station.
Number/Error Explanation
12080 Program requires... words of APT compiler cannot allocate the required amount of memory.
L-Memory. Max = .... Either there is an insufficient amount of memory in your controller
12081 Program requires... S-Memory. or you have attempted to use an APT operation not supported by
Max = .... your controller. For example, for Series 505 controllers, SFPGMs
12082 Program requires... V-Memory.
are only supported by the 545, 545L, 555, 565/565T/565P, and the
Max = .... 575, and any APT operation requiring an SFPGM can only be used
with these controllers.
12083 Program requires... words of
K-Memory. Max = .... APT attempts to compile code for the controller indicated in the
12084 Program requires... one shots. Compiler Control File. Check to make sure this file correctly
Max = .... indicates the controller that you intend to use. The Controller
12085 Program requires... tmr/ctr/dcat Support section of the “APT Overview” Chapter in the SIMATIC
boxes. Max = .... APT Programming Reference (Tables) Manual lists which APT
programming options are available on the supported controllers.
12086 Program requires... table move
boxes. Max = ....
If you have not attempted to use an unsupported option for your
12087 Program requires... shift boxes. controller, be sure that the memory size in Compiler Control File
Max = .... matches the memory size of controller. If this is the only error,
12088 Program requires... drums. deselect Force Compile in the Compiler Control File before
Max = .... recompiling.
12090 Program using ... of invalid
memory type ... for current If you still receive one of these errors, do one of the following:
controller type. Reduce the general memory usage of your present program.
12114 Program requires... analog
Reduce the amount of reserved memory in the Compiler
alarms. Max = .... Control File (as possible).
Increase the amount of memory in your controller. For the
12115 Program requires... loops. 545-1101 and the 560/560T/565/565T/565P models, and the S5
Max = ....
928B, you can add additional memory cards.
12116 Program requires... RLL Do not compile a Debug version. Compiling a Debug version
subroutines. Max = .... uses more memory.
12117 Program requires... special
function programs. Max = ....
12118 Program requires... special
function subroutines. Max = ....
12119 Program requirements exceed
available controller memory:
Number/Error Explanation
PROFIBUS--DP Errors/Messages
12180 Non-numeric string “ ... ” not Check the indicated file and line for a word outside of a comment.
within comment. Words can only be within comments.
Check the indicated file and line for a comment that was not closed
12181 Encountered end of file before
comment termination. by an ending symbol “}” or “*)”. This may occur on a line previous
to the one reported.
12182 PROFIBUS--DP slave ... is invalid and Check the indicated file and line for a slave number that is not
must be in range [n1 . . n2]. within the required range.
12183 Channel ... is invalid and must be Check the indicated file and line for a channel number that is not
in range [n1 . . n2]. within the required range.
12184 Base ... is invalid and must be in Check the indicated file and line for a base number that is not
range [n1 . . n2]. within the required range.
12185 Slot ... is invalid and must be in range Check the indicated file and line for a slot number that is not
[n1 . . n2]. within the required range.
12186 PROFIBUS--DP module ... is invalid Check the indicated file and line for a module number that is not
and must be in range [n1 . . n2]. within the required range.
12187 Required module, channel and base Check the indicated file and line for a missing module number,
missing. channel number, and base number.
12192 PROFIBUS--DP slave ... , module ... Check the indicated file and line. The slave module specified was
has already been used. previously used in this file.
The indicated slave module was not given a starting address in the
12194 Invalid PROFIBUS starting address module editor. Please verify that this slave and module are
for ... . associated with a channel, base, and slot and given a valid starting
address in the module editor.
Error Explanation
PROFIBUS--DP Errors/Messages
12195 File or path name not found EXPORT.2BF did not exist in the /PRR directory.
Disk full Disk containing APT was full.
Slave ... in APT but not in COM The indicated slave was in the PROFIBUS.CFG file, but not in
PROFIBUS the COM PROFIBUS export file.
Slave ... in COM PROFIBUS but not in The indicated slave was in the COM PROFIBUS export file, but
APT not in the PROFIBUS.CFG file.
Slave ..., Module ... in APT but not in The indicated slave module was in the PROFIBUS.CFG file, but
COM PROFIBUS not in the COM PROFIBUS export file.
Slave ... , Module ... in COM PROFIBUS The indicated slave module was in the COM PROFIBUS export
but not in APT file, but not in the PROFIBUS.CFG file.
Slave ... , Module ... APT: ,nX nY nWX There is a mismatch between PROFIBUS.CFG and the COM
nWY, COM PB: nX nY nWX nWY PROFIBUS data for this slave module.
Number/Error Explanation
13000 codes are for Series 505 controllers only.
13000 505 ASSEMBLY BLOCK An invalid application ID was entered in the Compiler Control
Invalid application ID ..., must be Editor. Correct the ID and recompile.
within A to Z for instruction
’DEPENDENCY’, parameter 1 near
line ... of object $575
505 ASSEMBLY BLOCK The U-memory file specified contains an unknown record. Correct
Invalid record ... in U memory file ... the U-memory file and recompile.
... address has been assigned A cross-reference can be generated to determine where the loop or
multiple times. analog address was used multiple times. Correct the error and
recompile.
RLL statement is too complex to Simplify the indicated RLL statement and recompile the program.
compile near line ... of object ... in ...
Statement is too complex to Simplify the indicated SF or RLL statement and recompile the
compile near line ... of object ... in ... program.
Statement is too complex to The statement is too complex for controller to execute at run time.
execute at run time near line ... Simplify the indicated statement and recompile the program.
of object ... in ...
Reserving U memory (...) is not Make a choice between reserving U-memory or entering a
permitted when a U memory file U-memory file name.
name (...) is declared.
... out of range for instruction More than 128 analog alarms have been created or reserved.
“PACK_AALM”, parameter ... near
line ... of object ...
... out of range for instruction More than 64 loops have been created or reserved.
“PACK_LOOP”, parameter ... near
line ... of object ...
... out of range for instruction A sequence array is occupying a V-memory location greater than
“MWFT”, parameter ... near V32767. You must put the sequence array in lower V-memory.
line ... of object ... Follow these tips.
If the sequence array is given a reserved memory address,
move the array to a lower V-memory location.
Reduce any reserved V-memory, if used.
Use a force compile to remove holes in memory.
Select YES in Translate Build Option to remove any holes due
to fixed marked tag address.
Number/Error Explanation
14006 Potential PCS/controller mismatch. This is a warning. It means you have changed your marked tags,
Reinstall translator tags to correct. but not installed them on PCS.
14008 Tag...in...cannot be translated. (If I/O This tag cannot be translated to PCS. PCS can only translate I, Q,
point, try marking ’IMAGE F, D, DW, DD, TMR, and CTR. If the tag is an I/O point, then mark
REGISTER’ field) Memory Type = . . . the image register field on the I/O Form.
For Series 505 controllers, TISTAR Releases 1.x and 2.x did not
14012 DO NOT ATTEMPT TO INSTALL support V- and K-memory addresses above 65536. The following
TAGS. are possible solutions:
Tag ... in ... has an address out of — Reduce the amount of any reserved V- and K-memory.
range, ..., which cannot be — Make sure any user-assigned addresses are below this value if
translated to TISTAR Release 1.x or the object is marked for tag translate.
TISTAR 2.x. — Recompile with a YES Translate Build to move all translated
tags to lower memory.
Number/Error Explanation
15000 codes are for S5 controllers only
15007 S5 ASSEMBLY BLOCK Either a subroutine is named A or the assembly code is incorrect.
Syntax error near token “A(” near Either a subroutine is named AN or the assembly code is incorrect.
line ... of object ... in ...
Either a subroutine is named O or the assembly code is incorrect.
S5 ASSEMBLY BLOCK Either a subroutine is named ON or the assembly code is incorrect.
Syntax error near token “AN(” near
line ... of object ... in ... If you receive any of these errors, do one of the following:
If a subroutine exists with the name A, A AN,
AN O,O or ON
ON, rename
S5 ASSEMBLY BLOCK the subroutine and recompile.
Syntax error near token “O(” near
line ... of object ... in ... If in-line assembly code is being used, check for the correct
syntax and recompile.
S5 ASSEMBLY BLOCK
Syntax error near token “ON(” near
Use the Extract utility as described in the DOS Utilities
line ... of object ... in ... appendix section of the SIMATIC APT User Manual to
determine if the generated code is correct for the
given object.
16025 Direct address % . . . is not in the The direct address that is called out is not in the reserved memory
reserved memory range near line in the Compiler Control File. Check the items that are reserved in
. . . of object . . . in . . . the Compiler Control File.
16035 S5 ASSEMBLY BLOCK
. . . block is out of range. Range = . . . DRs or DXs are out of range. The range is 0 to 255.
to . . . near line . . . of object . . . in . . .
16038 FB/FX . . . is too large (. . . words) for The FB or FX is too large to fit in the given object. Reduce your
psect . . . near line . . . of object . . .
in . . . code for that given object.
16045 Statement is too complex to execute The statement is too complex for the controller to execute at run
at run time, near line ... of object ...
in ... time. Simplify the indicated statement and recompile the program.
Overview You may receive one of the following error messages during translation or
program download. If you cannot correct the problem by following the
suggestions in Table A-2, or if you receive a message not on this list, call
(800) 333--7421 in the U.S.A., or 49--911--895--7000 outside the U.S.A., for
assistance.
Translate Errors
Message Cause Corrective Action
OSU disk access error. Unable to read the hard disk on Check the hard disk on the remote
the remote computer. computer for errors, or to see if it is full.
TISTAR Model 20 TRANS does
Fatal Error—APT file has Check for UNIT tags, TEXT tags, or other
not know to interpret some
incorrect or missing tag types not supported in TISTAR
information in the
information. Rel. 1.3.x.
INSTALL.TAG file.
Translate Errors
Message Cause Corrective Action
PCS error occurred An error occurred during the Check the file TRANSLAT.RPT for
installing tags. install phase of tag translation. messages.
Be certain that the tag configurator
PCS tag configuration The tag configurator or tag software is not running on the PCS system,
currently active. translator is already running. i.e., no one is configuring PCS tags.
Download Errors
Message Cause Corrective Action
Taskcode error detected. The controller returned the error Refer to your controller user manual for
that follows. details.
NIM error detected. The NIM returned the error that Refer to your NIM user manual for details.
follows.
Check cabling between the APT node and
Communications between the PCS node; check the communications card
PCS communications error. APT node and the PCS node are installation; be certain that you followed the
not available or are broken. setup and translate procedures described in
this manual.
Check cabling between the APT node and
Communications between the PCS node; check the communications card
PCS is not responding. APT node and the PCS node are installation; be certain that you followed the
not available or are broken. setup and translate procedures described in
this manual.
APT cannot communicate with Be certain that you followed the setup and
Unable to initiate PCS APT the APT server task running on translate procedures described in this
server. the PCS node. manual.
Communications between the
TISTAR-TIWAY DEU and the NIM are not Check TIWAY cabling.
communications error. available or are broken.
Direct link communications Check cabling. Be certain that the baud rate
PC-controller between the remote computer and serial communications port (specified
communications error. and the controller are not when you set up APT) are correct.
available or are broken.
PCS must be in operate PCS is not in the Operate state. Set PCS to the Operate state.
state.
Be certain that the baud rate and serial
Cannot set baud rate. The specified port is invalid for communications port (specified when you
communications. set up APT) are correct.
The user does not have the
User is not privileged. PCS privilege to download a Use a User ID with appropriate security
program to the controller. privilege.
Secondary name not found. The secondary name does not Use the correct secondary name, or change
exist in the PCS database. PCS configuration.
Download Errors
Message Cause Corrective Action
Secondary is not connected. The secondary is not physically Connect the secondary to the PCS system.
connected to the PCS system.
Recompile APT for the correct secondary, or
Secondary is of wrong type. The APT program does not match connect the correct secondary to the
the connected secondary. PCS system.
Be certain that the subdirectory
The remote computer cannot \APT\PROGRAM\program_name\MAKE
Last compile did not access the file RETURN or exists on the remote computer and that it
complete. compile did not complete. contains the file RETURN. Also check that
you have a successfully compiled program.
Use the DOS command CHKDSK to check
the hard disk and files.
Be certain that the subdirectory
\APT\PROGRAM\program_name\MAKE
The remote computer hard disk exists on the remote computer and that it
Cannot access APT file. may be bad, or the download files contains the file RETURN.
are corrupted. Be certain that the subdirectory
\APT\PROGRAM\program_name exists on
the remote computer and that it contains
the OBJECT.DWN and VERSION.DWN
files for each unit that is compiled.
Note that the controller may contain an
Current download aborted. The user aborted the download. invalid program when you abort the
download.
The program name that you
Program not found. specified for downloading was not Use the correct program name.
found.
Be certain that the file OBJECT.DWN
Download file not found. The file OBJECT.DWN is exists in the subdirectory
missing. \APT\PROGRAM\program_name.
The controller does not process Install a 545, 545L, 555, 565/565T/565P, or a
No loop card on controller. loop, analog alarm, or Special 575; or compile for another type of
Function Program information. controller.
Program too large. The controller memory cannot Reduce the size of the program, or increase
hold the program. controller memory.
More RCCs were specified in the
Not enough RCCs on APT compile file than are Specify fewer RCCs in the APT compile file,
controller. actually installed (560/560T/ or install additional RCCs.
565/565T/565P only).
APT locked from writing to Certain download functions have See the last page of the Release Notes,
controller. been limited. “Remove Debug Functionality.”
Debug Errors
Message Cause Corrective Action
Debug out of variable Too many incremental compiles. Force compile.
storage space.
Overview You may receive one of the following error messages while archiving or
restoring a program. If you cannot correct the problem by following the
suggestions in Table A-3, and need assistance, call (800) 333--7421 in the
U.S.A., or 49--911--895--7000 outside the U.S.A.
The DOS operating system may generate an error code when you validate or
compile an APT program. A DOS error code is listed in a compile or validate
report as the term Errno = nn. The nn is defined in Table A-4. Refer to the
documentation for your DOS operating system for corrective measures. If
you cannot correct the problem, or if you receive a message not on this list,
call (800) 333--7421 in the U.S.A., or 49--911--895--7000 outside the U.S.A.,
for assistance.
The two error codes most commonly reported are #02 and #24.
Overview APT allows you to access memory addresses directly by using a percent sign
(%) prefix. The types of direct memory addressing available depend on the
kind of controller you have.
Status Word memory Allows you to read status words that contain
operational information about your Series 505 controller.
System Data Area (RS) memory Allows you to read the internal
system parameters that contain operational information about your S5
controller.
Availability Status word memory and temporary (SFPGM) memory variables are
supported for Series 505 controllers only. System Data Area (RS) memory is
supported for S5 controllers only. Reserved memory is supported for both
Series 505 and S5 controllers.
Status Words If you have a Series 505 controller, APT allows you to read Status Words by
(Series 505 only) using the %STW address as a variable. For example, %STW1 allows you to
directly access the information in Status Word 1. For information about the
meaning of the status words, see the manual that comes with your Series
505 controller.
System Data If you have an S5 controller, APT allows you to read RS words by using the
Area (RS) %RSW address as a variable. For example, %RSW14 on a 928B allows you
(S5 only) to directly access the information in RS14, which is the base address of the
flag area. For a 948U/R, %RS9.0 allows you to directly access the bit
information in RS9.0, which is the QVZ test bit. For more information about
the RS memory area, see the manual that comes with your S5 controller.
NOTE: Assign values only to T-Memory locations T11--T16. APT and the
controller use locations T1--T10.
NOTE: Do not assign a real value to %T16 because only one memory
location is available at that address.
Reserved Memory For both controller families, APT permits you to reserve controller memory.
See Section B.2 for a discussion of reserved memory and direct addressing
for Series 505 controllers. See Section B.3 for a discussion of reserved
memory and direct addressing for S5 controllers.
Reserved Memory When you set up the Compiler Control File, APT allows you to reserve
for Series 505 memory locations for your use. Figure B-2 shows the portion of the compile
control screen for a 565/565T where you specify these reserved memory
locations.
Reserved locations -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Ladder (L): 0 Words Nonretentive cr’s: 0
Variable (V): 0 Words Retentive cr’s: 0
Constants (K): 0 Words Timer/Counters: 0
Special (S): 0 Words Drum/Edrum: 0
Loops: 0 Shift register: 0
Analog Alarms: 0 Table Move: 0
SF programs: 0 One Shots: 0
SF subroutines: 0 Dset: 0
Role swap: 0 Tset: 0
-- -- -- -- -- -- -- -- -- -- -- -- -- -- End of Form -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
NOTE: Most APT applications do not use the Reserve Memory option, but
rather let APT determine the memory allocation. In the event that you have
an existing ladder logic program, your ladder logic program can coexist
with APT. You must reserve all memory associated with that program in
order for your program to run properly. You can edit your ladder logic
program in TISOFT before you download APT’s program.
Ladder (L) Memory is memory used for ladder logic code (RLL). Reserve
the number of L words you need to store your own ladder logic program
which you will use in conjunction with APT. Refer to the SIMATIC 505
Programming Reference Manual for a detailed list of the number of L words
required by each instruction.
Variable (V) Memory is memory used for storing read/write integer and
real values. Integer values require one memory location and real values
require two memory locations. If you are reserving memory to store arrays
you must reserve enough memory for the entire array. APT accesses
reserved V locations by %V1, %V2, etc., for integers and %V1., %V3., etc.,
for reals.
NOTE: When you reserve retentive and non-retentive CRs, you are not
reserving actual addresses; you are only reserving an amount of space. For
instance, if you specify 780 non-retentive CRs, you get %C1--%C768 and
%C1025--%C1036. If you specify 10 retentive CRs, you get %C769--%C778.
Table B-1 lists the direct addresses that are supported by APT for
Series 505 controllers.
Table B-1 Direct Addresses Supported by APT for Series 505 Controllers
Math
Address Description Debug MAITT APT Objects
Language
%AACK Analog alarm acknowledge Yes Yes Yes
%AADB Analog alarm deadband Yes Yes Yes
%AALM Analog alarm Yes
%ACFH Analog alarm C-flags high Yes Yes Yes
%ACFL Analog alarm C-flags low Yes Yes Yes
%AERR Analog alarm error Yes Yes Yes
%AHA Analog alarm high alarm Yes Yes Yes
%AHHA Analog alarm high-high alarm Yes Yes Yes
%ALA Analog alarm low alarm Yes Yes Yes
%ALLA Analog alarm low-low alarm Yes Yes Yes
%AODA Analog alarm orange deviation alarm Yes Yes Yes
%APET Analog alarm process execution time Yes Yes Yes
%APV Analog alarm process variable Yes Yes Yes
%APVH Analog alarm process variable high Yes Yes Yes
%APVL Analog alarm process variable low Yes Yes Yes
%ARCA Analog alarm rate-of-change alarm Yes Yes Yes
%ASP Analog alarm setpoint Yes Yes Yes
%ASPH Analog alarm setpoint high Yes Yes Yes
%ASPL Analog alarm setpoint low Yes Yes Yes
%ATS Analog alarm sample time Yes Yes Yes
%AVF Analog alarm V-flags Yes Yes Yes
%AYDA Analog alarm yellow deviation alarm Yes Yes Yes
%C Control relay Yes Yes Yes Yes
%DCP Drum current preset Yes Yes Yes
%DSC Drum step current Yes Yes Yes
%DSP Drum step preset Yes Yes Yes
%G Global memory * Yes Yes Yes Yes
%Gx Global application memory * Yes Yes Yes Yes
%K Constant * Yes Yes Yes Yes
%LACK Loop acknowledge Yes Yes Yes
%LADB Loop deadband Yes Yes Yes
%LCFH Loop C-flags high Yes Yes Yes
%LCFL Loop C-flags low Yes Yes Yes
%LERR Loop error Yes Yes Yes
%LHA Loop high alarm Yes Yes Yes
Math
Address Description Debug MAITT APT Objects
Language
%LHHA Loop high-high alarm Yes Yes Yes
%LKC Loop proportional gain Yes Yes Yes
%LKD Loop derivative gain limiting coefficient Yes Yes Yes
%LLA Loop low alarm Yes Yes Yes
%LLLA Loop low-low alarm Yes Yes Yes
%LMN Loop output Yes Yes Yes
%LMX Loop bias Yes Yes Yes
%LODA Loop orange deviation alarm Yes Yes Yes
%LOOP Loop Yes
%LPET Loop process execution time Yes Yes Yes
%LPV Loop process variable Yes Yes Yes
%LPVH Loop process variable high Yes Yes Yes
%LPVL Loop process variable low Yes Yes Yes
%LRCA Loop rate-of-change alarm Yes Yes Yes
%LRSF Loop ramp soak flags Yes Yes Yes
%LSP Loop setpoint Yes Yes Yes
%LSPH Loop setpoint high Yes Yes Yes
%LSPL Loop setpoint low Yes Yes Yes
%LTD Loop derivative time Yes Yes Yes
%LTI Loop integral time Yes Yes Yes
%LTS Loop sample time Yes Yes Yes
%LVF Loop V-flags Yes Yes Yes
%LYDA Loop yellow deviation alarms Yes Yes Yes
%PPET SFSUB process execution time Yes Yes Yes
%SPET SFPGM process execution time Yes Yes Yes
%STW Controller status word * Yes Yes Yes Yes
%TCC Timer/counter current Yes Yes Yes
%TCP Timer/counter preset Yes Yes Yes
%TPET Task process execution time Yes Yes Yes
%VMM,
VME memory * Yes Yes Yes Yes
%VMS
%V Variable memory * Yes Yes Yes Yes
%WX Word input * Yes Yes Yes
%WY Word output * Yes Yes Yes
%X Discrete input * Yes Yes Yes
%Y Discrete output * Yes Yes Yes
* See the following section, “Direct Addressing Guidelines for Series 505 Controller.”
Direct Addressing For Series 505 controllers, integer values require one memory location. Real
Guidelines for values require two memory locations, and are referenced with a period ( . )
Series 505 following the address, except in the Declaration Table. For example, %V100.
Controllers accesses the real value stored in memory location V100 and V101.
For Series 505 S-memory, real values for loops and analog alarms only
require one memory location; however, they still have to be referenced with
a period ( . ). Refer to Chapter 2, Table 2-5, for loop memory, and Table 2-13
for analog alarm memory.
The first available direct memory address for a Series 505 controller is 1,
not 0. Do not use a direct memory address to access Series 505 control
memory addresses X0, Y0, V0, K0, STW0, WX0, or WY0, e.g., %X0, %Y0,
etc. These addresses do not exist, and an “illegal direct address” error occurs
when the program is compiled.
The following types of memory are available only on the 575 controller:
G, VMM, and VMS.
There are two types of Series 505 VME memory: VMS, which corresponds to
VME address (16-bit address), and VMM, which corresponds to VME
address (24-bit address). Both of these memory types use byte-oriented
addressing. For example, writing an integer (V-memory) to %VMM0F000
writes to both %VMM0F000 and %VMM0F001. Consequently, you cannot
reference odd-numbered VMM- or VMS-memory addresses.
Both VMS and VMM memory must be referenced with hex addresses. Also,
the address must begin with a digit. Since hex addresses can sometimes
begin with a letter (A through F), you may have to insert a “0” (zero) in front
of the address.
Reserved Memory When you fill out the Compiler Control File, APT allows you to reserve
for S5 Controllers memory locations for your use. Figure B-3 shows the portion of the compiler
control screen for an S5 928B or 948U/948R CPU where you specify these
reserved memory locations.
Reserved locations -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Data Blocks (DB):
Ext. Data Blocks (DX):
Function Blocks (FB):
Ext. Function Blocks (FX):
Program Blocks (PB):
Sequence Blocks (SB):
Flag Bytes:
S-Flag Bytes:
Timers:
Counters::
Enter the actual numbers that you want to reserve. For instance, if you
place a 10 after Data Blocks on the form, then you reserve DB10. Separate
numbers by commas, and show a range of numbers by placing a colon ( : )
between the starting number and the ending number. For example, if you
enter these numbers after Function Blocks: 40, 41, 50:59, 255, then you are
reserving FB40, FB41, FB50 through FB59, and FB255. Because you have
reserved these function blocks, APT will not use them, and you can program
them in STL and download them to the controller using STEP 5.
NOTE: If your function blocks, program blocks, or sequence blocks use any
data blocks, flag words, etc., you must reserve these, too.
Data Blocks (DB) Enter the data blocks that your S5 program uses.
Valid entries are 5--255 for the 948U/R CPUs, and 3--255 for the 928B. The
controller uses DB0--DB2 for a 928B CPU, or DB0--DB4 for the 948U/R.
When you reserve a data block, you get the entire data block. APT assumes
the length of the DB is 256 words.
Extended Data Blocks (DX) Enter the extended data blocks that your
S5 program uses. Valid entries are 2--255. When you reserve an extended
data block, you get the entire data block. APT assumes the length of the DX
is 256 words.
Function Blocks (FB) Enter the function blocks that you want to
reserve. Valid entries are 0--255. These function blocks can be either ones
that you purchased or ones you have written. You must download the
function blocks to the controller after you download your APT program. Do
not put the controller in RUN mode until you have downloaded all reserved
function blocks to the controller. Every time you clear the controller you
must download the function blocks again. If your function blocks use any
data or flags, reserve the appropriate memory. Maximum FB length
permitted by APT is 4K.
Ext. Function Blocks (FX) Enter the extended function blocks that you
want to reserve. Valid entries are 0--255. You must download the extended
function blocks to the controller after you download APT. Every time you
clear the controller you must download the extended function blocks again.
Maximum FX length permitted by APT is 4K.
Program Blocks (PB) Enter the program blocks that you want to
reserve. Valid entries are 0--255. Maximum PB length permitted by APT is
4K.
Sequence Blocks (SB) Enter the sequence blocks that you want to
reserve. Valid entries are 0--255. Maximum SB length permitted by APT is
4K.
Flag Bytes Enter the flag bytes that you want to reserve. Valid entries
are 2--199. APT uses FW0 (FY0 and FY1) as the H-flag word for redundant
control. You cannot reserve flag bytes 200--255 because APT uses them as a
scratch flag area. Your function block, program block, or sequence block can
share the scratch flag area with APT, but you cannot reserve these bytes.
S-Flag Bytes Enter the extended flag bytes (S-flags) that you want to
reserve. Valid entries are 0--1023 for a 928B CPU, or 0--4096 for the 948U/R
CPU.
NOTE: When you reserve a flag byte or an extended flag byte, you get all
eight bits of the flag. If you are using flags for integers, remember to reserve
two flags for each integer. If you are using real numbers, remember to
reserve four flags for each real number.
Timers Enter the number of S5 timers that you want to reserve. Valid
entries are 0--255, which reserve timers TMR0 to TMR255.
Size Declarations
Memory Inline
Range in Description Debug MAITT and I/O
Types Assembly*
Bits Symbols
%CT 0.0 to 255.15 1 Counters (bits) Yes Yes Yes **
%CTR 0 to 255 16 Counters (words) Yes Yes Yes Yes
%DB 0 to 255 Data Block Yes
%DB#:D 0.0 to 255.15 1 Data Bit Yes Yes Yes Yes
%DB#:DW 0 to 255 16 Data Word Yes Yes Yes Yes
%DB#:DD 0 to 254 32 Double Data Word Yes Yes Yes Yes
%DB#:DL 0 to 255 8 Left-Hand Byte of Yes Yes Yes
DW
%DB#:DR 0 to 255 8 Right-Hand Byte of Yes Yes Yes
DW
%DX 0 to 255 Extended Data Yes
Blocks
%DX#:D 0.0 to 255.15 1 Data Bit Yes Yes Yes Yes
%DX#:DW 0 to 255 16 Data Word Yes Yes Yes Yes
%DX#:DD 0 to 254 32 Double Data Word Yes Yes Yes Yes
%DX#:DL 0 to 255 8 Left-Hand Byte of Yes Yes Yes
DW
%DX#:DR 0 to 255 8 Right-Hand Byte of Yes Yes Yes
DW
%F 0.0 to 255.7 1 Flag Bit Yes Yes Yes Yes
%FB 0 to 255 Function Block Yes
%FY 0 to 255 8 Flag Byte Yes Yes Yes
%FW 0 to 254 16 Flag Word Yes Yes Yes Yes
%FD 0 to 252 32 Flag Double Word Yes Yes Yes Yes
%I 0 to 127.7 1 Digital Input Yes Yes Yes Yes
%IB 0 to 127 8 Digital Input Byte Yes Yes Yes
%IW 0 to 126 16 Digital Input Word Yes Yes Yes Yes
%ID 0 to 124 32 Double Word Input Yes Yes Yes Yes
* Cannot use direct addresses in the Math language
g g except
p in the Inline Assembly
y Math Statement.
** Only available for 948 CPUs.
Size Declarations
Memory Inline
Range in Description Debug MAITT and I/O
Types Assembly*
Bits Symbols
%KB 0 to 255 8 Constant (1 byte) Yes
%KC 0 to 999 16 Constant (count) Yes
%KF --32768 to 16 Constant Yes
32767 (fixed point)
%KG --1.7E38 to 32 Constant Yes
1.7E38 (floating point)
%KH 0 to FFFF 16 Constant Yes
(hexadecimal)
%KM 0s and 1s only 16 Constant Yes
(2 byte-bit pattern)
%KS ASCII Char- 16 Constant (2 charac- Yes
acters ters)
%KT 0.0 to 999.3 16 Constant (time) Yes
%KY 0 to 255 16 Constant (2 bytes) Yes
%OW 0 to 254 16 Extended Yes Yes Yes Yes
Peripheral Word
%OY 0 to 255 8 Extended Yes Yes Yes
Peripheral Byte
%PB 0 to 255 Program Blocks Yes
%PW 0 to 254 16 Peripheral Word Yes Yes Yes Yes
%PY 0 to 255 8 Peripheral Byte Yes Yes Yes
%Q 0.0 to 127.7 1 Digital Output Yes Yes Yes Yes
%QB 0 to 127 8 Digital Output Byte Yes Yes Yes
%QW 0 to 126 16 Digital Output Yes Yes Yes Yes
Word
%QD 0 to 124 32 Double Output Yes Yes Yes Yes
Word
%RI 0.0 to 255.15 1 Interface Data Area Yes Yes Yes **
(bits)
%RIW 0 to 255 16 Interface Data Area Yes Yes Yes
(words)
* Cannot use direct addresses in the Math Language
g g except
p in the Inline Assembly
y Math Statement.
** Only available for 948 CPUs.
Size Declarations
Memory Inline
Range in Description Debug MAITT and I/O
Types Assembly*
Bits Symbols
Extended Interface
%RJ 0.0 to 255.15 1 Yes Yes Yes **
Data Area (bits)
Extended Interface
%RJW 0 to 255 16 Yes Yes Yes
Data Area (words)
System Data Area
%RS 0.0 to 255.15 1 Yes Yes Yes **
(bits)
System Data Area
%RSW 0 to 255 16 Yes Yes Yes
(words)
Extended System
%RT 0.0 to 255.15 1 Yes Yes Yes **
Data Area (bits)
Extended System
%RTW 0 to 255 16 Yes Yes Yes
Data Area (words)
0.0 to 1023.7
(928B)
%S 1 Extended Flag Bit Yes Yes Yes Yes
0.0 to 4095.7
(948U/R)
%SB 0 to 255 Sequence Blocks Yes
0.0 to 1023
(928B)
%SY 8 Extended Flag Byte Yes Yes Yes
0.0 to 4095
(948U/R)
0 to 1022
(928B)
%SW 16 Extended Flag Word Yes Yes Yes Yes
0 to 4094
(948U/R)
0 to 1020
(928B) Extended Double
%SD 32 Yes Yes Yes Yes
0 to 4092 Flag Word
(948U/R)
%TM 0.0 to 255.15 1 Timers (bits) Yes Yes Yes **
%TMR 0 to 255 16 Timers (words) Yes Yes Yes Yes
* Cannot use direct addresses in the Math language except in the Inline Assembly Math Statement.
** Only available for 948 CPUs.
Direct Addressing For S5 controllers, integer values require two flag-byte memory locations or
Guidelines for S5 one DB/DX data-word memory location. Real values require four flag-byte
Controllers memory locations or two DB/DX data-word memory locations. Real numbers
are referenced with a period ( . ) following the address, except in the
Declaration Table. For example, %FD100. accesses the real value stored in
memory locations FY100, FY101, FY102, and FY103.
Use the APT Declaration Table to assign symbolic names to reserved flag
and DB/DX memory so that you can reference flag and DB/DX memory in
APT by their symbolic names instead of their direct addresses.
Use an inline assembly math statement to call OBs greater than OB39 and
reserved FBs, FXs, PBs, or SBs. Refer to Appendix C of this manual, “Inline
Assembly Code for S5,” for information on the inline assembly math
statement.
You cannot reserve the scratch flag area (F200 to F255), but you can use it
in your own FBs, FXs, PBs, or SBs when you call them with the inline
assembly math statement. APT uses this area on an ongoing basis and
continually overwrites its contents. If your FB, FX, PB, or SB uses scratch
flags, they are local to the block, and they are overwritten after the FB, PB,
or SB executes.
If you want to use external FBs, FXs, PBs, or SBs, you must reserve them
in the Compiler Control File. Download your APT program before you
download your FBs, FXs, PBs, or SBs to the controller. Any time you clear
the controller memory, you must download the blocks again. If you put your
controller in RUN mode and the blocks have not been downloaded, you get
an error and the controller goes to STOP mode. To avoid having to
re-download your blocks when you use a Force Compile, do not select
the Clear Memory option; this way your blocks remain in the controller
memory, and you can set the controller to RUN mode.
When you reserve flag or DB/DX memory, you must download them into the
controller before you use them. If you perform a COLDSTART afterwards,
the flag words are set to zero and must be downloaded again; however, the
DB/DX memory retains the same value as before the COLDSTART. If you
perform an overall reset, which clears all memory, you must download both
flag and DB/DX memory again.
Overview This appendix describes how to integrate external FBs, FXs, PBs, SBs, OBs,
DBs, and DXs into APT and how to use the inline assembly math statement
that is provided by APT for S5 controllers. The purpose of the inline
assembly math statement is to permit you to call external blocks that have
been written using STL into APT. You can use inline assembly math
statements with the APT Math language.
Data blocks (DBs) or extended data blocks (DXs) that you need to open.
You can call existing FBs, FXs, PBs, SBs, and OBs in STL, perform load and
transfer operations, or open DBs and DXs using an inline assembly math
statement.
Table C-1 lists those operations and operands which are supported for inline
assembly use. The operations and operands listed here are the only ones
supported. Additional operations may be used internally by APT, but these
operations are purposely undocumented, with no commitment as to future
support or compatiblity.
Availability Inline assembly math statements are supported only for S5 controllers.
Operations Operands
A, AN, O, ON %Ix.x, %Qx.x, %Dx.x, %Fx.x, %Sx.x, %TMRx.x, %CTRx.x
A, AN, O, ON APT boolean
= %Ix.x, %Qx.x, %Dx.x, %Fx.x, %Sx.x
= APT boolean
Boolean Operations
O
A(
O(
)
Operations Operands
L %IBx, %IWx, %IDx
L %QBx, %QWx, %QDx
L %FYx, %FWx, %FDx
L %DLx, %DRx, %DWx, %DDx
L %KBx, %KCx, %KFx, %KGx, %KHx, %KMx, %KSx, %KTx, %KYx
L %PYx, %PWx
Load Operations
p L %OYx, %OWx
L %RIWx, %RJWx, %RSWx, %RTWx
L %SYx, %SWx, %SDx
L %TMRx, %CTRx
L APT integer
L APT real
LC %TMRx, %CTRx
T %IBx, %IWx, %IDx
T %QBx, %QWx, %QDx
T %FYx, %FWx, %FDx
T %DLx, %DRx, %DWx, %DDx
T %PYx, %PWx
Transfer Operations
T %OYx, %OWx
T %RIWx, %RJWx, %RSWx, %RTWx
T %SYx, %SWx, %SDx
T APT integer
T APT real
Formatting Inline Inline assembly math statements can be used in APT anywhere that you
Assembly Math can use the Math language: in an SFC step, in a math CFB, in associated
Statements math, or in a subroutine. All FB, FX, PB, SB, and OB calls can be made
with an inline assembly math statement.
INTEGER: INT5;
BEGIN
INT5 := 100;
The local declarations for your subroutine follow the same rules as local
declarations in the Math language. However, if you want to use a local
declaration in an IN_ASM statement, you must reference it according to the
following syntax: Block_name.NNL.Declaration_name. In Figure C-1, the
local declaration, INT1, is referenced within an IN_ASM statement using
this syntax.
Overview When you call an FB, FX, PB, SB, or OB that has parameters, the
parameters are either loaded into the accumulators or, for FBs and FXs
only, loaded into a parameter list. This section discusses the different types
of parameters that you can use in an inline assembly math statement.
Direct Addresses You can use direct addresses as parameters in an inline assembly math
statement. Refer to Appendix B for all the direct addresses allowed. If you
use a direct address, you must precede it with the percent sign ( % ). Do not
enter a space after the % sign. All direct addresses supported for S5
controllers are permitted in inline assembly math statements.
Flags and Other To enter an S5 bit as a parameter, you must use the AND command. For
Bits example, to enter the S5 flag F1.1 as a parameter, use the following syntax:
A %F1.1
To incorporate the input bit I1.0 as a parameter, use the following syntax:
A %I1.0
Words and To enter an S5 word or double word as a parameter, you must use the LOAD
Double Words command. For example, to enter the analog input PW128 as a parameter,
use the following syntax:
L %PW128
L %ID120
APT Symbolic You can use APT symbolic names as parameters in an inline assembly math
Names statement. How you handle the parameter depends on whether you are
sending it to the accumulators (for an FB, FX, PB, SB, or OB) or to a
parameter list (FB, FX only).
NOTE: When you refer to APT symbolic names in any inline assembly math
statement, regardless of where you are sending the parameter, write the
symbolic name entirely in uppercase letters. The Table editors for APT use
uppercase. If you refer to an APT symbolic name in mixed case when you
make inline assembly math statements, the assembler cannot match it to
the correct declaration.
1. Use the Declaration Table, I/O Table, Recipe Table, or Device Table to
declare the APT symbolic name(s). You can use automatic addressing.
NOTE: When you use the symbolic name, the call to the DB/DX occurs
when loading parameters to the accumulators, but not when loading
parameters in a parameter list.
Constants You can also use the S5 constants as parameters in inline assembly math
statements. These constants cannot be used anywhere else in APT. When
you use S5 constants in an inline assembly math statement, you must enter
them according to the formatting requirements of APT, which are listed in
Table C-2. For examples of how to load the different S5 constants, see
Table C-3.
Overview To incorporate an FB, FX, PB, SB, DB, or DX into APT, you must first
reserve the block in the Compiler Control File. For information about how to
reserve blocks in the Compiler Control File, see the appendix on “Direct
Memory Addressing” in this manual. You do not have to reserve OBs in the
Compiler Control File, because OBs are resident in the S5 controller.
You can call external FBs, FXs, PBs, OBs, SBs, DBs, and DXs in an inline
assembly math statement from any one of these four locations: from within
a math CFB, from associated math, from an SFC step with Math language,
or from a subroutine. For information about how to edit a math CFB, see
Chapter 8 of this manual. To learn about the Math language, see
Chapter 10 of this manual. To edit a subroutine, see Chapter 10, “User
Subroutines,” in the SIMATIC APT Programming Reference (Tables)
Manual.
You must download the external FBs, FXs, PBs, SBs, DBs, and DXs to the
controller using STEP 5. The inline assembly math statements are
downloaded with APT. When you download your program to the controller
initially, be sure to download APT before you download the FBs, FXs, PBs,
SBs, DBs, and DXs. If you clear the memory in the controller later for any
reason, you must re-download all external FBs, FXs, PBs, SBs, DBs, and
DXs.
Only selected OBs can be executed using the inline assembly math
statement. If you have a 928B or 948U CPU, you can execute OB40--OB255.
If you have a 948R CPU, you can execute OB121--OB255; OB40--OB120 are
used for redundancy.
NOTE: You cannot modify the code in OBs using STEP 5. If you try to edit
OB1--OB39 using STEP 5, your modifications are overwritten by APT.
1. Enter the inline assembly identifier that indicates the beginning of the
statement.
IN_ASM[*
2. Enter the jump (that is, the call) to the FB, FX, PB, SB, or OB.
JU %FBx
JU %FXx
JU %PBx
JU %SBx
JU %OBx
where x is the number that identifies the FB, FX, PB, SB, or OB.
3. Enter the inline assembly identifier that indicates the end of the
statement.
*];
Example The following example shows an inline assembly math statement that
incorporates a function block, FB101, into APT. Assume FB101 is a
user-written subroutine that identifies the end of a telegram. FB101 uses an
already existing DB, DB50. Both FB101 and DB50 have been reserved in
the Compiler Control File. No parameters are required for FB101, and
nothing is sent to the accumulators upon completion. This FB is used to
send a telegram to the CP524 card. The FB determines the end of the
telegram by calculating the error-checking LRC. FB101 then puts the LRC
at the end of the telegram.
BEGIN
IN_ASM[* {identifies beginning of inline assembly statement}
C %DB50 {open DB50}
JU %FB101 {jump to FB101}
*]; {identifies the end of inline assembly statement}
Loading a The only type of block that uses a parameter list is a function
Parameter List block/extended function block (FB/FX). If you want to incorporate an
external FB or FX with parameters into APT, you must first reserve the FB
or FX in the Compiler Control File. You can then edit your math CFB, SFC
step, associated math, or subroutine.
1. Enter the inline assembly identifier that indicates the beginning of the
statement.
IN_ASM[*
JU %FBx
JU y
See Section C.2 for examples of load statements for the various types of
parameter (direct addresses, symbolic names, bits, constants) that are
permitted.
5. Enter the inline assembly identifier that indicates the end of the
statement.
*];
NOTE: You cannot load KB, DH, SY, SW, or SD data types as a parameter
in a parameter list.
! WARNING
The parameter list must match what the FB/FX requires.
If you change, add, or delete parameters, the FB/FX code in the controller
changes in an unpredictable manner. Unpredictable controller operations could
result in death and/or damage to equipment.
Double check your parameters list against the parameters required by the
FB/FX. If you do change, add, or delete parameters, double check your FB after
you download the parameters to ensure correctness.
See the following page for an example of an inline assembly math statement
that calls a function block and loads a parameter list.
The block in this example is FB40, an analog input scale FB. The analog
input is %PW130, which is a zero-bias input with a range of 0.0 to 100.0.
The result of the analog scaling is placed in the variable named OUT1. This
variable, OUT1, was declared in the declaration section of APT and given a
user-assigned address in DB6, in accordance with the procedure described
in Section C.2. Since the size of the parameter list, as calculated above, is
12, the jump to go past the parameters is 13.
BEGIN
IN_ASM[* {identifies beginning of inline assembly statement}
C %DB6 {calls the DB that stores the APT symbol named OUT1}
JU %FB40 {jump to FB40}
JU 13 {jump the length of parameters (12 words) plus 1}
L %KF+128 {first parameter, first I/O point on analog card}
L %KS’ P’ {analog card is in the PW area}
L %KY1,4 {the second I/O point on analog card; it is zero bias}
L %KG100.0 {the upper limit of the scaled value}
L %KG0.0 {the lower limit of the scaled value}
A %I1.0 {bit that requests a single scan}
L OUT1 {the result from FB40 goes into the APT symbol OUT1}
A %Q1.0 {the broken transmitter bit}
A %Q1.1 {the overrange bit}
A %Q1.2 {bit that indicates whether single scan has occurred}
*]; {identifies the end of inline assembly statement}
Using the You can use the accumulators to pass the parameters of an external FB, FX,
Accumulators PB, SB, or OB. You must reserve FBs, FXs, PBs, and SBs in the Compiler
Control File before you incorporate them into APT. You do not have to
reserve OBs in the Compiler Control File.
1. Load the first two parameters into Accumulator 1 and enter the ENT
command.
2. Load the third parameter into Accumulator 1 and enter the ENT
command.
! WARNING
You can load a maximum of four accumulators before you begin to overwrite
data. Loading more than four accumulators could result in unpredictable
operation of the controller.
Unpredictable operation of the controller could result in death or serious injury
to personnel, and/or damage to equipment.
Do not load more than four parameters, total, to the accumulators.
1. Enter the inline assembly identifier that indicates the beginning of the
statement.
IN_ASM[*
See Section C.2 for examples of load statements for the various types of
parameter (direct addresses, symbolic names, bits, constants) that are
permitted.
JU %FBx
JU %FXx
JU %PBx
JU %SBx
JU %OBx
where x is the number that identifies the FB, FX, PB, SB, or OB.
4. Enter the inline assembly identifier that indicates the end of the
statement.
*];
Example This example shows an inline assembly math statement that loads
parameters for a cosine function block at FB102 into the accumulators. Both
the inputs and the results of the cosine function block are stored in the
accumulators. In this example, THETA is an angle that has already been
declared in the declaration section of APT. COSTHETA is a variable that
has been declared in APT; it holds the result of the FB. Notice that THETA
and COSTHETA do not have to have a user-assigned address, since they are
passed through the accumulators instead of through a parameter list.
BEGIN
IN_ASM[* {identifies beginning of inline assembly statement}
L THETA {load THETA into Accumulator 1}
JU %FB102 {jump to the cosine FB}
= %F250.2 {error flag}
T COSTHETA {transfer result from Accumulator 1 to COSTHETA}
*]; {identifies the end of inline assembly statement}
This code loads THETA into Accumulator 1 and then jumps to FB102. The
cosine of THETA is placed into Accumulator 1 and then transferred to the
variable COSTHETA. If the calculation is successful, FB102 sets RLO.
If you declare a data word in the declaration section of APT, and assign it to
a reserved DB or DX, you can use the left-hand byte and the right-hand
byte. To specify the left-hand byte, you can either use the memory type DL.
To specify the right-hand byte, use memory type DR.
The following example calls a data block, DB3, and loads the left-hand and
right-hand bytes of data word 12.
BEGIN
C %DB3 {calls DB3}
L %DB3:DL12 {loads left-hand byte of DW12}
L %DB3:DR12 {loads right-hand byte of DW12}
You must issue the call to the DB/DX before the jump to an FB/FX if you are
using the DB/DX data as inputs to a parameter list.
Index-1
B Block (continued)
S5 (continued)
BCD to binary procedure, 11-11 function (FB), B-12
incorporating into APT, C-10
Binary to BCD procedure, 11-12 opening, C-19
Bit assign procedure, 11-13 program (PB), B-12
sequence (SB), B-12
Bit clear procedure, 11-14 scale, 9-13
Bit set procedure, 11-15 second order lag, 3-10
second order lead lag, 3-7
Bit test function, 11-18
split range control, 7-9
Bits to integer function, 11-16 square, 8-18
Block square root, 8-20
absolute value, 8-5 subtractor, 8-22
analog alarm, 2-38 summer, 8-24
anti-reset windup protection/constraint, 9-3 threshold selector, 6-22
anti-reset windup protection/select, 9-6 valve sequencer control, 7-13
average selector, 6-5
continuous function. See CFB
correlated lookup table, 9-9 C
dead time compensator, 4-3
dead time delay, 3-23 C-flags
derivative, 3-20 analog alarms, 2-42
divider, 8-7 PID loops, 2-25
dual mode, 4-8 CFB
feedforward output adjust, 4-14 commands, 1-8
feedforward setpoint adjust, 4-20 configuring, 1-6
first order lag, 3-17 error codes, 1-10
first order lead lag, 3-13 extensions, 1-9
high selector, 6-8 referencing, 1-3
inswitch selector, 6-11 types, 1-4
integrator, 3-26
interlock, 8-9 CFC
low selector, 6-14 defined, 1-3
math, 8-11 language, 1-2
median selector, 6-17 ch 1 token, 1-10
motor position control, 7-3
Clear flag procedure, 11-19
multiplier, 8-16
on/off, 2-32 Code specifier, math block, 10-18
output limiter, 5-3 Command statement, 10-26
outswitch selector, 6-19
PID, 2-3 Comment, math, 10-24
proportional time control, 7-6 Compiling programs
rate limiter, 5-5 compile messages, A-2
ratio station, 4-25 error messages, A-4
S5
and math statements, C-2 Constant (K) memory, reserved, B-5
data (DB), B-11 Continuous function block. See CFB
extended data (DX), B-11
Continuous function chart. See CFC
extended function (FX), B-12
Copy bytes procedure, 11-20
Index-2
Copy direct procedure, 11-22 DOS, error messages, A-48
Correlated lookup table control block, 9-9 Dual mode control block, 4-8
commands, 9-12 commands, 4-12
extensions, 9-12 enabling/disabling, 4-9
extensions, 4-12
Cosine function, 11-24
Dynamic control block
Counter (S5), reserved, B-12
dead time delay, 3-23
Counter (TCP) memory, reserved, B-6 derivative, 3-20
enabling/disabling, 3-3
first order lag, 3-17
D first order lead lag, 3-13
initialization, 3-4
Data block (DB), reserved, B-11 integrator, 3-26
second order lag, 3-10
Data types
second order lead lag, 3-7
boolean, 10-14
simulation equations, 3-6
integer, 10-12
real, 10-13
Dead time compensator control block
commands, 4-6
E
extensions, 4-6 Edge function, 11-25
input/output control, 4-3
Else statement, 10-28
Dead time delay control block
commands, 3-25 Elsif statement, 10-28
extensions, 3-25 Endif statement, 10-28
input/output control, 3-23
Error codes, CFB extensions, 1-10
Declaration, math block, 10-19
Error messages
Derivative control block archive program, A-43
commands, 3-22 DOS system, A-48
extensions, 3-22 download program, A-40
input control, 3-20 program compile, A-4
Direct controller addresses restore program, A-43
and inline assembly statement, C-5 tag translation, A-40
reserved memory, 10-9 Executable section, math block, 10-23
S5
Exponent function, 11-26
guidelines, B-16
reserved memory, B-11 Expressions, math language, 10-11
variables, B-13
Extended data block (DX), reserved, B-11
Series 505
guidelines, B-10 Extended function block (FX), reserved, B-12
reserved memory, B-4 Extensions
variables, B-8 absolute value control block, 8-6
status words, 10-9, B-2 analog alarm control block, 2-40
system data area memory, 10-9, B-2 anti-reset windup protection/constraint block,
temporary memory, 10-9, B-3 9-5
Divider control block anti-reset windup protection/select block, 9-8
divide inputs, 8-7 average selector control block, 6-7
extensions, 8-8 correlated lookup table control block, 9-12
Index-3
Extensions (continued) Feedforward setpoint adjust control block
dead time compensator control block, 4-6 commands, 4-23
dead time delay control block, 3-25 extensions, 4-23
derivative control block, 3-22 setpoint control, 4-20
divider control block, 8-8
First order lag control block
dual mode control block, 4-12
commands, 3-19
error codes, 1-10
extensions, 3-19
feedforward output adjust control block, 4-18
input/output control, 3-17
feedforward setpoint adjust control block,
4-23 First order lead lag control block
first order lag control block, 3-19 commands, 3-16
first order lead lag control block, 3-16 extensions, 3-16
high selector control block, 6-10 input/output control, 3-13
inswitch selector control block, 6-13 Flag byte, reserved, B-12
integrator control block, 3-28
low selector control block, 6-16 Flag, APT, PID control block, 2-21
math control block, 8-15 Forced role swap procedure, 11-27
median selector control block, 6-18
motor position control block, 7-5 Fraction function, 11-28
multiplier control block, 8-17 Function block (FB), reserved, B-12
on/off control block, 2-36
Function statement, 10-26
output limiter control block, 5-4
outswitch selector control block, 6-21
PID control block, 2-23, 2-27
proportional time control block, 7-8 H
rate limiter control block, 5-7
ratio station control block, 4-27 High selector control block
RTD status, 2-31 commands, 6-10
scale control block, 9-15 extensions, 6-10
second order lag control block, 3-12 high input, 6-8
second order lead lag control block, 3-9
split range control block, 7-12
square control block, 8-19 I
square root control block, 8-21
subtractor control block, 8-23 I control block. See PID control block
summer control block, 8-25 Identifiers, math language, 10-7
system-defined, 10-8
thermocouple status, 2-31 If statement, 10-28
threshold selector control block, 6-24 Immediate read input procedure, 11-35
valve sequencer control block, 7-16
Immediate write output procedure, 11-36
IN_ASM statement, C-2
F Inline assembly (in_asm) statement
accumulator, C-16
Feedforward output adjust control block defined, C-2
commands, 4-17 parameters, C-5
extensions, 4-18
output control, 4-14 Inswitch selector control block
commands, 6-13
extensions, 6-13
select input, 6-11
Index-4
Integer math operators, 10-12 Loop (continued)
process variable, 2-9
Integer to bits procedure, 11-32
reverse-acting, 2-15
Integer to real function, 11-34 S-memory extensions, 2-29
Integrator control block setpoint, 2-11
commands, 3-28 status, 2-27
extensions, 3-28 tuning parameters, 2-19
input/output control, 3-26 V-flags, 2-25
Interlock control block, create interlock, 8-9 Low selector control block
commands, 6-16
Interpolate procedure, 11-30 extensions, 6-16
low input, 6-14
K
Key words, math language, 10-6
M
Map tuning and alarm data to S-memory, PID
blocks, 2-30
L Math block
RLL code, 10-4
Ladder (L) memory, reserved, B-4
SFPGM code, 10-4
Language, math. See Math language
Math control block
Languages, CFC, 1-2 absolute value, 8-5
Latch procedure, 11-37 commands, 8-15
divider, 8-7
Lead lag procedure, 11-38 enabling/disabling, 8-14
Left shift function, 11-40 extensions, 8-15
interlock, 8-9
Limit procedure, 11-41 math, 8-11
Limiter control block multiplier, 8-16
enabling/disabling, 5-2 square, 8-18
output limiter, 5-3 square root, 8-20
rate limiter, 5-5 subtractor, 8-22
summer, 8-24
Load array procedure, 11-42
user-defined math, 8-11
Logarithm (LN) function, 11-46
Math language
Logarithm (LOG) function, 11-47 data types
Logical math operators, 10-15 boolean, 10-14
integer, 10-12
Lookup table procedure, 11-44 real, 10-13
Loop defined, 10-2
algorithm, 2-4 direct controller addresses, 10-9
associated math, 2-17 expressions, 10-11
C-flags, 2-25 functions, 11-3
controller options, 2-15 ABS, 11-7
direct-acting, 2-15 ARCCOS, 11-8
extensions, 2-29 ARCSIN, 11-9
freeze bias, 2-16 ARCTAN, 11-10
output, 2-13 BITS_TO_INT, 11-16
Index-5
Math language (continued) Math language (continued)
functions (continued) procedures (continued)
BITTEST, 11-18 PTRUNC, 11-55
COS, 11-24 SCALE, 11-58
EDGE, 11-25 SETSSI, 11-62
EXP, 11-26 UNPACK_BITS, 11-68
FRAC, 11-28 UNSCALE, 11-70
INT_TO_REAL, 11-34 subroutines, 11-6
LEFTSHIFT, 11-40
Math operators
LN, 11-46
integer, 10-12
LOG, 11-47
logical, 10-15
RIGHTSHIFT, 11-56
real, 10-13
ROUND, 11-57
relational, 10-14
SIN, 11-64
SQRT, 11-65 Math statements
TAN, 11-66 assignment, 10-25
TRUNC, 11-67 command, 10-26
identifiers, 10-7 comments, 10-24
key words, 10-6 else, 10-28
math block structure, 10-16 elsif, 10-28
code specifier, 10-18 endif, 10-28
declaration section, 10-19 function, 10-26
executable section, 10-23 if, 10-28
PRAGMA, 10-18 inline assembly
precedence level, 10-11 and S5 blocks, C-2
procedures, 11-3 formatting, C-4
BCDBIN, 11-11 parameters, C-5
BINBCD, 11-12 print, 10-26
BIT_ASSIGN, 11-13 procedure, 10-26
BITCLEAR, 11-14 while, 10-30
BITSET, 11-15 Maximum value procedure, 11-48
CLEAR, 11-19
COPY_BYTES, 11-20 Median selector control block
COPY_DIRECT, 11-22 commands, 6-18
FRS, 11-27 extensions, 6-18
INT_TO_BITS, 11-32 median input, 6-17
INTERPOLATE, 11-30 Memory
IREAD, 11-35 S5, system data area (RS), B-2
IWRITE, 11-36 Series 505
LATCH, 11-37 reserved, B-4
LEAD_LAG, 11-38 status word, B-2
LIMIT, 11-41 temporary, B-3
LOAD_ARRAY, 11-42
LOOKUP_TABLE, 11-44 Messages
MAX, 11-48 archive program error, A-43
MIN, 11-49 compile error, A-4
MINMAX, 11-50 DOS system, A-48
ON, 11-51 download error, A-40
PACK_BITS, 11-52 restore program error, A-43
PBITS_TO_INT, 11-53 tag translate error, A-40
PROUND, 11-54 Minimum value procedure, 11-49
Index-6
Minimum/maximum value procedure, 11-50
P
MOD, integer math operator, 10-12
P control block. See PID control block
Motor position control block
commands, 7-5 Pack bits procedure, 11-52
extensions, 7-5 Pbits to integer procedure, 11-53
select valve position, 7-3
PD control block. See PID control block
Multiplier control block
extensions, 8-17 PI control block. See PID control block
multiply inputs, 8-16 PID control block
APT flags, 2-21
associated math, 2-17
N commands, 2-21
controller options, 2-15
NOT, logical math operator, 10-15 direct-acting, 2-15
extensions, 2-23, 2-27, 2-29
freeze bias, 2-16
O loop
C-flags, 2-25
On flag procedure, 11-51 V-flags, 2-25
loop control, 2-3
On/off control block, 2-32
output, 2-13
commands, 2-35
process variable, 2-9
direct-acting, 2-33
reverse-acting, 2-15
extensions, 2-36
S-memory extensions, 2-29
reverse-acting, 2-33
setpoint, 2-11
Operators tuning parameters, 2-19
integer, 10-12
Power failure, S5 retentive values, 12-4
logical, 10-15
real, 10-13 PRAGMA, 10-18
relational, 10-14 Precedence level, math operators, 10-11
OR Print statement, 10-26
integer math operator, 10-12
logical math operator, 10-15 Procedure statement, 10-26
Other control blocks Program
anti-reset windup protection/constraint, 9-3 archiving, error messages, A-43
anti-reset windup protection/select, 9-6 compiling
correlated lookup table, 9-9 error messages, A-4
enabling/disabling, 9-2 messages, A-2
scale, 9-13 downloading to controller, error messages,
A-40
Output limiter control block restoring, error messages, A-43
commands, 5-4 validating, error messages, A-48
extensions, 5-4
variable range control, 5-3 Program block (PB), reserved, B-12
Outswitch selector control block Proportional time control block, 7-6
commands, 6-21 commands, 7-8
extensions, 6-21 extensions, 7-8
select output, 6-19
Index-7
Pround (real to integer) procedure, 11-54 Selector control block
average, 6-5
Ptrunc (truncate real) procedure, 11-55
enabling/disabling, 6-4
high, 6-8
inswitch, 6-11
R low, 6-14
median, 6-17
Rate limiter control block outswitch, 6-19
commands, 5-7 threshold, 6-22
extensions, 5-7
input control, 5-5 Sequence block (SB), reserved, B-12
Ratio station control block, 4-25 Sequential function chart. See SFC
commands, 4-27 Series 505, math language procedures, 11-3
extensions, 4-27 Set scan inhibit procedure, 11-62
RBE, reserving memory, B-7 SFC
Real math operators, 10-13 defined, 12-2
drawing, 12-14
Relational math operators, 10-14 math section, 12-7
Relay Ladder Logic code. See RLL code parallel branches, 12-17
rules, 12-20
Resistance temperature detector (RTD) module, parallel section, 12-6
extensions, 2-31
program flow, 12-3
Right shift function, 11-56 recovering from power loss, 12-4
RLL code, math blocks, 10-4 safe-state
command restrictions, 13-6
Round (real to integer) function, 11-57 command types
defined, 13-4
SSABORT, 13-16
S SSARM, 13-14
SSDEFINE, 13-10
S-flag byte, reserved, B-12 SSDISARM, 13-15
S-memory SSENTRY, 13-7
analog alarm extensions, 2-44 SSRETURN, 13-8
PID extensions, 2-29 SSTRIGGER, 13-12
defined, 13-2
S5, math language procedures, 11-3 level, 13-2
Safe-state SFC. See SFC local, 13-2
operation, 13-3
Scale control block, 9-13 priority, 13-2
commands, 9-15 step requirements, 13-6
extensions, 9-15 subordinate, 13-2
Scale procedure, 11-58 selection branches, 12-22
rules, 12-25
Second order lag control block
steps, 12-5
commands, 3-12
rules, 12-12
extensions, 3-12
transitions, 12-8
input/output control, 3-10
rules, 12-12
Second order lead lag control block types
commands, 3-9 main, 12-2, 12-28
extensions, 3-9 safe state, 12-2
input/output control, 3-7 subordinate, 12-2, 12-29
Index-8
SFPGM code, math blocks, 10-4 Timer (S5), reserved, B-12
Sine function, 11-64 Timer (TCP) memory, reserved, B-6
Special (S) memory, reserved, B-5 Transitions, SFC, 12-8
Special Function Program code. See SFPGM Truncate real function, 11-67
code
Split range control block
commands, 7-12 U
extensions, 7-12
split input signal, 7-9 Unpack bits procedure, 11-68
Square control block Unscale procedure, 11-70
compute squares, 8-18 User (U) memory, reserved, B-7
extensions, 8-19
Square root control block
compute square root, 8-20 V
extensions, 8-21
Validation, program, error messages, A-48
Square root function, 11-65
Valve control block
Standard control block
enabling/disabling, 7-2
analog alarm, 2-38
motor position, 7-3
on/off block, 2-32
proportional time, 7-6
PID, 2-3
split range, 7-9
Statements, math. See Math statements valve sequencer, 7-13
Steps, SFC, 12-5 Valve sequencer control block
Subroutines, functions and procedures, 11-6 commands, 7-16
control valves, 7-13
Subtractor control block extensions, 7-16
extensions, 8-23
subtract inputs, 8-22 Variable (V) memory, reserved, B-4
T W
Tags, translating, error messages, A-40
While statement, 10-30
Tangent function, 11-66
Thermocouple module, extensions, 2-31
Threshold selector control block X
commands, 6-24
XOR, integer math operator, 10-12
extensions, 6-24
select threshold, 6-22
Index-9
Customer Response
We would like to know what you think about our user manuals so that we can serve you better.
How would you rate the quality of our manuals?
Would you be interested in giving us more detailed comments about our manuals?
Your Name:
Title:
Telephone Number: ( )
Company Name:
Company Address:
FOLD