LinuxCNC Documentation

SYNOPSIS

loadrt toggle2nist [count=N|names=name1[,name2…​]]

DESCRIPTION

Toggle2nist can be used with a latching switch or push button to control a device that has separate on and off inputs and an is-on output. A debounce delay in cycles can be set for in. (default = 2) A maximum output pulse length in cycles can be set for on and off. (default = 100)

  • On a rising edge on pin in when is-on is low: It sets on until is-on becomes high.

  • On a falling edge on pin in when is-on is high: It sets off until is-on becomes low.

  • Pins on and off remain high until is-on confirms the respective state or until max-pulse-length is reached.

       ┐     ┌─────────────────────────────┐
in   : └─────┘                             └───────────────────────

       ┐     ┌───────────┐
on   : └─────┘           └─────────────────────────────────────────

       ┐                                   ┌───────────┐
off  : └───────────────────────────────────┘           └───────────

       ┐                 ┌─────────────────────────────┐
is-on: └─────────────────┘                             └───────────

FUNCTIONS

toggle2nist.N

PINS

toggle2nist.N.in bool in

toggle button in

toggle2nist.N.is-on bool in

current state of device

toggle2nist.N.debounce ui32 in (default: 2)

debounce delay for in-pin in cycles

toggle2nist.N.max-pulse-length ui32 in (default: 100)

max output pulse length

toggle2nist.N.on bool out

turn device on

toggle2nist.N.off bool out

turn device off

AUTHOR

Anders Wallin

LICENSE

GPL