modelica-tools / FMUComplianceChecker

FMI Compliance Checker for validation of FMUs 1.0 and 2.0
BSD 3-Clause "New" or "Revised" License
42 stars 31 forks source link

Real discrete input values not read correctly from the input file (v2.0.4) #57

Open daviddecobee opened 4 years ago

daviddecobee commented 4 years ago

Using a co-simulation with multiple real value inputs that are discrete I have seen that the first value in the input file is copied to all real inputs. For example a model with real discrete variables A, B, C and an input file that using the compliance checker with an input similar to:

"time","A","B","C"
0,1.0,2.0,3.0

The output file (using -f) will show:

"time","A","B","C"
0,1.0,1.0,1.0

If I use integers or continuous no issue.

I originally raised this here: https://github.com/ghorwin/FMICodeGenerator/issues/32

But I believe the issue is not with the code generator but seems to be the compliance checker.

filip-stenstrom commented 4 years ago

Yes this seems to be Checker bug.

It should be enough to change fmi2_input_reader.c:152: indata->interpData[i] = *v1; -> indata->interpData[i] = v1[i]; (and same for FMI 1 corresponding file).

I'll fix this, but also want to add some tests which might take a bit longer. I'll open PR though.

Kahldar commented 2 years ago

Do you plan a release (with binaries) with that fix ?