Template:Making multi-step configuration changes using trigger subroutines
Jump to navigation Jump to search
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:
- 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.
- In this example, the PID controller block can be switched on / off based on a trigger variable (true/false).
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..On"] = 0 Else ["Acid_Control.Cfg..On"] = 1 Endif EndSub