Skip to main content

bitXIsUnset

Short summary​

This assertion method checks if the selected bit of current value is unset

Parameters​

NameTypeCommentKind
currentValueBYTEcurrent value to checkinput
numberBitNumberBytenumber of bit to checkinput
messageAssertMessagemessage if the assertion is falseinput

Code​

Declaration​

METHOD bitXIsUnset
VAR_INPUT
(* current value to check *)
currentValue :BYTE;
(* number of bit to check *)
number :BitNumberByte;
(* message if the assertion is false *)
message :AssertMessage;
END_VAR

Implementation​

IF (
TO_BOOL(
TO_BYTE(SHL(THIS^.LSB, number))
AND currentValue
)
) THEN
THIS^.assertionWasWrong(message, THIS^.getDebugInfo('bitXIsUnset'));
END_IF