Skip to main content

isEqualTo

Short summary

This assertion method checks if all bytes of memory of data and dataToCompare are equal

Attention: Binary comparison means it compares values byte by byte, regardless of type information (signs, REAL etc...) and it compares padding bytes, too.

Attention: STRING and WSTRING is null terminated that means TwinCAT sets null byte/word at the end of the string and touches nothing else For example foo :STRING(3) := 'foo'; looks binary 16#66 16#6F 16#6F 16#00. if you set foo to an empty string foo := '' it looks like 16#00 16#6F 16#6F 16#00.

Parameters

NameTypeCommentKind
dataANYcurrent binary datainput
dataToCompareANYbinary data with the expected valuesinput
messageAssertMessagemessage if the assertion is falseinput

Code

Declaration

METHOD isEqualTo
VAR_INPUT
(* current binary data *)
data :ANY;
(* binary data with the expected values *)
dataToCompare :ANY;
(* message if the assertion is false *)
message :AssertMessage;
END_VAR