question

gilbert jerald avatar image
0 Likes"
gilbert jerald asked Joerg Vogel commented

How to send item to queue using operator by matching the item type ?

Hi,

I want to send the item to four different queue's based on match item type using operator. I have used match item type in send to the port field but it's not working properly when I use an operator to transport the item. I have attached the model for your reference. send-item-by-matching-the-item-type.fsm

Thank you in advance for your valuable answer.

matching itemtypes transporter
5 |100000

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

1 Answer

·
Jeff Nordgren avatar image
0 Likes"
Jeff Nordgren answered Joerg Vogel commented
@gilbert jerald

The way that queues work, is that when a flowitem enters a queue, it is immediately ready to leave. This causes the Send To Port code to fire. Because you are using an Operator to transport the flowitems, when flowitems come into the queue, the operator has not yet dropped off any previous flowitems so it get confused as to where flowitems are in the queues. It's a timing thing because of the time it takes the operator to drop off a flowitem. During that time, lots of flowitems enter the queue and are ready to leave and where they are to go is calculated based on what is in the download queues when then enter the upstream queue.

Here is how I would "manage" that. In the attached model, I put a second queue after the Source, or rather a another queue between the Source and Queue1. Then I only allow 1 flowitem into Queue1 at a time, closing the input port on entry into the queue. Then in the downstream queues, when a flowitem enters, I re-open the input port of Queue1. Then the logic on Queue1 will work because the flowitems are in the downstream queues when the Send To Port code is executed in Queue1.

I hope all of that made some sense? Take a look at the attached mode. If you have any questions or problems, please let us know.

Thanks.

send-item-by-matching-the-item-type-jn1-v1714.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.

gilbert jerald avatar image gilbert jerald commented ·

@Jeff Nordgren

Thanks for your response. I have understood your concept and I have tried it out, it's working fine. I am facing few problems when I try to implement this concept in my model.

In my model, there is Five type of item comes from source1 and move to respective Buffer area(1,2,3,4,5) through Staging Queue1 using matching item type command in staging Queue1. Operator 1 will load the item from staging queue1 and unload it in the respective buffer area. Here another worker Operator2 is used to load the item from Buffer area to Staging Queue2. The max content for all buffer area is 4.

In the below a picture I have explains my problem and the expected solution in my current model. Please let me know is there any other way to accomplish this?

Also, I have attached the sample model for your reference.sample-model.fsm

Thanks in advance for your valuable answer.

0 Likes 0 ·
sample-model.fsm (34.4 KiB)
match-item-type.png (113.4 KiB)
Jeff Nordgren avatar image Jeff Nordgren gilbert jerald commented ·

@gilbert jerald

I have one question I ran into. What if a queue has a max of 4 of one item type in it and the next flowitem is of that same type. There are no "empty" queues. All queues have some number, less than 4, in them of a different itemtype. What should happen then? Should the flowitem be put in a queue with other itemtypes but has a total of less than 4 in the queue?

When I fixed the problem you describe above, I ran into this scenario. And because the queues get filled up, the queues end up having multiple itemtypes in them because Operator2 can't keep them clear. So, what should happen?

0 Likes 0 ·
gilbert jerald avatar image gilbert jerald Jeff Nordgren commented ·

@Jeff Nordgren

If a queue has a max of 4 of one item type in it and the next flow item is of that same type means it should not move to some other queues have less than 4 in them of a different item type. Instead, it should go back to previous staging queue and allow the next item that can enter into buffer queues with the condition of matching item type and max content =4

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel commented ·

In addition to @Jeff Nordgren description I would let the operator or dispatcher decide what to do. The support queue isn't necessary, but all considerations must be included in the source code. Jeff is right, it is a timing issue. When The operator receives a transport task sequence. He can evaluate the unload station and the involved item form the unload task. If the combination fits to the current situation, he doesn't change anything. But if the station is at the moment different then there are some parameters to change. Obviously the unload station in the travel and unload task must change. The nroftransportin variable of the incorrect unload station must be decremented. In opposite the new unload station variable must be incremented.

If you don't use a dispatcher the operator gets all available transport task sequence at once. You change the task sequence then in the function On Resource Available in the operator. If you use a dispatcher, the function OnReceive Task Sequence is suitable because the dispatcher transmits only one sequence after the last has been finished.

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.