Cancel
Showing results for 
Search instead for 
Did you mean: 

Shared ressources and waituntil

Builder
Builder

Hi guys,

 

I've a problem with my code using waituntil.

I have 2, single proc, using the same method, containing :

[...]

waituntil ("Condition = A" and SharedTrolley.occupied) prio 1;

Condition = B;

[...]

 

I use it that way because i need to make a reservation for the use of a trolley when the trolley is back and full. 2 single procs share the same trolley.

 

-> But, when the 2 single proc are at the same step of the method, and are both waiting for the waituntil conditions, when the conditions are true, i think that both are passing the next step of the method.

But, it's generating problems because only one can use the shared ressource !

 

I need that only the singleproc which is waiting for the longest time skip the waituntil statement....

How to modify my code in order to do this ?

4 REPLIES

Re: Shared ressources and waituntil

Siemens Phenom Siemens Phenom
Siemens Phenom

I think you are wrong. If you use waituntil, only 1 Method will wake up. If you want both Methods to wake up, you would have to write stopuntil.

_________________________________________________________________
Did you like the answer? Then click the Thumbs Up button.
Did the answer solve your problem? Then accept the answer as solution.

Re: Shared ressources and waituntil

Builder
Builder

So, if 2 instances of the same method are waiting at the same waituntil (same priority), and the waituntil conditions become true.

If at the next step (after the waituntil), the method makes the condition to be false, only one instance will wake up ?

The instances don't simultaneously wake up  when the conditions became true ?

Re: Shared ressources and waituntil

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

the methods will wake up one after another and after each method(instance) the condition is checked anew, check the example, look at the @ (actual MU).

 

 

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

Re: Shared ressources and waituntil

Builder
Builder

ok !

 

I can't see the model you made for me 'cause i'm still with the 12.0.3 version of plant. But i now understand the concept.

 

Thanks a lot you two !