run SimulationX model via COM interface

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

run SimulationX model via COM interface

Fonavi
Hello to all professional Octave users

I would appreciate your help with the following problem:

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

/% Load package
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 with the following code:

/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'/


Can you help me out with the correct code for running the simulation model?

Thanks in advance
Georg




--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html