question

Victor Alejandro HT avatar image
0 Likes"
Victor Alejandro HT asked Joerg Vogel edited

How to get the max content statistics of a conveyor system?

Hi all,

I want to get the max content of a conveyor system ( made of 3 conveyor elements). I tried with the composite WIP chart but it only show the current content of the system. I tried with the statistic collector but register the max content of every single conveyor element and also tried with the old legacy templates but still doesn´t show the number I need. I attached an image and the model.

conveyor-system.fsm

Thanks for your support.

Alejandro.

FlexSim 18.2.2
conveyor system
1.png (64.9 KiB)
conveyor-system.fsm (33.1 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.

Joerg Vogel avatar image
2 Likes"
Joerg Vogel answered Joerg Vogel commented

It is the current content of all conveyors whenever an Item enters or exits the system. You can set a tracked variable to the value of the current contents of the conveyors. Or you can calculate the sum of the current content from the statistic of the conveyors by a calcluated table. 17016-conveyor-system-jv.fsm


· 6
5 |100000

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

Victor Alejandro HT avatar image Victor Alejandro HT commented ·

Thank you @Jörg Vogel I will go for the tracked variable option.

0 Likes 0 ·
Victor Alejandro HT avatar image Victor Alejandro HT Victor Alejandro HT commented ·

Hi @Jörg Vogel, I tried to apply your solution to my bigger model but it appears the followin error:

I also noticed that I can not write the full formula in the statistic collector, I need the sum of 10 values and I only can sum 6 due to lack of space in the value field.

Do you have any idea, how can I solve this problem. Thanks in advance.

duda.fsm

Alejandro

0 Likes 0 ·
duda.fsm (2.9 MiB)
error.png (10.6 KiB)
error2.png (18.8 KiB)
Joerg Vogel avatar image Joerg Vogel Victor Alejandro HT commented ·

@Victor Alejandro HT, you can try to add more source code directly in the code editor (icon parchment roll) right of the field. The source code line ends then with a semicolon. If the line gets to long you can write in the next line further. The end of the command is the semicolon.

1 Like 1 ·
Show more comments
Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Joerg Vogel edited

There is an object in the tree which controls all conveyors. It is called "ConveyorSystem". Therein is a coupling node that contains all items on all conveyors. If you find an attribute that you can use to limit the conveyors, you can count the items by a table query over this node.

Object conveySystem = model().find("ConveyorSystem");
treenode conveyItems = conveySystem.attrs.variables.subnodes["items"];
double data = Table.query("SELECT COUNT($2) FROM $1 WHERE $2 LIKE 'Con%'",
    /*$1*/ conveyItems.subnodes.length, 
    /*$2*/ conveyItems.subnodes[$iter(1)].value.up.up.up.name)[1][1];
print("items on Conveyors name starting with Con ",data);

Here is the attribute the name of the conveyors starting with "Con". The attached model contains other conveyors,which names start with "veyor".

I didn't find a more elegant way to get to the name than the several ups after getting the value of the queried node. Typically a table is the result of a query, but the count clause writes the value in the first cell of such a table. Then the result can be evaluated to a number value.

count-item-on-conveyor-by-conveyor-name.fsm


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.