question

Oscar C13 avatar image
0 Likes"
Oscar C13 asked José Antonio MD commented

Write a usage time in a table

I wanted to be able to write in a table, the time that a processor has been used, but I don´t know what code I have to use in the table to be able to refer to the processing time.

I did this but I don´t know if there is a better way.
ProcessTimeTable.fsm

FlexSim 21.2.2
global tableprocess time
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 Joerg Vogel commented

I have two solutions added. I evaluate the staytime twice: first in Processfinish trigger, second by Process Flow:

  1. Model.time-getentrytime(item) // Trigger value for a new row
  2. Model.time-getentrytime(token.item) // Process Flow for a new row value

Second solution: a label at processor sets a process time

I read this label value. I need a reference to involved processor which I assign in previous event driven source activity to a token label: token.Processor

  1. token.Processor.myCurrentProcessTime // read label value for a new row

You will choose a template in a trigger or in Process Flow for a Custom Code activity

addrowandvalueglobaltable.jpg

getStaytimeProcessor.fsm


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

José Antonio MD avatar image
0 Likes"
José Antonio MD answered José Antonio MD commented

Hello @Oscar C13,


You can use the code "getTotalTimeAt". For example:

  1. Object P=Model.find("Processor1");
  2. return P.stats.state().getTotalTimeAt(2);

You can find more examples in the forum: How to get the collecting time of a process flow Sink from its tree ? - FlexSim Community .

I hope I have been helpful.

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