question

yoni A avatar image
0 Likes"
yoni A asked tannerp commented

assigning item type after a separator

capture1.png

I have a processor that feeds a separator(Blue square), the separator splits 1 part into two parts that go to two different containers RH to black container and LH to blue container, I have six different items types that goes thru the same separator, how does the processor does the following itemtype assignment after splitting the parts in right and left for the following schedule

A1 RH ItemType 1 (500 units in black container)

A2 LH ItemType 2 (500 units in blue container)

F1 RH ItemType 3 (500 units in black container)

F2 LH ItemType 4 (500 units in blue container

N1 RH ItemType 5 (500 units in black container)

N2 LH ItemType 6 (500 units in blue container)

then, there are 6 queues where each item type have to go: ItemType 1 goes to queue 1

ItemType 2 goes to queue 2

ItemType 3 goes to queue 3

ItemType 4 goes to queue 4

ItemType 5 goes to queue 5

ItemType 6 goes to queue 6

itemtype
capture1.png (216.4 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.

tannerp avatar image tannerp commented ·

If you could upload your model, that would be helpful. One suggestion would be to use the "Send To Port" in your Separator to designate the container to which the item will be sent.

0 Likes 0 ·

1 Answer

·
Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered

I assume you set your products {A1, A2,F1,..} behind the Queues {RH, LH}.

You can assert a string label to the item before splitting it on entry of the combiner.

Array class =["A","F","N"];
string product = class[duniform(1,3)];
item.labels.assert("product",product);

The combiner sends the items to the Port by strict round robin.

The queue triggers sets type by the switch statement structure. Because this structure expects integer numbers you converts the string label "product" back to a number by the index of an array.

Array class =["A","F","N"];
int caseNum = class.indexOf(item.product);
int newType = 1;
switch(caseNum){
   case 1: {// your code to assign a label Type value;
             break;}
   default: {// your code to assign a label Type value; 
             break;}
}

"A" is the index 1

"F" is the index 2

"N" is the index 3

5 |100000

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

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.