Send parts using label

Send parts using label

michela_08
Not applicable
732 Views
15 Replies
Message 1 of 16

Send parts using label

michela_08
Not applicable

[ FlexSim 22.2.3 ]

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_typeCombiner 1Combiner 2Combiner 3
Lyesyesno
Hyesyesno
Lyesyesno
Hyesyesno
Snonoyes


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?



0 Likes
Accepted solutions (1)
733 Views
15 Replies
Replies (15)
Message 2 of 16

jason_lightfoot_adsk
Autodesk
Autodesk

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

0 Likes
Message 3 of 16

michela_08
Not applicable

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
Message 4 of 16

joerg_vogel_HsH
Mentor
Mentor
Accepted solution

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.

0 Likes
Message 5 of 16

michela_08
Not applicable

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
Message 6 of 16

joerg_vogel_HsH
Mentor
Mentor

@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
Message 7 of 16

michela_08
Not applicable

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
Message 8 of 16

joerg_vogel_HsH
Mentor
Mentor
@michela_08 , the parchment roll icon is the source code editor.
0 Likes
Message 9 of 16

michela_08
Not applicable

can you please check this? @Joerg Vogel

yes I have added the code.

In my model attached, Combiner 1 has to wait for 2 items coming from Port 1 of same type label, but in this case it starts processing as soon as one item exits from Port 1.

For example, Combiner 1 has to wait until two parts to enter from Port1 (Processor) and then 5 parts from Input port 2. Total there should be 7 parts when it starts processing.

Send_parts_through_label_1.fsm

0 Likes
Message 10 of 16

jason_lightfoot_adsk
Autodesk
Autodesk

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"

Message 11 of 16

joerg_vogel_HsH
Mentor
Mentor

A combiner cannot combine 2 items from port one. The default mechanism does not allow this. Perhaps you add a chart of a process that you want to get accomplished with a sequence of entering items, their type, their origin, because I misunderstood your description completely.

0 Likes
Message 12 of 16

michela_08
Not applicable
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
Message 13 of 16

jason_lightfoot_adsk
Autodesk
Autodesk
The combiner doesn't do that.
0 Likes
Message 14 of 16

andrew_o2
Not applicable

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
Message 15 of 16

Jeanette_Fullmer
Community Manager
Community Manager

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

0 Likes
Message 16 of 16

michela_08
Not applicable
Thank you @Jeanette F
0 Likes