Subtract

This function block performs subtraction across multiple numeric inputs. It is useful when you need to subtract several values from a single starting value (for example: initial value minus a list of offsets).

πŸ“₯ Inputs

  • Number (multiple) Accepts 2 to 20 numeric inputs. The first connected number is treated as the starting value; the remaining connected numbers are summed and subtracted from that starting value. Disconnected inputs are ignored.

Note: The total number of Number inputs can be changed with the block controls (see Controls).

πŸ“€ Outputs

  • Number The resulting numeric value: first input minus the sum of the remaining inputs.

πŸ•ΉοΈ Controls

  • Input size A dropdown that lets you choose how many numeric input sockets the block provides (values from 2 up to 20). Changing this updates the available input sockets immediately.

🎯 Features

  • Dynamic input count β€” easily adjust how many values you want to provide without adding or removing separate blocks.

  • Graceful handling of missing inputs β€” the block ignores inputs that are not connected so you can change wiring without causing errors.

  • Single numeric output β€” straightforward result suitable for further math, logging, or visualization.

βš™οΈ How it runs

When the block runs, it reads the connected numeric inputs, takes the first connected value as the base, sums all other connected values, and returns the difference (base minus sum of others). If some inputs are not connected, they are simply skipped.

πŸ“ Usage Instructions

  1. Set the desired number of inputs using Input size.

  2. Connect numeric sources (manual inputs, measurements, or other math blocks) to the provided Number sockets.

  3. Use the single Number output where you need the computed difference.

πŸ’‘ Tips and Tricks

  • Combine with Number Input when you want to provide manual values for quick tests or demonstrations.

  • Use Number Range to provide a pair of values (min/max) as inputs when testing threshold differences.

  • Use Round after this block to limit the number of decimals shown or stored.

  • Use Absolute if you need the magnitude of the difference regardless of sign (e.g., error magnitudes).

  • If you need to visualize changes over time, feed the result into Scope to plot live values.

  • If your values come as lists or batches, consider pairing with Get Element to extract specific elements for subtraction.

  • For aggregated arithmetic pipelines, combine with Add, Multiply, or Divide blocks before or after this block to create more complex formulas.

πŸ› οΈ Troubleshooting

  • Unexpected result sign: verify which input is connected to the first socket (this is used as the base value).

  • Missing inputs: if some inputs are not connected, they are skipped β€” ensure all required values are connected or provided.

  • Precision issues: add a Round block after this block to format the result to the desired decimal precision.

Last updated

Was this helpful?