question

Vns avatar image
0 Likes"
Vns asked Jeanette F commented

Combining multiple flow items based on label

test1.fsm

Hi all - I need some help with combining multiple flow items(totes) ; with the label (pallet_id) to the similar base pallet . However it seem that the combiner is not pulling the items from either queue (Split_1 /Queue 9). I there something I missed or overlooked


1693927591822.png


I based my model on a related thread : HERE

Thanks in advance.

FlexSim 23.2.0
combiner
1693927591822.png (130.0 KiB)
test1.fsm (1.0 MiB)
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

·
Jeanette F avatar image
0 Likes"
Jeanette F answered Jeanette F commented

Hello @Vns,

The only thing you are missing with implementing what you found is you need to change your MatchedOrder and Order to be integer variables instead of strings and use 0 instead of a blank string.

/**Custom Code*/
treenode current = ownerobject(c);
treenode item = param(1);
int port =  param(2);
int MatchedOrder = current.MatchedOrder;

if (MatchedOrder != 0) {
    //We previously matched an item so pull the matching order from the other queue
    if (item.pallet_id == MatchedOrder) {
        current.MatchedOrder = 0;
        return 1;
    }
    return 0;
}
 
int Order = item.pallet_id;
//Search the opposite queue for the same order
int otherPort = port % 2 + 1; //Grab the other port rank so we look at the other queue
treenode queue = current.as(Object).inObjects[otherPort];
for (int i = 1; i <= queue.subnodes.length; i++) {
    if (queue.subnodes[i].pallet_id == Order) {
        //Found a matching order, save the order on a label
        current.MatchedOrder = Order;
        //Now pull the item that just entered the original queue
        return 1;
    }
   
}
//No matches, pull nothing
return 0;

test1_1.fsm


test1-1.fsm (65.5 KiB)
· 6
5 |100000

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

Vns avatar image Vns commented ·
Hi @Jeanette F thanks so much for pointing that out.

However, i do have other totes still on the queue under the same pallet id which need to be pull to the combiner.

Is there a way i could read the number of relevant tote on the queue to set the target quantity on the combiner ?

0 Likes 0 ·
Jeanette F avatar image Jeanette F ♦♦ Vns commented ·

Hello @Vns,

I think it would be best to have a label on the pallet that says how many totes it is expecting and that label is what then determines how many to pull. Is that reasonable for your application?

Or do you just need to set the value to 7 in the combiner since it is 7 in the first combiner and I do not see you altering it?

0 Likes 0 ·
Vns avatar image Vns Jeanette F ♦♦ commented ·
Hi @Jeanette F - i do have a randomize split on SEP_1 therefore the number of tote will only be determine on queue 9.

I'm assuming the combiner target must be dynamic to register the new qty after the split.

0 Likes 0 ·
Show more comments

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.