Opened 12 years ago

Last modified 8 years ago

#2309 closed defect

Cannot read numbers from a file — at Initial Version

Reported by: paul Owned by: probably noone
Priority: high Milestone: 1.12.0
Component: Code Generation Version: trunk
Keywords: Cc: Willi Braun

Description

With OMEdit i wanted to execute the following model:

model ReadNumber

import Streams = Modelica.Utilities.Streams;
import Strings = Modelica.Utilities.Strings;
constant String filename = "<pathtofile>/numberfile.txt";
Integer lineno = 1;
String line;
Boolean eof;
Real value;

algorithm

(line, eof):= Streams.readLine( filename, lineno );
value:= Strings.scanReal( line );

end ReadNumber;

The content of numberfile.txt in the path <pathtofile> is

1.1
2.1
3.1

OMEdit apparently exectutes all steps including simulation. There is no error message. However, the plot shows no variables to be displayed, as if no simulation had been done.

I am using OpenModelica 1.9.0 beta4+dev (r16769). The two original files have been attached.

Change History (2)

by anonymous, 12 years ago

Attachment: ReadNumber-br.mo added

by anonymous, 12 years ago

Attachment: numberfile.txt added
Note: See TracTickets for help on using tickets.