SaveStringX (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

ALL

Firmware version:

1.00 / 1.00.00


SaveStringX will save a string to a specific location in the persistent extended FLASH memory.

 

Use the GetFlashXSize function to determine the highest location it is possible to write to.

 

Note: there is a limited number of writes to the Flash Memory that make use of this function. Please read the Persistent Memory introductory section.

 

 

Input:

index : INT (1..max)

Location number the string should be saved in.

 

str : STRING

String that is to be saved.

 

Returns: INT

(Only reported from firmware version 5.00 / R1.30.00)

0

- Success.

1

- Invalid index.

3

- Invalid length.

 

Declaration:

FUNCTION SaveStringX;
VAR_INPUT
  index : INT;
  str   : STRING;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
 
BEGIN
  ...
SaveStringX(index:=10, str:="hello world");
  // Persistent memory location number 10 will contain "hello world" after the call
  ...
END;
 
END_PROGRAM;