Array index out of bounds: Assign Labels

Array index out of bounds: Assign Labels

e_yiing98
Not applicable
108 Views
7 Replies
Message 1 of 8

Array index out of bounds: Assign Labels

e_yiing98
Not applicable

[ FlexSim 21.2.4 ]

example model.fsm

Hi,

4 totes arrive at buffer2 every 10 seconds, each tote will be sent to the input queue of the processor.

I assign a label called destination, value is the input queue of processor.

But it comes out exception error, what's wrong with the activity assign label?

Any advices is much appreciated.

0 Likes
Accepted solutions (1)
109 Views
7 Replies
Replies (7)
Message 2 of 8

moehlmann_fe
Participant
Participant
Accepted solution

The processors WireBond12, 13 and 14 are not connected to their queue. So "inObjects" is empty and trying to read the first inObjects causes the error.

1670163844273.png

0 Likes
Message 3 of 8

e_yiing98
Not applicable
After connecting processors and queues, the model still not working well.

In Processor process flow, I found that token enters <Push to List> has assigned label <destination>, however when I check the entries, the <has destination> label is still equals to zero. Therefore, agv can't pull anything from the list.

Any mistakes in my push to list/pull to list event?


0 Likes
Message 4 of 8

moehlmann_fe
Participant
Participant
The "destination" label is written to the token, but the item is pushed to the list. Since the item still doesn't have the label, the "hasDestination" field returns 0.
0 Likes
Message 5 of 8

e_yiing98
Not applicable
I got it! I should assign label on token.item! Thanks Felix!
0 Likes
Message 6 of 8

e_yiing98
Not applicable

@Felix Möhlmann I have another small question, I have set agv capacity to 4 and pull from list request number to 4, but agv just load 1 item. Could you please help?example model_221207.fsm

0 Likes
Message 7 of 8

moehlmann_fe
Participant
Participant

Because you left the "Require Quantity" at 1 the token continues after the first item is created. You think of the two fields as "At most" (Request Quantity) and "At least" (Require Quantity).

Furthermore, if you pull more than one object, the resulting label will contain an array of the pulled values. You will have to load them individually. For example by using a subflow that gets executed for each entry in the array.

I've made those adjustments to your model, but you will have to decide how to handle/adjust the transport of finished items. (Load them if available after unloading an item, then later move them to Buffer3 once all other items are unloaded, for example)

example-model-221207_1.fsm

0 Likes
Message 8 of 8

e_yiing98
Not applicable
Thanks Felix!
0 Likes