SysMemIsValidPointer (FUN)

FUNCTION SysMemIsValidPointer : RTS_IEC_RESULT

Check if a pointer points to a valid address RETURN: Returns the runtime system error code (see CmpErrors_Itfs.library):

  • ERR_OK: Memory is valid

  • ERR_FAILED: Memory is invalid. Cannot be accessed with the requested access mode bWrite

InOut:

Scope

Name

Type

Comment

Return

SysMemIsValidPointer

RTS_IEC_RESULT

Input

ptr

POINTER TO BYTE

Pointer to the memory to be checked

udiSize

__XWORD

Size of the memory to be checked

bWrite

BOOL

TRUE=Check, if memory can be written, FALSE=Check only for read access