04-21-2011 04:17 AM
I am having problems with implementing OOP concepts using Functional Mock Up Interface.
Does anyone here have experience with Functional Mock Up Interfece for Labview.
I am forced to believe very few have worked or are working on this particular API.
I am very curious as to how an object is initioalised in labview using FMI Functions .
The FMI program is obvioulsz converted to a DLL and Labview uses the Call Library node to access each function.
These functions are either for memory allocation, object creation as well as setting up the initial values of the model instance and inside a loop
other functions for determining the continous states etc.
While FMI implementation is in C the portabilitz to Labview is something i find confusing.
Is there any other method of C labview Interface apart from Labwindows CVI or the Call Library node.
Any comment or suggestion at this point is highly appreciated.
regards
Raghu I menon
04-21-2011 07:34 AM
I am curious. You mentioned, I believe, that you converted the FMI model to a DLL and called it from LabVIEW using the Call Library Function Node. This sounds like the exact right approach. Did something not work as expected? Are you having issues configuring the method calls in the Call Library Function Node?
04-21-2011 08:08 AM
The function i included in the DLLheader was a simple function from the C code.
I want to call a function that Initialises objects and uses the model instance of the Interface,
All these functions related to the object creation are in the main().
Now i read somewhere that we cannot export the main() when creating a DLL from a C program.
The next logic was that i would need to de fragment the main program into smaller functions that had a specific task.
So If a complete main function does these things.
1.Instantiate a model.
2.Initialise a model.
3.Set Time.
Under the Loop
4.set continous states.
5.Fixed step integration of states.
6.get continous states.
7.Log states.
Close Loop.
Terminate model instance.
Now comes the part where i am stuck.
So i have assigned a function each of the steps to get done.
I no longer have the main program but rather seperate functions that were earlier the main()-
Now when i export the initialise function into a DLL, i cannot view it under the funcnames in the Call Library node.
The DLL creation shows no erros.
Is my logic or method flawed.
Do you know someone who has succesfully interfaced Modelica with LV.?
regards
Raghu