Setting the condition in the stack inserter to 'A=1':
When both items are low – The inserter is seeing 'A' with a value of '2'. Condition is False. Will never activate.
and
When one item is low – The inserter is seeing 'A' with a value of '1'. Condition is True. Which item?
The inserter doesn't know which item is low.
Over time the wagon would become clogged with one item because there is no distinction between items.
Setting the condition in the stack inserter to 'A>0':
When both items are low – The inserter is seeing 'A' with a value of '2'. Condition is True.
Both items are required. How many of each item is required? Which item is lower?
Which item has reached a D/C's condition?
Over time the wagon would become clogged with one item because there is no distinction between items.
and
When one item is low – The inserter is seeing 'A' with a value of '1'. Condition is True. Which item is low?
The inserter doesn't know which item is low.
Again over time the wagon would become clogged with one item because there is no distinction between items.
When the stack inserter condition is true it removes from the chest the item that is at the end of the stacks not necessarily the item that is required.
If that particular item is replenished into the chest faster than the stack inserter can insert into the wagon then that item will always be put into the wagon.
Even just setting filters as I suggested has it's drawbacks as well.
Because the D/C's are set to output when an item is low, when a train isn't at the stop the D/C's are detecting no items
so they output, which activates the inserter, when the train arrives again the inserter performs one cycle and inserts a
particular item(quantity equivalent to the current stack filter inserter or filter inserter researched stack bonus)into the
wagon even if that item isn't lower than the value set to be detected in a D/C.
Over time the wagon would become clogged with one item.
The only way around it is to isolate the inserter from the D/C's until the train is parked at the stop (in automatic mode).
Now that trains have a unique ID number (don't know what version of Factorio it was implemented) that is greater
than '1' after the first train is placed (with a default letter of 'T') we can set a D/C to 'T>1' output 'T' with 'Input count'
selected. Wired exactly the same as the D/C's that detect the contents of the wagon.
'Read stopped train' has to be selected in the stop so the train ID is outputted.
Another D/C set to 'Anything>1' output 'Everything' with '1' selected is then used that isolates the inserter from the
D/C's that are detecting the train ID and the quantity and type of item in the wagon.
Only when a train arrives at the stop (that has an ID of '2' or higher) does the 'Anything>1' output 'Everything' become True.
Allowing the output from the D/C's to get to the inserter.
Now items will not be inserted into the wagon when a train returns unless items are low, even if the train is set to manual mode at the stop.
If the train you are using is your first train and it's the first time it has been placed it will have an ID of '1'.
Pick it up and place it again it should now have an ID of '2'. Any train placed from now on will not use the ID of '1'.
The following images hopefully are clear enough to see how to set up what I just explained.
- Train Stop-H.jpg (447.8 KiB) Viewed 6672 times
- Train Detector-H.jpg (325.94 KiB) Viewed 6672 times
- Inserter Isolator-H.jpg (324.96 KiB) Viewed 6672 times