question

Jouky D avatar image
0 Likes"
Jouky D asked Benjamin W2 commented

How to Export Dashboard tables every 2.3 (for example) units of simulation time?

Hello,

Can I export a data table automatically every 2 days of the simulation (for example) to obtain an Excel file (or CSV) for each exportation during 10 days, i.e. 5 Excels files o 5 sheets in an excel file?

Thank you

FlexSim 20.0.2
timeexcel exportflexsim 20.0.2automatic
5 |100000

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

tannerp avatar image
1 Like"
tannerp answered Benjamin W2 commented

This is a little unorthodox, but I think it's still possible. I used Process Flow to create a token every 1 second. The token is assigned a "ModelTime" label, which is just the time in the model (used later to name exported CSV files). The Custom Code activity in the Process Flow takes the data from the WIP By Type table and clones it to GlobalTable1 (you could do any chart type as long as you have a Stats Collector/Calculated Table for it).

The exported files are saved with labels that are created by concatenation so that you can figure out which CSV file is associated with each second in the model.

Hopefully this helps. You can always modify it to meet your needs.

exporttest.fsm


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

Benjamin W2 avatar image
1 Like"
Benjamin W2 answered Jouky D commented

Hi @Jouky D,

You might try something like this:

  1. Create a user event. Go to tools, click the green plus, enter the time of the event in "First Event Time" field. Check "Repeat event."
  2. In your "Event Code", add the following custom code:


  1. excelcreateworkbook();
  2. excelsetsheet("Sheet1");
  3. excelexporttable("Table1",1,1,5,3);
  4. excelsave("NewWorkBook.xlsx");
  5. excelclose(0);

Here is some documentation on these commands:





1587053774847.png (109.5 KiB)
1587053803922.png (90.6 KiB)
· 7
5 |100000

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