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
| Name | Type | Comment | Kind |
|---|---|---|---|
| address | PVOID | memory address | input |
| sizeInBytes | UDINT | number of bytes | input |
| message | AssertMessage | message if the assertion is false | input |
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