Hello everyone, I would like to simulate piles of materials that are moved in the factory every X hours or at defined hours during the day. I tried to use an exit method with the "waituntil" function to unlock the exit of the Pile buffers at a defined time until the buffer is empty. In the example below, I would like to empty this buffer and morve the parts at 12:00:00.
?.exitlocked := false
?.exitlocked := true
However, the waituntil function does not work. Is there a better way to do it? What am I missing?
Thank you in advance for your help.
Solved! Go to Solution.
I would advice you to use the Generator, as Steffen_B said above, or the Trigger depending on your schedules. While the first one is easier to set up, the Trigger allows you to define a more complex schedule, and the both of them can be repeated periodically. If you have further questions about how to use them, they are well explained in the user's help.
In any case, you will have to define a method which will be executed at the desired time. This method could be something like the following:
waituntil myBuffer.Empty = true
Your example will not work due to different factors. The first one is that you can not watch the EventController simulation time. Even if that was possible, you will execute the method every time a part is exiting the buffer, thus creating and overload of suspended methods which may be executed without your control.
I always try to minimize the number of methods that will be executed at any time in the simulaton in order to make it more understandeble, easier to track and error-proof.
I hope it was helpful.