Table of Contents

DigitalInput

Namespace
ZEquipment
Extends
Inherited Properties
Inherited Methods
Implements

This function block represents a single digital input. It includes a boolean located variable, which may be linked to a terminal. The instance can be used as is, but it is benefical to specify the following traits

  • logic (defaults to Normal, which can either be Normal (value in the PLC is the same as on the terminal) or Inverted (value in the PLC is the negation of the value on the terminal).
  • trigger logic (defaults to Normal)
  • logging (not necessary but can be useful sometimes)
  • the name of this digital input
  • simulation mode (defaults to TRUE). If simulation is enabled this function block controls an internal held state variable, which is manipulated instead of the located variable on a fieldbus terminal.
Note

By default instances are simulated. In order to make use of a physical terminal, the method SetSimulation(on:=FALSE) has to be called.

FUNCTION_BLOCK DigitalInput EXTENDS ZEquipment.Digital IMPLEMENTS ZEquipment.IDigital, ZCore.ITrigger

Properties

Simulation

By default all digital interfaces that extend from this function block are simulated, to disable simulation mode this can be done by changing this property. Usually, the decision if simulation is used, takes places during initialization phase. However, some applications require to switch between these modes on-the-fly. In the latter case simply call this method at any time.

PROPERTY Simulation : BOOL

Property Value

BOOL

Methods

EnableImpl

This method implements the actual logic behind Enable and may be overloaded by extensions of this function block. If the digital input is set to simulation mode this method is actually changing the state of an internally held state variable. If the simulation mode is disabled, inputs can't be written to and no action is performed.

METHOD PROTECTED EnableImpl (
 on : BOOL)

Inputs

on BOOL