question

doug palmer avatar image
0 Likes"
doug palmer asked Benjamin W2 commented

having trouble splitting items on conveyor

simple-product-seperation.fsm I have looked on the forums and found a similar problem but I when I try it it still does not work. I either get no label found or an exception error. I have two source creating two different flow items I am giving them labels at creation. the flow items are splitting on the conveyor but with following exceptions.

exception: FlexScript exception: Array index out of bounds at MODEL:/DP1>variables/localType/onArrival

FlexSim 19.2.1
splitting items on conveyor with exceptions
5 |100000

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

Steven Hamoen avatar image
0 Likes"
Steven Hamoen answered

@doug palmer The problem is that on the decision point you have only 1 outobject connection. Your code is the following:

current.outObjects[item.producttype]

This means that if your producttype label reads 1 it states: current.outObjects[1] meaning the first outobject connected to your DP1 which is DP2

This means that if your producttype label reads 2 it states: current.outObjects[2] meaning the second outobject connected to your DP1 which is not existing. So you ask something beyond the end of array of connections, that is why the exception comes up.

So you can either connect a 2nd DP for the products that go straight on, or you use the condition that states that only producttype 1 is going throught the code of the send item

5 |100000

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

Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Benjamin W2 commented

You have only one output port! But you set two destinations!

// item.producttype has got a range of [1,2]
: current.outObjects[1]
: current.outObjects[2]

You can add another output connection of DP1 to a different DP on the straight conveyor

Or you work with a different condition for one exclusive connection:


· 5
5 |100000

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

Joerg Vogel avatar image Joerg Vogel commented ·

@steven.hamoen was a bit faster

1 Like 1 ·
doug palmer avatar image doug palmer commented ·

Hi Jorg: I am trying to upload my simulation which is under 25Mb and it fails. Is there another way to send it?

I incorporated your suggestion in one model and it works but when I try the exact same thing in a new model the decision node doesn't react.

0 Likes 0 ·
doug palmer avatar image doug palmer commented ·

anzalduas-carview-multilane-rev-2.fsmtrying to upload the file

0 Likes 0 ·
doug palmer avatar image doug palmer commented ·

I think I figured it out it has to do with the flow item being to long.

0 Likes 0 ·
Benjamin W2 avatar image Benjamin W2 doug palmer commented ·

Hi @doug palmer,

It is most likely because your flow-item file is too big. Consider reducing the size of your 3d flow-objects to reduce the file size.

0 Likes 0 ·