question

Kevin Espinoza avatar image
0 Likes"
Kevin Espinoza asked Kevin Espinoza commented

Decide help

Viernes 1.fsm

Why is my decide not working properly? only send tokens through 1 node :(

FlexSim 24.0.1
decidenodeflexscrip
viernes-1.fsm (4.1 MiB)
5 |100000

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

1 Answer

·
Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Kevin Espinoza commented

You need to toggle the decision code (via the code editor) back to flexscript ('S') from external code ('E'):

1709567170663.png

but then you also need to return the correct port - at the moment you test a label called 'labelname' which doesn't exist and then only return 1 or 2.


1709567170663.png (3.3 KiB)
· 3
5 |100000

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

Kevin Espinoza avatar image Kevin Espinoza commented ·

Sorry, I added the wrong model, this is the model where the problem is specifically in Decide01viernes-1 askflexsim.fsm

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ Kevin Espinoza commented ·

The expresion comparing those label values isn't doing what you think. Essentially you'll be comparing a subnode length to a boolean result - so 0 or 1 and mostly all will return true.

You need to have two tests in the same expression:

token.ContenidoQ95 > token.ContenidoQ79 && token.ContenidoQ79 < token.ContenidoQ89

where && represents the logical AND operator.

0 Likes 0 ·
Kevin Espinoza avatar image Kevin Espinoza Jason Lightfoot ♦ commented ·

Such a simple mistake. Thanks Jason :)

0 Likes 0 ·

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.