FB_WG_Scaling

FB_WG_Scaling 1:

The function block FB_WG_Scaling is used for scaling raw values. The raw values can be scaled individually or as an array, for example as oversampling values.

The configuration structure is transferred with ST_WG_Scaling.

Syntax

Declaration:

fbScaling : FB_WG_Scaling(stConfig := ...)

Definition:

FUNCTION_BLOCK FB_WG_Scaling
VAR_INPUT
    stConfig        : ST_WG_Scaling;
END_VAR
VAR_OUTPUT
    bError             : BOOL;
    bConfigured        : BOOL;
    ipResultMessage    : I_TCMessage;
    eCalibrateState    : ULINT;
    tLastTare          : ULINT;
    fCurrentTareOffset : LREAL;
END_VAR

FB_WG_Scaling 2: Inputs

Name

Type

Description

stConfig

ST_WG_Scaling

Function block-specific configuration structure

FB_WG_Scaling 3: Outputs

Name

Type

Description

bError

BOOL

TRUE, if an error occurs.

bConfigured

BOOL

TRUE if the configuration was successful.

ipResultMessage

I_TCMessage

Interface that provides properties and methods for message handling.

eCalibrateState

E_WG_Calibrate

Current calibrate/tare state.

tLastTare

ULINT

Timestamp of the last Tare()/UpdateTareOffset() method call.

fCurrentTareOffset

LREAL

Updates itself with every Tare()/UpdateTareOffset() method call.

FB_WG_Scaling 4: Methods

Name

Definition location

Description

Configure()

Local

Loads a new (or initial) configuration structure.

Call()

Local

Calculates the output signal for a given input signal and configuration of the function block.

Reset()

Local

Resets internal states.

ApplyCalibration()

Local

Ends the calibration process.

CalibrateRefHigh()

Local

Triggers the fReferenceHigh calibration.

CalibrateRefLow()

Local

Triggers the fReferenceLow calibration.

Tare()

Local

Triggers the tare calibration.

UpdateTareOffset()

Local

Sets the tare offset value manually and updates the tLastTare/fCurrentTareOffset output.

FB_WG_Scaling 5: Properties

Name

Type

Access

Definition location

Initial value

Description

bTraceLevelDefault

BOOL

Get, Set

Local

TRUE

TRUE, if eTraceLevel = Warning

eTraceLevel

TcEventSeverity

Get, Set

Local

Warning

Severity of an event

nTimeStamp

ULINT

Get, Set

Local

0

Timestamp of the oldest input value of the next Call().

Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT v3.1.4024.50

PC or CX (x64, x86)

Tc3_Weighing