I run the demo ‘buck_converter_with_co_simulation’ because i need to learn about plecs and python co-simulation.
but I run the simulation with simulation scripts, it occurs error
Script error
Error in script ‘Co-Simulation’, line 18: Error: In ‘buck_converter_with_co_simulation/Controller/Co-Simulation/PID Controller (Co-Simulation)’: Cannot open output file for writing.
I already sum path in python, and run plecs with Administrator rights
how can i do next step for this situation?
This demo model has known issues that vary depending on the version and operating system. For this reason, we have deprecated it from the official PLECS release.
The error message indicates that the output file cannot be written, which usually means you do not have sufficient permissions.
May I ask what you intend to use it for? There may be a more suitable or reliable implementation available.
I want to learn about plecs and python co-simulation through .txt files (or .csv files) in and out.
As i know this demo model uses txt file to co-simulation each program, and main PID control is operated in python script.
So i want other demoes that similar approach like send txt files each other.
Or can you suggest other solutions to co-simulation?
I already know another demo like this PLECS: XML-RPC Interface and Controller Design in Python | Plexim . but i didn’t run this demo yet.
Thanks for your kind answer.
Thank you for the clarification. Using .txt
or .csv
files for co-simulation is generally not a good practice and should only be considered if no other option is available. File-based exchange is slow, error-prone, and can quickly become a bottleneck in more complex setups.
Could you share a bit more about what you want to achieve with this co-simulation? For example, are you mainly interested in exchanging signals with a Python-based controller, logging results, or running optimization routines? Depending on your goal, there are usually more efficient approaches available (e.g., the XML-RPC interface you mentioned).
With a bit more detail, I’d be happy to suggest the most suitable solution.
I want use python like orchestrator.
Than i could be build the data pipelines, manage, analyze the date and logging results . And also control the multi programs with python.
Maybe i will be expand the usage to Ai workflow.
Thanks for the clarification! In that case, using the RPC interface would be the better approach. It’s much more efficient and reliable than exchanging .txt
or .csv
files.