Making multi-step configuration changes using trigger subroutines

From SysCAD Documentation
Jump to navigation Jump to search

Navigation: PGMs ➔ Example PGM Files ➔ Multi-Step Trigger

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

Related Links: Trigger Subroutines



Where multiple steps are required to re-configure a unit operation, the steps may need to be broken up between the different trigger subroutines so that they are executed in series.

Two examples are shown here:

  1. In this example, a Filter Press model is required to be turned on, the method changed and a parameter set. Since the parameter may not be available until the method selection is made, these will be performed in different subroutines.
  2. In this example, the PID controller block can be switched on / off based on a trigger variable (true/false).
Example1 Example2
Sub InitialisePreStart()
 ;--- Logic executed very early before first iteration
 ; Turn on filter press FP_001
 ["FP_001.On"] = 1

EndSub
 
Sub PreStart()
 ;--- Logic executed early before first iteration
 ; Set method in filter press FP_001 to FiltrateConcAt25C
 ["FP_001.Method"] = 1
EndSub

Sub InitialiseSolution()
 ;--- Logic executed during initialisation before first iteration
 ; Set required filtrate solid concentration in filter press FP_001
 ["FP_001.FiltrateSolidConc25Reqd (g/L)"] = 2

EndSub
Sub PreStart()
 ;--- Logic executed early before first iteration
 ; example for switching PID control block on/off based on trigger:
  if UsePID_Control
	["Acid_Control.Cfg.[2].On"] = 0
  Else
	["Acid_Control.Cfg.[2].On"] = 1
  Endif
EndSub