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.

Loading preview …

Inputs

InputTypeAvailabilityDescription
aNumberDefaultFirst value in the formula.
bNumberDefaultSecond value in the formula.
c–jNumberOptionalAdditional 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

OperatorOperationExample
+Additiona + b
-Subtractiona - b
*Multiplicationa * b
/Divisiona / b

Output

OutputTypeDescription
F(x)NumberResult of the configured formula.

Example

To add three sensor values:

  1. Add input c with the + control.
  2. Connect the three values to a, b and c.
  3. Enter a + b + c in the F(x) field.
  4. 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.