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-101
Table 1-10. Efficient Use of Subroutines.
Number of Program Lines
Number of Calls
per Program Pass
1 Line 2 Lines 3 Lines 4 Lines
or more
1 Call
No No No No
2 Calls
No No Even Yes
3 Calls
No No Yes Yes
4 Calls or more
No Yes Yes Yes
Use the following steps and Table 1-10 to determine when it
becomes beneficial to use a subroutine:
1. Determine how many program lines a subroutine will contain
(excluding the RETURN command).
2. Determine how many times the subroutine will be called through
one pass of the program.
• If the result is "NO," then it is more efficient to use straight-
line program code.
• If the result is "EVEN," then there is no benefit for using
either method.
• If the result is "YES," then it is more efficient to use a
subroutine.
APOGEE PPCL User’s Manual
1-102 Siemens Building Technologies, Inc.
Subroutine Commands
Using GOTO
The GOTO command is commonly used to skip over subroutines or
blocks of code and transfer control to another location in the
program. Observe the following guidelines when using a GOTO
command:
• Make sure GOTO commands are routing control to a program
line and not a comment line.
• Except for the last line of the program, all GOTO commands must
transfer control to a sequentially higher line number.
• The GOTO command in the last line of the program is the only
command that transfers control to the top of the program.
• If no other program lines need to be read during a pass, transfer
program control to the GOTO command in the last line of the
program
• Use GOSUB and RETURN to transfer program control to and
from subroutines. Do not use the GOTO command.
Using GOSUB
The GOSUB command transfers control to a subroutine. Variable
arguments can be passed to the subroutine from the mainline code
using $ARG local variables (if applicable). The values in the $ARG
points replace their respective point values.
When the subroutine processing is complete, program control is
transferred back to the GOSUB statement by the RETURN
command. The field panel then continues processing at the next
sequential line number.
For information on transferring control to a subroutine, see GOSUB
and RETURN in Chapter 3–Syntax.