Queue problem

All topics on the Atoms in any Enterprise Dynamics Library.
Post Reply
joseba92
Posts: 1
Joined: Wednesday 21 May, 2014 - 16:19

Queue problem

Post by joseba92 »

Good afternoon!
I am a student of the Universidad Pública de Navarra (Spain) and i am doing my final proyect and i need your Help.
After a productive process the products are stored in a queue and these are automatically going to the sink. I wonder if is there any atom that allows me to empty the store when it have 10 pieces.
Thank you!
Regards

Joseba
Nick
Posts: 48
Joined: Saturday 15 February, 2014 - 01:52

Re: Queue problem

Post by Nick »

Hi Joseba,

Based on your model description you don't need any additional atoms.
Enter the following code on the 'Trigger on Entry' of the Queue atom (the 'store'):

Code: Select all

Do(
   CloseOutput(c),
   if(
       Content(c) = 10,
       OpenOutput(c)
   )
)
Some remarks:
1. 'c' is the current atom; the atom the products enter; the queue
2. If the content of c is 10, the output channel of c is opened and all products in the queue are sent to the next atom
3. Every product that enters the queue closes the output channel. if the output channel is already closed then it stays closed

Regards, Nick
Post Reply