Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change type of nextTimerDefined from int to modelica_boolean in handlerTimersFMI #11469

Merged
merged 3 commits into from
Nov 21, 2023

Conversation

Arinomo
Copy link
Contributor

@Arinomo Arinomo commented Oct 27, 2023

Type mismatched of argument 4 in handlersTimersFMI when integrating FMU from OM in rt-env
Discussion 11436

Purpose

So FMU from OM could be integrated in rt-env

Approach

-int handleTimersFMI(DATA* data, threadData_t *threadData, double currentTime, int *nextTimerDefined, double *nextTimerActivationTime)
+int handleTimersFMI(DATA* data, threadData_t *threadData, double currentTime, modelica_boolean *nextTimerDefined, double *nextTimerActivationTime)

change type of  *nextTimerDefined from int to modelica_boolean
change type of  *nextTimerDefined from int to modelica_boolean
@CLAassistant
Copy link

CLAassistant commented Oct 27, 2023

CLA assistant check
All committers have signed the CLA.

@AnHeuermann AnHeuermann enabled auto-merge (squash) October 27, 2023 13:39
@adrpo
Copy link
Member

adrpo commented Nov 12, 2023

I had to kill DualMassOscillator_cs.mos test as it got stuck. We should really use alarm on these tests as they seem to get stuck.

hudson    317996  0.0  0.0  12468  9932 ?        S    15:03   0:00 /usr/bin/perl -w ../../rtest -v -nolib DualMassOscillator_cs.mos
hudson    318001  0.0  0.0   2888   960 ?        S    15:03   0:00 sh -c /var/lib/jenkins/ws/OpenModelica_PR-11469/build/bin/omc --running-testsuite=/tmp/rtest16086.aSIXp.tmpDualMassOscillator_cs.mos +locale=C --alarm=900  DualMassOscillator_cs.mos >>/tmp/omc-rtest-unknown/omsimulator/DualMassOscillator_cs.mos_temp4172/log-DualMassOscillator_cs.mos 2>&1
hudson    318003  0.0  1.2 444624 397680 ?       S    15:03   0:03 /var/lib/jenkins/ws/OpenModelica_PR-11469/build/bin/omc --running-testsuite=/tmp/rtest16086.aSIXp.tmpDualMassOscillator_cs.mos +locale=C --alarm=900 DualMassOscillator_cs.mos
hudson    319087  0.0  0.0   2888   964 ?        S    15:03   0:00 /bin/sh -c /var/lib/jenkins/ws/OpenModelica_PR-11469/build/bin/../bin/OMSimulator DualMassOscillator_cs.lua
hudson    319089  1.0  8.8 2949720 2904092 ?     S    15:03   3:05 /var/lib/jenkins/ws/OpenModelica_PR-11469/build/bin/../bin/OMSimulator DualMassOscillator_cs.lua

@AnHeuermann
Copy link
Member

A lot of strange side effects for FMUs. I guess we need to reproduce these issues locally to fix them.

@AnHeuermann
Copy link
Member

Looks like the type cast from fmi2Boolean to modelica_boolean isn't working as expected. Since we don't use the FMI or OpenModelica types in a clean way I mixed it even further and changed

- fmi2Boolean nextTimerDefined;
+ modelica_boolean nextTimerDefined;

For FMI we should define modelica_boolean and the other types as the FMI equivalent types, see #11577

@AnHeuermann
Copy link
Member

@Arinomo Can you check if this works for your dSPACE application? Then I'll merge the PR.

@Arinomo
Copy link
Contributor Author

Arinomo commented Nov 15, 2023

@AnHeuermann ok, i will check it and will report as soon as next week.

@Arinomo
Copy link
Contributor Author

Arinomo commented Nov 21, 2023

@AnHeuermann it works for my Application. Thank you.

@AnHeuermann AnHeuermann merged commit 86161f6 into OpenModelica:master Nov 21, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants