question

mni_pei avatar image
0 Likes"
mni_pei asked Jeanette F commented

Why can't the name of unload item be recorded?

I wrote custom code to record the name of the unloaded item and the nth time the item was unloaded.

1720184815769.png

There is a problem I encounter.

1720184993719.png

In Row3, AGV is expected to unload 2 items which are Type 1. (Column 8, as indicated by the red box.)

But when I print the name of the unloaded item, it is supposed that two item names will be printed, but in fact only one of the item names is printed.(Column 11, as indicated by the orange box.)

The nth time the item which was unloaded is also be wrong.

I want to calculate how many times each item has been unloaded, and where it was unloaded each time.

example2- try to record step with true multiload and realtime.fsm

FlexSim 23.0.15
itemwrite to global table
· 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.

Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @mni_pei, 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 comment back to reopen your question.

0 Likes 0 ·

1 Answer

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered

You have two tokens that each write to the same cells. So the second token overwrites the values of the first. You could instead initialize the cell as an empty array and push values to it.

The subflow tokens also both refer to the same item because the "unloaditem" label is assigned on the parent token and also overwritten by the second pull. That both items are unloaded is 'lucky' in that the timing of actions works out. But to not potentially run into issues later, the "Label Access On Parent Only" option in the Run Sub Flow activity should be unchecked.

example2-try-to-record-step-with-true-multiload-an_1.fsm


5 |100000

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