Configure

The method can be used at runtime to initially configure the weighing instance (if not already done in the declaration) or to reconfigure it.

If a weighing instance is not configured, the methods Call() and Reset()cannot be used.

Syntax

METHOD Configure := BOOL
VAR_INPUT
     stConfig := ST_WG_Weighing;
END_VAR

Configure 1: Inputs

Name

Type

Description

stConfig

ST_WG_Weighing

Configuration structure

Sample

(*Declaration without configuration*)
fbWeighing : FB_WG_Weighing();
(* initial configuration of fbWeighing *)
IF bInit THEN
    bSucceed := bWeighing.Configure(stConfig := stParams);
    bInit    := FALSE
END_IF

(* reconfigure fbWeighing on bReconfigure := TRUE *)
IF bReconfigure THEN
    stParams.nWindowLength := 50; (*change window length*)
    bSucceed         := fbWeighing.Configure(stConfig := stParams);
    bReconfigure     := FALSE;
END_IF

Configure 2: Return value

Name

Type

Description

Configure

BOOL

TRUE if the weighing instance was configured successfully.