SaveDataF (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

ALL

Firmware version:

1.00 / 1.00.00


SaveDataF will save a block of memory to a specific location in the persistent FRAM memory.

 

A total of 20 (X32) / 100 (NX32/NX32L) FRAM entries are available.

 

Input:                

index : INT (1..20 or 1..100)

Location number the block of memory should be saved in.

 

data : ADR

Address of the memory block that should be saved.

 

datasize : INT (1..255)

Maximum size to save.

 

Returns: INT

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

0

- Success.

1

- Invalid index.

2

- Data is missing.

3

- Invalid size.

 

Declaration:

FUNCTION SaveDataF;
VAR_INPUT
  index   : INT;
  data     : PTR;
  datasize : INT;
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
 
VAR
  xx   : ARRAY[1..100] OF SINT;
END_VAR;
 
BEGIN
  ...
SaveDataF(index:=10, data:=ADDR(xx), datasize:=SIZEOF(xx));
  // Persistent memory location number 10 will contain the contents of 'xx' after the call
  ...
END;
 
END_PROGRAM;