Hey all,

I have a question about using Matlab in PI ACE. I have multiple contexts for my ACE calculation. Each context sends data for variables to Matlab, changes it's Matlab working directory to the location of the ".m" file specific to it's context, and then executes a specific ".m" file. If I call CreateObject("Matlab.Application") in my ModuleDependentInitialization portion of the ACE code, then I create one instance of Matlab that is shared between all contexts. If I call CreateObject("Matlab.Application.Single") instead, then I create one instance of Matlab per context in ACE. If I only use one instance of Matlab for all contexts, won't I have an issue if two or more contexts trigger at the same time?

Thanks,

Jimmy

From what I can tell you probably will, especially if you try to work with the same objects or variables within the MATLAB environment. What's your concern with creating one instance per context?