question

xiang avatar image
0 Likes"
xiang asked Joerg Vogel commented

How to repeatedly grab 3 materials and then grab 2 materials

pallet.fsm

FlexSim 19.0.0
pallet
pallet.fsm (52.5 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.

Wang Yang avatar image Wang Yang commented ·

If you are an official user of V2019, you can directly contact our agent in China : CSN. Our company will provide professional and quick technical support. Technical Q&A mailbox: [email protected] you.

0 Likes 0 ·

1 Answer

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

It is a fine model. The batch activity must alternately batch 3 and then 2 items, as you described above. The difference is only one. You get a constant number stream of {0,1,0,1,0,1,..} by modulus division of 2 for an increasing number stream of one {0,1,2,3,4,5,6,..}. This number stream can you get from any statistical Input or Output of an activity like the batching activity. Because the stream must be increasing by 1, you must choose here the output value of the batching activity. Unfortunately the output value of the first releasing token is 0, you have to add 1 to this value to get a return value of 1.

statistical output stream is 0,1,2,3,4,5,..

//(statistical output value +1) modulus division by 2, then enhanced by 2
(getstat(activity, "Output", STAT_CURRENT, current)+1)%2+2

statement stream results in 3,2,3,2,3,..

Now your array of items contains 3 or 2 item references. You can't use a static sequence to combine the 2nd and 3rd item into the 1st item anymore.

  • You can add a decision activity that splits to two different combining structures depending on the length of the array. Each structure can be static again.
  • Or you can call a sub flow that do this more dynamically.

I have added in my model the later variant to move items and use therein the first variant to change the location for the combined items. Because I need a reference from the end of the array to move into the first item, I choose this element by the pop() method and assign it to a label at the token in the sub flow.

Later in the sub flow I use the rank of this item to set different locations by a decision structure.

26650-pallet-jv.fsm


· 7
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 ·

I have added another items array as a label to the batched token, because I didn't know if you need your array called items later in your logic again. The method pop() eliminates the returned element of the array. The original data isn't kept.

0 Likes 0 ·
xiang avatar image xiang Joerg Vogel commented ·

Thank you very much

0 Likes 0 ·
xiang avatar image xiang Joerg Vogel commented ·

How do you alternate 3, 3, and 4. changing the position of each item.

0 Likes 0 ·
xiang avatar image xiang commented ·

How do you alternate 3, 3, and 4. changing the position of each item.

0 Likes 0 ·
pallet334.fsm (51.8 KiB)
Joerg Vogel avatar image Joerg Vogel commented ·

A larger sequence needs an indirect approach over an array. The sequence of batch sizes is stored in an array, maybe in a global variable [3,3,4]. You get the value of a current batchsize through a modulus operation. The result will be 0,1,2,0,1,2,0,1,2,.. This isn't suited for the indexes of an array which starts with 1. You add simply 1 to the modulus result.

getstat(activity, "Output", STAT_CURRENT, current)%3+1

Then the batchsize is:

yourGlobVar[getstat(activity, "Output", STAT_CURRENT, current)%3+1]

transport-batched-items-in-squences.fsm

0 Likes 0 ·
xiang avatar image xiang Joerg Vogel commented ·

stacking3-3-4.fsmHow to change the position of items.Thank you.

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel xiang commented ·

Hello @xiang, you get probably a faster answer if you ask your request in a new question. In my opinion your request has nothing to do with an alternating sequence of item grabbing. It is more likely a question of setting locations or stacking. Many thanks for considering my comment. Regards Jörg.

0 Likes 0 ·