This is my function. I am trying to export this code to fmu. I am using fmusdk.
For each cycle(time step),
- my
input
should be changed to the value given during simulation. myexecute()
should be called.- the values of
input
andpout
should be stored during simulation, so that we can plot the values after the simulation.
I tried the examples(BouncingBall and values) given in fmusdk. I have created corresponding fmus and imported them in Amesim. They are working fine. But i am unable to figure out how to do the same for my C file/function
/*
* Execution function
*/
void myexecute(double *input, double *pout)
{
(*pout) = 2 * (*input);
}
I examined the bouncingBall.c and values.c, they have only four methods
setStartValues(ModelInstance *comp)
calculateValues(ModelInstance *comp)
getReal(ModelInstance *comp, fmi2ValueReference vr)
void eventUpdate(ModelInstance *comp, fmi2EventInfo *eventInfo, int isTimeEvent, int isNewEventIteration)
Can someone help me in accomplishing this fmi export? In short i am looking for the contents for the above 4 functions. Explaination for the above 4 methods will also be sufficient. I can create the contents for the functions.