Global variable is not incremented

Global variable is not incremented

jaime_g
Not applicable
10 Views
2 Replies
Message 1 of 3

Global variable is not incremented

jaime_g
Not applicable

[ FlexSim 22.2.1 ]

ModeloJuanPablo.fsmGoodnight.

Can you help me with the attached model. In the entry trigger in the queue, the variable vTipoItem never reaches the value 5 despite the fact that for each item that enters the queue, I increase it by 1. Thanks

0 Likes
Accepted solutions (1)
11 Views
2 Replies
Replies (2)
Message 2 of 3

moehlmann_fe
Observer
Observer
Accepted solution

The 'equals' operator is "==". In your if-condition you only have a single "=". So it sets the value of the variable to 5, which gets interpreted as true, since it is a non-zero number. Thus, the variable always gets reset back to 1.

1669100506062.png

Message 3 of 3

andrew_o2
Not applicable

Hi @Jaime G, was Felix Möhlmann's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes