ADVANCED: strToMemory (function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

ALL

Firmware version:

1.00 / 1.00.00


strToMemory will copy the contents of a string to memory.

 

Input:

dst : PTR

Pointer to the memory where the string should be copied to.

 

str : STRING

The string that is to be copied.

 

len : INT

Number of bytes to be copied to memory.

 

Returns:

None

 

Declaration:

FUNCTION strToMemory;
VAR_INPUT
  dst : PTR;
  str : STRING;
  len : INT;
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
VAR
  data : ARRAY[0..100] OF SINT;
  s         : STRING;
END_VAR;
 
PROGRAM test;
 
BEGIN
  ...
  s:="hello world";
strToMemory(dst:=ADDR(data), str:=s, len:=strlen(str:=s));
  // The array 'data' will now contain the contents of the string 's'
  ...
END;
 
END_PROGRAM;