Skip to main content

isValid

Short summary​

This assertion method checks if pointer is valid. That means the pointer is not zero, the pointer is not in the memory area unknown.

Attention: A pointer to a variable on the stack is also in an unknown area of memory, but it is a valid pointer. That means the method does not work for pointers to stack variables

Parameters​

NameTypeCommentKind
addressPVOIDmemory addressinput
sizeInBytesUDINTnumber of bytesinput
messageAssertMessagemessage if the assertion is falseinput

Code​

Declaration​

METHOD isValid
VAR_INPUT
(* memory address *)
address :PVOID;
(* number of bytes *)
sizeInBytes :UDINT;
(* message if the assertion is false *)
message :AssertMessage;
END_VAR