valueIsInRangeOf
Short summary
This assertion method checks if the current value is inside a limit
Attention:
limits are included: valueIsInRangeOf(3, 3, 3) is a true assertion
Parameters
| Name | Type | Comment | Kind |
|---|---|---|---|
| lowerLimit | __XINT | lower limit for the current value | input |
| currentValue | __XINT | current value to check | input |
| upperLimit | __XINT | upper limit for the current value | input |
| message | AssertMessage | message if the assertion is false | input |
Code
Declaration
METHOD valueIsInRangeOf
VAR_INPUT
(* lower limit for the current value *)
lowerLimit :__XINT;
(* current value to check *)
currentValue :__XINT;
(* upper limit for the current value *)
upperLimit :__XINT;
(* message if the assertion is false *)
message :AssertMessage;
END_VAR
Implementation
IF (
(currentValue < lowerLimit)
OR_ELSE (currentValue > upperLimit)
) THEN
THIS^.assertionWasWrong(message, THIS^.getDebugInfo('valueIsInRangeOf'));
END_IF