LoadDataF (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

ALL

Firmware version:

1.00 / 1.00.00


LoadDataF will load a block of memory from 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 data should be loaded from.

 

data : ADR

Address of the memory block that receives the loaded data.

 

datasize : INT (1..255)

Maximum size to load into "ptr".

 

Returns: INT

The actual length loaded from the specified index (this will be 0 if there is no valid data at the index - i.e. a string is stored at this position).

 

 

Declaration:

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

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
 
VAR
  xx     : ARRAY[1..100] OF SINT;
  length : INT;
END_VAR;
 
BEGIN
  ...
 length:=LoadDataF(index:=10, data:=ADDR(xx), datasize:=SIZEOF(xx));
  // Persistent memory location number 10 will be loaded into 'xx'
  ...
END;
 
END_PROGRAM;