Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Connecting sub-models

Connecting sub-models

So I am currently working on a model of electric propulsion, I have already modeled engine, battery and other components and now, I would like to package them into sub-models ore something similar like in symulink but when I want to connect my models with other models, I always get this translation error that goes: Expected X to be a class, but found component instead. I am very confused and I do not know, how to resolve this issue, but I can not finish my project without this feature as the model is getting increasingly more complex and harder to handle. I was trying to solve this with using packets and inserted classes into the packet but that didn't work either and now, I am out of ideas, how to deal with this (I'm a rather new to modelica so maybe is there a simple way to fix this that I'm unaware of) So if anyone knows, how to solve this riddle, I would be very grateful.
Best, Luka

Re: Connecting sub-models

In addition, yesterday, I followed this instructions on how to create and connect submodels: https://www.claytex.com/blog/creating-a … ubsystems/
and I still receive the same translation error, I really do not know, what else to try, to solve this. Any help would be much appreciated.

Re: Connecting sub-models

Unfortunately without some idea on how the code looks
like is really hard to know what the problem is.

Can you at least show just the line where this error appears?

I understand you cannot share the models publicly but maybe you
can send it via email to openmodelica@ida.liu.se and we will delete
them after we see what the problem is.

Re: Connecting sub-models

Fortunately, after I posted my comment above, I figured it out. I was using protected keywords in the names of my models and because of this, the program refused to check and simulate my sub-system. So it works now fine, I just didn't know, this could present a problem and I am still at the beginning of the learning curve so yeah...

There are 0 guests and 0 other users also viewing this topic