Initialise PreStart Trigger Subroutine Examples

From SysCAD Documentation
Jump to navigation Jump to search

Navigation: PGMs ➔ Example PGM Files ➔ Initialise PreStart

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


Reset Actions

Sub InitialisePreStart()
 ;--- Logic executed very early before first iteration

 ; Perform complete reset of project
 ["$Solver.Cmd.CompleteReset"] = 1  

EndSub

Activate/deactivate flowsheets

Note: Separate tags for Activate / Deactivate. These cannot be set to 0.
Sub InitialisePreStart()
 ;--- Logic executed very early before first iteration

 ; Activate flowsheet 05_Flowsheet
 ["PlantModel.Page[05_Flowsheet].Activate"] = 1  

 ; Deactivate flowsheet 10_Flowsheet
 ["PlantModel.Page[10_Flowsheet].DeActivate"] = 1

EndSub

Cross-page connections

Sub InitialisePreStart()
 ;--- Logic executed very early before first iteration

 ; Turn on cross-page connection in Feeder XPG_001
 ["XPG_001.ConnectionOn"] = 1

 ; Turn off cross-page connection in Feeder XPG_002
 ["XPG_002.ConnectionOn"] = 0

 ; Set cross-page connection in Feeder XPG_001 to XPG_002
 [str "XPG_001.Conn_To"] = "XPG_002"

EndSub