In other languages: Česky Deutsch Français Italiano 日本語 Polska Português do Brasil Русский 中文

Circuit network: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(Page entirely restructured and largely rewritten for clarity.)
Line 1: Line 1:
{{Languages}}
{{Languages}}
[[Circuit network]]s (CCNet) enables the control of devices based on the amount of [[Items]] and Fluids stored in all [[Chests]] and [[Storage tank|Storage tanks]] connected to the same network via red or green wires.
'''Circuit networks''' are built using red or green wire, and enable the control of some devices, based upon information broadcast onto the network by connected storage devices.  The information is broadcast onto a specific channel, based on the item or liquid the storage device contains.  Each circuit network contains a channel for every kind of item, as well as twenty extra [[Virtual signals]] which act as user-definable channels.


:[[File:InnerOfGreenCable.jpg|400px]]
:[[File:InnerOfGreenCable.jpg|400px]]
A more technical explanation is, that the circuit network is a standardized bus-system. '''See [[Automatic control/Smart bus|this explanation]].


Even if the circuit network looks quite different to the [[Logistic network]], the [[Automatic control/Smart bus|bus]] is principally the same beccause the information is the same. '''The basic difference between them is that, in a logistic network, everything which is covered by a roboport pops up as content, but in the circuit network only the connected chests and storage tanks were considered.
== Physical network structure ==
 
A circuit network consists only of those devices connected together with the same color wire.  Wire can be strung directly from device to device, or across any intervening power poles.
 
Note that each connected set of wires forms a separate network.  For example, it's entirely possible to have four red-wire networks and three green-wire networks.  Red and green networks will remain separate and do not link up if red and green wires happen to touch the same power pole or device.
 
* To connect wires to a power pole, drag the wire to the base of the pole.
* To erase a wire connection, drag the same color wire over an existing connection. 
* To remove '''all''' connections from a power pole, shift-click on the pole.  The first shift-click will remove all electrical connections, and the second will remove all red and green wires.
* When connecting to a [[Arithmetic Combinator]] or [[Decider Combinator]], take care to drag the wire to the correct input or output side.
 
== Broadcast Information ==
 
[[Smart chest|Smart Chests]] (and more advanced storage containers based on Smart Chests) and [[Storage tank|Storage Tanks]] broadcast the amount of [[Items]] or [[Fluids]] they contain.  Each amount is broadcast as a numeric value on a 'channel' corresponding to the item they contain.  For example, a Storage Tank containing 1000 Crude Oil will broadcast 1000 on the Crude Oil channel.
 
Multiple broadcasts of the same item or fluid are additive; if there are two connected Storage Tanks with 1000 Crude Oil each, the value of the Crude Oil channel will be 2000.
 
[[Combinators]] also broadcast their outputs (onto whatever channel is specified).
 
== Use of Information ==
 
[[Lamp|Lamps]], [[Smart inserter|Smart Inserters]], and pumps (both the [[Small Pump]] and the [[Offshore Pump]]), as well as Combinators  can use the information.
 
They can either compare results between different channels, or compare a channel to a specific value.  The pictured inserter works if the count of [[Iron plate|Iron plates]] is lower than the count of [[Steel plate|Steel plates]].
 
[[File:smart_inserter.png|thumb|250px|Example condition: "Work only if the count of Iron plates is lower than the count of Steel plates."]]
 
* [[Lamp|Lamps]] can be used as visible signal devices; for example, you could set a lamp to turn on when the number on the Coal channel drops below 1000.
 
* [[Smart inserter|Smart Inserters]] can switch on or off, altering the flow of items on conveyor belts; for example, you could cut off input into a factory making [[Science pack|Science Packs]] when you have collected a large enough buffer of them.
 
* [[Small pump|Small Pumps]] and [[Offshore pump|Offshore Pumps]] work the same way for fluids.
 
* '''Combinators''' take the broadcast information and perform more complex functions, broadcasting the results.
 
== Basic ==
 
[[File:circuit-network-example-1.png|thumb|256px|A basic circuit network usable to fill a chest with a defined amount of items.]]
 
The simplest network is to connect a smart inserter with a chest next to it, to control the amount of items in the chest.
(Note that you do not have to connect them using a power pole as the picture shows; you can connect them directly.)
 
== Combinators ==
 
Combinators allow more advanced functions to be used on a circuit network.
 
*The [[Constant Combinator]] broadcasts up to 15 values on any of the channels for whatever networks it is connected to.  (You cannot currently specify whether a value should be red or green; if you need different values, use two combinators, one for each color wire.)  You can use any item channel or any of the [[Virtual signals|Virtual signal]] channels.
**Note that using two of the 15 slots to broadcast values on the '''same''' channel is the same as broadcasting the sum of the two values from one slot.
 
*The [[Arithmetic Combinator]] performs arithmetic operations on input values and broadcasts the result to the specified output channel.  The input and output channels can be any item channel or any of the virtual signal channels.
** Connecting: The Arithmetic Combinator connects to a red or green network on its '''input''' side (the terminals are set into the main body and look like spark plugs) and performs an arithmetic calculation which is broadcast into the specified channel on its '''output''' side (the output wires appear to stretch out a bit from the body of the device).
** Feedback: Note that the input network and the output network '''are not the same network'''.  Connecting the output network back to the input network will result in a feedback loop.  For example, adding 1 to the value for Copper Plates and broadcasting it as Copper Plates is an action that results in an infinite loop if output is connected back to input.  The value for Copper Plates will rapidly (but not instantly) shoot upward.  This technique can be combined with Decider Combinator logic to make electronic clocks, gates, and other systems; see [[Combinator Tutorial]] for advanced techniques.
** Each:  This combinator can use the 'Each' signal for both input and output, in which case '''all''' non-zero input channels will have the combinator's operation performed and broadcast on the output side.  Having Each signals for input and output and using a non-changing operation (like adding zero) is equivalent to having a 'one-way' wire; all the information from the input network is copied to the output network, but the reverse is not true.
**Multi-network: The Arithmetic Combinator can be joined to both red and green networks on the input side and will sum their inputs.
 
*The [[Decider Combinator]] functions much like an Arithmetic Combinator, but is designed to compare values from red and green networks.  In terms of Connecting, Feedback, and the Each signal it functions as specified above.  In addition, it can handle the Everything and Anything signals, and performs more complex functions than summing when attached to multiple networks.  See the [[Decider Combinator]] page for more details on how to use this.
 
== Logistic Network ==
 
The Logistic network used by [[Logistic robot|Logistic Robots]] is essentially a third network (a wireless one), along with the green and red wired network.  The Logistic Network is based on proximity to a central [[Roboport]].  See [[Logistic network]] for more information.


== Items/Devices ==
== Items/Devices ==
Line 13: Line 71:
| {{imagelink|green-wire|Green wire}} || Wires used to connect smart devices to a green network.
| {{imagelink|green-wire|Green wire}} || Wires used to connect smart devices to a green network.
|-
|-
| {{imagelink|smart-chest|Smart chest}} || The most basic chest connectable to '''Circuit networks'''. Its content will be sent to the network.
| {{imagelink|smart-chest|Smart chest}} || The most basic chest connectable to a '''Circuit network'''. Its content will be sent to the network.
|-
|-
| {{imagelink|Provider-chest|Active Provider chest}} || A chest connectable to '''Circuit networks''' and participating in the [[Logistic network]]. Its content will be sent to the network.
| {{imagelink|Provider-chest|Active Provider chest}} || A chest connectable to a '''Circuit network''' and part of the [[Logistic network]]. Its content will be sent to the network.
|-
|-
| {{imagelink|Logistic-chest-passive-provider|Passive Provider chest}} || A chest connectable to '''Circuit networks''' and participating in the [[Logistic network]]. Its content will be sent to the network.
| {{imagelink|Logistic-chest-passive-provider|Passive Provider chest}} || A chest connectable to a '''Circuit network''' and part of the [[Logistic network]]. Its content will be sent to the network.
|-
|-
| {{imagelink|requester-chest|Requester chest}} || A chest connectable to '''Circuit networks''' and participating in the [[Logistic network]]. Its content will be sent to the network.
| {{imagelink|requester-chest|Requester chest}} || A chest connectable to a '''Circuit network''' and part of the [[Logistic network]]. Its content will be sent to the network.
|-
|-
| {{imagelink|storage-chest|Storage chest}} || A chest connectable to '''Circuit networks''' and participating in the [[Logistic network]]. Its content will be sent to the network.
| {{imagelink|storage-chest|Storage chest}} || A chest connectable to a '''Circuit network''' and part of the [[Logistic network]]. Its content will be sent to the network.
|-
|-
| {{imagelink|storage-tank|Storage tank}} || The storage tank is also connectable to '''Circuit networks''' (since ''v0.12''). Its fluid content will be sent to the network.
| {{imagelink|storage-tank|Storage tank}} || The storage tank is also connectable to a '''Circuit network''' (since ''v0.12''). Its fluid content will be sent to the network.
|-
|-
| {{imagelink|smart-inserter|Smart inserter}} || The only inserter connectable to '''Circuit networks''' and [[Logistic network]]s. The condition when the inserter is working is configurable in the menu.
| {{imagelink|smart-inserter|Smart inserter}} || The only inserter connectable to a '''Circuit network''' and the [[Logistic network]]. The condition when the inserter is working is configurable in the menu.
|-
|-
| {{imagelink|small-lamp|Lamp}} || The lamp is connectable to '''Circuit networks'''. The condition when the lamp is shining is configurable in the menu.
| {{imagelink|small-lamp|Lamp}} || The lamp is connectable to a '''Circuit network'''. The condition when the lamp is shining is configurable in the menu.
|-
|-
| {{imagelink|small-pump|Small pump}} || The small pump is connectable to '''Circuit networks'''. The condition when the pump is working is configurable in the menu.
| {{imagelink|small-pump|Small pump}} || The small pump is connectable to a '''Circuit network'''. The condition when the pump is working is configurable in the menu.
|-
|-
| {{imagelink|offshore-pump|Offshore Pump}} || The offshore pump is connectable to '''Circuit networks'''. The condition when the pump is working is configurable in the menu.
| {{imagelink|offshore-pump|Offshore Pump}} || The offshore pump is connectable to a '''Circuit network'''. The condition when the pump is working is configurable in the menu.
|-
|-
| {{imagelink|constant-combinator|Constant Combinator}} || The constant combinator is connectable to '''Circuit networks'''. You can set up to 15 signals in its GUI which will be sent to the network (like a chest that contains pseudo items). It has several outputs for red and green wires.
| {{imagelink|constant-combinator|Constant Combinator}} || The constant combinator is connectable to a '''Circuit network'''. You can set up to 15 signals in its GUI which will be sent to the network. It has several outputs for red and green wires.
|-
|-
| {{imagelink|arithmetic-combinator|Arithmetic Combinator}} || The arithmetic combinator is connectable to '''Circuit networks'''. It can perform mathematical operations (+, -, *, /) based on the amounts of the inputs signals (red and green wire signals are summed).
| {{imagelink|arithmetic-combinator|Arithmetic Combinator}} || The arithmetic combinator is connectable to a '''Circuit network'''. It can perform mathematical operations (+, -, *, /) based on the amounts of the input signals (red and green wire signals are summed).
|-
|-
| {{imagelink|decider-combinator|Decider Combinator}} || The decider combinator is connectable to '''Circuit networks'''. It acts like any signal controlled device. You can compare the input signals (red and green wire signals are summed) by using "less than", "bigger than" or "equal to". If the condition is true, it will output a configurable signal.
| {{imagelink|decider-combinator|Decider Combinator}} || The decider combinator is connectable to a '''Circuit network'''. It acts like any signal controlled device. You can compare the input signals (red and green wire signals are summed) by using "less than", "bigger than" or "equal to". If the condition is true, it will output a configurable signal.
|}
|}


== Basic ==
[[File:circuit-network-example-1.png|thumb|256px|A basic circuit network usable to fill a chest with a defined amount of items. '''Watch exactly, how the red wires are connected!''']]
The circuit network is often use to control the amount of certain items or fluids in the factory. Before the storage tank, lamp, small and offshore pump were included to the circuit network, the basic usage was to connect a smart inserter with a chest next to it to control the amount of items in the chest.
* To connect wires over long distances, you can use power poles by dragging the wire from the base of a pole to the target entity.
* To erase any wire connection, drag the same color wire over top an existing connection. 
* To remove all connections – including electrical – from power poles, shift-click on the pole.
* When connecting to [[Decider Combinator]] or [[Arithmetic Combinator]], take care to drag the wire to the correct input or outside side of the target entity.
== Advanced ==
[[File:circuit-network.jpg|256px|thumb|The picture shows a circuit network that contains over 42,000 coal and  12,000 iron plates.]]
The [[Automatic control/Smart bus|smart bus]] page explains the function of the bus.
There are several links into the forum (''outdated''):


=== Examples (''outdated'') ===
* [http://www.factorioforums.com/forum/viewtopic.php?f=5&t=3149 Forum article about the basic usage]
* [http://www.factorioforums.com/forum/viewtopic.php?f=5&t=3149 Forum article about the basic usage]
* [http://www.factorioforums.com/forum/viewtopic.php?f=9&t=696&p=24183#p24183 About comparison of the circuit wires with examples from the real world]
* [http://www.factorioforums.com/forum/viewtopic.php?f=9&t=696&p=24183#p24183 About comparison of the circuit wires with examples from the real world]* [http://www.factorioforums.com/forum/viewtopic.php?f=8&t=348 Logic Gates, Edge Detector]
 
=== Receivers ===
[[File:smart_inserter.png|thumb|250px|Example condition: "Work only if the count of [[Iron plate]]s is lower than the amount of [[Steel plate]]s." Instead of the steel plate you can use a constant value.]]
[[Smart inserter]]s, [[Lamp]]s, [[Small pump]]s and [[Offshore pump]]s are currently the only devices connectable to the circuit network. If a circuit condition is set, they only work if this condition is true.
When it is connected to the network, it is possible to set up the condition in three parts:
* Item or fluid. To check the condition, the amount of the given item or fluid in the connected circuit network is taken.
* Type of the condition: less than, bigger than, equal
* Item or fluid. To check the condition, the amount of the given item or fluid in the connected circuit network is taken.
Both values will be compared by using the given type of the condition.
 
=== Multiple networks ===
It is possible to establish multiple distinct networks of the same color. Just make sure that there is no wire connection between them and they will be treated as separate networks.
 
=== Examples (''outdated'') ===
* [http://www.factorioforums.com/forum/viewtopic.php?f=8&t=348 Logic Gates, Edge Detector]
* [http://www.factorioforums.com/forum/viewtopic.php?f=6&t=4728&p=37251#p37157 Logic gates revisited]
* [http://www.factorioforums.com/forum/viewtopic.php?f=6&t=4728&p=37251#p37157 Logic gates revisited]
* [http://www.factorioforums.com/forum/viewtopic.php?f=18&t=3211&p=23692#p23676 Evenly fill two item onto one lane]
* [http://www.factorioforums.com/forum/viewtopic.php?f=18&t=3211&p=23692#p23676 Evenly fill two item onto one lane]

Revision as of 09:38, 9 June 2016

Circuit networks are built using red or green wire, and enable the control of some devices, based upon information broadcast onto the network by connected storage devices. The information is broadcast onto a specific channel, based on the item or liquid the storage device contains. Each circuit network contains a channel for every kind of item, as well as twenty extra Virtual signals which act as user-definable channels.

InnerOfGreenCable.jpg

Physical network structure

A circuit network consists only of those devices connected together with the same color wire. Wire can be strung directly from device to device, or across any intervening power poles.

Note that each connected set of wires forms a separate network. For example, it's entirely possible to have four red-wire networks and three green-wire networks. Red and green networks will remain separate and do not link up if red and green wires happen to touch the same power pole or device.

  • To connect wires to a power pole, drag the wire to the base of the pole.
  • To erase a wire connection, drag the same color wire over an existing connection.
  • To remove all connections from a power pole, shift-click on the pole. The first shift-click will remove all electrical connections, and the second will remove all red and green wires.
  • When connecting to a Arithmetic Combinator or Decider Combinator, take care to drag the wire to the correct input or output side.

Broadcast Information

Smart Chests (and more advanced storage containers based on Smart Chests) and Storage Tanks broadcast the amount of Items or Fluids they contain. Each amount is broadcast as a numeric value on a 'channel' corresponding to the item they contain. For example, a Storage Tank containing 1000 Crude Oil will broadcast 1000 on the Crude Oil channel.

Multiple broadcasts of the same item or fluid are additive; if there are two connected Storage Tanks with 1000 Crude Oil each, the value of the Crude Oil channel will be 2000.

Combinators also broadcast their outputs (onto whatever channel is specified).

Use of Information

Lamps, Smart Inserters, and pumps (both the Small Pump and the Offshore Pump), as well as Combinators can use the information.

They can either compare results between different channels, or compare a channel to a specific value. The pictured inserter works if the count of Iron plates is lower than the count of Steel plates.

Example condition: "Work only if the count of Iron plates is lower than the count of Steel plates."
  • Lamps can be used as visible signal devices; for example, you could set a lamp to turn on when the number on the Coal channel drops below 1000.
  • Smart Inserters can switch on or off, altering the flow of items on conveyor belts; for example, you could cut off input into a factory making Science Packs when you have collected a large enough buffer of them.
  • Combinators take the broadcast information and perform more complex functions, broadcasting the results.

Basic

File:Circuit-network-example-1.png
A basic circuit network usable to fill a chest with a defined amount of items.

The simplest network is to connect a smart inserter with a chest next to it, to control the amount of items in the chest. (Note that you do not have to connect them using a power pole as the picture shows; you can connect them directly.)

Combinators

Combinators allow more advanced functions to be used on a circuit network.

  • The Constant Combinator broadcasts up to 15 values on any of the channels for whatever networks it is connected to. (You cannot currently specify whether a value should be red or green; if you need different values, use two combinators, one for each color wire.) You can use any item channel or any of the Virtual signal channels.
    • Note that using two of the 15 slots to broadcast values on the same channel is the same as broadcasting the sum of the two values from one slot.
  • The Arithmetic Combinator performs arithmetic operations on input values and broadcasts the result to the specified output channel. The input and output channels can be any item channel or any of the virtual signal channels.
    • Connecting: The Arithmetic Combinator connects to a red or green network on its input side (the terminals are set into the main body and look like spark plugs) and performs an arithmetic calculation which is broadcast into the specified channel on its output side (the output wires appear to stretch out a bit from the body of the device).
    • Feedback: Note that the input network and the output network are not the same network. Connecting the output network back to the input network will result in a feedback loop. For example, adding 1 to the value for Copper Plates and broadcasting it as Copper Plates is an action that results in an infinite loop if output is connected back to input. The value for Copper Plates will rapidly (but not instantly) shoot upward. This technique can be combined with Decider Combinator logic to make electronic clocks, gates, and other systems; see Combinator Tutorial for advanced techniques.
    • Each: This combinator can use the 'Each' signal for both input and output, in which case all non-zero input channels will have the combinator's operation performed and broadcast on the output side. Having Each signals for input and output and using a non-changing operation (like adding zero) is equivalent to having a 'one-way' wire; all the information from the input network is copied to the output network, but the reverse is not true.
    • Multi-network: The Arithmetic Combinator can be joined to both red and green networks on the input side and will sum their inputs.
  • The Decider Combinator functions much like an Arithmetic Combinator, but is designed to compare values from red and green networks. In terms of Connecting, Feedback, and the Each signal it functions as specified above. In addition, it can handle the Everything and Anything signals, and performs more complex functions than summing when attached to multiple networks. See the Decider Combinator page for more details on how to use this.

Logistic Network

The Logistic network used by Logistic Robots is essentially a third network (a wireless one), along with the green and red wired network. The Logistic Network is based on proximity to a central Roboport. See Logistic network for more information.

Items/Devices

Red wire Wires used to connect smart devices to a red network.
Green wire Wires used to connect smart devices to a green network.
Smart-chest.png
Smart chest
The most basic chest connectable to a Circuit network. Its content will be sent to the network.
Active Provider chest A chest connectable to a Circuit network and part of the Logistic network. Its content will be sent to the network.
Passive Provider chest A chest connectable to a Circuit network and part of the Logistic network. Its content will be sent to the network.
Requester chest A chest connectable to a Circuit network and part of the Logistic network. Its content will be sent to the network.
Storage chest A chest connectable to a Circuit network and part of the Logistic network. Its content will be sent to the network.
Storage tank The storage tank is also connectable to a Circuit network (since v0.12). Its fluid content will be sent to the network.
Smart-inserter.png
Smart inserter
The only inserter connectable to a Circuit network and the Logistic network. The condition when the inserter is working is configurable in the menu.
Lamp The lamp is connectable to a Circuit network. The condition when the lamp is shining is configurable in the menu.
Small pump The small pump is connectable to a Circuit network. The condition when the pump is working is configurable in the menu.
Offshore Pump The offshore pump is connectable to a Circuit network. The condition when the pump is working is configurable in the menu.
Constant Combinator The constant combinator is connectable to a Circuit network. You can set up to 15 signals in its GUI which will be sent to the network. It has several outputs for red and green wires.
Arithmetic Combinator The arithmetic combinator is connectable to a Circuit network. It can perform mathematical operations (+, -, *, /) based on the amounts of the input signals (red and green wire signals are summed).
Decider Combinator The decider combinator is connectable to a Circuit network. It acts like any signal controlled device. You can compare the input signals (red and green wire signals are summed) by using "less than", "bigger than" or "equal to". If the condition is true, it will output a configurable signal.


Examples (outdated)

See also