Cancel
Showing results for 
Search instead for 
Did you mean: 

Waituntil for AbsSimTime

Legend
Legend

Hello everyone,

 

ModelDescription:- i want to start production of order ((for that creating entity in source)) . Before that we have to check, if Release_Time_Planned pass or not.. if not then waituntil this time then start production of order..

 

Order and Release_Time_planned are available in Tablefile(t_current-production_plan).

i wrote follwing method.But its not working properly.

problem: if Release_Time_Planned > AbsSimTime then it will wait but after when met this conditions but still  it will not wakeup.waituntil_abssimtime.PNG

I attched table which contain order and Release_time information.

thanks in advance

7 REPLIES

Re: Waituntil for AbsSimTime

Phenom
Phenom

The waituntil statement is comparing 2 local variables:

 

NewReleaseTime_Period and AbsSimtime

 

Once set, these variables will not be  (dynamically) updated

 

Therefore the waitunil statement is sort of "froozen"

 

as the condition containing the 2 variables never changes

Re: Waituntil for AbsSimTime

Legend
Legend

Hello @simulator,

 

thanks for your reply.

How can i do this? I did like following code....Note that here ((var AbsSimTime,NewRelease_Time_Planned,TimeDiff : Datetime))

wait.PNG

But it still not working. Do you have better idea then suggest me. and what is the error in above code??

thanks in advance

Re: Waituntil for AbsSimTime

Phenom
Phenom

In this case it is hard to tell from this bit of code,

 

what is not working and then of course how to solve.

 

Set a breakpoint at the "if" statement

 

and check the contents of "TimeDiff"

 

and  -later on- the "reserviert" attribute

Re: Waituntil for AbsSimTime

In my opinion the local variable TimeDiff should be of type time, not datetime. Perhaps that is the reason...

Re: Waituntil for AbsSimTime

Phenom
Phenom

@Andreas_SimPlan is right !

 

Datetime deltas turn out to a time format.

 

@Niks1

 The debugger must have opened to show the error.

Re: Waituntil for AbsSimTime

Legend
Legend

Hi @simulator, @Andreas_SimPlan

 

thanks for reply.. i change datatyp of Timediff as time.But it shows following error......wait timediff.PNG

 

More Description: This method assign in exit contol of source. and location of this method is in class library(.Klassen.MUs.Methods.m_OrderStartInSource).

 

thanks in advance

Re: Waituntil for AbsSimTime

You can not use the wait statement in a method in the class library. It doesn't know an eventcontroller.

But you could call  an instantiated "wait method" from you class method:

 

-- classmethod is exitcontrol, instantiated method is next to material flow object
?.~.m_waitmethod(TimeDiff)

and your wait method could then just wait:

param waittime : time

wait waittime