NTNU-IHB/FMI4cpp

How do I find out the names and types of input/output variables of an FMU?

chiragr15 opened this issue · 4 comments

I have an FMU which is loaded as a Co-Sim model via fmi4cpp. I am able to access the model-description, but how do I get the names of variables and their types through model-description?

I have only the .fmu file and no model_description.xml(as present in the examples provided)

The modelDescription.xml is located inside the FMU, which is just a ZIP archive.

Thank you for your reply,
I apologize for not being clear with my doubt, I have a custom FMU that I am testing the fmi4cpp library on. I am currently able to load it as co-sim fmu and step through it. I want to access the variables inside the modelDescription using fmi4cpp as I do not know the names or reference values of the variables.

How do I do this?

The instance and fmu object should have a get_model_description() function that holds a model_variables field. You should be able to loop through this using indices or a foreach loop on the object itself.

But it's been a long time since I looked at this.

Thank you for your reply.