# Level to pulse

Process

Converts a boolean level signal into a pulse. Generates a timed output pulse every time the input is true, even if it was already true. Useful for connecting stateful boolean outputs to pulse-triggered inputs.

Level to pulse
I
O

# Inputs

IDAbbrevNameTypeDefaultDescription
inputIInputBOOLEANfalseBoolean signal. Every true value triggers an output pulse, regardless of the previous state.

# Outputs

IDAbbrevNameTypeDefaultDescription
outputOOutputBOOLEANfalsePulse output. Goes high for the configured pulse duration each time the input is true.

# Configuration

IDNameTypeDefaultUnitDescription
pulse_durationPulse durationNUMBER0.1sDuration of the output pulse.

Details:

> 0

# Source Code

View Volang source
value = input::value()

extern fn onPulseEnd() {
    output::set("output", false)
}

if (value) {
    callback::clear()
    output::set("output", true)
    pulse_ms = math::round(config::get("pulse_duration") * 1000)
    callback::set(pulse_ms, "onPulseEnd")
}
Converts a boolean level signal into a pulse. Generates a timed output pulse every time the input is true, even if it was already true. Useful for connecting stateful boolean outputs to pulse-triggered inputs.