Messaging Block

The Messaging Block is used to send Bluetooth Messages between EV3 Bricks. To send or receive a message, the EV3 Bricks must first be connected, either by the on-brick Bluetooth Menu or through the Bluetooth Connection block.

See the Bluetooth Connection block section for more information.


Message Title
Mode Selector
Inputs

Use the Mode Selector to select how you want the Messaging Block to work. After selecting the mode, you can choose values for the inputs. The inputs available will change depending on the mode. The modes and inputs are described below.
Messages are characterized by three components
1. The Bricks between which the message is being passed
2. The Message Title identifying the message
3. The Message value. This may be Text, Numeric or Logic
Messaging Modes
Send


The Send mode (Text, Numeric or Logic) sends a message by Bluetooth to a connected EV3 Brick. You can select which EV3 Brick to send the message to using the Receiving Brick Name input. The Message Title is used to uniquely identify the message being sent.
Receive


The Receive mode (Text, Numeric or Logic) receives a message by Bluetooth from a connected EV3 Brick. The Received Message output will be False until a message has been received. The message that is received is available from the Message output.

The Message Title is used to uniquely identify the message being received.
Example
An EV3 Brick (named Leo) collects a Color Sensor reading and sends it to another EV3 Brick (named Kim). Kim is waiting until a message is received. This message is then shown on its display.

Leo’s Program section




Kim’s Program section



The Message Title allows multiple streams of information to be sent between EV3 Bricks. For example, one brick might send messages named ‘Color’ and ‘Rotations’ within the same program.
Compare


The Compare mode (Text, Numeric, or Logic) compares the received message with an existing value. If the conditions are met, the Compare Result output is True. If the conditions are not met, the Compare Result output is False.

Numeric: The received message is compared to a threshold value according to one of the following logic operators.
Equal To (0)
Not Equals (1)
Greater Than (2)
Greater Than or Equal To (3)
Less Than (4)
Less Than or Equal To (5)
Text: The received message is compared to a comparison Text according to one of the following.
Equal To (0)
Not Equal To (1)
Logic: The received message is output in Compare Result
Inputs and Outputs
The inputs of the Messaging block control the details of how messaging will operate. You can enter the input values directly into the block. Alternatively, the values can be supplied by Data Wires from the outputs of other Programming Blocks. The inputs available and their functions depend on the mode you selected.
InputTypeNotes
Message Title Text
Receiving Brick Name TextIf this field is left empty your message will be broadcasted.
Message Text, Numeric, or Logic
Compare Type NumericComparison type for a Message Compare Mode with a Threshold Value or Comparison Text.
0: = (Equal)
1: ≠ (Not Equal)
2: > (Greater Than)
3: ≥ (Greater Than or Equal To)
4: < (Less Than)
5: ≤ (Less Than or Equal To)
Threshold Value Numeric
Comparison Text Text
The outputs available will depend on the mode selected. To use an output, use a Data Wire to connect it to another Programming Block.
OutputTypeNotes
Message Text, Numeric, or LogicResult of the comparison type
Compare Result Text, Numeric, or LogicResult of the comparison type
Messaging
Quick links