FB_ScaleAnalogHmi

FB_ScaleAnalogHmi 1:

Implements functions for scaling analog values with parameterization via the HMI.

Syntax:

FUNCTION_BLOCK FB_ScaleAnalogHmi EXTENDS FB_ScaleHmi

FB_ScaleAnalogHmi 2: Properties

Name

Type

Access

Initial value

Description

Name

STRING

Get, Set

<SourceName>

Specifies the name of the class instance.

FB_ScaleAnalogHmi

ScalingElectricalMax

LREAL

Get, Set

10.0

Maximum of the electrical voltage input.

ScalingElectricalMin

LREAL

Get, Set

0.0

Minimum of the electrical voltage input.

ScalingRawMax

LREAL

Get, Set

32767

Maximum of the raw analog measured value (bit).

ScalingRawMin

LREAL

Get, Set

0

Minimum of the raw analog measured value (bit).

ScalingValueMax

LREAL

Get, Set

100.0

Maximum of the scaled end unit.

ScalingValueMin

LREAL

Get, Set

0.0

Minimum of the scaled end unit.

UnitGroupElectrical

STRING(64)

Get, Set

‘‘

Physical quantity in which the electrical measurement is measured.

UnitGroupValue

STRING(64)

Get, Set

‘‘

Physical quantity in which the scaled end value is measured.

FB_Base

BaseState

E_BaseState

Get

eNotHandled

Initialization state of the class instance.

Error

BOOL

Get

FALSE

Class is in an error state.

ResultMessage

I_AppMessage

Get

-

Access to the class-internal EventLogger.

[PROTECTED] _Name

STRING

Get

<SourceName>

.Name without leading 'fb'.

FB_ScaleAnalogHmi 3: Methods

Name

Description

Reset()

Resets the error state of the class.

FB_ScaleAnalogHmi

ElectricalToRaw(fElectrical)

Scales the electrical voltage to the raw analog measured value (bit/numeric).

ElectricalToValue(fElectrical)

Scales the electrical voltage to the unit of the final scaling.

RawToElectrical(nRaw)

Scales the raw analog measured value (bit/numeric) to the electrical voltage.

RawToValue(nRaw)

Scales the raw analog measured value (bit/numeric) to the unit of the final scaling.

ValueToElectrical(fValue)

Scales the unit of the final scaling to the electrical voltage.

ValueToRaw(fValue)

Scales the unit of the final scaling to the raw analog measured value (bit/numeric).

FB_ScaleHmi

[PROTECTED] XtoY(...)

Scales a value x to a value y, using the minimum and maximum value of both scales.

FB_BaseHmi

Init(ipBase)

Default initialization method to pass the base class.

FB_ScaleAnalogHmi 4: Interfaces

Type

Description

I_Base

Standard interface on FB_Base.

I_ScaleAnalogHmi

Standard interface on FB_ScaleAnnalogHmi.

I_ScaleAnalogScalings

Interface to the scaling minima and maxima.

I_BaseHmi

Standard interface on FB_BaseHmi.

I_BaseEmpty

For extension without standard interface.

I_BaseDev

Covers all methods and properties of the base class.

Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT >= v3.1.4024.54 (recommended)
TwinCAT >= v3.1.4024.42 (required)

PC or CX (x64, x86)

Tc3_PlasticBaseApplication (>= v12.8.1.0)