question

chao.g avatar image
1 Like"
chao.g asked Adrian Haws edited

Item Routing

Have a simple question about routing here:

Below in the screenshot, there are 3 type of parts, routing to 15 different processor, type 1 goes to processor 1 to 5, type 2 goes to processor 6 to 10, type 3 goes to processor 11 to 15, within each type, it's going to the first available processor, what I am doing right now is using pull strategy with specific item type.

Is there a way to do this routing in the upstream buffer? like simple code ?

Thanks,

FlexSim 16.1.0
itemtypesend to portfirst availableitem listreevaluate send to
routing.png (26.9 KiB)
5 |100000

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

Axel Kohonen avatar image
5 Likes"
Axel Kohonen answered Axel Kohonen commented

Hi Chao,

Jing's solution works easier if you can think of the three queues as only virtual and only existing in the simulation model, but not in real life. But if that is not possible then the idea below should work.

If not possible to use Jing's solution I think you will need to write the code in the upstream queue SendToPort trigger yourself. You can have three if:s that check the itemtype and inside each if a for loop that goes through the processors that are accepted for that itemtype and checks if there is an available one. In case none of them is available return the port number of a port that is already busy, e.g. the first processor in the group. Then you also need to check the "Reevaluate SendTo on Downstream Availability" checkbox in the Flow tab of the upstream queue so that it runs the code again when a processor becomes available.

Hope this helps!

Axel

· 2
5 |100000

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

chao.g avatar image chao.g commented ·

Axel,

Yes, this is what I am looking for. Return the port number of a port that is already busy + Reevaluate SendTo on Downstream Availability.

Thanks for your help!

0 Likes 0 ·
Axel Kohonen avatar image Axel Kohonen chao.g commented ·

Hi,

If the answer was what you were looking for then please mark the answer as correct so that others find the answer faster.

Thanks!

Axel

0 Likes 0 ·
Brandon Peterson avatar image
4 Likes"
Brandon Peterson answered Brandon Peterson commented

Chao,

In the current version you have the ability to uses a List instead of port connections for managing flow between objects. I have created a sample model for you that does what you described. The way that it works is that the send to port trigger pushes the flowitems onto a default item list. You can create the list by using the "Global List" -> "Item List" option in the toolbox. There are no port connections between the queue and the 15 processors. Instead, each processor "pulls" using the pick list option "Use List" -> "Pull from Item List". In that option there is a query that only pulls flowitems that have the correct item type.

The query to pull item type "1" would be: "WHERE itemType = 1"

In that query "itemType" is a field that is defined on the Global List by default. The neat thing about this method is that you can have processors that can take multiple item types.

Query for type "1" and "2" : "WHERE itemType = 1 OR itemType = 2"

Qery for types greater than 2: "WHERE itemType > 2"

There are definitely many ways to accomplish what you are trying to do and each has its own positive and negative sides so you will want to choose the one that works best for you.

Good Luck,

Brandon


· 2
5 |100000

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

chao.g avatar image chao.g commented ·

Brandon,

I do really like the idea of using a list to push and pull, similar to an order list I am used to in AutoMod, in the sample model you provided, I am getting an error below, is this a version issue or something else? I am using 16.1.0.

LIST_RETURN_BACK_ORDER_IF_NOT_FULFILL)

This is in the code field of pull from itemtype list.

Thanks,

Chao

0 Likes 0 ·
Brandon Peterson avatar image Brandon Peterson ♦ chao.g commented ·

Chao,

I got the same problem on my computer here at home where I am using version 16.1.0 at work I am using 16.1.1

I would suggest doing the latest upgrade to get past the error. If that isn't possible let me know and I'll try to find another solution to get past the error for you.

Regards,

Brandon

2 Likes 2 ·
jing.c avatar image
2 Likes"
jing.c answered Axel Kohonen converted comment to answer

Hi, chao.

Try to send different itemtype item to different queue before going to processor. These transit queues only connect the processors your item need and keep "First Available" in SendToPort.

I think it's the simplest way to solve your question, and May it helps you.

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

chao.g avatar image chao.g commented ·

Thanks for the response.

The idea is to have a centralized buffer system, having 3 separate buffer will be expensive in our case, I can have a central buffer followed by 3 separate buffer with a capacity of 1, but again, that's not the reality, I am looking for a direct way of doing this in the central buffer.

0 Likes 0 ·
Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered chao.g commented

Hi Chao,

As @Axel Kohonen suggested you can accomplish that with some code and alabel structure in the processors. I have attached a model which route-mapping depends on a label in the processors. The queue tests all processors to find a suitable station. If the Send To function can't find one, the item is hold in the queue and 4 seconds later the same item is tested again in the Send To function. To indicate the second test I changed the color of the item. The following test starts by the command releaseitem in the OnMessage trigger of the queue.

My approach does not depend on the option Reevaluate SendTo.


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

chao.g avatar image chao.g commented ·

Thanks a lot, this is a little more complicated than I am thinking, but it definately opens more doors for other problems.

0 Likes 0 ·

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.