Close output channel of warehouse atom by using GUI

All topics on the Atoms in any Enterprise Dynamics Library.
Post Reply
ute
Posts: 2
Joined: Thursday 17 January, 2013 - 14:33

Close output channel of warehouse atom by using GUI

Post by ute »

Dear ED Team,

I would like to build a GUI in order to be able to open and close 1 output channel of the warehouse atom (by clicking). The idea is that there are 2 output channels to begin with, which are each linked to a queue. How can I use the GUI to close one of the output channels before any product enters the warehouse?

Thank you very much for your time to look into it!
marlies
Posts: 301
Joined: Monday 17 January, 2011 - 09:28

Re: Close output channel of warehouse atom by using GUI

Post by marlies »

Hello,

Closing just one output channel is not recommended as the internal code of the atoms usually use the commands openalloc/closealloc which will overwrite your specific openoc and closeoc code.

It would be better to define the maximum number of channels available in a global variable or in a label on your warehouse atom.

Assume that you want to send the product to a random available output channel. The standard code to do this (see sendto strategy 4. A random open channel) is:

Code: Select all

IndexMax(NrOC(c), OCReady(Count,c)*Random(100000))
Instead of checking all outputchannels (nroc) of the warehouse you could adjust the code so that it only checks the number of channels you want. Assume you've got a label AvailableQueues on your warehouse, the code could look like this:

Code: Select all

IndexMax(Label([AvailableQueues],c) , OCReady(Count,c)*Random(100000))
So, if you want to adjust the available channels using a gui button, you can update the label AvailableQueues of your warehouse atom.

Regards, Marlies
Post Reply