- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Usage of...
Usage of Modelica.Utilities.Streams.readFile
Usage of Modelica.Utilities.Streams.readFile
Hi everyone,
i'm trying to read the file'WritebackData.txt and save it in file_content. I'm using this command:
String[:] file_content= Modelica.Utilities.Streams.readFile("C:\01_Data\Lukas\Hoehenverstellung\WriteBackData.txt");
When trying to simulate, nothing happens, no Simulation and no (error) message appears.
Can someone tell me how to use Modelica.Utilities.Streams.readFile properly
Thanks
lwinklmann
- lwinklmann
- 17 Posts
Re: Usage of Modelica.Utilities.Streams.readFile
You need to use \\ or / instead of \.
- adrpo
- 885 Posts
Re: Usage of Modelica.Utilities.Streams.readFile
Hi adrpo,
Thanks for your quick reply! Unfortunately, it still doesnt work. Can you think of any other error when using this command? Btw. it says when checking that my class has 0 equations and 1 variable.
Thanks
lwinklmann
- lwinklmann
- 17 Posts
Re: Usage of Modelica.Utilities.Streams.readFile
Can you post your full model? Otherwise is hard to guess what is wrong.
If the model is not public, you can send it to us at OpenModelica @ ida.liu.se and we will delete it after finding the issue.
- adrpo
- 885 Posts
Re: Usage of Modelica.Utilities.Streams.readFile
Sure! It was only a model for testing the Modelic.Utilities library. It only consists of that one command that i wrote before. My full model is:
model test2
String[:] file_content= Modelica.Utilities.Streams.readFile("C:/01_Data/Lukas/Hoehenverstellung/WriteBackData.txt");
end test2;
Also i double checked, the path i used is correct.
- lwinklmann
- 17 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Usage of...