I have a problem with OpenModelica and i think that is a bug with the sample() function.
I have a model wich uses an external function to send messages using sockets. This function is used in a while loop like this:
CODE
...
...
Modelica.Blocks.Interfaces.RealInput din;
Real a;
Real b(start=0);
Boolean SampleEvent;
algorithm
SampleEvent := sample(0,1);
when SampleEvent then
a:= sendMessage(String(din));
b:=b+a;
end when;
I noticed that the function sendMessage() was executed two time in each step. The plot of b variable is a confirmation of this.
The same code is working without any problem under Dymola.
The sendMessage external function return 1, so each time sendMessage is executed a is equal to 1. At the first step b is equal to 2. so it means that is is twice time executed. (see the plot file)
I am using OpenModelica 1.4.3, i installed it last year exactly 16 february 2007.
Can any one help me? is this a known bug?
Best Regards,
Hassen