SubStateMachines not generated for C++

Questions regarding the use of UaModeler

Moderator: uamodeler

Post Reply
tfruehwirth
Jr. Member
Jr. Member
Posts: 4
Joined: 02 Mar 2015, 16:26

SubStateMachines not generated for C++

Post by tfruehwirth »

Hi,

I'm trying to model a StateMachine in which some states have SubStateMachines, which themselves probably have SubStateMachines, etc.

Unfortunately, the Modeler in Version 1.4.3 352 seems to only export code for the "top-level" state machine, but not for the SubStateMachines. While the NodeIds are defined in the code, the SubStateMachine structure would not appear when browsing the address space with UAExpert.

I tried to attach a minimal example to this post but it gives me an "Sorry, the board attachment quota has been reached" error. It contains a "MyObjectType", having a "MyStateMachine" as a child. The state "MyState1" of "MyStateMachine" should have a SubStateMachine "MySubStateMachine" with states "MySubState1" and "MySubState2".

Is this a bug in the Modeler or is it an error in my model?

Best regards,
Thomas Frühwirth

User avatar
Support Team
Hero Member
Hero Member
Posts: 3068
Joined: 18 Mar 2011, 15:09

Re: SubStateMachines not generated for C++

Post by Support Team »

Hello,

The states and the sub state machines shall belong to the same state machine:
Specification part 5:
"The HasSubStateMachine ReferenceType is a concrete ReferenceType and can be used directly. It is a subtype of NonHierarchicalReferences.
The semantic of this ReferenceType is to point from a State to an instance of a StateMachineType which represents the sub-states for the State.
The SourceNode of this ReferenceType shall be an Object of the ObjectType StateType. The TargetNode shall be an Object of the ObjectType StateMachineType or one of its subtypes. Each Object can be the TargetNode of at most one HasSubStateMachine Reference.
The SourceNode (the state) and the TargetNode (the SubStateMachine) shall belong to the same StateMachine, that is, both shall be referenced from the same Object of type StateMachineType using a HasComponent Reference or a subtype of HasComponent."

Please send your example to support@unifiedautomation.com.
Best regards
Unified Automation Support Team

Post Reply