Count items on the belt?

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
MeyerX
Manual Inserter
Manual Inserter
Posts: 3
Joined: Tue Nov 21, 2017 1:30 pm
Contact:

Count items on the belt?

Post by MeyerX »

New Player here, yeah!!

I come from the wiki and the FAQ and I'm unsure about this one thing right now: Belts and the wire Network, there seems to be no direct way to know how many items are on a belt? The Network only knows about chests? Is that correct?

What confuses me is the tooltip shown here in the Picture that says "items on the belt". So I expect the number at the moment to be 10 (or '4' in the second pic). But the connected inserter above continues to place items on the belt although it should only be enabled if "iron plates < 1" - (belt empty)

Whats up with counting items on a belt, i.e. to achieve a max. certain number of items going around?
belt-limit-1.jpg
belt-limit-1.jpg (397.96 KiB) Viewed 55259 times
belt-limit-2.jpg
belt-limit-2.jpg (389.63 KiB) Viewed 55259 times
thanks
ratchetfreak
Filter Inserter
Filter Inserter
Posts: 952
Joined: Sat May 23, 2015 12:10 pm
Contact:

Re: Count items on the belt?

Post by ratchetfreak »

The reader only looks at the belt segment it is on. The item will move way from the reader and let the inserter activate again.

The inside of a corner belt is a very small space to put items, so the belt needs to be pretty saturated to stop the inserter inserting.
Zavian
Smart Inserter
Smart Inserter
Posts: 1649
Joined: Thu Mar 02, 2017 2:57 am
Contact:

Re: Count items on the belt?

Post by Zavian »

Read belt contents read the contents that particular piece of belt. If you want the contents of the multiple pieces of belt you need to wire each individual piece into the circuit network.

Edit: It's also possible to wire up the inserters adding/removing things from a belt, and using that and some combinators, calculate how many items are on the belt that way
Last edited by Zavian on Tue Nov 21, 2017 2:45 pm, edited 1 time in total.
Engimage
Smart Inserter
Smart Inserter
Posts: 1069
Joined: Wed Jun 29, 2016 10:02 am
Contact:

Re: Count items on the belt?

Post by Engimage »

As it was said. Circuit connector on a belt operates only on the tile it is on. So it will read the contents on this particular belt tile which can hold maximum of 8 items when fully saturated. Also if you want to stop the belt it will stop only this tile allowing rest of the belts move freely and items will just stop right before this belt piece like it is not there.

With inserters be aware that it makes its decision on making its move BEFORE it moves and it will not stop if its condition has become false while doing so. This can lead to undesirable result for you as you are using burner inserter in this case which is painfully slow.

If you need to count items on all the belts on a certain path you have to make circuit connections on them all chain connecting them up to your inserter.
User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: Count items on the belt?

Post by impetus maximus »

as Zavian said, you can use combinators to keep track of the belt's contents.
have the inserters that are placing/picking set to 'read hand contents' 'pulse'.
wire the inserter placing to the belt, to the input of an arithmetic that's set to *each +0 *each.
wire the output of that combinator to it's own input (making a memory cell).

wire the inserter taking from the belt (again read/pulse on the inserter) to a second arithmetic combinator
set to *each *(mulitply) by -1 so it subtracts what is taken from the belt.
then wire it to the 'memory cell's' input.
belt.count.png
belt.count.png (207.42 KiB) Viewed 55238 times
*Nixie Tube Mod use for the numbers shown (not used in blueprint)
mouse over the poll to see the item count.
0.15.37 blueprint string
you can then track what is currently on the belt.
since it uses *each it can track multiple types of items with a single memory cell.

[edit] of course this is kind of a bad example since the burner inserters will count the fuel they used. :lol:
MeyerX
Manual Inserter
Manual Inserter
Posts: 3
Joined: Tue Nov 21, 2017 1:30 pm
Contact:

Re: Count items on the belt?

Post by MeyerX »

PacifyerGrey wrote: Circuit connector on a belt operates only on the tile it is on.

Ok, I was afraid that this would be the actual case here. So I have to implement my Loop differently.

Nice example @Impetus maximus, thanks
User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: Count items on the belt?

Post by impetus maximus »

you're welcome. :)
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Count items on the belt?

Post by Optera »

Check out Siggboys rolling average for belt throughput. viewtopic.php?f=193&t=29679
Jap2.0
Smart Inserter
Smart Inserter
Posts: 2382
Joined: Tue Jun 20, 2017 12:02 am
Contact:

Re: Count items on the belt?

Post by Jap2.0 »

In an example like that, you could also wire the entire belt. I realize that it might not work well on a larger scale, but in a small loop like this it should work.
There are 10 types of people: those who get this joke and those who don't.
Bauer
Filter Inserter
Filter Inserter
Posts: 349
Joined: Fri May 05, 2017 12:48 pm
Contact:

Re: Count items on the belt?

Post by Bauer »

I use a similar setup for a science sushi belt:

Connect the 10 belt segments before the inserter to the inserter. Set condition to "xy < 10".That works pretty well if it's not important how many items are exactly on the loop. I do this with 6 inserters for 6 differnt science packs. On 10 segments fit 70 items. That leaves 10 open spaces which suffices to avoid a jam.
mrvn
Smart Inserter
Smart Inserter
Posts: 5925
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Count items on the belt?

Post by mrvn »

Bauer wrote:I use a similar setup for a science sushi belt:

Connect the 10 belt segments before the inserter to the inserter. Set condition to "xy < 10".That works pretty well if it's not important how many items are exactly on the loop. I do this with 6 inserters for 6 differnt science packs. On 10 segments fit 70 items. That leaves 10 open spaces which suffices to avoid a jam.
I did the same for a sushi science belt with a twist. Have a loop with fast transport belts (red) and all the science labs. Then at one end wire up 10 segments like you did, then one yellow transport belt and then the inserters. The yellow transport belt slows down the loop, causing unused science packs to collect before it. Hopefully there aren't many since the science labs should be using most of them before that point.

This gives a better count of what is on the belt in excess and allows other science packs to be inserted inbetween them. For example when you switch to something requiring only red science and 70 green science packs collect before the yellow transport belt then after the inserters you will have 50% green science packs on the loop and up to 50% red science packs depending on your inserter speed and number.
Bauer
Filter Inserter
Filter Inserter
Posts: 349
Joined: Fri May 05, 2017 12:48 pm
Contact:

Re: Count items on the belt?

Post by Bauer »

mrvn wrote:
Bauer wrote:I use a similar setup for a science sushi belt:

Connect the 10 belt segments before the inserter to the inserter. Set condition to "xy < 10".That works pretty well if it's not important how many items are exactly on the loop. I do this with 6 inserters for 6 differnt science packs. On 10 segments fit 70 items. That leaves 10 open spaces which suffices to avoid a jam.
I did the same for a sushi science belt with a twist. Have a loop with fast transport belts (red) and all the science labs. Then at one end wire up 10 segments like you did, then one yellow transport belt and then the inserters. The yellow transport belt slows down the loop, causing unused science packs to collect before it. Hopefully there aren't many since the science labs should be using most of them before that point.

This gives a better count of what is on the belt in excess and allows other science packs to be inserted inbetween them. For example when you switch to something requiring only red science and 70 green science packs collect before the yellow transport belt then after the inserters you will have 50% green science packs on the loop and up to 50% red science packs depending on your inserter speed and number.
That's a neat idea. I use blue belts for max throughput, though. I just don't want things to slow down. (Things tend to be too small, too slow, too little in factorio too quickly anyway.)
As long as all labs are working, there is no danger for a dead-lock situation anyway. But you will run short of one kind of science packs sooner or later. It's then when it's important to have sufficiently gaps on the belt once the missing packs come again. With blue belts you need stack inserters. I recomment to carefully adjust the stack size and use a splitter to forge the new science packs into the loop. The same splitter can be used for lane balancing.
mrvn
Smart Inserter
Smart Inserter
Posts: 5925
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Count items on the belt?

Post by mrvn »

Bauer wrote:
mrvn wrote:
Bauer wrote:I use a similar setup for a science sushi belt:

Connect the 10 belt segments before the inserter to the inserter. Set condition to "xy < 10".That works pretty well if it's not important how many items are exactly on the loop. I do this with 6 inserters for 6 differnt science packs. On 10 segments fit 70 items. That leaves 10 open spaces which suffices to avoid a jam.
I did the same for a sushi science belt with a twist. Have a loop with fast transport belts (red) and all the science labs. Then at one end wire up 10 segments like you did, then one yellow transport belt and then the inserters. The yellow transport belt slows down the loop, causing unused science packs to collect before it. Hopefully there aren't many since the science labs should be using most of them before that point.

This gives a better count of what is on the belt in excess and allows other science packs to be inserted inbetween them. For example when you switch to something requiring only red science and 70 green science packs collect before the yellow transport belt then after the inserters you will have 50% green science packs on the loop and up to 50% red science packs depending on your inserter speed and number.
That's a neat idea. I use blue belts for max throughput, though. I just don't want things to slow down. (Things tend to be too small, too slow, too little in factorio too quickly anyway.)
As long as all labs are working, there is no danger for a dead-lock situation anyway. But you will run short of one kind of science packs sooner or later. It's then when it's important to have sufficiently gaps on the belt once the missing packs come again. With blue belts you need stack inserters. I recomment to carefully adjust the stack size and use a splitter to forge the new science packs into the loop. The same splitter can be used for lane balancing.
Or you can use belts to side feed science packs and wire them to stop when the counting segments show > 10 items already. But be sure to use slower belts so one type doesn't fully saturate the loop.
User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: Count items on the belt?

Post by impetus maximus »

<off topic> what is wrong with long handed inserters for science? :?
or belt weaving if you are feeling hackish? :P
mrvn
Smart Inserter
Smart Inserter
Posts: 5925
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Count items on the belt?

Post by mrvn »

impetus maximus wrote:<off topic> what is wrong with long handed inserters for science? :?
or belt weaving if you are feeling hackish? :P
7 science packs, 2 sides per belt, 2 belts, you do the math.

I have a loop with science packs feeding into science labs. Then 4 more rows of science labs that feed from the previous row. So putting 2 belts on each side of the labs is impractical. Makes for a very compact science setup.
Bauer
Filter Inserter
Filter Inserter
Posts: 349
Joined: Fri May 05, 2017 12:48 pm
Contact:

Re: Count items on the belt?

Post by Bauer »

mrvn wrote:
impetus maximus wrote:<off topic> what is wrong with long handed inserters for science? :?
or belt weaving if you are feeling hackish? :P
7 science packs, 2 sides per belt, 2 belts, you do the math.

I have a loop with science packs feeding into science labs. Then 4 more rows of science labs that feed from the previous row. So putting 2 belts on each side of the labs is impractical. Makes for a very compact science setup.
Well, you can do 3 belts, and underground belts to access the far side with long handed inserters. 3 time 2 is still not 7.
Belt weaving forces you to use red and/or yellow belts. I hate this slow stuff. Have you seen a yellow belt moving at 13 UPS? I have no such patience.

On the other hand. Due to UPS limitation I switched to bot logistics for science a while ago.
If you want a resource efficient mathod, go for the sushi belt.
User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: Count items on the belt?

Post by impetus maximus »

Bauer wrote: If you want a resource efficient mathod, go for the sushi belt.
or cart it in. :P
cart science belt
sparr
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: Count items on the belt?

Post by sparr »

I wrote this viewtopic.php?f=93&t=25959 many versions ago. It became mostly obsolete when they added the option to directly read one belt tile to the circuit network, so I stopped updating it. Also because they never added an easy way to find all the connected belts, so 99% of the mod code is just the "follow the belt network and update a cache of connected belts" part and I hated debugging that part.
Post Reply

Return to “Gameplay Help”