question

Tzu Hsuan C avatar image
0 Likes"
Tzu Hsuan C asked Jeanette F commented

How to write different values to one global table in different column?

hi,

I would like to write down the time when item enters station1 and also the time when item leaves from queue into a global table(mytable).I want to put "time when item enters station1" in column 1, "time when item leaves from queue" in column 2.

Until here, in global table it turns out to be this. How can I trigger item to write in column 2?

I tried to use "Write to a global table" to assign value( the time when item leaves from queue) to column2, but in this way, each value will only be written in row1, column2.

FlexSim 20.2.3
global tableflexsim 20.2.3
1622703756304.png (98.0 KiB)
1622703767377.png (233.0 KiB)
1622703777656.png (271.0 KiB)
1622703849287.png (29.8 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.

Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @Tzu Hsuan C, was Felix Möhlmann's or Joerg Vogel's answer helpful? If so, please click the red "Accept" button at the bottom of one of their answers. 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 and comment back to reopen your question.

0 Likes 0 ·
Felix Möhlmann avatar image
1 Like"
Felix Möhlmann answered

As a simple solution, in the "Write to a global table" option for the trigger, you can use the output statistic of the queue to determine the correct row number.This will work as long as all items that enter station 1 leave the queue in the same order (no items are created/deleted inbetween the stations and they must not overtake each other).


A more robust solution would be to create a label on the item when it enters station1 that contains the number of the row. "Add Label" -> use the number of rows in the table at that time

Table("mytable").numRows

as value for the label. Then use that label as row number in the "Write to a global table" on the queue.


writetotable.png (8.3 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
0 Likes"
Joerg Vogel answered

Perhaps you can still adapt the tutorial of FlexSim 19 on create and track custom statistics.

5 |100000

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