DIGITAL INPUTS for status detection and button controls.
Properties
ENABLED
-
When set to YES the input is added to the Data table available for viewing and logging.
-
When set to NO the input is not added to the Data table and cannot be used.
PIN
Indicates the input pin name and number on the device connector.
LABEL
User editable channel label.
FUNCTION
Assigned data function to this channel.
PULL UP
On some Digital Inputs a PULL UP option is available. When enabled the Input will be pulled to +5V by a 1K resistor setting the default state of the input when no signal is connected to HIGH (1).
The PULL UP is typically enabled when button is connected to the input. When the button is pressed it connects the Input to Ground setting the Digital Input Level to LOW(1).
POLARITY
For button applications it is desired that the Digital Input value is HIGH(1) when the button is pressed and LOW(0) when depressed so the POLARITY is set to inverted.
CONFIGURATION
Digital/Button
· Can be used for detecting the status of an input signal. Refer to the device specifications for allowable voltage and trigger levels. For the fastest response the debounce time is set to 0.00s.
· Can be used normal push button input. When the button is pressed the output is 1, when depressed it is 0. A typical debounce time setting is 0.05s. When used with PULL UP enabled the POLARITY should be set to inverted.
Toggle
· Each time the button is pressed the output toggles from 0 to 1 or 1 to 0. A typical debounce time setting is 0.05s.
· When the button is held pressed the output toggles at a rate of 4 times the set debounce time.
Multistage Loop
· Each time the button is pressed the output increments by one until it reaches the set number of stages where it resets to 0. A typical debounce time setting is 0.05s.
· Example output for 4 STG LOOP: 0, 1, 2, 3, 0, 1, 2, 3, 0, 1...
· When the button is held pressed the output increments at a rate of 4 times the set debounce time.
Multistage Up-Down
· Each time the button is pressed the output increments by one until it reaches the set number of stages where it starts decrementing until it reaches 0 and then inverts direction again. A typical debounce time setting is 0.05s.
· Example output for 4 STG UP-DOWN: 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1...
· When the button is held pressed the output increments at a rate of 4 times the set debounce time.
DEBOUNCE s
LONG BUTTON HOLD DETECTION
An output that is enabled every time a button is held pressed for a desired amount of time can be setup using a math channel:
· Enable a digital input with a DIGITAL/BUTTON configuration so that it outputs 1 when the button is pressed and 0 when depressed.
· Enable a math channel with the following equation: ((tim['BUTTON',('BUTTON' - 1)]) > 200)
· In the example the math channel output will be 0 until the "BUTTON" is 1 for at least 2.00s. It will go back to 0 when the "BUTTON" is 0.
· You can set the desired hold down time in 0.01s units replacing the "200" number in the equation.