question

Chitra J avatar image
0 Likes"
Chitra J asked Ben Wilson commented

How to make decision based on current content's item Type

I want to identify Type wise contents in the conveyor system and their count as well. I can get that on dashboard using WIP by Type chart.

but I want to save/use that same data somewhere in the model to make decisions.

example: At the exit of each part from the conveyor system, I want to identify how many left behind on the conveyor system of the same type.

I have attached sample model here.

WIP by Type.fsm

FlexSim 20.2.1
conveyorsystemflexsim 20.2.1wip by type
wip-by-type.fsm (125.4 KiB)
· 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.

Ben Wilson avatar image Ben Wilson ♦♦ commented ·

Hi @Chitra J, was Jeanette F's answer helpful? If so, please click the red "Accept" button on their answer. 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 or comment back to reopen your question.

0 Likes 0 ·

1 Answer

·
Jeanette F avatar image
1 Like"
Jeanette F answered

Hello @Chitra J,

Your Statistic Collectors make tables and these tables can be referenced in your model or in process flow.

The following code will return the value from the specified row and column of the table.

Table("Example table")[rowNumber][columnNumber]

This code will also return a value from the matching row of the table. The code looks through the first column of the table to find a matching value and then returns the second column value of the row with the matching value. This is helpful with a table that has changing rows or columns like a statistics collector is at the beginning of the model.

Variant searchVal = token.Type;
Table table = reftable("Example table");

for(int i = 1; i <= table.numRows; i++) {
    if(table[i][1] == searchVal)
        return [i, 2];
}

I created in your model a process flow that creates a token when the box leaves the conveyer and then that token has a label assigned to it. The label contains the number of boxes left of the conveyer. You will notice there are two labels created that store the number of boxes left on the conveyer. This is so each of the above methods can be demonstrated. You will notice that the first method is not correct until the Table has all Type (1-10) in it. I kept this method included because it may help you with referencing the tables in other circumstances.

Here is the adjusted model for your reference.

wip-by-type.fsm


wip-by-type.fsm (521.0 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.

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.