question

Adam C avatar image
0 Likes"
Adam C asked Steven Hamoen commented

Flowitem entering combiner port 0 when task sequence sends to port 2

Container object enters (port 1) and triggers a task sequence for the operator. The operator gets a flowitem from one of two queues, depending on inventory availability. The flowitem should enter (port 2) and trigger more retrievals until pack quantity is met, but it is reading as coming from port 0 and therefore not triggering the code to create the next task sequence.

autefa-concept-v2.fsm

FlexSim 18.0.5
combinersportstask sequences
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

·
Steven Hamoen avatar image
0 Likes"
Steven Hamoen answered Steven Hamoen commented

@Adam C I have take a look at what you have written. There are a few remarks:

1. Have you tried debugging your onentry trigger? Just open the code and click on the far left column of the code window (just before the linenumbers) such that a red dot appears. If you now run the code it stops there and you can see the values of all your variables or put some code in the watch variables window to check for your code. You will also see that it is entering through port 2 all the time so that is not the problem.

2. If you have done that you would see

current.stats.content.value - 1 == packQty

will never be hit. This is because current.stats.content.value is always 2. 1 being the bottom pallet, the other being the flowitem you just put in the combiner. After your code is executed the combiner puts your newly entered flowitem into the bottom so the content is 1 again until your next flowitem arrives.

3. because this code is never executed after a while your combiner spits out the bottom with everything in it and this messes everything up.

so what can you do. Most important remark: Learn about process flow. This is exactly made for these types of situations.

But I understand that coming this far, this is not the right solution. So you should look at the content of the bottom, so your line of code should become something like:

current.subnodes[1].subnodes.length

This will give you the content of your bottom (subnodes[1]) and not the content of the combiner. Actually I think to get the content of an object subnodes.lenght is the preferred way. (although I guess yours also works)

But then you should also make sure that you release the packed product from the combiner yourself, because now the combiner is doing that. If you fix this, together with the debug approach you should be able to build your model further.

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

Adam C avatar image Adam C commented ·

Steven, I have tried debugging. When the first flowitem/tray enters, the local variables shows port to equal 0 when it should be 2, and the if statement checking for port equal to 2 is skipped over. Where do you see that it is entering port 2?

I see what you mean on the content vs subnode length now that I look at it in the tree.

Can you explain the need to manually release the packed product from the combiner? I do not understand the issue with letting the combiner handle it after the process time finishes.

0 Likes 0 ·
Steven Hamoen avatar image Steven Hamoen Adam C commented ·

@Adam C For the port number see attached picture. And if I step through the code it nicely enters the correct piece of code.

There was another error. Once it hits the correct amount you shouldn't bring any other products to the combiner until the next pallet has entered. So in the part where you check for the content you should add the line:

return dispatchtasksequence(ts);

You were correct that you don't have to release the product yourself if the amount matches the amount in the combiner table. So I also attached your model with the changes and I think that it now does what you want.

autefa-concept-v2-tal.fsm

0 Likes 0 ·
portnrs.png (281.9 KiB)

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.