Cameo crashes when running a Matlab STK script

Moderator: Moderators

Cameo crashes when running a Matlab STK script

Postby ayenawi14 » Fri Sep 03, 2021 1:00 pm

I have a simple demo which runs a matlab script in an activity diagram. I have a block that executes an external matlab script. When I run the simulation, the script runs, and it begins generating the STK scenario that I have built as expected, but then once the script completes, Cameo crashes/closes. Is there a conflict with using the STK matlab interface from a cameo executed script? Is there a way to solve this? The script runs fine when just using matlab, so it is something to do with running in Cameo.

Thanks for help in advance!
ayenawi14
Forum Newbie
Forum Newbie
 
Posts: 5
Posts Rating:0
Joined: Fri Sep 03, 2021 12:56 pm

Re: Cameo crashes when running a Matlab STK script

Postby saulius_p » Tue Sep 07, 2021 9:37 am

Hello Alec,

Good to talk to you.

Should all work well. Can you share small sample? Which version of Cameo ant Matlab you are using?

Sincerely,
Saulius
Best regards,
Saulius Pavalkis
User avatar
saulius_p
No Magic
No Magic
 
Posts: 345
Posts Rating:17
Joined: Fri Dec 04, 2009 5:37 am
Full name: Saulius Pavalkis

Re: Cameo crashes when running a Matlab STK script

Postby ayenawi14 » Tue Sep 07, 2021 10:46 am

Attached is a sample scenario with a single satellite. I am using Cameo Systems Modeler 19.0 and MATLAB R2020b. The stk window pops up and propagates as expected but then both applications crash/close. The script is run from a simple activity diagram simulation from an opaque action block. Note you may have to increase the simulation timeout time, as the default 15 seconds is too short.

Additionally, is there a log or debug file that is generated when cameo crashes that I could also investigate?

Thanks for your help!

Alec
You do not have the required permissions to view the files attached to this post.
ayenawi14
Forum Newbie
Forum Newbie
 
Posts: 5
Posts Rating:0
Joined: Fri Sep 03, 2021 12:56 pm

Re: Cameo crashes when running a Matlab STK script

Postby saulius_p » Tue Sep 07, 2021 12:20 pm

Alec,

We do not have STK to debug this capability. Interaction between Matlab /Simulink still shall work. There were some issues with string value past between Cameo and Matlab in v19.0

You can find log file at (e.g.):
C:\Users\SPS6\AppData\Local\.cameo.systems.modeler\2021x\Simulation.log

Hope this helps.

Kind regards,
Saulius
Best regards,
Saulius Pavalkis
User avatar
saulius_p
No Magic
No Magic
 
Posts: 345
Posts Rating:17
Joined: Fri Dec 04, 2009 5:37 am
Full name: Saulius Pavalkis

Re: Cameo crashes when running a Matlab STK script

Postby ayenawi14 » Tue Sep 07, 2021 1:27 pm

I seem to have discovered the issue. The issue comes from using the following series of matlab commands:

app = actxserver('stk12.application');
root = app.Personality2;
root.ExecuteCommand('Animate * Reset');

The real cause is the last one (root.executeCommand). This particular function must cause some conflict with cameo at the end of the script.
ayenawi14
Forum Newbie
Forum Newbie
 
Posts: 5
Posts Rating:0
Joined: Fri Sep 03, 2021 12:56 pm

Re: Cameo crashes when running a Matlab STK script

Postby saulius_p » Tue Sep 07, 2021 3:44 pm

Thank you for sharing. Can you workaround it?
Best regards,
Saulius Pavalkis
User avatar
saulius_p
No Magic
No Magic
 
Posts: 345
Posts Rating:17
Joined: Fri Dec 04, 2009 5:37 am
Full name: Saulius Pavalkis


Return to Cameo Simulation Toolkits

Who is online

Users browsing this forum: No registered users and 1 guest