Cancel
Showing results for 
Search instead for 
Did you mean: 

Get datetime from system

Pioneer
Pioneer

Hello Everyone,

 

In my model, Eventcontroller.date(starting datetime) is before 1 month (2018/06/18 09:00:00).when simulation reach at current datetime(from system datetime 2018/07/18 17:25:00), then i want to call method. How is it possible??

 

Can you suggest me, How can i get datetime from system? and where can i define these code so after meet these condition(Eventcontrollere datetime= System datetime) it will call Method??

 

Thanks in advance for your magical ideaSmiley HappySmiley Happy

10 REPLIES

Re: Get datetime from system

Phenom
Phenom

To get the current date time from the system have a look at the sysdate method.

 

You can delay the start of a method through the methCall method (for details s.helpfile).

 

 

 

Re: Get datetime from system

Valued Contributor
Valued Contributor
  1. sysDate

Re: Get datetime from system

Pioneer
Pioneer

Hello @simulator, @fox,

 

Thanks for your reply.

We can get datetime of system from sysdate but i have one more question: I want to call Newmethod when  Eventcontroller datetime= System datetime. Note that my simulation start before 1 month.

Where can i define these code ((I mean, in Display, Generator.....??))so it will activate only when eventcontroller time reach at current systemtime.

Can you suggest me a any idea?

 

Thanks in advance Smiley HappySmiley Happy

Re: Get datetime from system

Phenom
Phenom

As posted before, did you have a look at the method "methCALL" in the help file ?

 

The generator object would probably also do.

Re: Get datetime from system

Pioneer
Pioneer

Hi @simulator

 

 i already read Methcall from helpfile. i wrote follwing code in Init method.

 

init.PNG

 

Here timediff is 9:02:34:36:9090. Means after this time methcall call this method (m_wait). But problem is system date is also running.so when simulationtime reach at systemDate(2018/07/19 11:34:36:9090) but at that point systemdate will ne different(May be 2018/07/19 11:45:00:0000 like date).

 

I want to call method when Both time will be excatly same. Can you suggest any better idea?

Thanks in advance

 

Re: Get datetime from system

Phenom
Phenom

You mean to say, that to simulate roughly 9 days,

 

the DES takes roughly 10 min

 

and the

 

m_wait method is therefore launched too late in the simulation ?

Re: Get datetime from system

Pioneer
Pioneer

thanks @simulator for quick reply

 

ya,

Model description: my model is started from past ((normally before 1 month but everytime difference-- according to Excel file)). and when this simulation time reach at current time ((sysdate)) then we will gate new excel file of order. These new order, we can produce by 5 different layout.

So i want to call method (when eventcotrollerdate= sysdate)) and this method contain code that can update production plan according to new orderlist  and save this model in different 5 folder.

 

Can you suggest any idea??

Thanks a lot

Re: Get datetime from system

Phenom
Phenom
To get aligned:

The Discrete Event Simulation "jumps" from one event stamp to the next.

Therefore you cannot schedule a method Call and expect the method to be executed

at the current continuous real time stamp.

The Discrete Event simulation time is not synchronous to current real time!

If the simulation reaches the current time stamp -according to eventcontroller time-

all data should be provided and available to carry on simulating in simulation time !



Re: Get datetime from system

Hi Niks1,

try the method of my screenshot. It calls the m_CheckSysdate until the difference between the current (real time) moment and the simulated time is smaller than a limit: in my case 1 sec.

 

Unbenannt.PNG