I am using JFMI (https://ptolemy.berkeley.edu/java/jfmi/) to communicate with FMI (in C) from Java.
For the communication, I use existing functions (e.g., simulation.write(inPort.getName()).with((Double) value);).
However, I face two problems:
- fmuTemplate.c contains global variables for configuring numbers of float, integer, and other variables. However, the configuration does not seem logical to me. For example, if I write that the NUMBER_OF_REALS is 2, and the NUMBER_OF_INTEGERS is 2, I can only use two times write to real/float or two times to integers. If I want to use 4 scalar variables (2 float, 2 int), I need to define NUMBER_OF_REALS 2 and NUMBER_OF_INTEGERS 4. As if the order is incremental.
- Writting strings from Java to FMI seems to crash the program ("invalidState:fmi2SetString: Illegal call sequence.").
Did you perhaps encounter similar issues? If yes, could you please share your experience?
Best regards and thank you.