question

michela-08 avatar image
0 Likes"
michela-08 asked michela-08 commented

Send parts using label

Hi, In my model attached the parts are sent from source 1 to the Queue1 with Item_type label as mentioned in the Arrival Schedule of the Source 1.

I want to send parts from Processor 1 to all the combiner's based on the below given sequence:

Item_type Combiner 1 Combiner 2 Combiner 3
L yes yes no
H yes yes no
L yes yes no
H yes yes no
S no no yes


but the condition here is:

There will be 2 parts coming from Queue1 of Item_type == "L" and two parts of Item_type == "H" so

Case 1:

Processor 1 has to send items of type "L" (2 items) to either of the Combiner 1 or Combiner 2(if the machine is available and not busy) and should be combined together with parts coming from the buffers Queue2 and Queue 3 respectively.

Similarly :

Case 2:

Processor 1 has to send items of type "H" (2 items) to either of the Combiner 1 or Combiner 2 (if machine is available and not busy) and should be combiner together with parts coming from the buffers Queue2 and Queue3 respectively.

Case 3:

Combiner 3 does not have any condition just the parts with Item_type == "S" should move to that Combiner 3 and get combined with parts from Queue 4.

How to achieve this? Below I have attached my model. Please help

Send_parts_through_label.fsm

@Jason Lightfoot @Felix Möhlmann @Jeanette F can you please help?



FlexSim 22.2.3
combinerbuffer
· 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.

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

Combiner

Pull Strategy any Port

Pull Requirement Combiner 1 and 2

in source code editor

  1. if (port > 1) // input ports 2, 3,..
  2. return item.Type == current.first.Type; // same Type as container item from port 1
  3. // code for port 1
  4. array reqPorts = ["L", "H"]; // allowed values of Type
  5. return reqPorts.indexOf(item.Type)+1;
  6. // Type Not element of array returns -1. I need 0 as logical false, so I add one.

Combiner 3

edit field directly: item.Type == "S"

or in source code editor

  1. return item.Type == "S";

Comment: previously tested items of pull requirement won’t be tested twice. Maybe if you need this, you must release all items in Queue 1 by source code command releaseitem( obj item, 0);. You replace obj item by a reference to each item in Queue 1.

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

Jeanette F avatar image
0 Likes"
Jeanette F answered michela-08 commented

Hello @michela_08,

From reading Jason and Jorge's responses the answer was getting help up with that you cannot pull different items from the same port. To mitigate this I added another connection from the queues to the combiners and set on the queues to send the items to port based on the case of the Item_type label.

1671512791998.png

Then I set the on Entry Triggers to set the component list depending on what the first item was that entered. I did change your global table so it worked with the default on entry trigger code.

1671512842251.png

1671512901120.png

The last combiner doesn't need the trigger.

send-parts-through-label-1_1.fsm


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

Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Jason Lightfoot commented

Here's a model which will pull alternating L/H parts into combiners 1 and 2 and have S parts go to combiner 2. The sequence into the processor will cause it to lock so you probably need to explain a bit better what should happen.

send-parts-through-label_jl.fsm


· 4
5 |100000

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