5.1.42. Digital input (pdx_DigitalInput)

Output the state of a digital input pin after debounce logic.

5.1.42.1. Supported targets

M110-000, M110-000, M220-000, M220-0AU, M220-000, M220-0AU, M221-000, M221-000, M250-000, M250-000, M460-000, M460-000, M461-000, M461-000, M670-000 and M670-000

5.1.42.2. Required license

None (Main library). (See Section 2.3, “Licensed Features”.)

5.1.42.3. Description

The digital input block reads a raw input digital value of 0 if the pin identified by the mask parameter Channel is at a logic low state or 1 if the pin is at a logic high state. The block is also capable of inverting and debouncing a signal.

If the mask parameter inversion is set to 1 then a logical NOT operation is applied to the input value before further processing. Otherwise it is passed through unchanged.

Debouncing can be achieved by setting mask parameters Set dead time and Reset dead time. On the first iteration of the block, the debounced_state outport is set to the value of the digital input (or the sim_state inport under simulation).

5.1.42.4. Inports

  • sim_state

    Only used in simulation. when the model is simulated, the outport debounced_state is set to the value of this inport.

    Range: 0 or 1

    Value type:Boolean
    Calibratable:No

5.1.42.5. Outports

  • debounced_state

    1 if the raw input digital value has been high for at least Set dead time, 0 if the raw input digital value has been low for at least Reset dead time.

    Range: 0 or 1

    Value type:Boolean
    Calibratable:No

5.1.42.6. Mask parameters

  • Channel

    The channel pin for this digital input.

    Value type:List
    Calibratable:No
  • Inversion

    If inversion is ticked then a logical NOT operation is applied to the input value before further processing.

    Value type:Boolean
    Calibratable:No
  • Set dead time

    The time the input will have to be high, before the block switches its output from 0 to 1. A value of zero is acceptable. A negative value has the same effect as a zero value.

    Value type:Real
    Calibratable:Yes, offline and online
  • Reset dead time

    The reset dead time is the time the input will have to be low, before the block switches its output from 1 to 0. A value of zero is acceptable. A negative value has the same effect as a zero value.

    Value type:Real
    Calibratable:Yes, offline and online
  • Sample time

    The periodicity of the block execution.

    Range: [0.001, 3600] seconds

    Value type:Real
    Calibratable:No
  • Provide simulation input?

    Tick to enable inport sim_state.

    Value type:Boolean
    Calibratable:No

5.1.42.7. Notes