question

Sachin N avatar image
0 Likes"
Sachin N asked Sachin N commented

Flexscript exception trying to set object state

I am trying to set the state of an object from process flow. Some tokens bypass some of the acquire actions. When these tokens go through a set state action, it generates this flexsim exception error ' FlexScript exception: MODEL:/Tools/ProcessFlow/ProcessFlow/Setoff1>variables/codeNode'. Is there a way to address this error?

changestatelogic09272019.fsm

FlexSim 19.2.1
set object state
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

·
Matthew Gillespie avatar image
1 Like"
Matthew Gillespie answered Sachin N commented

In the Setoff1 activity you're setting the state of the object assigned to the resource1 label. However, only some of the tokens (the ones that acquire Resource1) have anything assigned to the resource1 label. I added a decide activity before the Setoff1 activity that checks if the resource1 label has anything assigned to it before letting a token enter it. Otherwise it routes the token around th Setoff1 and Release1 activities.

checkresource1.fsm


checkresource1.fsm (42.0 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.

Sachin N avatar image Sachin N commented ·

Thanks that worked. I had to change the decide to token.resource == 0 rather than token.resource ! = 0 for it to work.

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.