question

Jaime G avatar image
0 Likes"
Jaime G asked Andrew O commented

Global variable is not incremented

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

FlexSim 22.2.1
global variables
modelojuanpablo.fsm (27.7 KiB)
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Andrew O avatar image Andrew O ♦ commented ·

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 0 ·

1 Answer

·
Felix Möhlmann avatar image
1 Like"
Felix Möhlmann answered

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


1669100506062.png (4.2 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.