Manual For Data and Books
Manual For Data and Books
Reference Manual
www.flsmidth.com/automation
csc@flsmidth.com
Disclaimer:
The information in this document is subject to change without notice and should not be construed
as a commitment by FLSmidth A/S. FLSmidth assumes no responsibility for any errors that may
appear in this document.
In no event shall FLSmidth be liable for direct, indirect, special, incidental, or consequential
damages of any nature or kind arising from the use of this document, nor shall FLSmidth be liable
for incidental or consequential damages arising from use of any software or hardware described in
this document.
Options specified and described in the FLSmidth documentation as part of the general description -
but initially neither ordered by the customer nor confirmed by the seller - will not commit the
supplier to any further and future supply and/or installation.
The software described in this document is furnished under a license and may be used, copied, or
disclosed only in accordance with the terms of such license.
1. Introduction 4
1.1 Purpose 4
1.2 Intended audience 4
1.3 How to use this manual 4
4. Related Manuals 14
4.1 Related Manuals 14
5. Annexure 15
5.1 Annexure I 15
1.1 Purpose
The purpose of this manual is to give deeper details of how to configure and use
the PXP Databooks feature.
Default Validator
Bugs in Code?
The Jupyter notebook IDE is integrated into the PXP Databooks, where it can be
used for Creating, Editing or Debugging the Python program. Users will be able to
use the complete features of the Jupyter notebook in the PXP Databooks.
It is to be noted that the Jupyter notebook in the PXP Databooks is only used as
an IDE, the execution of the Databooks at runtime (i.e., during PXP Application
execution) the PXP Databooks are executed on Python 3.8.6 runtime
environment.
Most of the 3rd party packages used for building the AI/ML solutions are included
in the PXP Databooks by default. Moreover, users will be able to install their own
packages or 3rd packages on the environment.
To delete a Databook, select the Databook that needs to be deleted and click on
the symbol. An existing Databook can also disabled by unchecking on the
check box. Once the Databook is disabled, it will not be executed anymore, and it
can be re-enabled later at anytime.
Once the Databook is created, you can navigate to the Databook present in the
custom component section and you will be able to find the options to Edit,
When you export a Databook, the Python program is exported along with the
Input and Output variables section to an XML. You will be able to import back the
XML into the Databook again. While exporting/importing the Input variable links
are not included. So, users need to configure the input variable links once they
import an exported Databook.
There is a configurable parameter “Max execution time” on the top menu bar of
the Databook. It is defined in seconds with a default value as 5. When the
If a Databook takes either more time to execute than the Max execution time or
fails to execute due an error in the python program for 3 consecutive executions,
then the Databook is blocked for execution. All the Blocked Databooks are auto
unblocked every 30 min. However, if the users make any changes and saves the
application, then the all the blocked Databooks are unblocked.
Similar to Softsensors, the Input and Output variables can be defined. Users will
be able to link the outputs of PXP Components layer as Inputs in the Databooks.
The outputs from the Databooks can be consumed either in Group Interlocks or
Decision tree or Controller or in any of the Core features (Eg: Mimics, Trend etc.).
The Databook and Application needs to be saved first to be able to retrieve values
in the python program, whenever a new Input/Output variables are created or
existing ones are modified.
Currently, the following Data types are supported for the Input variables
The PXPCommon Python package’s notebook class facilitates for Input & output
operations between PXP and Python layer.
The notebook class in the PXPCommon has the following methods
Read()
Read_Timeseries()
Write()
Write_Trace()
Trigger_InfoEvent()
Trigger_WarningEvent()
Trigger_ErrorEvent()
To use any of the above methods, the notebook class must be inherited while
passing the Databook name as argument to the class.
Obj = PXPCommon.notebook(‘KL1.Custom.PXPDataBook’)
Please Note: When the PXP Application is cloned with different application name,
the Databook name in the above Databook code is not changed to the newer
application name. So, users must correct the Databook name in all the PXP
Databooks present in the application after importing the new cloned application.
The Response object is a Python Named Tuple which contains the retrieved values
in the same variables passed as arguments to the Read method. The values from
the response object can be accessed by response.<variable name>
InputReal = response.InputReal
Please note: All the values of variables of type will be in string format. You can
convert it to Float, Int or Boolean by using the inbuilt Python functions. The Time
type will give the value in Seconds.
The Read_Timeseries() method in the notebook class can be used to access the
input variables of RealTS, BooleanTS and IntegerTS types. Currently, PXP
Databooks supports retrieval for 60 historical values for a variable.
Tags= ["InputRealTimeSeries"]
EndTime=datetime.utcnow()
IntervalLength = 120 # in minutes
AggInterval = 60 # in seconds
responseTS=obj.Read_TimeSeries(Tags, IntervalLength, AggInterval,EndTime)
The above example code retrieves the data for the last 120 minutes with 60
seconds (1 min) average for the “InputRealTimeSeries” variable. However, since
only 60 values can be retrieved, the above code retrieved the last 60 minutes of
data.
The Response object is a Python Named Tuple. For each Timeseries variable, the
response has 4 properties - Values, Times, States and Length.
Where, Values property has the Values of the variable; Times has the
Timestamps in DateTime format; States has the State values of the Variable;
Length property provides the Length of Series retrieved. All the retrieved data of
timeseries variable is in list format.
InputRealTimeSeriesLength = responseTS.InputRealTimeSeries_Length
InputRealTimeSeriesValues = responseTS.InputRealTimeSeries_Values
InputRealTimeSeriesStates = responseTS.InputRealTimeSeries_States
InputRealTimeSeriesTimes = responseTS.InputRealTimeSeries_Times
Please note: If there is no historical data for a variable of timeseries type, then a
None type object is return instead of a list.
Please remember, the Python variables type should match with the Type defined
in the Output variables section for the Databook. However, in case of Time type,
either the value can be in Real/integer with seconds or in time format.
The below text is an log written to the log file when there was an SyntaxError in
the PXP Databook thk1.custom.punderflowpump1.
Users will also be able to place logs into this file by using the Write_Trace()
method of the notebook class. This functionality will be helpful in writing
debugging statements to capture any Errors that are occurring only during the
execution of the PXP Databook but not occurring during the debugging though
Jupyter Notebook.
Users should never install/upgrade the Jupyter Core python package with an
alternate version other that the one supplied by FLS.
Never use functions like time.sleep(), which will pause the execution of the
Databook at runtime.
5.1 Annexure I
The list of Python packages that are installed on the PXP server by Default can be
found below.