A wagon is used to transport items and can be filled and emptied like a chest, but with many more inserters at the same time. Up to 12 inserters per wagon are possible (from both sides). The Inserter item stack size is important to fill the wagon fast!
In manual-mode cargo wagons can only be filled or emptied when they are not moving and horizontally or vertically orientated. In automated-mode it is the same, but additionally they can only filled/empty, when stopped on a train-stop (not on a signal). A spot where inserters are prepositioned to transfer cargo for wagons is called a train station.
Wagons have a stack limitation option the same way chests do, which is useful if you need to limit the number of transported items for some reason.
Each stack in the cargo wagon can be filtered. This works in the same way as the quick bar (toolbelt); the default key to define or remove the filter is the middle mouse button.
This can be used to transport different items in one wagon. For example, you could transport both empty and full oil barrels in one wagon; at the train stations, the barrels would be handled using smart inserters for each kind of barrel. This is discussed in the forum thread Tired of babysitting expansions? Auto-supply w/ trains!.
A cargo wagon can be filled with 2000 items of ores (copper, iron, coal...) or 4000 items of processed plates (copper plates, iron plates, steel). This makes preprocessing your ores into plates (near the mines) a useful strategy, before you transport it to your factory. See Transport/Compress by Pre-production for a more detailed discussion of this concept.
Use as big chest
It is possible to use the cargo wagon as a "big chest": Place rails, put an unmoving wagon on it and inserters around. The advantages of this construction are:
- Cargo can be transferred with many more inserters than with a chest, bypassing the limitations of the inserter stack size bonus.
- Items are transported instantly over the length of the wagon. Correctly configured, this is faster than a transport belt.
For examples of this, see these forum threads:
- Solar panel factory
- Cargo wagon sourced RGB circuits production facility
- Mass production with ZERO belts and robots