question

Gabriel D16 avatar image
0 Likes"
Gabriel D16 asked Gabriel D16 commented

token creation problem with ArrivalTime conversion

Hello, I am doing a Digital Twin project and I want my model be always actualized with current datas.

Then, I import Excel datas with the database connector (better than the Excel Import's interface because faster to import) and I run a Code to convert my DataTime in seconds to be used by FlexSim. I also set the simulation's clock with the pc's clock.

The issue is that tokens are not created at the ArrivalTime. I think that the conversion (string to seconds) is the cause because when I import only seconds to my model without convert, it works.

I attach a test model with only this part of the problem, and his excel file.

Thank you for the help !

arrivalTime_test.fsm

schedule_source.xlsx

FlexSim 22.0.3
convert 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.

1 Answer

Matthew Gillespie avatar image
1 Like"
Matthew Gillespie answered Gabriel D16 commented

It looks like the issue you're running into is that the Scheduled Source schedules the first arrival when you reset the model. So it's scheduling the first event using the Excel time (something like 13297431550) before you convert it to model time. So you probably need to add Model Trigger for the model's On Reset and schedule the first event in there.

Alternatively you could have the token in the Import Data Continuously pull in the next model time, delay until that time, and then use the Create Tokens activity to create an arrival token at that time. That way you don't worry about the Scheduled Source scheduling an event in OnReset.

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

Gabriel D16 avatar image Gabriel D16 commented ·
I tried using the "Create Tokens" and with a Delay as you said and it works. I don't have the error again. Thank you for your help
0 Likes 0 ·