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
Command Syntax
Siemens Building Technologies, Inc. 3-51
When using multi-level subroutines, the rules that govern $ARGn
variables and point name declarations for GOSUB commands
change as follows:
• $ARGn variables used in multi-level subroutines cannot be
shared between subroutine levels. That is, you cannot assign the
value of PT1 to $ARG1 in the call to level one and then assign
the value of PT2 to $ARG1 in the call to level two.
• When defining a new level in a multi-level subroutine, list the
previously-defined $ARGn variables in sequential order to
preserve their values.
Any new points declared in that level must be placed after the
$ARGn variables. For example, in the third level of a multi-level
subroutine, $ARG1 and $ARG2 would be redefined before the
defining the new value of PT3.
• If a previously-defined $ARGn variable is not redefined in the call
to a new level, any values introduced in the new level replace the
values in $ARGn.
Subroutine Examples
To explain the concept of subroutine program control, two examples
of program code are provided in this section:
• Program flow sequence
• Multiple level subroutines
Program Flow Sequence
This example demonstrates how a number of PPCL commands are
used in subroutines. Refer to Figure 3-1 as you follow the program
flow sequence.
• The variables PT1 and PT2 demonstrate the passing of values
between subroutines.
• The $ARG local variable demonstrates how values are passed
between subroutines.
• The GOTO command, which is used to bypass subroutines, is
also shown in this example.
APOGEE PPCL User’s Manual
3-52 Siemens Building Technologies, Inc.
The program flow through one complete pass is as follows:
1. At line 130, the GOSUB command transfers control to line 1010.
2. At line 1010, the program assigns a value of 10 to PT1 and the
value of 20 to PT2. Line 1030 branches back to the line after the
GOSUB command (at line 130). After the program returns to the
main line code, the values of the two points become:
PT1 = 10
PT2 = 20
3. The program continues to sequentially evaluate program lines
until it encounters the GOSUB command at line 300. The
program branches to line 2010. This command also defines two
values that are passed (PT1 and PT2).
4. At line 2010, a $ARGn point is assigned a value. When the
program encounters a $ARGn point, it checks the calling
GOSUB command for point names. The GOSUB command used
to call this subroutine contains two point names. When the
program encounters the first $ARGn variable at line 2010, it
takes the first point name defined in the GOSUB command
(PT1) and stores that value in $ARG1 (10). Line 2010 also adds
one (1) to the value of $ARG1.
5. When the program encounters the second $ARGn variable at
line 2020, it takes the second point name defined in the GOSUB
command (PT2) and stores that value in $ARG2 (20). Line 2020
also adds one (1) to the value of $ARG2.
Line 2030 returns control of the program to the line after the
GOSUB command (at line 300). At line 400, the program
executes the GOTO command to line 3000 that returns control
back to mainline code.
After one pass of the program, the values of the points after
being updated by the $ARGn variables, will be as follows:
PT1 = 11
PT2 = 21