openmodelicainterest  

global declaration

Roshna
Thu, 22 Oct 2009 00:35:21 -0700

Hi all,

 

I have one model and outside that model individual functions are written,
all in a single .mo file. For my application, I want to include a while loop
in which one function is to be called( which includes external "C"
interface).But when executing the program I got error message as

 

"Error: Internal error While statements in algorithms not supported yet.
Suggested workaround: place while statement in a Modelica function".

 

So I wrote one more function to include the while condition and it calls
'function getTime()'.

 

function while_loop

.............

.............

algorithm

while((time>rTime))

loop

newTime:=getTime();

sleep();

end while;

end while_loop;

----------------------

 

 

function getTime

 output Real y;

 external y=getTime()annotation(Library="libTimeAccess1.o",

 Include="#include \"TimeAccess1.h\"");

end getTime;

 

function sleep

input Integer s;

 external sleep(s)annotation(Library="libTimeAccess1.o",

 Include="#include \"TimeAccess1.h\"");

end sleep;

 

 

 

 

But now the message is 

  

"Error: Class getTime not found in scope global scope"

 

How to declare a function as global? Can anybody tell me how to solve this
error?

 

Thanks in advance.

 

 

 

Roshna C P

Control & Instrumentation Group,

Center for Development of Advanced Computing,

Trivandrum, India.

 

 



______________________________________
Scanned and protected by Email scanner
  • global declaration Roshna