Skip to main content

valueIsInRangeOf

Short summary​

This assertion method checks if the current value is inside a limit

Attention: limits are included: valueIsInRangeOf(t#3ms,t#3ms ,t#3ms) is a true assertion

Parameters​

NameTypeCommentKind
lowerLimitTIMElower limit for the current valueinput
currentValueTIMEcurrent value to checkinput
upperLimitTIMEupper limit for the current valueinput
messageAssertMessagemessage if the assertion is falseinput

Code​

Declaration​

METHOD valueIsInRangeOf
VAR_INPUT
(* lower limit for the current value *)
lowerLimit :TIME;
(* current value to check *)
currentValue :TIME;
(* upper limit for the current value *)
upperLimit :TIME;
(* message if the assertion is false *)
message :AssertMessage;
END_VAR

Implementation​

IF ((currentValue < lowerLimit) OR (currentValue > upperLimit)) THEN
THIS^.assertionWasWrong(
message := message,
additionalText := THIS^.getDebugInfo('valueIsInRangeOf')
);
END_IF