Proprietary Information of Albemarle Corporation.
Using User Variables,
Scripts & Triggers
Alan Kramer
Global FCC Modeling Specialist
KBC Software User Group Conference
2018
Houston
Proprietary Information of Albemarle Corporation.
• Often we receive data with poor flue gas analysis.
• This leads to bad values for Hydrogen in Coke.
• For “simple” situations, we can use an equation to estimate the flue gas analysis to
give a reasonable H in Coke.
• For “complex” situations, we have to manually iterate each calibration case
individually for the flue gas estimate to give a reasonable H in Coke.
• We want to add H in Coke as an independent variable in calibration mode.
• We want the model to solve for the flue gas analysis.
The Problem
2
Proprietary Information of Albemarle Corporation.
• Create a user variable to hold the H in Coke target value.
– This can be input from Calibration Input
• Create a user variable script to calculate the flue gas CO2.
• Use triggers to start the script calculation.
• Use triggers to iterate the CO2 calculation until the H in Coke target is met.
The Solution
3
Proprietary Information of Albemarle Corporation.
Logic Schematic
4
Flue Gas CO2
H Content of Coke Stream
FCC
Proprietary Information of Albemarle Corporation.
FCC-MeterFCC Coke-Meter
Logic Schematic
5
Flue Gas CO2
H Content of Coke Stream
FCC
Proprietary Information of Albemarle Corporation.
FCC-MeterFCC Coke-Meter
Logic Schematic
Flue Gas CO2
H Content of Coke Stream
FCC
HinC Target
Proprietary Information of Albemarle Corporation.
Creating User Variables To Store Values
7
Proprietary Information of Albemarle Corporation.
FCC-MeterFCC Coke-Meter
Logic Schematic
HinC Script
Flue Gas CO2
H Content of Coke Stream
FCC
HinC Target
Proprietary Information of Albemarle Corporation.
Creating User Variables With Embedded Scripts
9
Type script here
Proprietary Information of Albemarle Corporation.
FCC-MeterFCC Coke-Meter
Logic Schematic
HinC Script
Flue Gas CO2
H Content of Coke Stream
FCC
HinC Target
Proprietary Information of Albemarle Corporation.
Writing Scripts
11
Proprietary Information of Albemarle Corporation.
VB Script Hints
12
• All script variables are variant type
• No script variable declarations
– You do need to declare arrays with dimensions
• If a variable in a script refers to an object, you must SET it
• No GOTO, GOSUB, EXIT or END
– Handle this with (nested) IF blocks and lots of planning
– But you can have multiple functions in a single script
• Empty = -32767
Proprietary Information of Albemarle Corporation.
FCC-MeterFCC Coke-Meter
Logic Schematic
HinC TargetHinC Script
Flue Gas CO2
H Content of Coke Stream
FCC
Proprietary Information of Albemarle Corporation.
Writing Scripts
14
Proprietary Information of Albemarle Corporation.
FCC-MeterFCC Coke-Meter
Logic Schematic
HinC TargetHinC Script
Flue Gas CO2
H Content of Coke Stream
FCC
Proprietary Information of Albemarle Corporation.
Writing Scripts
16
Proprietary Information of Albemarle Corporation.
FCC-MeterFCC Coke-Meter
Logic Schematic
HinC TargetHinC Script
Flue Gas CO2
H Content of Coke Stream
FCC
HinC Current Error
Proprietary Information of Albemarle Corporation.
Writing Scripts
18
Proprietary Information of Albemarle Corporation.
FCC-MeterFCC Coke-Meter
Logic Schematic
HinC TargetHinC Script
Flue Gas CO2
H Content of Coke Stream
FCC
HinC Current ErrorIf ~0 then stop
Proprietary Information of Albemarle Corporation.
Writing Scripts
20
Proprietary Information of Albemarle Corporation.
FCC-MeterFCC Coke-Meter
Logic Schematic
HinC TargetHinC Script
Flue Gas CO2
H Content of Coke Stream
FCC HinC Stored Error
HinC Current Error
Proprietary Information of Albemarle Corporation.
Writing Scripts
22
Proprietary Information of Albemarle Corporation.
FCC-MeterFCC Coke-Meter
Logic Schematic
HinC TargetHinC Script
Flue Gas CO2 HinC Stored Error
H Content of Coke Stream
FCC
HinC Current ErrorIf = then stop
Proprietary Information of Albemarle Corporation.
Writing Scripts
24
Proprietary Information of Albemarle Corporation.
FCC-MeterFCC Coke-Meter
Logic Schematic
HinC TargetHinC Script
Flue Gas CO2 HinC Stored Error
H Content of Coke Stream
FCC
HinC Current Error
Proprietary Information of Albemarle Corporation.
Writing Scripts
26
Proprietary Information of Albemarle Corporation.
FCC-MeterFCC Coke-Meter
Logic Schematic
HinC TargetHinC Script
Flue Gas CO2 HinC Stored Error
H Content of Coke Stream
FCC T
Proprietary Information of Albemarle Corporation.
Setting Trigger to Solve Parent Object on Value Change
28
Proprietary Information of Albemarle Corporation.
FCC-MeterFCC Coke-Meter
Logic Schematic
HinC TargetHinC Script
Flue Gas CO2 HinC Stored Error
H Content of Coke Stream
FCC T
Proprietary Information of Albemarle Corporation.
FCC-MeterFCC Coke-Meter
Logic Schematic
HinC TargetHinC Script
Flue Gas CO2 HinC Stored Error
H Content of Coke Stream
FCC T
Proprietary Information of Albemarle Corporation.
FCC-MeterFCC Coke-Meter
Logic Schematic
HinC TargetHinC Script
Flue Gas CO2 HinC Stored Error T
H Content of Coke Stream
Trigger 3
FCC
Value
Proprietary Information of Albemarle Corporation.
Run Script After Parent Object Execute
32
Proprietary Information of Albemarle Corporation.
FCC-MeterFCC Coke-Meter
Logic Schematic
HinC TargetHinC Script
Flue Gas CO2 HinC Stored Error T
H Content of Coke Stream
Trigger 3 T
FCC
Proprietary Information of Albemarle Corporation.
FCC-MeterFCC Coke-Meter
Logic Schematic
HinC TargetHinC Script
Flue Gas CO2 HinC Stored Error T
Trigger 1
H Content of Coke Stream
Trigger 3 T
FCC
Value
Proprietary Information of Albemarle Corporation.
Setting Trigger to Solve Parent Object on Value Change
35
Proprietary Information of Albemarle Corporation.
FCC-MeterFCC Coke-Meter
Logic Schematic
HinC TargetHinC Script
Flue Gas CO2 HinC Stored Error T
Trigger 1 T
H Content of Coke Stream
Trigger 3 T
FCC
Proprietary Information of Albemarle Corporation.
FCC-MeterFCC Coke-Meter
Logic Schematic
37
HinC TargetHinC Script
Flue Gas CO2 HinC Stored Error T
Trigger 1 T
H Content of Coke Stream Trigger 2 T
Trigger 3 T
FCC
Compare
If different take on a random value
between 0 and 1
Proprietary Information of Albemarle Corporation.
Setting Trigger to Take on A Radom Value
38
Proprietary Information of Albemarle Corporation.
FCC-MeterFCC Coke-Meter
Logic Schematic
39
HinC TargetHinC Script
Flue Gas CO2 HinC Stored Error T
Trigger 1 T
H Content of Coke Stream Trigger 2 T
Trigger 3 T
FCC
Proprietary Information of Albemarle Corporation.
FCC-MeterFCC Coke-Meter
Logic Schematic
40
HinC TargetHinC Script
Flue Gas CO2 HinC Stored Error T
Trigger 1 T
Trigger on Calib Start TH Content of Coke Stream Trigger 2 T
Trigger 3 T
FCC
Proprietary Information of Albemarle Corporation.
Setting Trigger to Run Script on Calibration Starting
41
Proprietary Information of Albemarle Corporation.
FCC-MeterFCC Coke-Meter
Logic Schematic
42
HinC TargetHinC Script
Flue Gas CO2 HinC Stored Error T
Trigger 1 T
Trigger on Calib Start TH Content of Coke Stream Trigger 2 T
Trigger 3 T
FCC
-1
Proprietary Information of Albemarle Corporation.
Setting Trigger to Solve Parent Object on Value Change
43
Proprietary Information of Albemarle Corporation.
FCC-MeterFCC Coke-Meter
Logic Schematic
44
HinC TargetHinC Script
Flue Gas CO2 HinC Stored Error T
Trigger 1 T
Trigger on Calib Start TH Content of Coke Stream Trigger 2 T
Trigger 3 T
FCC
Proprietary Information of Albemarle Corporation.
• User variables and scripts aren’t really difficult or scary.
• You can use user variables and scripts to add important functionality.
• The ‘simplicity’ of VB Script has advantages and drawbacks.
• Triggers take some practice and patience to set up correctly.
• Save often. It’s easy to create infinite calculation loops.
• VB Script syntax examples on following slides.
Conclusions
45
Proprietary Information of Albemarle Corporation.
• Create a variable referencing an object in the flowsheet
Set CokeMeter = SimulationCase.GetObjectInCase("FCC Coke-Meter")
• Create a variable referencing a variable in a meter
Set HinCVariable = CokeMeter.ActiveDataSet.Variables.Find("Hydrogen Content", "")
• Store the value from the ‘screened’ column of a meter using a specific unit of
measure
HinC = HinCVariable.ScreenedValueWithUnits("wt %")
• Put a value into the ‘input’ column of a meter
HinCVariable.InputValue = 7
VB Script Syntax Examples
46
Proprietary Information of Albemarle Corporation.
• Get a user variable value from the same parent object
ThisScriptVariable = Me.GetUserVariable(“OtherUserVar").Variable.Value
• To set the value of a user variable value, flip the above statement around
• Get a user variable value with a specific UOM from another object (cokemeter)
ThisScriptVariable = CokeMeter.GetUserVariable(“OtherUserVar").Variable.GetValue(“UOM”)
• Set the value of the current user variable to xxx
Result = xxx
• Send something to the trace window
Application.Trace “Something = " & Something, True
VB Script Syntax Examples
47
Proprietary Information of Albemarle Corporation.

More Related Content

PDF
Earliest days SIM reactor suite models
PDF
Valero Petro-SIM simple tools
PDF
Marathon Petro-SIM use at Marathon
PDF
Using HTRI technology within Petro-SIM
PDF
Europe User Conference: Neste FCC-SIM model usage
PDF
Valero solving reactor models via alternate specs
PDF
Sustaining energy performance
PDF
Europe User Conference: MOL multi unit optimization of FCC and VGOHTR reactor...
Earliest days SIM reactor suite models
Valero Petro-SIM simple tools
Marathon Petro-SIM use at Marathon
Using HTRI technology within Petro-SIM
Europe User Conference: Neste FCC-SIM model usage
Valero solving reactor models via alternate specs
Sustaining energy performance
Europe User Conference: MOL multi unit optimization of FCC and VGOHTR reactor...

What's hot (20)

PDF
KBC decision making tool optimal planning scheduling utility
PDF
Case study FCC model with integrated energy and yield
PDF
Europe User Conference: KBC Visual MESA energy real-time optimizer at TOTAL A...
PDF
Europe User Conference: Galp refinery wide model - a real work example
PDF
Europe User Conference: BP - implementing and supporting a multi-model, multi...
PDF
Mechanical Engineering Seminar 2017_3
PDF
Mechanical Engineering Seminar 2017_2
PDF
Mechanical Engineering Seminar 2017_1
PDF
Eskom - Grid Connectivity
PPTX
Virtual Commissioning and Real-Time Training for Increasing Performance
PPTX
Fuel System Library Overview
PDF
Advisian dynamic process simulation capability june 2019
PPT
IFS General Presentation 120315
PDF
Mechanical Engineering Seminar 2017_3
PPTX
Vehicle Dynamics Library - Overview
PPTX
Textual Macro-Structure
PPTX
Textual Macroestructures
PDF
Generating Cash From Your Backup Generator
DOC
KEY ATTRIBUTES FULL TEXT
DOCX
vivekResume
KBC decision making tool optimal planning scheduling utility
Case study FCC model with integrated energy and yield
Europe User Conference: KBC Visual MESA energy real-time optimizer at TOTAL A...
Europe User Conference: Galp refinery wide model - a real work example
Europe User Conference: BP - implementing and supporting a multi-model, multi...
Mechanical Engineering Seminar 2017_3
Mechanical Engineering Seminar 2017_2
Mechanical Engineering Seminar 2017_1
Eskom - Grid Connectivity
Virtual Commissioning and Real-Time Training for Increasing Performance
Fuel System Library Overview
Advisian dynamic process simulation capability june 2019
IFS General Presentation 120315
Mechanical Engineering Seminar 2017_3
Vehicle Dynamics Library - Overview
Textual Macro-Structure
Textual Macroestructures
Generating Cash From Your Backup Generator
KEY ATTRIBUTES FULL TEXT
vivekResume
Ad

More from KBC (A Yokogawa Company) (20)

PDF
Digitalization assuring your plant achieves its full potential Larson
PDF
Energy Optimization with Pinch Analysis McMullan
PDF
Technology for Profitable Tracking and Optimization Rogers
PDF
Digital Twin: A value creator
PDF
Digitalization of Engineering Silos Howell
PDF
What will happen to the Bottom of the Barrel Knight
PDF
Asia Downstream 2019 Simon Rogers
PDF
KBC Proven Application of Digital Twin
PDF
KBC scheduling hydrocarbon supply chain
PDF
Motiva online monitoring and optimization energy system
PDF
Equipment sizing and costing using Petro-SIM
PDF
KBC unit monitoring Petro-SIM and PI-AF
PDF
PDF
Europe User Conference: BPT - Transforming data into insight
PDF
Europe User Conference: The importance of life of field in flow assurance
PDF
Europe User Conference: Pressure / Enthalpy flash formulation
PDF
Europe User Conference: thermodynamic behaviour of HPHT reservoir fluids and ...
PDF
Europe User Conference: Modelling-waxy-fluids
PDF
Europe User Conference: KBC Engineering Suite v7
PDF
Europe User Conference: GRACE catalyst trial evaluation
Digitalization assuring your plant achieves its full potential Larson
Energy Optimization with Pinch Analysis McMullan
Technology for Profitable Tracking and Optimization Rogers
Digital Twin: A value creator
Digitalization of Engineering Silos Howell
What will happen to the Bottom of the Barrel Knight
Asia Downstream 2019 Simon Rogers
KBC Proven Application of Digital Twin
KBC scheduling hydrocarbon supply chain
Motiva online monitoring and optimization energy system
Equipment sizing and costing using Petro-SIM
KBC unit monitoring Petro-SIM and PI-AF
Europe User Conference: BPT - Transforming data into insight
Europe User Conference: The importance of life of field in flow assurance
Europe User Conference: Pressure / Enthalpy flash formulation
Europe User Conference: thermodynamic behaviour of HPHT reservoir fluids and ...
Europe User Conference: Modelling-waxy-fluids
Europe User Conference: KBC Engineering Suite v7
Europe User Conference: GRACE catalyst trial evaluation
Ad

Recently uploaded (20)

PPTX
agenticai-neweraofintelligence-250529192801-1b5e6870.pptx
PDF
CXOs-Are-you-still-doing-manual-DevOps-in-the-age-of-AI.pdf
PDF
Electrocardiogram sequences data analytics and classification using unsupervi...
PDF
NewMind AI Weekly Chronicles – August ’25 Week IV
PDF
The AI Revolution in Customer Service - 2025
PDF
INTERSPEECH 2025 「Recent Advances and Future Directions in Voice Conversion」
PDF
Early detection and classification of bone marrow changes in lumbar vertebrae...
PDF
A hybrid framework for wild animal classification using fine-tuned DenseNet12...
PDF
MENA-ECEONOMIC-CONTEXT-VC MENA-ECEONOMIC
PPTX
Internet of Everything -Basic concepts details
PDF
giants, standing on the shoulders of - by Daniel Stenberg
PDF
Lung cancer patients survival prediction using outlier detection and optimize...
PDF
Build Real-Time ML Apps with Python, Feast & NoSQL
PPTX
SGT Report The Beast Plan and Cyberphysical Systems of Control
PDF
Introduction to MCP and A2A Protocols: Enabling Agent Communication
PDF
Ensemble model-based arrhythmia classification with local interpretable model...
PDF
The-Future-of-Automotive-Quality-is-Here-AI-Driven-Engineering.pdf
PDF
Dell Pro Micro: Speed customer interactions, patient processing, and learning...
PDF
Aug23rd - Mulesoft Community Workshop - Hyd, India.pdf
PDF
5-Ways-AI-is-Revolutionizing-Telecom-Quality-Engineering.pdf
agenticai-neweraofintelligence-250529192801-1b5e6870.pptx
CXOs-Are-you-still-doing-manual-DevOps-in-the-age-of-AI.pdf
Electrocardiogram sequences data analytics and classification using unsupervi...
NewMind AI Weekly Chronicles – August ’25 Week IV
The AI Revolution in Customer Service - 2025
INTERSPEECH 2025 「Recent Advances and Future Directions in Voice Conversion」
Early detection and classification of bone marrow changes in lumbar vertebrae...
A hybrid framework for wild animal classification using fine-tuned DenseNet12...
MENA-ECEONOMIC-CONTEXT-VC MENA-ECEONOMIC
Internet of Everything -Basic concepts details
giants, standing on the shoulders of - by Daniel Stenberg
Lung cancer patients survival prediction using outlier detection and optimize...
Build Real-Time ML Apps with Python, Feast & NoSQL
SGT Report The Beast Plan and Cyberphysical Systems of Control
Introduction to MCP and A2A Protocols: Enabling Agent Communication
Ensemble model-based arrhythmia classification with local interpretable model...
The-Future-of-Automotive-Quality-is-Here-AI-Driven-Engineering.pdf
Dell Pro Micro: Speed customer interactions, patient processing, and learning...
Aug23rd - Mulesoft Community Workshop - Hyd, India.pdf
5-Ways-AI-is-Revolutionizing-Telecom-Quality-Engineering.pdf

Albemarle using user variables scripts triggers

  • 1. Proprietary Information of Albemarle Corporation. Using User Variables, Scripts & Triggers Alan Kramer Global FCC Modeling Specialist KBC Software User Group Conference 2018 Houston
  • 2. Proprietary Information of Albemarle Corporation. • Often we receive data with poor flue gas analysis. • This leads to bad values for Hydrogen in Coke. • For “simple” situations, we can use an equation to estimate the flue gas analysis to give a reasonable H in Coke. • For “complex” situations, we have to manually iterate each calibration case individually for the flue gas estimate to give a reasonable H in Coke. • We want to add H in Coke as an independent variable in calibration mode. • We want the model to solve for the flue gas analysis. The Problem 2
  • 3. Proprietary Information of Albemarle Corporation. • Create a user variable to hold the H in Coke target value. – This can be input from Calibration Input • Create a user variable script to calculate the flue gas CO2. • Use triggers to start the script calculation. • Use triggers to iterate the CO2 calculation until the H in Coke target is met. The Solution 3
  • 4. Proprietary Information of Albemarle Corporation. Logic Schematic 4 Flue Gas CO2 H Content of Coke Stream FCC
  • 5. Proprietary Information of Albemarle Corporation. FCC-MeterFCC Coke-Meter Logic Schematic 5 Flue Gas CO2 H Content of Coke Stream FCC
  • 6. Proprietary Information of Albemarle Corporation. FCC-MeterFCC Coke-Meter Logic Schematic Flue Gas CO2 H Content of Coke Stream FCC HinC Target
  • 7. Proprietary Information of Albemarle Corporation. Creating User Variables To Store Values 7
  • 8. Proprietary Information of Albemarle Corporation. FCC-MeterFCC Coke-Meter Logic Schematic HinC Script Flue Gas CO2 H Content of Coke Stream FCC HinC Target
  • 9. Proprietary Information of Albemarle Corporation. Creating User Variables With Embedded Scripts 9 Type script here
  • 10. Proprietary Information of Albemarle Corporation. FCC-MeterFCC Coke-Meter Logic Schematic HinC Script Flue Gas CO2 H Content of Coke Stream FCC HinC Target
  • 11. Proprietary Information of Albemarle Corporation. Writing Scripts 11
  • 12. Proprietary Information of Albemarle Corporation. VB Script Hints 12 • All script variables are variant type • No script variable declarations – You do need to declare arrays with dimensions • If a variable in a script refers to an object, you must SET it • No GOTO, GOSUB, EXIT or END – Handle this with (nested) IF blocks and lots of planning – But you can have multiple functions in a single script • Empty = -32767
  • 13. Proprietary Information of Albemarle Corporation. FCC-MeterFCC Coke-Meter Logic Schematic HinC TargetHinC Script Flue Gas CO2 H Content of Coke Stream FCC
  • 14. Proprietary Information of Albemarle Corporation. Writing Scripts 14
  • 15. Proprietary Information of Albemarle Corporation. FCC-MeterFCC Coke-Meter Logic Schematic HinC TargetHinC Script Flue Gas CO2 H Content of Coke Stream FCC
  • 16. Proprietary Information of Albemarle Corporation. Writing Scripts 16
  • 17. Proprietary Information of Albemarle Corporation. FCC-MeterFCC Coke-Meter Logic Schematic HinC TargetHinC Script Flue Gas CO2 H Content of Coke Stream FCC HinC Current Error
  • 18. Proprietary Information of Albemarle Corporation. Writing Scripts 18
  • 19. Proprietary Information of Albemarle Corporation. FCC-MeterFCC Coke-Meter Logic Schematic HinC TargetHinC Script Flue Gas CO2 H Content of Coke Stream FCC HinC Current ErrorIf ~0 then stop
  • 20. Proprietary Information of Albemarle Corporation. Writing Scripts 20
  • 21. Proprietary Information of Albemarle Corporation. FCC-MeterFCC Coke-Meter Logic Schematic HinC TargetHinC Script Flue Gas CO2 H Content of Coke Stream FCC HinC Stored Error HinC Current Error
  • 22. Proprietary Information of Albemarle Corporation. Writing Scripts 22
  • 23. Proprietary Information of Albemarle Corporation. FCC-MeterFCC Coke-Meter Logic Schematic HinC TargetHinC Script Flue Gas CO2 HinC Stored Error H Content of Coke Stream FCC HinC Current ErrorIf = then stop
  • 24. Proprietary Information of Albemarle Corporation. Writing Scripts 24
  • 25. Proprietary Information of Albemarle Corporation. FCC-MeterFCC Coke-Meter Logic Schematic HinC TargetHinC Script Flue Gas CO2 HinC Stored Error H Content of Coke Stream FCC HinC Current Error
  • 26. Proprietary Information of Albemarle Corporation. Writing Scripts 26
  • 27. Proprietary Information of Albemarle Corporation. FCC-MeterFCC Coke-Meter Logic Schematic HinC TargetHinC Script Flue Gas CO2 HinC Stored Error H Content of Coke Stream FCC T
  • 28. Proprietary Information of Albemarle Corporation. Setting Trigger to Solve Parent Object on Value Change 28
  • 29. Proprietary Information of Albemarle Corporation. FCC-MeterFCC Coke-Meter Logic Schematic HinC TargetHinC Script Flue Gas CO2 HinC Stored Error H Content of Coke Stream FCC T
  • 30. Proprietary Information of Albemarle Corporation. FCC-MeterFCC Coke-Meter Logic Schematic HinC TargetHinC Script Flue Gas CO2 HinC Stored Error H Content of Coke Stream FCC T
  • 31. Proprietary Information of Albemarle Corporation. FCC-MeterFCC Coke-Meter Logic Schematic HinC TargetHinC Script Flue Gas CO2 HinC Stored Error T H Content of Coke Stream Trigger 3 FCC Value
  • 32. Proprietary Information of Albemarle Corporation. Run Script After Parent Object Execute 32
  • 33. Proprietary Information of Albemarle Corporation. FCC-MeterFCC Coke-Meter Logic Schematic HinC TargetHinC Script Flue Gas CO2 HinC Stored Error T H Content of Coke Stream Trigger 3 T FCC
  • 34. Proprietary Information of Albemarle Corporation. FCC-MeterFCC Coke-Meter Logic Schematic HinC TargetHinC Script Flue Gas CO2 HinC Stored Error T Trigger 1 H Content of Coke Stream Trigger 3 T FCC Value
  • 35. Proprietary Information of Albemarle Corporation. Setting Trigger to Solve Parent Object on Value Change 35
  • 36. Proprietary Information of Albemarle Corporation. FCC-MeterFCC Coke-Meter Logic Schematic HinC TargetHinC Script Flue Gas CO2 HinC Stored Error T Trigger 1 T H Content of Coke Stream Trigger 3 T FCC
  • 37. Proprietary Information of Albemarle Corporation. FCC-MeterFCC Coke-Meter Logic Schematic 37 HinC TargetHinC Script Flue Gas CO2 HinC Stored Error T Trigger 1 T H Content of Coke Stream Trigger 2 T Trigger 3 T FCC Compare If different take on a random value between 0 and 1
  • 38. Proprietary Information of Albemarle Corporation. Setting Trigger to Take on A Radom Value 38
  • 39. Proprietary Information of Albemarle Corporation. FCC-MeterFCC Coke-Meter Logic Schematic 39 HinC TargetHinC Script Flue Gas CO2 HinC Stored Error T Trigger 1 T H Content of Coke Stream Trigger 2 T Trigger 3 T FCC
  • 40. Proprietary Information of Albemarle Corporation. FCC-MeterFCC Coke-Meter Logic Schematic 40 HinC TargetHinC Script Flue Gas CO2 HinC Stored Error T Trigger 1 T Trigger on Calib Start TH Content of Coke Stream Trigger 2 T Trigger 3 T FCC
  • 41. Proprietary Information of Albemarle Corporation. Setting Trigger to Run Script on Calibration Starting 41
  • 42. Proprietary Information of Albemarle Corporation. FCC-MeterFCC Coke-Meter Logic Schematic 42 HinC TargetHinC Script Flue Gas CO2 HinC Stored Error T Trigger 1 T Trigger on Calib Start TH Content of Coke Stream Trigger 2 T Trigger 3 T FCC -1
  • 43. Proprietary Information of Albemarle Corporation. Setting Trigger to Solve Parent Object on Value Change 43
  • 44. Proprietary Information of Albemarle Corporation. FCC-MeterFCC Coke-Meter Logic Schematic 44 HinC TargetHinC Script Flue Gas CO2 HinC Stored Error T Trigger 1 T Trigger on Calib Start TH Content of Coke Stream Trigger 2 T Trigger 3 T FCC
  • 45. Proprietary Information of Albemarle Corporation. • User variables and scripts aren’t really difficult or scary. • You can use user variables and scripts to add important functionality. • The ‘simplicity’ of VB Script has advantages and drawbacks. • Triggers take some practice and patience to set up correctly. • Save often. It’s easy to create infinite calculation loops. • VB Script syntax examples on following slides. Conclusions 45
  • 46. Proprietary Information of Albemarle Corporation. • Create a variable referencing an object in the flowsheet Set CokeMeter = SimulationCase.GetObjectInCase("FCC Coke-Meter") • Create a variable referencing a variable in a meter Set HinCVariable = CokeMeter.ActiveDataSet.Variables.Find("Hydrogen Content", "") • Store the value from the ‘screened’ column of a meter using a specific unit of measure HinC = HinCVariable.ScreenedValueWithUnits("wt %") • Put a value into the ‘input’ column of a meter HinCVariable.InputValue = 7 VB Script Syntax Examples 46
  • 47. Proprietary Information of Albemarle Corporation. • Get a user variable value from the same parent object ThisScriptVariable = Me.GetUserVariable(“OtherUserVar").Variable.Value • To set the value of a user variable value, flip the above statement around • Get a user variable value with a specific UOM from another object (cokemeter) ThisScriptVariable = CokeMeter.GetUserVariable(“OtherUserVar").Variable.GetValue(“UOM”) • Set the value of the current user variable to xxx Result = xxx • Send something to the trace window Application.Trace “Something = " & Something, True VB Script Syntax Examples 47
  • 48. Proprietary Information of Albemarle Corporation.