Hi > the new OpenModelica "morning-build" that fixes the error: > http://www.ida.liu.se/~pelab/modelica/OpenModelica/OMC/nightly-builds/
Great, thanks again! > I don't quite get why would you want to use an external function > that returns the same value I wanted to test the external function mechanism. Since it didn't worked the first time I tried a minimal configuration - an argument-free function. Maybe the function even stays that way - without arguments. All I want to do is feed the model input data externally. The question is when to provide a new value. I'm going to synchronise that from the runtime library code. Though I have a small issue with that. I figured solver_dasrt.cpp line 239 would start the main simulation loop. Yet simulation time only counts up every 5th loop run with the model used (time step of 0.005). Is there some way of tackling the definite start of a new time step from the code? Regards, Alexander > but is not my place to complain and > I'm glad you did as it exposed a bug in the compiler :) > Thanks for reporting it! > Cheers, > Adrian Pop/ [EMAIL PROTECTED] wrote: > That was fast. Thank you Adrian! > > > > -----Ursprüngliche Nachricht----- Von: > [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Im Auftrag von Adrian > Pop Gesendet: Montag, 20. Oktober 2008 13:25 An: > [email protected] Betreff: Re: External functions > without arguments are not found > > > Hi, > > I found and corrected the bug. I'll test it a bit more before I > commit the fix. I'll then generate a new nightly-build later today > and get back to you when is available. > > Cheers, Adrian Pop/ > > Adrian Pop wrote: >> Hi, >> >> This is clearly a funny bug. It should work. I'll have a look at it >> and let you know when is fixed. >> >> Cheers, Adrian Pop/ >> >> [EMAIL PROTECTED] wrote: >>> Hi, >>> >>> I tried the ExternalLibraries example from the User Guide in the >>> testmodels directory of the 1.4.4 release. It worked fine. >>> >>> Then I wanted to change one function to take no arguments. That >>> didn't work. Did I do something wrong or is this a bug? >>> Description follows. >>> >>> Regards, Alexander >>> >>> >>> I changed ExternalFunc1_ext() to take no arguments. Changed all >>> the signatures and implementations. Like in the C file: >>> >>> double ExternalFunc1_ext() { return 2; } >>> >>> And in the model: >>> >>> function ExternalFunc1 output Real y; external >>> y=ExternalFunc1_ext() >>> annotation(Library="libExternalFunc1_ext.o", >>> Include="#include\"ExternalFunc1_ext.h\""); end ExternalFunc1; >>> >>> With a later call to: >>> >>> der(x)=-ExternalFunc1(); >>> >>> Running the script gives off: >>> >>>>> runScript("ExternalLibraries.mos") "true 0 0 record >>>>> resultFile = >>> "Simulation failed. No matching function found for >>> ExternalFunc1() of type function() => Real, candidates are >>> function() => Real Error occured while flattening model >>> ExternalLibraries " end record >>> >>> true" >>>
<<winmail.dat>>
