Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem running .mos with the command line - Dymola and Windows #597

Open
rpatureau opened this issue Mar 14, 2025 · 0 comments
Open

Problem running .mos with the command line - Dymola and Windows #597

rpatureau opened this issue Mar 14, 2025 · 0 comments

Comments

@rpatureau
Copy link
Contributor

OS: Windows 11 Pro
Buildingspy: 5.2.dev0 (buildingspy.version)
Dymola: 2025x

Issue:
The .mos file is created but cannot be launched by dymola

Potential problem:

The absolute name of the .mos file should be provided

In the function

_runSimulation(self, mosFile, timeout, directory):
       mo_fil = mosFile.replace(directory, ".")
       ...

it appears that it leads to mo_fil being .\run.mos
If I run in the cmd window:

c:\dymola>dmc -r ".\run.mos" (OR dmc -r "run.mos" OR dmc -r run.mos)
Script:.\run.mos
Error: Input error; cannot read .\run.mos.
Error: Ensure the input exists and is readable.

But if I write:

c:\dymola>dmc -r "c:\dymola\run.mos"

Then the script runs

Steps to reproduce

from buildingspy.simulate.Dymola import Simulator
import os

out_dir = r'C:\dymola'

s=Simulator("Modelica.Blocks.Examples.PID_Controller", outputDirectory=out_dir)
s.showGUI(True)
s.simulate()

Should I take a closer look and correct if it I can?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant