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-55
• As the program branches from the second subroutine to the
third subroutine, $ARG1 and $ARG2 continue to represent
PT1 and PT2 respectively.
1000 C MAINLINE PROGRAM FOR LOGICAL FIRMWARE
1010 C
1020 C THIS PROGRAM TEACHES HOW GOSUBS AND
1030 C $ARG POINTS WORK IN MULTIPLE
1040 C LEVEL SUBROUTINES.
1050 C
1100 ...
1200 ...
1300 ...
1350 C THIS GOSUB CALLS THE FIRST SUBROUTINE
1360 C AND PASSES THE VALUE DEFINED IN PT1 TO
1370 C TO $ARG1.
1380 C
1500 GOSUB 2030 PT1
2000 C
2010 C SUBROUTINE #1
2020 C
2030 ...
2040 ...
2050 C IN ORDER TO PRESERVE THE VALUE LOCATED
2060 C IN $ARG1, YOU MUST DEFINE $ARG1 IN THE
2070 C SECOND SUBROUTINE'S CALLING GOSUB. THE
2080 C PROGRAM ALSO PASSES A SECOND POINT
2090 C VALUE NAMED PT2.
2100 C
2500 GOSUB 3030 $ARG1,PT2
2510 RETURN
3000 C
3010 C SUBROUTINE #2
3020 C
3030 ...
3040 ...
3050 C IN ORDER TO PRESERVE THE VALUES
3060 C LOCATED IN $ARG1 AND $ARG2, YOU MUST
3070 C DEFINE BOTH POINTS IN THE THIRD
3080 C SUBROUTINE'S CALLING GOSUB. THE
3090 C PROGRAM ALSO PASSES A THIRD POINT
APOGEE PPCL User’s Manual
3-56 Siemens Building Technologies, Inc.
3100 C VALUE CALLED PT3.
3200 GOSUB 4020 $ARG1,$ARG2,PT3
3210 RETURN
4000 C SUBROUTINE #3
4010 C
4020 ...
4030 ...
4040 RETURN
Figure 3-2. Multiple Level Subroutines.
Notes
• A GOSUB command can only reference point names or local
variables.
• A GOTO command can be used inside of a subroutine only if the
command does not transfer program control out of that
subroutine.
• The last line of a subroutine must be a RETURN command.
• Do not transfer control out of a subroutine without using a
RETURN command.
• Do not use time-based commands such as LOOP, SAMPLE,
TOD, and WAIT inside a subroutine.
• Do not use an IF/THEN/ELSE command with a GOSUB
command.
See also
GOTO, RETURN