Skip to main content

valueIsOdd

Short summary

This assertion method checks if the current value is odd

Parameters

NameTypeCommentKind
currentValueINTcurrent value to checkinput
messageAssertMessagemessage if the assertion is falseinput

Code

Declaration

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

Implementation

{warning disable C0195}
IF ((currentValue AND THIS^.LSB_MASK) = 0) THEN
THIS^.assertionWasWrong(message, THIS^.getDebugInfo('valueIsOdd'));
END_IF
{warning restore C0195}