Skip to main content

valueIsNegative

Short summary​

This assertion method checks if the current value is negative

Parameters​

NameTypeCommentKind
currentValue__XINTcurrent value to checkinput
messageAssertMessagemessage if the assertion is falseinput

Code​

Declaration​

METHOD valueIsNegative
VAR_INPUT
(* current value to check *)
currentValue :__XINT;
(* message if the assertion is false *)
message :AssertMessage;
END_VAR

Implementation​

IF (currentValue >= 0) THEN
THIS^.assertionWasWrong(message, THIS^.getDebugInfo('valueIsNegative'));
END_IF