Cameo Systems Modeller to Python

Systems engineering related questions and discussions.

Moderator: Moderators

Cameo Systems Modeller to Python

Postby werheid97@gmail.com » Wed Feb 10, 2021 3:54 am

Hey there,

I want to have a connection between a contraint block in the CSM and python. Therefore I connected a contraint block with a Matlab script, which worked well and connected a
Matlab script with a Python script, which worked good as well. If I try to connect all of them together, so that the CSM calls the Matlab function which calls the Python function, it
fails. Even if I do not use the output of my Python function. In the moment where it is a part of my Matlab script it doesnt work anymore in the CSM, which means I do not get any outputs.

##Matlab Code
Code: Select all
function distanceCheckP = mymode(time, speed)

distanceCheckP = py.dataParse.distance(time, speed);
out = [distanceCheckP];

end


##Python Code
Code: Select all
def distance(time, speed):
     
    distanceCheck = (3 * speed * time)
    return distanceCheck


As I said, if I just do the math in Matlab in works. And if I only calls the Python function in my Matlab enviroment it works as well.
I connect the Matlab to the CSM just with drag and drop. If there is any other opportunity to connect the CSM to a Python script, I
also would be interested in that.

Best regards,

Jonas
werheid97@gmail.com
Forum Newbie
Forum Newbie
 
Posts: 5
Posts Rating:0
Joined: Wed Feb 10, 2021 3:46 am

Return to Model Based Systems Engineering (MBSE)

Who is online

Users browsing this forum: No registered users and 0 guests