Only found solution so far is to re-install PI Datalink. Does anyone have experience with this sort of problem?
It seems I found the problem. Occasionally after running Excel through Matlab, an Excel process will continue running after the conclusion of the script and result in the problem I stated above. Killing all instances of Excel in the task manager fixes the problem immediately thus far.
Thank you for the help,
There are many reasons why PI DataLink would not load and most of them are described on KB00265 - PI DataLink Ribbon does not appear in Excel.
Does this happen only after calling the file in Matlab or does it happen in other situations? Is it possible to open it the same way, but with local administrator privileges? What is the OS and Office/Excel version? Is it a click-to-run version?
I went through the linked troubleshooting document and I do not believe this falls into any of those categories. So far it seems that this problem only occurs randomly after extracting data from excel through Matlab. It does not happen after any specific number of times or period of time after the first call. When I run excel as an administrator, I get the following "unhandled exception":
Could not load file or assembly 'OSIsoft.PIAnalytics.Common, Version=1.0.777.0, Culture=neutral, PublicKeyToken=6238be57836698e6' or one of its dependencies. The system cannot find the file specified.
This is all on Windows 10 with Excel 2016 and Datalink 2016 (5.3).
Please let me know if there is anything else I can provide that would help out!
Edit: It looks like all the features of Datalink still work when excel is run with administrator rights, but still will not work when called from Matlab
The "OSIsoft.PIAnalytics.Common" message is related to the Notifications Client add-in. It refers to the Legacy Notifications. Do you still use that? If not, you can simply disable the PI DataLink Notifications add-in (File-> Options -> Add-In -> COM Add-Ins -> Go):
But this should not be related to the original issue. I have some other questions:
The data is extracted using the xlsread function in Matlab and I never see the excel file actually open in the process, I only know it is gone when the program does not work or I open the excel file myself and see that there is no connection to PI. The PI Datalink ribbon is missing after this problem occurs and does not come back unless Excel is run with admin rights, PI Datalink is reinstalled, or sometimes after a system restart. I am unable to manually enable it.
If you want to be extra sure, you may check the following registry keys for the Value "LoadBehavior". They should be set to 3.
Retrieving data ...