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.

Andrew O avatar image Andrew O commented ·

Hi @michela-08, was one of Joerg Vogel's or Jason Lightfoot's answers helpful? If so, please click the "Accept" button at the bottom of the one that best answers your question. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

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

if (port > 1) // input ports 2, 3,..
  return item.Type == current.first.Type; // same Type as container item from port 1
// code for port 1
array reqPorts = ["L", "H"]; // allowed values of Type
return reqPorts.indexOf(item.Type)+1; 
// 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

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.

michela-08 avatar image michela-08 commented ·

Hi @Joerg Vogel

I used the same code. but it throwing me this error. Can you tell me what is wrong?

1670746977021.png

0 Likes 0 ·
1670746977021.png (50.9 KiB)
Joerg Vogel avatar image Joerg Vogel michela-08 commented ·

@michela_08 ,It is a problem of ascii character “ and “. Please rewrite them in the source code editor. My system distinguishes between opening and closing “ characters. This is not suited in source code writing.

EDIT: Source code updated to standard double quotation marks.

0 Likes 0 ·
michela-08 avatar image michela-08 Joerg Vogel commented ·

Apologies @Joerg Vogel I am new to flexsim. I have no idea about Source code editor. Can you please tell me where can I find source code editor.

I added this code in the Pull requirement of combiner "Custom code"

1670747830415.png

0 Likes 0 ·
1670747830415.png (9.1 KiB)
Show more comments
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.

michela-08 avatar image michela-08 commented ·
Thank you @Jeanette F
0 Likes 0 ·
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.

michela-08 avatar image michela-08 commented ·

Hi Jason,

Thank you for the model.

But i have few conditions, can you please tell how to do this?

Processor 1 has to send two items(one after another) of Item_type == "L" to either of the combiner 1 or 2 (which is available) and then only items from Item_type == "L" from Queue 2 or Queue3 (from Input port 2 target quantity) will get combiner together in the Combiner 1 or Combiner 2.

This is same for items with Item_type == "H".

whereas Combiner 3 has dedicated items with Item_type == "S"(no conditions here).

Note : Basically I want two items of same label type(from input port 1) to be combined with the same label type of items(from Queue 2 and Queue 3:: input port 2) for both the combiners 1 and 2.

Either of the label types "L" and "H" can enter Combiner 1 and Combiner 2(whichever is available)

Note : I have updated the model with few changes.

Send_parts_through_label_1.fsm

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ michela-08 commented ·

You're partially describing a possible sequence of events but not the underlying constraint.

It sounds like the constraint is the processor has to run the sequence LHLHSLHLHSLHLSH..... etc. and that there is no constraint on the combiner sequence just that they have capabilities to do LH (C1&C2) and S (C3), but the order in which they arrive at the combiner is not important - it's just the sequence at the processor. Is that correct?

If so, the pull requirement on C1 and C2 can just be item.Type!="S"

1 Like 1 ·
michela-08 avatar image michela-08 Jason Lightfoot ♦♦ commented ·
I am sorry , its my mistake.

The sequence coming from processor to combiner is based in this way (please ignore the sequence from source). I had mistaken.

"LL" "HH" "LL" "HH" "HH" "LL" "HH" "LL".......

I want to combine two items of LL and with items from the port 2 of type "L". So totally together it should come out as one product. Same for HH.

This should happen in both combiners 1 and 2( whichever is available)

Using Join option, I cannot combine parts from Port 1. I want to combine 2 parts from port 1 with specified parts from port 2.

0 Likes 0 ·
Show more comments