Skip to main content

valueIsPositive

Short summary​

This assertion method checks if the current value is positve

Parameters​

NameTypeCommentKind
currentValueSINTcurrent value to checkinput
messageAssertMessagemessage if the assertion is falseinput

Code​

Declaration​

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

Implementation​

IF (currentValue < 0) THEN
THIS^.assertionWasWrong(message, THIS^.getDebugInfo('valueIsPositive'));
END_IF