Run Simulation model via COM interface

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Run Simulation model via COM interface

Fonavi
Hello Octave professionals
 
I would appreciate your help with the following problem:

I want to run a SimulationX modell via a COM interface with Octave (Ocatve 4.4.0).
I have no problems starting and initializing the simulation programm
(SimulationX) and opening the simulation model with the following code:

% Load package COM interface
pkg load windows
% Start of SimulationX
sim = actxserver('iti.simx37');
sim.Visible = true;
% Wait till SimulationX is initialized
if strcmp(sim.InitState, 'simUninitialized')
while ~strcmp(sim.InitState, 'simInitBase')
pause(0.1);
end
end
% Load libraries
if strcmp(sim.InitState, 'simInitBase')
sim.InitSimEnvironment()
end
% Open document/ model
doc = sim.Documents.Open('P:\Folder\Model.isx');


Then I try to run the simulation:

doc.Reset;
doc.Start;
while ~strcmp(doc.SolutionState, 'simStopped')
pause(0.1)
end


and recieve this error message from Octave:

/error: com_get: property/method invocation on the COM object failed with
error `0x80020003'/


How to run the simulation model?

Thanks so much!
Georg