FB_WG_Scaling
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
Outputs
Name | Type | Description |
---|---|---|
bError | BOOL | TRUE, if an error occurs. |
bConfigured | BOOL | TRUE if the configuration was successful. |
ipResultMessage | Interface that provides properties and methods for message handling. | |
eCalibrateState | Current calibrate/tare state. | |
tLastTare | ULINT | Timestamp of the last Tare()/UpdateTareOffset() method call. |
fCurrentTareOffset | LREAL | Updates itself with every Tare()/UpdateTareOffset() method call. |
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. |
Properties
Name | Type | Access | Definition location | Initial value | Description |
---|---|---|---|---|---|
bTraceLevelDefault | BOOL | Get, Set | Local | TRUE | TRUE, if eTraceLevel = Warning |
eTraceLevel | 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 |