Skip to main content

valueIsEven

Short summary

This assertion method checks if the current value is even

Parameters

NameTypeCommentKind
currentValueSINTcurrent value to checkinput
messageTc2_System.T_MaxStringmessage if the assertion is falseinput

Code

Declaration

METHOD valueIsEven
VAR_INPUT
(* current value to check *)
currentValue :SINT;
(* message if the assertion is false *)
message :Tc2_System.T_MaxString;
END_VAR

Implementation

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