Change Pulse

Monitors an input value (like a Slider) and outputs a True pulse (imitating a button) whenever the data changes.

Utilities Nickname: Pulse

Overview

Monitors an input value (like a Slider) and outputs a True pulse (imitating a button) whenever the data changes.

Inputs (1)

  • Data (Generic): Data to monitor (e.g., a Number Slider).

Outputs (1)

  • Pulse (Boolean): Outputs True for one solution when Data changes, then resets to False.

Method, assumptions and simplifications

The same notes appear in the component's Info output.

Method

  1. Compares the text form (ToString) of Data with the value stored at the previous solution; with a list input, each item is compared with the item at the same index in the previous solution.
  2. If it differs from the stored value, or Data becomes empty or returns after being empty, Pulse is True and a new solution is scheduled 5 ms later, in which Pulse returns to False.
  3. The first value after the file opens or the component is placed only initialises the memory and does not pulse.

Assumptions

  • The text form of the data changes when the data changes; true for numbers, text and booleans.

Simplifications and limits

  • Geometry is compared by its text form, which is usually just the type name, so geometry edits are not detected.

Workflow

  • Number Slider or Value List -> Data; Pulse -> a Save or Export button input.