SysMemCmp (FUN) ¶ FUNCTION SysMemCmp : DINT Compares the content of two buffers RETURN: Returns 0 if the buffer contents are equal, else !=0 InOut: Scope Name Type Comment Return SysMemCmp DINT Input pBuffer1 POINTER TO BYTE Address of first memory area (buffer 1) pBuffer2 POINTER TO BYTE Address of second memory area (buffer 2) udiCount __XWORD Number of bytes to be compared
SysMemCpy (FUN) ¶ FUNCTION SysMemCpy : POINTER TO BYTE Copy the content from source (pSrc) to destination buffer (pDest) RETURN: Pointer to the destination buffer, where the copy was done InOut: Scope Name Type Comment Return SysMemCpy POINTER TO BYTE Input pDest POINTER TO BYTE Pointer to memory address to be copied to (target) pSrc POINTER TO BYTE Pointer to memory address to be copied from (source) udiCount __XWORD Number of bytes to be copied
SysMemForceSwap (FUN) ¶ FUNCTION SysMemForceSwap : DINT Routine to force swapping memory independant of the byteorder of the system! RETURN: Number of bytes swapped: -1 = failed (size too large) >0 = Number of bytes swapped InOut: Scope Name Type Comment Return SysMemForceSwap DINT Input pbyBuffer POINTER TO BYTE POINTER TO data TO swap. You can check, which order is selected by calling the routine with pbyBuffer=0 udiSize UDINT Size of one element to swap udiCount UDINT Number of elements to swap
SysMemFreeData (FUN) ¶ FUNCTION SysMemFreeData : RTS_IEC_RESULT Release data memory RETURN: Returns the runtime system error code (see CmpErrors_Itfs.library) InOut: Scope Name Type Comment Return SysMemFreeData RTS_IEC_RESULT Input szComponent STRING Name of the component. Can be the library- or POU-name from IEC. pMemory POINTER TO BYTE Pointer to memory to be released
SysMemGetCurrentHeapSize (FUN) ¶ FUNCTION SysMemGetCurrentHeapSize : __XWORD Routine to get total size of the currently allocated heap memory RETURN: Size of the memory in bytes that is currently allocated from the heap InOut: Scope Name Type Comment Return SysMemGetCurrentHeapSize __XWORD Input pResult POINTER TO RTS_IEC_RESULT Pointer to runtime system error code (see CmpErrors_Itfs.library)
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
SysMemMove (FUN) ¶ FUNCTION SysMemMove : POINTER TO BYTE Copy the content from source (pSrc) to destination buffer (pDest). This routine works for overlapping buffers too in opposite to SysMemCpy! RETURN: Pointer to the destination buffer, where the move was done InOut: Scope Name Type Comment Return SysMemMove POINTER TO BYTE Input pDest POINTER TO BYTE Pointer to memory address to be moved to (target) pSrc POINTER TO BYTE Pointer to memory address to be moved from (source) udiCount __XWORD Number of bytes to be moveed
SysMemReallocData (FUN) ¶ FUNCTION SysMemReallocData : POINTER TO BYTE Reallocate data memory with the specified size. By use of this function the size of a memory block can be modified (reallocation). Therefor a pointer on the memory block to be reallocated is passed to the function. The content of the memory block will not be modified. If the requested memory size cannot made available at the same place (address) , the function will allocate new memory space, RETURN: Pointer to the memory block. 0 if no memory is not available InOut: Scope Name Type Comment Return SysMemReallocData POINTER TO BYTE Input szComponent STRING Name of the component. Can be the library- or POU-name from IEC. pMemory POINTER TO BYTE Pointer to memory to resize udiSize __XWORD Requested size of the memory pResult POINTER TO RTS_IEC_RESULT Pointer to runtime system error code (see CmpErrors_Itfs.library)
SysMemSet (FUN) ¶ FUNCTION SysMemSet : POINTER TO BYTE By use of this function a memory space is initialized with a specified value RETURN: Pointer to the memory block which was initialized. 0 if the operation failed InOut: Scope Name Type Comment Return SysMemSet POINTER TO BYTE Input pDest POINTER TO BYTE Pointer to memory block to initialize udiValue UDINT Value with which the memory is to be initialized udiCount __XWORD Number of bytes to be initialized in the memory block
SysIntRegister (FUN) ¶ FUNCTION SysIntRegister : RTS_IEC_RESULT <description>Function to register an interrupt handler. By use of this function an interrupt handler (Interrupt Service Routine, ISR) for the interrupt specified by its handle gets registered. During registration, the start address of the function to be executed in case of the associated interrupt request is filled into the vector table on the target.</description> <result><p>RESULT: Returns the runtime system error code (see CmpErrors.library).</p></result> InOut: Scope Name Type Comment Return SysIntRegister RTS_IEC_RESULT Input hInt RTS_IEC_HANDLE <param name=”hInt” type=”IN”>Handle to interrupt returned by SysIntOpen.</param> pCallback POINTER TO BYTE <param name=”pCallback” type=”IN”>Interrupt handler. Callback layout:<br /> FUNCTION IntHandler : RTS_IEC_RESULT<br /> VAR_INPUT<br /> ulAdditionalInfo : UDINT;<br /> END_VAR </param> ulAdditionalInfo __UXINT <param name=”ulAdditionalInfo” type=”IN”>Info value that is transmitted to the interrupt handler</param>