question

Fengjun0113 avatar image
0 Likes"
Fengjun0113 asked Fengjun0113 commented

Get item in "Write to Table"

Hello, it is a FlexSim 2016 model. I am trying to read "item" then I can set number to Global Table in "Write to Table". I tried to used "node" to read item but it didn't work. How can I fix it?

1661387939312.png

https://drive.google.com/file/d/1ENEKjrQ2jK9h68S3pK9Fe529uOZsXSu6/view?usp=sharing

FlexSim 16.1.2
itemnodewrite to table
1661387939312.png (196.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.

1 Answer

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Fengjun0113 commented

The items are assigned the name "Product" in the source schedule. So that is the node name you would have to search for.

treenode item = node("/Product",current);

Instead of the name, you can also use the rank to refer to a subnode. So if the item will always be the first subnode of the processor, you can use the following and get a reference to the item regardless of its name.

treenode item = node("/1",current);
· 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.

Fengjun0113 avatar image Fengjun0113 commented ·
Thank you !
0 Likes 0 ·
Fengjun0113 avatar image Fengjun0113 commented ·


Hello @Felix Möhlmann, in this model, I also want to add a column in "WaitStats" to see how many samples for each row. How can I do?

1661735160270.png


0 Likes 0 ·
1661735160270.png (15.6 KiB)
Felix Möhlmann avatar image Felix Möhlmann Fengjun0113 commented ·

You should be able to use the "COUNT" SQL-keyword to determine how many entries there are for each processor in the WaitTimes table.

"SELECT COUNT(Process) FROM WaitTimes WHERE Process == ..."

https://www.w3schools.com/sql/sql_count_avg_sum.asp

0 Likes 0 ·
Fengjun0113 avatar image Fengjun0113 Felix Möhlmann commented ·
Thank You !
0 Likes 0 ·