AssertIsInRange

AssertIsInRange 1:

The AssertIsInRange method can be used to check whether the passed value (fActual) falls within a range, that is, between an upper and a lower limit. If this is not the case, a corresponding error message can be passed via the sMessage parameter.

Syntax

METHOD PUBLIC AssertIsInRange
VAR_INPUT
    fActual : LREAL;
    fLower : LREAL
    fUpper : LREAL;
    sMessage : STRING;
END_VAR

AssertIsInRange 2: Inputs

Name

Type

Description

fActual

LREAL

LREAL value to be compared with

fLower

LREAL

lower limit against which it is compared

fUpper

LREAL

upper limit against which the comparison is made

sMessage

STRING(255)

Error message to be passed

Sample:


AssertIsInRange (fActual:=<actual Value>,fLower:=<LowerBorder>, fUpper:=<UpperBorder>,sMessage:='Error message to be displayed in the client!');