Increment throught transition in State Machine

Hi,

I have a problem with loop transition. I want to make automatization with State Machine. In my first state - Init i’ve got Error handling with Try Catch activity. When catch is getting some value It changes value of It from Nothing to exception.

In my loop transition I have got condition "exc_InitException isnot Nothing ".

I want to add second condition next to “exc_InitException isnot Nothing” that makes that loop working only 3 times then goes to final state. In transition Action field i added Assign with Counter init_counter = Init_counter + 1 but value of it never changes and always is 1 making this loop infinity. I tried to initialize counter inside Init with default value 0 or 1 but that change nothing.

How can I force counter to increment?

initloop

Make sure your counter variable is in the StateMachine scope so it doesn’t reset…
Do not set the initial value for counter, int defaults to 0 and you risk overwriting it.
Make sure you reset the exception variable on reentry to the state. Set it to Nothing.
Make sure incrementation is in the transition action and works correctly (log it or step through in debug Mode or both).
Check your transition conditions - since you have a shared trigger transition, they are evaluated in order and first one returning True will trigger.

Thank You for your response.

I’ve checked all steps and It’s working.

There was a problem with shared trigger, I’ve made wrong order.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.