Opened 7 years ago

Closed 7 years ago

#4563 closed defect (fixed)

State machine reset error

Reported by: Bernhard Thiele Owned by: Bernhard Thiele
Priority: high Milestone: 1.13.0
Component: Frontend Version: v1.13.0-dev-nightly
Keywords: Cc: berger@…, Olena Rogovchenko, Lennart Ochel

Description

Resetting of nested state machines does not work correctly.

The attached test case of following nested state machine fails to correctly activate the states.


Investigation of the problem suggests that one of the equations in section 17.3.4 "Semantics Summary" in the MLS v3.3r1 is probably wrong. In the equation below from the MLS the condition if selectedState == i should probably be if activeState == i instead.

Boolean nextResetStates[nStates] = if active then {if selectedState == i then false else activeResetStates[i] for i in 1:nStates}
else previous(nextResetStates);

I will provide a fix for OpenModelica soon and will also fill a ticket for the MLS in order to clarify the issue.

Attachments (3)

SMGraphicalTestCases.mo (41.2 KB ) - added by Bernhard Thiele 7 years ago.
SMGraphicalTestCases_DeepHierarchy.mos (719 bytes ) - added by Bernhard Thiele 7 years ago.
NestedStateMachine.png (37.1 KB ) - added by Bernhard Thiele 7 years ago.

Download all attachments as: .zip

Change History (4)

by Bernhard Thiele, 7 years ago

Attachment: SMGraphicalTestCases.mo added

by Bernhard Thiele, 7 years ago

by Bernhard Thiele, 7 years ago

Attachment: NestedStateMachine.png added

comment:1 by Bernhard Thiele, 7 years ago

Cc: Lennart Ochel added
Resolution: fixed
Status: newclosed

I fixed the issue in OMC (https://github.com/OpenModelica/OMCompiler/pull/1901), added the test case (https://github.com/OpenModelica/OpenModelica-testsuite/pull/742), and opened a MLS ticket (https://trac.modelica.org/Modelica/ticket/2209).

One remaining issue is that the test case currently only works with the C++ run-time, hence there is the line setCommandLineOptions({"+simCodeTarget=Cpp"}); in the test script. However, this is an issue of the synchronous language elements support in the C run-time, hence I close this ticket.

Note: See TracTickets for help on using tickets.