question

Stefano avatar image
0 Likes"
Stefano asked Jeanette F commented

Help Needed with Dynamic Excel Updates for Source Arrival Schedule

Hi All!

Sorry for the long text, I think this should be fairly easy for the experienced.

I'm trying to build a simple digital twin experiment. My goal is to add new items to a queue every time I add a new row to an Excel sheet. Since this is a digital twin experiment, the row will be added while the simulation is running.

Here's what I have so far:

  1. I managed to connect an Excel sheet to the "arrival schedule" table of a source, and that part is working fine.

1718472270958.png1718472285878.png


2, However, when I update the Excel sheet with more rows (considering I'm adding future arrival times that the model hasn't reached yet), the "arrival schedule" table is updated, but the model doesn't reflect these changes unless I reset it. This defeats the purpose of having "live" updates.

1718472431523.png


My questions:

  1. How can I force the source to "recheck" the Excel table for updates without resetting the simulation? The table updates, but the Source isn't creating new items after the simulation starts running.

  2. How can I convert dates from Excel to FlexSim time format? Ideally, I would like to use arrival times in mm/dd/yyyy hh:mm format instead of seconds. Any tips on handling this conversion would be greatly appreciated. I saw this post, but couldn't really figure out where to put that line of code.

  3. How can I use scheduled arrivals in a process flow? I attempted a global table lookup based on the Excel sheet, but it didn't work. If someone could explain how to fill out the table for scheduled arrivals in process flow, that would be very helpful.

1718472557028.png

Thanks in advance for any guidance or solutions you can provide!

schedule-source.xlsx

process-flow-scheduled-source1.fsm

FlexSim 24.1.0
arrival table
· 3
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 Joerg Vogel commented ·

https://docs.flexsim.com/en/24.1/Reference/CodingInFlexSim/FlexScriptAPIReference/Data/DateTime.html#Method-fromExcelTime

please consider to use a different arrival mode for a source. If you use instead an interarrival time you can read a next time arrival difference from an excel file while a model runs. Please be aware of that you must already know the next time interval when previous item is created. If you cannot realize this condition then you can only create an item by code directly in your model without a source.

0 Likes 0 ·
Stefano avatar image Stefano Joerg Vogel commented ·
Thanks for the reply! Sorry, what do you mean by creating an item by code directly? Is it using the Flexsim command console?
0 Likes 0 ·

Hi @Stefano, was Joerg Vogel's answer helpful? If so, please click the "Accept" button at the bottom of their answer. 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 comment back to reopen your question.

0 Likes 0 ·

1 Answer

·
Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered

You get Items by code or process flow activity.

process flow: create object

command: treenode.copy method already existing item from Flowitem bin.

5 |100000

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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