token creation problem with ArrivalTime conversion

token creation problem with ArrivalTime conversion

gabriel_d16
Not applicable
45 Views
2 Replies
Message 1 of 3

token creation problem with ArrivalTime conversion

gabriel_d16
Not applicable

[ FlexSim 22.0.3 ]

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

0 Likes
Accepted solutions (1)
46 Views
2 Replies
Replies (2)
Message 2 of 3

Matthew_Gillespie
Autodesk
Autodesk
Accepted solution

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.



Matthew Gillespie
FlexSim Software Developer

Message 3 of 3

gabriel_d16
Not applicable
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