Data Wires

A Data Wire allows you to supply an input value for a programming block using an output value from another block in your program. This allows you to create interactions between blocks and create more complex behaviors for your robot.
Example
This program uses a Data Wire to connect the Light output from the Color Sensor block to the Power input of the Move Steering block. This will make the speed that the robot drives be determined by the light intensity that the Color Sensor detects. The process is repeated in a Loop so that the power is continuously updated based on new sensor readings.
Tips and Tricks
If you try the program above on a robot with the Color Sensor pointing downward near the ground, the robot’s speed will change as it drives over different colors.
Data Wire Types
Data Wires carry values from one block to another. Each Data Wire has a type, which is determined by the output type of the block at the start of the wire. This is also the type of the value carried by the Data Wire. See Data Types for more information on the different types.

Data Wires, block inputs, and block outputs have a different appearance depending on their type, as shown in the table below.
TypeBlock InputBlock OutputBlock Output Data Wire
Logic
Numeric
Text
Numeric Array
Logic Array
Creating a Data Wire
To create a data wire, drag from an output of a programming block to an input of another programming block, as shown in the steps below.
StepActionExample
1Start at a block output
2Drag left to right
3End at a block input
Tips and Tricks
The block with the output (the start of the Data Wire) must be before the block with the input (the end of the Data Wire) in the program.
The block output and the block input must have the same Data Type, or be compatible for a Data Wire Conversion.
A Data Wire will replace the input value that was entered directly into the block. In the example above, the Power input value of 50 is replaced by the Data Wire. The Move Steering block is now getting the Power input from the Data Wire.
Deleting a Data Wire
To delete a data wire, click the block input at the end of the data wire. The Data Wire will be deleted, and the input value that was entered directly into the block will be restored. Click the block input again to enter a new input value.
Using a Block Output for Multiple Data Wires
You can use the output of a block as the starting point for more than one Data Wire, as shown in the image below. To use an output again, simply drag another Data Wire.
Tips and Tricks
You cannot connect more input Data Wires to the same hub.
Data Wire Conversions
A Data Wire must connect a block output and a block input of the same type, or the types must be compatible for one of the automatic conversions allowed below.
From TypeTo TypeResult
Logic NumericFalse = 0
True = 1
Logic TextFalse = “0”
True = “1”
Logic Logic ArrayArray with one element
Logic Numeric ArrayArray with one element (0 or 1)
Numeric TextText representation of the number
(For example, “3.5”)
Numeric Numeric ArrayArray with one element
Logic Array Numeric ArrayArray of same size with elements equal to 0 or 1
Displaying Data Wire Values
If the EV3 brick is connected to your computer (by USB, Bluetooth, or Wi-Fi) when a program is running, you can display the value of a Data Wire while the program is running. To display a Data Wire value, simply position your mouse cursor over the Data Wire. The value will display in a small window near the Data Wire.
Example
In the program below, the Data Wire has a value of 30 at the time the image was taken. In this example, because the blocks are in a Loop, the value of the data wire can change each time the Color Sensor block executes. The display updates continuously to show the most recent value.
Tips and Tricks
Displaying Data Wire values can help you understand how your program is working. Looking for values that are different than you expect can help you find the cause of a problem in your program. For example, if you create the program above but accidentally use the Measure – Color mode of the Color Sensor instead of the Measure – Reflected Light Intensity mode, the Data Wire will only show values in the range 0-7 instead of the range 0-100 as expected (see Using the Color Sensor).
Data Wires
Quick links