You will need to save the dataset data in a PI Tag to be able to save the historical changes.
I assume that your dataset calculation has Performance Equation (PE) syntax involved. Therefore, you can either
1.Use the PE Scheduler and configure PE tags in SMT or
2.Use PI Analysis Service and configure expression analyses in PSE
In both case, you will need to write out your equation again.
Thanks for prompt reply.
As of now i dunt have access to to create new PI tags for my calculations.
I try to work out with ODBC database.
Is there any way to perform calculation in VBA and save it in Excel which is already connected as a ODBC to Processbook?
I am trying to change the Excel once connected to ODBC, but it says cannot modify the file. I had to close Processbook for that.
What method are you using to save to Excel? Maybe you can paste your code here.
I have found a code that enables the communication with Excel but it says "Invalid Argument". Calc TP3.xlsx. Call TP3.xlsx is my databse that is connected as a ODBC.
Public Sub doExcelAutomation()
On Error GoTo doExcelAutomationErr
Dim mySheet As Object
Dim xlApp As Object
Dim strName As String
strName = "C:\Users\Documents\Calc TP3.xlsx"
Set xlApp = CreateObject("Excel.Application")
Set mySheet = xlApp.Workbooks.Open("C:\Users\Documents\Calc TP3.xlsx").Sheets(1)
If Error Then
xlApp.Visible = False
Set mySheet = xlApp.Sheets("YourSheetName")
mySheet.cells(8, 1).Value = 66600
mySheet.cells(9, 1).Value = 650
Set mySheet = Nothing
Set xlApp = Nothing
MsgBox Err.Description, vbOKOnly, Err.Source & ":" & Err.Number
or if you have simpler code to connect to Excel and update there with data, please share with me
I understand that you cannot create PI Points because of limited privileges to the PI Data Archive and that you are trying to workaround that shortcoming by writing PI ProcessBook Dataset results to an Excel Sheet. We like to support our users in using PI and not in working around using PI. If I am not mistaken, PI ProcessBook is the only PI related piece in your approach. Using Asset Analytics and to persist calculation results to PI Points is the better and way more mature approach. In case you are planning to share your ProcessBook display with colleagues, they will have to set up the ODBC data source first. Is this really what you want?
Please consider talking to the Administrator of your PI System to get the required privileges.
With regards to the VBA code you've posted, it looks to me as if it is attempting to access the Excel workbook directly. Because you are mentioning a connection as ODBC data source, I would expect a reference to the ODBC connection instead.
Thank you very much all for your comments. I really appreciate it.
I will try to ask a permission to grant me an access to PI Data Archive. In this case i need to have several new PI Tags that i can store my calculations.