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
NumberThe resulting numeric value: first input minus the sum of the remaining inputs.
πΉοΈ Controls
Input sizeA 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
Set the desired number of inputs using
Input size.Connect numeric sources (manual inputs, measurements, or other math blocks) to the provided
Numbersockets.Use the single
Numberoutput where you need the computed difference.
π‘ Tips and Tricks
Combine with
Number Inputwhen you want to provide manual values for quick tests or demonstrations.Use
Number Rangeto provide a pair of values (min/max) as inputs when testing threshold differences.Use
Roundafter this block to limit the number of decimals shown or stored.Use
Absoluteif 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
Scopeto plot live values.If your values come as lists or batches, consider pairing with
Get Elementto extract specific elements for subtraction.For aggregated arithmetic pipelines, combine with
Add,Multiply, orDivideblocks 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
Roundblock after this block to format the result to the desired decimal precision.
Last updated
Was this helpful?