PPCL Programs

This section discusses the following topics:

Program Development

After you complete the process of planning the PPCL program, you can start writing program code for each of the modes by entering the PPCL program lines into the Program Editor. Start with one mode, and code the solution.

Keep in mind that multiple PPCL programs can be run in a single field panel. This allows you to reduce the size of a large program by dividing it into smaller modules of program functionality. You can then run a separate program for each module. Each program in the field panel will have its own set of line numbers, resident points, and local variables.

For more information on the program language and PPCL syntax, see the Powers Process Control Language User’s Manual (125-1896).

Compiler Errors

When you save the program, the Program Editor compiles the program statements into an executable control program. During compilation, the compiler automatically checks each PPCL statement for correct syntax. If the compiler finds an error, an error message displays in the Output section, and the program changes are not saved. To locate the error in the program code, double-click on the error. The cursor moves to the start of the program line where the error occurred. You can then make any necessary changes to correct the error.

Before saving the program, you can compile the entire program to check for correct syntax. You can also compile just one program line in order to check its syntax without having to compile the entire program.

Common Compiler Errors

The common compiler errors are described below.

Downloading the PPCL Program

When you create a new program or make changes to an existing program in the PPCL Editor and successfully compile and save the program, changes are automatically downloaded to the field panel.

How long it takes to download a program depends on the number of statements in the program.

If program changes are made at the field panel, the changes are automatically uploaded to the management station when the program is saved at the field panel. You do not need to coldstart the field panel in order for program changes to take effect.

Program Testing

Before enabling program statements, test the program code to verify that the program works properly under a variety of operating conditions. Tests should be developed in which you test individual modes or small sections of code, one at a time, until the entire program is tested.

When a program is tested, the data used should adequately test all conditions that the program may encounter. Test conditions not only include testing the range at which an input responds, but also testing values outside the range of response. If an input is defined to accept values from 50 degrees Fahrenheit to 70 degrees Fahrenheit, use an input value of 40 degrees Fahrenheit to find out how the system responds. If the program turns a point ON, find out what happens when you turn it OFF. Test how your program will react if a sensor or fan motor would fail.

When you use values that are not expected to be encountered by the program, you discover how the program processes errors. The precautions you take in programming and testing can save you downtime when the system encounters unusual operating conditions.

Trace Bits

When you modify PPCL code, you should clear trace bits from the previous PPCL code to ensure that the program runs properly. Clearing trace bits helps you to follow the flow of PPCL execution. With trace bits cleared and PPCL code displayed, you can determine if certain statements are being executed or bypassed. This is a useful tool for debugging PPCL code. For the procedure, see Clearing Trace Bits.

Program Documentation

After you have written and tested a program, the final step is to create program documentation. You should include documentation that details the functions and the equipment controlled by the program. Below are examples of program documentation.