question

gilbert jerald avatar image
1 Like"
gilbert jerald asked Matt Long commented

how to limit the number of content in a conveyor?

in my model how to set he maximum content for the conveyor such that the conveyor carry only 3 item at a time , i have use process flow for this but it does not work123.fsm

Choose One
conveyor content
123.fsm (26.6 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Regan Blackett avatar image
5 Likes"
Regan Blackett answered Matt Long commented

@gilbert jerald

the approach to using Process Flow for this is, in my opinion, a good one, there is just a couple of pieces missing to make it work the way you want.

First it's important to keep in mind that there is no inherent link between the tokens in process flow and the flowitems or the Zone and the Conveyors; IE, even if the Zone is 'full' that won't keep flowitems from entering the objects without some additional activities. So that is the first thing we will need to add; a way to force flowitems to wait to enter the conveyor if the Zone is at capacity.

I would accomplish this by setting your Event Triggered Source to listen for the OnProcessFinish event of Processor3, On the Source activity we make sure to capture a reference to the item in the processor, by typing a label name (like item for example) next to the Process Item field in the Label Assignment table. Like this:

Follow the Source with a Custom Code activity that closes the output ports of the processor when the Zone has 3 tokens in it.

So whenever the Processor finishes a flowitem, it creates a token, if the Zone is already full, the Processor holds the Flowitem, and the token is kept out of the Zone due to the constraint on the Zone. The condition for checking the Zone content can be a little tricky, you can write it like this:

getstat(getactivity(processFlow, "Zone"), "Content", STAT_CURRENT, current) == 3

Next, the token enters the Zone, but needs to be kept in the Zone as long its corresponding flowitem is still on one of the conveyors. This means we need a Wait for Event activity, that listens for when flowitems leave either Conveyor1 or Conveyor10 (a single Wait for Event can listen to multiple events on multiple objects by clicking the Button and using the sampler to choose an object and an event.)

Under the 'Label Assignment/Matching' table set the item label to a 'match' operation. This way the only token that is released by the Wait for Event corresponds to the flowitem that actually caused the event. Like this:

You will now need to reopen the Output ports of the Processor when the Zone can accept a new Token. I would handle this with another Custom Code activity. Once the Processor has its ports reopened your token can exit the zone.

Here's an example model built in 16.2.1:

zone-conveyor-capacity.fsm


source.png (14.8 KiB)
button.png (821 B)
wait.png (24.7 KiB)
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Matt Long avatar image Matt Long commented ·

If you don't want to use the getstat() command, you could change the Process Flow to look like this:

Where the first Enter Zone has the Max Wait Timer checked with a Time value of No Wait. This will check to see if the Zone is at capacity, and if so, will release the token through connector 2 where it will close the processor's output ports and then wait for the Zone to be freed up.

The No Wait is important so the ports are closed before the item has a chance to exit the processor.

Once the token can enter the zone, you open the output ports on the processor and let the item onto the conveyor.

3 Likes 3 ·
nogetstat.png (40.6 KiB)
nogetstat.png (41.4 KiB)
enterzone.png (24.0 KiB)