Cancel
Showing results for 
Search instead for 
Did you mean: 

How to deal with the onexitcontrol?

Valued Contributor
Valued Contributor

Hello ,everyone

 

I have a problem, I will describe it in detail.As shown in the following picture with marks:

 

Firstly,the part goes to "L0" from source,As long as the "L0" has parts(L0.nummu>0), the part will move to "m1"  preferentially.

Secondly, the" entity1" goes to "PB" from source2,when the "L0" has no parts and the "m1" is empty (or not ocuppied). the part will move to "m1" from "PB"  .

However, the model cannot run like that above.What should I do ?

Looking forward to your suggestions!

Thank U!

 

 

 

 

捕获.JPG

2 REPLIES

Re: How to deal with the onexitcontrol?

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

since the exitControl is (normally) only called once, you need to wait for the condition to move the part e.g.

 

As long as the "L0" has parts(L0.nummu>0), the part will move to "m1"  preferentially.

 

--wait for your condition

waituntil L0.occupied=false or M1.occupied=false

--move

if L0.occupied=false then

   @.move(L0)

else

  @.move(M1)

end

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

Re: How to deal with the onexitcontrol?

Valued Contributor
Valued Contributor

Hi,Steffen_B

 

Thanks for your directions!

 the model can run smoothly as what I expect.

Give my best regards to you!