Example PGM Files
Navigation: User Guide ➔ Getting Started ➔ Example PGM Files
| Simple Examples | Subroutines Examples | Dynamic Examples | Steady State Overall Mass Balance | Array and Matrix Examples | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Basic Layout | Simple Calculations | Initialise PreStart | Multi-Step Trigger | Checking Project | Counter, While and Random | Belt Filter Wash Loss | Startup Actions | Mass Balance | Mass Balance | Species Balance | Elemental Balance | Lookup Value | Set Values | Tridiagonal System |
Latest SysCAD Version: 13 May 2026 - SysCAD Build 139.37082
Related Links: PGMs
The above tables contain some quick access links for examples listed below. For more information and full example lists, please see below:
Simple Example PGM Files
Subroutine Examples
Example Model Procedure files
MP Example Files:
NOTE: A variation of the Tank Volume code, written in PGM format, is used in the Nickel Copper Example Project. For more information, refer to: GC_Controller (GC_Tanks).
PGM Files using Class and Functions
Using Array and Matrix
The following PGM examples demonstrate the use of the Array and Matrix Class.
- Table lookup using Array and Matrix
- Set A Table of Values Using Matrix Class
- Solving a tridiagonal system of equations
Quick Mass balance
The Predefined Class TagSelect can be used to generate quick mass balance checks for a project.
- Overall mass balance at the end of the project solve
- Species mass balance at the end of the project solve
- Elemental mass balance at the end of the project solve
NOTE: The Nickel Copper Project example project uses these quick mass balance checks, along with a more detailed variation of the elemental balance. For more information, refer to the example project: GC_Controller (Overall_Mass_Balance).
Species Check
The following PGM examples can be used to check species at the end of a project solve. They demonstrate the use of the Species Database, TagSelect, String Array, Array classes, as well as String Functions.
NOTE: From Build 139 onwards, the used/unused species lists can be accessed directly via the Plant Model - Species tab, without needing to create them in the PGM file.
- Generating a list of species with flow (useful for stream table reports)
- Checking whether a species is not used in the project (i.e. has no flow anywhere)
- Comparing two lists of string variables
Species Properties
The following PGM example can be used to retrieve species data. It demonstrates the use of the Species Database and Array classes.
User Defined Class and Functions
Class - Introduction and Function/Subroutine can be written as part of the main PGM file OR separately in its own file. If the Class or function/subroutine can be used by multiple PGM or projects, it is best to store the code in a separate file, so it can be re-used easily. Please see Sharing Classes between Projects for more information.
Some simple Class examples can be found on page: Class - Examples.
In the following examples, the Class definition is stored in a separate pgm file, the class pgm file is inserted using the include file syntax when it is required.
- Example Class to Set Species Splits
- Example Class to calculate Agitator Power
- Example Class to Find a user specified Reaction in a Reaction Block
In the following examples, the Class is written as part of the PGM code. User may copy the class definition into its own file if required.
- Example Class to set Aqueous Feeder based on concentration
- Example Class to set Evaporation based on user defined correlation
- Example Class to calculate Alumina properties
- Example Class - Check Elemental Balance of a Process Unit Operation
- Example Class - using Enum Drop list and Drop List in a class
- Example Class - variable gain to assist with solving sensitive PID control loops
- Example Class - Relaxed Cross Page Connector - example class to allow a graduate transfer of data across the cross-page connection. Useful for breaking sensitive loops, allowing a slower and smoother change between sections of the plant.
- Example Class - Boiling Point Elevation from TCE - example class to calculate boiling point elevation of water given water activity calculated by TCE. Warning: only suitable if water is the ONLY volatile species