logInitialize (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

ALL

Firmware version:

1.00 / 1.00.00


logInitialize initializes the memory used for the Datalogger. Whenever this function is called, any data already present in the Datalogger memory will be deleted. In order to detect if the Datalogger memory is already configured, use the functions logIsInitialized(), logMaxNumOfRecords(), and logValuesPerRecord(). The supplied key-value is checked when logIsInitialized() is called, which will only return true if the key-value is the same as used in the logIsInitialized() function call.
The number of records requested can be set to 0, which in turn will set the number of records to the maximum number available.

 

To create file- or memory-based Dataloggers, please use logCreate or logCreateMem.

 

Input:

numlogvalues : SINT (0..8)

Number of values that are logged in each record.

 

numlogrecords : DINT (0..65535)

Number of records that should be contained in the Datalogger (before wrap-around).

If 0 is specified on the number of records will be the maximum number available (depends on the "numlogvalues").

 

 

key : DINT

User-defined key-value.

 

Returns: BOOL

True if successful, false if there is no room for the specified number of records/number of values.

 

Declaration:

FUNCTION logInitialize : BOOL;
VAR_INPUT
  numlogvalues : SINT;
  numlogrecords : DINT;
  key           : DINT;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
 
BEGIN
  ...
  // Initialize log system to contain 2 values per record, and room for 100 records, keyvalue is 4711
  logInitialize(key:=4711, numlogvalues:=2, numlogrecords:=100);
  ...
END;
 
END_PROGRAM;