RunScriptRealTime
A free GitHub account is required to access the program code in this repository; send us your GitHub username.
Code for running Dynochem at-line, with realtime updates from the outside world, e.g. your DCS / process monitoring system, to illustrate digital twin creation, soft sensing and elements needed for advanced process control.
To invoke the features in this example, you need to be running Scale-up Suite 2 and to have a RunScript Automation product license. To preview a similar demo in the meantime, download the short animation file, Realtime.gif.
If you make improvements, please share them here. The repository is not yet public, so the code should not be shared outside this repository and your own dynamic models.
How to use the demo files:
- Download the Excel file v7_soft_sensor_demo and the example Dynochem model model_realtime and place them in the same folder on your PC.
- Open the xlsm to get started. This soft_sensor file demonstrates automated background running of Dynochem during data collection (e.g. during an experiment or production batch). Press ‘Acquire data’ to start.
- Realtime profiles (appearing on the Data tab in the xlsm) are then imposed on the rigorous Dynochem mechanistic / kinetic model (the xlsx), which runs every 10 sampling intervals.
- In the demo, the realtime ‘data’ - temperature profiles - are generated in Excel; in practise, an instrument, historian or automation system (DCS) would send these values to Excel, or even pass them directly to the RunScript Automation interface. The OPC standard may be used for this and several tools are available to access data using OPC from Excel. More generally, Excel can be removed entirely from the picture and the soft sensor could run using e.g. Python+Dynochem with results displayed in a web app/ on a mobile device.
- In the demo, Dynochem calculates the concentration profiles in the batch in response to the realtime (imposed) temperature changes and returns the yield and quality results to be plotted in the xlsm on the chart with the realtime temperature data.
- Retun to the first tab and press ‘Stop’ when you have seen enough.
- Dynochem is run using RunScript Automation (press Alt+F11 to see the code); this allows model predictions to be passed back to the calling program as an array in memory.
- No attempt has been made to optimise this demo. The main purpose is to illustrate how RunScript Automation may be used for this type of application.
Enjoy!