Error trying to link Matlab and Aspen Plus
I have error message while trying to link Matlab with my Aspen Plus simulation:
>> CHLC
Error using COM.Apwn_Document_37_0/invoke
Invoke Error, Dispatch Exception:
Source: Aspen Plus 37.0 OLE Services
Description: Unable to open file.
Error in CHLC (line 8)
Aspen.invoke(‘InitFromFile’,[mess.Name ” Simulation_Name ‘.apwz’]);
This is the code im using:
%% Linking
Aspen = actxserver(‘Apwn.Document.37.0’);
[stat,mess]=fileattrib; % get attributes of folder (Necessary to establish the location of the simulation)
Simulation_Name = ‘CL_SCO2’;% Aspeen Plus Simulation Name
Aspen.invoke(‘InitFromArchive2’,[mess.Name ” Simulation_Name ‘.bkp’]);
Aspen.Visible = 1; % 1 —> Aspen is Visible; 0 —> Aspen is open but not visible
Aspen.SuppressDialogs = 1; % Suppress windows dialogs.
Aspen.Engine.Run2(1); % Run the simulation
while Aspen.Engine.IsRunning == 1 % 1 –> If Aspen is running; 0 —> If Aspen stop.
pause(0.5);
end
Matlab version is R2022a (9.12.0.1884302) 64-bit and Aspen plus V11 (37.0.0395)
Already try saving Aspen simulation as .bkp and .apwz.
Yes, two files ( .m matlab code and .awpz / .bkp simulation) are in the same folder.I have error message while trying to link Matlab with my Aspen Plus simulation:
>> CHLC
Error using COM.Apwn_Document_37_0/invoke
Invoke Error, Dispatch Exception:
Source: Aspen Plus 37.0 OLE Services
Description: Unable to open file.
Error in CHLC (line 8)
Aspen.invoke(‘InitFromFile’,[mess.Name ” Simulation_Name ‘.apwz’]);
This is the code im using:
%% Linking
Aspen = actxserver(‘Apwn.Document.37.0’);
[stat,mess]=fileattrib; % get attributes of folder (Necessary to establish the location of the simulation)
Simulation_Name = ‘CL_SCO2’;% Aspeen Plus Simulation Name
Aspen.invoke(‘InitFromArchive2’,[mess.Name ” Simulation_Name ‘.bkp’]);
Aspen.Visible = 1; % 1 —> Aspen is Visible; 0 —> Aspen is open but not visible
Aspen.SuppressDialogs = 1; % Suppress windows dialogs.
Aspen.Engine.Run2(1); % Run the simulation
while Aspen.Engine.IsRunning == 1 % 1 –> If Aspen is running; 0 —> If Aspen stop.
pause(0.5);
end
Matlab version is R2022a (9.12.0.1884302) 64-bit and Aspen plus V11 (37.0.0395)
Already try saving Aspen simulation as .bkp and .apwz.
Yes, two files ( .m matlab code and .awpz / .bkp simulation) are in the same folder. I have error message while trying to link Matlab with my Aspen Plus simulation:
>> CHLC
Error using COM.Apwn_Document_37_0/invoke
Invoke Error, Dispatch Exception:
Source: Aspen Plus 37.0 OLE Services
Description: Unable to open file.
Error in CHLC (line 8)
Aspen.invoke(‘InitFromFile’,[mess.Name ” Simulation_Name ‘.apwz’]);
This is the code im using:
%% Linking
Aspen = actxserver(‘Apwn.Document.37.0’);
[stat,mess]=fileattrib; % get attributes of folder (Necessary to establish the location of the simulation)
Simulation_Name = ‘CL_SCO2’;% Aspeen Plus Simulation Name
Aspen.invoke(‘InitFromArchive2’,[mess.Name ” Simulation_Name ‘.bkp’]);
Aspen.Visible = 1; % 1 —> Aspen is Visible; 0 —> Aspen is open but not visible
Aspen.SuppressDialogs = 1; % Suppress windows dialogs.
Aspen.Engine.Run2(1); % Run the simulation
while Aspen.Engine.IsRunning == 1 % 1 –> If Aspen is running; 0 —> If Aspen stop.
pause(0.5);
end
Matlab version is R2022a (9.12.0.1884302) 64-bit and Aspen plus V11 (37.0.0395)
Already try saving Aspen simulation as .bkp and .apwz.
Yes, two files ( .m matlab code and .awpz / .bkp simulation) are in the same folder. aspen puls, matlab, link, error MATLAB Answers — New Questions