FB_BA_LastWriterWins_R04

FB_BA_LastWriterWins_R04 1:

The function block switches the input value fInxx at output fQ that changed last.

The output nActInput shows which input is currently being output.

As long as nothing changes on the function block (the PLC has just started) and all inputs are set to "0", "0" is also output at the outputs fQ and nActInput.

If several inputs change simultaneously in a PLC cycle, the input with the lower ordinal number has priority, e.g.: fIn01 before fIn02.

FB_BA_LastWriterWins_R04 2: Inputs

VAR_INPUT
  aFIFO          : Array [1..8] OF UDINT;
  fIn01…fIn08    : REAL;
END_VAR

Name

Type

Description

fIn01…fIn04

REAL

Input values.

FB_BA_LastWriterWins_R04 3: Outputs

VAR_OUTPUT
  fQ           : REAL;
  nActInput    : USINT;
END_VAR

Name

Type

Description

fQ

REAL

Output value.

nActInput

USINT

Indicates which input value is currently being output.

Requirements

Development environment

Required PLC library

TwinCAT from v3.1.4024.55

Tc3_BA2 from v5.3.19.0