Math
The Math block calculates a numeric result from a formula. It starts with inputs a and b and can be expanded to a maximum of ten inputs, labelled a through j.
Inputs
| Input | Type | Availability | Description |
|---|---|---|---|
a | Number | Default | First value in the formula. |
b | Number | Default | Second value in the formula. |
c–j | Number | Optional | Additional values enabled with the add-input control. |
Each input accepts either a connected numeric value or a fixed number entered directly in the block. Use the + and − controls at the bottom of the block to add or remove inputs. The block always has at least two and at most ten inputs.
Formula
Enter the calculation in the F(x) field and refer to the inputs by their lowercase labels. The default formula is a + b.
Operators
| Operator | Operation | Example |
|---|---|---|
+ | Addition | a + b |
- | Subtraction | a - b |
* | Multiplication | a * b |
/ | Division | a / b |
Output
| Output | Type | Description |
|---|---|---|
F(x) | Number | Result of the configured formula. |
Example
To add three sensor values:
- Add input
cwith the + control. - Connect the three values to
a,bandc. - Enter
a + b + cin the F(x) field. - Connect the
F(x)output to the next block.
Validation and errors
- A formula may only reference inputs currently enabled on the block.
- All connected or fixed input values must be numeric.
- Division by zero does not produce a valid numeric result.
Related blocks
- Compare Values — compares two numeric values and returns a Boolean result.