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

  1. 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:

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