Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Terminate() from external function

Terminate() from external function

Is it possible to call something similiar to terminate() from extrenal C function? I would want to save results into CSV file so exit probably wont work:)

Re: Terminate() from external function

As far as I know, you can only abort a simulation with an error-message from external C (ModelicaError), which works similar to a failed assertion.

Re: Terminate() from external function

Thanks for reply current/smile so I will probably try to combine it with some return value current/smile And one little question is there a way how to make der(variable) work if you get variable from external function?{or cant because  it is somehow linked to symbolic representation in compiler?} I tried many things but at the end I think I must stick to not ideal deraivation block which works current/smile. Which seems logical. But maybe I am missing something.

Edited by: bumino - May-10-16 06:28:36

Re: Terminate() from external function

Yes, either making an approximation using a derivative block. Or by using a symbolic derivative annotation on the external function and providing the external derivative function to the model...

There are 0 guests and 0 other users also viewing this topic
You are here: