User Guide
Table Of Contents
- Table of Contents
- How to Use This Manual
- Chapter 1–Program Methodology
- Overview
- Introduction to PPCL
- PPCL Rules
- PPCL Program Design Guidelines
- Relational Operators
- Logical Operators
- Arithmetic Operators
- Arithmetic Functions
- Special Functions
- Order of Precedence
- Resident Points
- Local Variables
- Point Priority Overview
- At (@) Priority Status Indicators
- Point Status Indicators
- Converting a Sequence of Operation intoProgram Code
- Chapter 2–Control OptionComparisons
- Chapter 3–Command Syntax
- Overview
- ACT (Activate lines)
- ADAPTM (Adaptive control, multiple)
- ADAPTS (Adaptive control, single)
- ALARM (Alarm state)
- AUTO (Auto status)
- DAY (Day mode)
- DBSWIT (Dead band switch)
- DC (Duty cycle)
- DCR (Duty cycle routine)
- DEACT (Deactivate lines)
- DEFINE (Define abbreviation)
- DISABL (Disable lines)
- DISALM (Disable alarm)
- DISCOV (Disable COV)
- DPHONE (Disable phone)
- EMAUTO (Emergency, Auto status)
- EMFAST (Emergency, Fast status)
- EMOFF (Emergency, Off status)
- EMON (Emergency, On status)
- EMSET (Emergency, set value)
- EMSLOW (Emergency, Slow status)
- ENABLE (Enable lines)
- ENALM (Enable alarm)
- ENCOV (Enable COV)
- EPHONE (Enable phone)
- FAST (Fast status)
- GOSUB (Go to subroutine)
- GOTO (Go to line)
- HLIMIT (High limit)
- HOLIDA (Holiday)
- IF/THEN and IF/THEN/ELSE (Conditional control)
- INITTO (Initialize totalized value)
- LLIMIT (Low limit)
- LOCAL (Local variable)
- LOOP (Loop control)
- MAX (Maximum value)
- MIN (Minimum value)
- NIGHT (Night mode)
- NORMAL (Normal operating mode)
- OFF (Off status)
- OIP (Operator interface program)
- ON (On status)
- ONPWRT (On after power return)
- PDL (Peak demand limiting)
- PDLDAT (PDL, define load attributes)
- PDLDPG (PDL, digital point group)
- PDLMTR (PDL, meter monitor)
- PDLSET (PDL, setpoints)
- RELEAS (Release)
- RETURN (Return/end subroutine)
- SAMPLE (Sample a statement)
- SET (Set point value)
- SLOW (Slow status)
- SSTO (Start/stop time optimization)
- SSTOCO (SSTO coefficients)
- STATE (State text command)
- TABLE (Table of coordinates)
- TIMAVG (Average over time)
- TOD (Time of day, digital points)
- TODMOD (TOD modes)
- TODSET (Time of day, analog points)
- WAIT (Wait time)
- Overview
- Glossary
- Appendix A—PPCL Reserved WordList
- Index
Program Methodology—Converting a Sequence of Operation into
Program Code
Siemens Building Technologies, Inc. 1-99
Designing Programs Using a Modular Structure
Modular programming is a style of programming that logically
organizes code into common functions. This style of programming
can be applied to a single program, or to multiple programs running
on the network or in one field panel.
Objectives of Modular Programming
The objectives of modular programming are to reduce program code
and standardize program code.
Reducing Program Code
If a section of code is used many times during one pass of the
program, that code can be defined as a subroutine (also called a
module). When that routine is needed, control is transferred to that
part of the program.
Standardizing Program Code
Subroutines help set programming standards that define where
functionality is placed in the program. If you use an established block
of code and do not change the line numbers, then that subroutine
will always be placed in the same location in the program.
APOGEE PPCL User’s Manual
1-100 Siemens Building Technologies, Inc.
Benefits of Using Subroutines
By defining functions, procedures, and formulas in subroutines,
programs become faster to create, easier to write, and require less
time to test. A subroutine used for one device can also be adapted
for other devices.
For example, if a specific operation is performed five different times
during one pass of the program, you have two programming options.
1. The first option is to duplicate the code in five different places in
the program.
• This option adds five times as much program code.
• When making a change to one segment, you must
remember to change all occurrences of that code.
2. The second option is to use a subroutine. Every time the
operation is needed, program control is transferred to the
subroutine.
• This option reduces the amount of mainline program code.
• When making a change, there is only one section of code to
change.
When to Use a Subroutine
Before creating a subroutine, determine if the subroutine contains
enough lines and is accessed enough times through one pass of the
program to be of any benefit. There are times that straight-line
program code will be the optimal solution.
• A single line of program code placed in a subroutine will never be
executed enough times to be of any benefit. In this case, you
would create more program code for a subroutine than you would
by using straight-line program code
• Conversely, a subroutine containing four lines of program code
becomes beneficial when it is called more than once.