Cancel
Showing results for 
Search instead for 
Did you mean: 

Waituntil Variable=True OR 10 seconds

Valued Contributor
Valued Contributor

Hi,

In a method I want to wait until a Variable gets True and if the Variable doesn't get true within 10 seconds I want to continue the method anyway.

With other words I want to waituntil Variable=true OR 10 seconds, whichever comes first.

Is that possible?

 

Thank you!

 

 

2 REPLIES 2

Re: Waituntil Variable=True OR 10 seconds

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

you can observe eventController.simTime, so if you want to wait 10 seconds:

var t:time:=eventController.simTime+10

waituntil variable=true or eventController.simTime>=t

Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: Waituntil Variable=True OR 10 seconds

Valued Contributor
Valued Contributor

Thank you!! I thought the eventcontroller was not watchable, but I see now that it is.