Skip to main content

isGreaterThan

Short summary

This assertion method checks the bytes of memory of data and dataToCompare if the content of the first unequal data byte is greater than the byte of dataToCompare the assertion is true

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 smaller valuesinput
messageAssertMessagemessage if the assertion is falseinput

Code

Declaration

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