question

Suraj J avatar image
0 Likes"
Suraj J asked Suraj J commented

Importing Excel on Reset & Running Model Automatically (Silently) Not working.

Using the .zip file provide by @Ben Wilson on this Post, I have updated the model to import the process times from excel. I have setup data import from excel and it works fine unless I use Import Table on Model Reset. If this is unchecked, the model runs fine and results are written. The simulation does not go through if this option is checked. Considering that we would like the latest values to be used in simulation, how would one proceed in this situation? I am attaching the updated zip file here.flexsim-remote.zip

FlexSim 18.1.2
excel importexcelcommand linecommand line interface
· 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.

Kari Payton avatar image Kari Payton commented ·

Hi @Suraj J have you double checked that the excel workbook address is correct? It should read something like C:saved location. For example I saved your file in my downloads so it looks like this.

It's working for me on reset.

1 Like 1 ·
excelinterfface.jpg (79.6 KiB)
Suraj J avatar image Suraj J Kari Payton commented ·

The path is correct as the file is saved at same location as the model. I am able to import the data. The reset import will also work if you are accessing it directly through GUI.

0 Likes 0 ·
Suraj J avatar image Suraj J commented ·

PS. Tried excelmultitableimport() on modelreset within model. Now the results are generated but for the old values. The values in global table are not updated.

0 Likes 0 ·
Suraj J avatar image Suraj J commented ·

@Ben Wilson I think this question has gone unnoticed. Could you please reply or refer the correct person to get in contact?

0 Likes 0 ·
Kari Payton avatar image Kari Payton commented ·

also the model is stopping because there is a "stop" on the code for the process cycle time. If you click the yellow triangle, the red circle around it will disappear.

Now the model will run without stopping. @Suraj J

0 Likes 0 ·
stop.jpg (59.7 KiB)
Suraj J avatar image Suraj J Kari Payton commented ·

I think the model does not stop for the debug stop when running in background.

Your replies are helpful, but the issue I am facing is the results are not updated even when I change the values in excel file.
Let me apply your suggestions and I will confirm this tomorrow when I get back to office.

0 Likes 0 ·
Suraj J avatar image Suraj J Kari Payton commented ·

The model is not completing its run after removing the stop and enabling import on reset.
This is what I do,

  1. Run the model in background (.bat) . Check results after run.
  2. Change the process time in Spreadsheet and save it. Run the .bat file.
  3. Model run stops.

If you open the model once, it will import the data on reset. Then the results will be generated if you run the bat file. After that, if the values are updated in the spreadsheet and the bat file is executed, the model run won't complete. The values are imported if they change in the spreadsheet, so the model would produce results until you change the values in the spreadsheet.

I think this stoppage has to do with the import window which shows the progress very briefly.

0 Likes 0 ·

1 Answer

Joshua S avatar image
1 Like"
Joshua S answered Suraj J commented

Try this, it worked for me, don't know fully why. Toggle Import Table on Model Reset on, then add excelmultitableimport(); to the top line of your script file.

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

Suraj J avatar image Suraj J commented ·

It works! Thank You!

0 Likes 0 ·