modelon-community / fmi-library

C library for importing FMUs
Other
115 stars 34 forks source link

Model structure is not valid due to detected errors. Cannot continue #128

Closed lyw2024 closed 4 months ago

lyw2024 commented 4 months ago

hello, all: when I try to read .FMU with FMILibary. see following:

lyw@ubuntu:~/Desktop/FMILibrary-2.0a1-src/FMILibrary-2.0a1/Test/FMI2$ ./fmi2Test Demo.fmu ./Temp argv[0] = ./fmi2Test argv[1] = Demo.fmu argv[2] = ./Temp module = FMILIB, log level = VERBOSE: Allocating FMIL context module = FMILIB, log level = VERBOSE: Detecting FMI standard version module = FMIZIP, log level = VERBOSE: Unpacking FMU into ./Temp module = FMIXML, log level = VERBOSE: Parsing XML to detect FMI standard version module = FMIXML, log level = VERBOSE: XML specifies FMI 2.0 module = FMILIB, log level = INFO: XML specifies FMI standard version 2.0 module = FMILIB, log level = VERBOSE: Parsing model description XML module = FMI2XML, log level = VERBOSE: Parsing XML element fmiModelDescription module = FMI2XML, log level = VERBOSE: Parsing XML element CoSimulation module = FMI2XML, log level = ERROR: Unknown attribute 'stepSize=0.001' in XML module = FMI2XML, log level = VERBOSE: Parsing XML element VendorAnnotations module = FMI2XML, log level = VERBOSE: Parsing XML element ModelVariables module = FMI2XML, log level = INFO: [Line:45] Detected during parsing: module = FMI2XML, log level = ERROR: XML element 'ScalarVariable': could not parse value for enumeration attribute 'causality'='independent' module = FMI2XML, log level = VERBOSE: Building alias index module = FMI2XML, log level = VERBOSE: Parsing XML element ModelStructure module = FMI2XML, log level = ERROR: [Line:52] Unknown element 'Unknown' in XML, skipping module = FMI2XML, log level = ERROR: [Line:53] Unknown element 'Unknown' in XML, skipping module = FMI2XML, log level = ERROR: [Line:54] Unknown element 'Unknown' in XML, skipping module = FMI2XML, log level = ERROR: [Line:55] Unknown element 'Unknown' in XML, skipping module = FMI2XML, log level = ERROR: [Line:57] Unknown element 'InitialUnknowns' in XML, skipping module = FMI2XML, log level = WARNING: [Line:58] Skipping nested XML element 'Unknown' module = FMI2XML, log level = WARNING: [Line:59] Skipping nested XML element 'Unknown' module = FMI2XML, log level = WARNING: [Line:60] Skipping nested XML element 'Unknown' module = FMI2XML, log level = WARNING: [Line:61] Skipping nested XML element 'Unknown' module = FMI2XML, log level = ERROR: Input variable ac is not listed among inputs in ModelStructure module = FMI2XML, log level = ERROR: Input variable bc is not listed among inputs in ModelStructure module = FMI2XML, log level = ERROR: Output variable out1 is not listed among outputs in ModelStructure module = FMI2XML, log level = ERROR: Output variable out2 is not listed among outputs in ModelStructure module = FMI2XML, log level = ERROR: Output variable out3 is not listed among outputs in ModelStructure module = FMI2XML, log level = ERROR: Output variable out4 is not listed among outputs in ModelStructure module = FMI2XML, log level = FATAL: Model structure is not valid due to detected errors. Cannot continue. module = FMI2XML, log level = FATAL: Parse error at line 63: parsing aborted

the FMU is generated by simulink.

image

do you know why I have this error, can you help me to solve it.

thank you.

PeterMeisrimelModelon commented 4 months ago

Hi lyw2024,

can you provide the complete modelDescription.xml in text form?

/Peter

lyw2024 commented 4 months ago

Hello, peter: I have update the modelDescription. please help to check. modelDescription.txt

thank you

PeterMeisrimelModelon commented 4 months ago

Hi lyw2024,

  1. You seem to be using a quite old FMILibrary version (according to the path), many of the errors reported are likely due to that, I recommend using a newer version.
  2. With a newer version, parsing your XML only yields a single error "Start attribute is required for this causality, variability and initial combination", for the independent variable. This appears incorrect from fmi-library, fix is incoming: https://github.com/modelon-community/fmi-library/pull/129

/Peter

lyw2024 commented 4 months ago

hello, peter: after I replaced with the latest version. This error ( "Start attribute is required for this causality, variability and initial combination") happened. Do you know when we can reaease fmi-library to fix this issue?

PeterMeisrimelModelon commented 4 months ago

Made a new release including that fix: https://github.com/modelon-community/fmi-library/releases/tag/3.0a4