FB_BA_SensorAnalog

FB_BA_SensorAnalog 1:

The function block MV, within the template, records an analog input value from an I/O bus terminal and converts it into a real process value.

FB_BA_SensorAnalog 2:

The initialization of the template takes place within the method FB_Init.

Block diagram

FB_BA_SensorAnalog 3:

Syntax

FUNCTION_BLOCK FB_BA_SensorAnalog EXTENDS FB_BA_View
VAR_INPUT CONSTANT
  MV               : FB_BA_AI_Raw;
END_VAR
VAR_OUTPUT
  fPresentValue    : REAL;
  bEvent           : BOOL;
  eEventState      : E_BA_EventState;
END_VAR

FB_BA_SensorAnalog 4: Inputs CONSTANT

Name

Type

Description

MV

FB_BA_AI_Raw

Analog input object for displaying a process value.

FB_BA_SensorAnalog 5: Outputs

Name

Type

Description

fPresentValue

REAL

Current value of the analog input object MV for displaying a process value.

bEvent

BOOL

A TRUE indicates that an event is pending.

eEventState

E_BA_EventState

Outputs the event state of the analog input object MV.

Requirements

Development environment

Necessary function

TwinCAT from v3.1.4024.35

TF8040 | TwinCAT Building Automation from V5.0.0.0