Showing results for 
Search instead for 
Do you mean 
Reply
Solved! Go to solution

From Store to Drain

Hello
I have question

 

I have a situation where I use the STORE, the elements are transferred to it and collected and at the end of the process, several elements is in the STORE, which method should I use to have been transferred to the DRAIN?

 

Thanks for answer

3 REPLIES
Solution
Solution
Accepted by topic author Lucas
‎03-01-2016 07:34 AM

Re: From Store to Drain

Hello Lucas,

 

at first you must catch the event of the end of the process.

Maybe you use an observer for the number of MUs: NumMU.

 

Furthermore you need an attribute of the object Store, the value of the attribute is the state:

Emptying or Not emptying.

In the Reset method you set

 

Store.emptying := false;

 

The observer method has the program.

 

(attribute: string; oldValue: any)
is
do
wait 60; -- Processing time
if (NOT Store.emptying) AND Store.numMU < 5 then
return
end;

Store.emptying := true;

while Store.occupied loop
waituntil Drain.empty prio 10;
Store.cont.move(Drain);
end;

Store.emptying := false;
end;

 

Regards,

Peter

Re: From Store to Drain

Hello, 

 

i'm also a beginner and i'm facing kind of the same problem as Lucas.

I think your answer can save my day, Peter. Only I cannot find the attribute 'Emptying' as part of the Store you are talking about...

 

My problem is that my store does not release its items even though the exit control (i.e. for MUTarget setting) is all OK.

 

Thanks for your answer,

Stijn

Re: From Store to Drain

Hello Stijn,

 'Emptying' is a custom attribute. You must create it. Open the dialog of the object Store.

Goto the tab 'User-defined' and press button New. The data type is boolean.

 It seem to be that the move is not possible. The reason can be a failure of the Drain.

The move method has a result value. It is true if the movable element (the part) was moved to the object Drain.

if NOT Store.cont.move(Drain) then
debug;
end;

 If the move was impossible, the debugger is opened and you can look for the reason.

Regards,

Peter