logRewrite (Functionblock)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

ALL

Firmware version:

1.00 / 1.00.00


logRewrite is used for changing an entry in the Datalogger. logRewrite will change both the tag and values of the record currently pointed to by the read pointer.

 

Caution must be taken when using logRewrite() and logRewriteTag() as it will reduce the number of possible write operations to the Datalogger. Please read the Datalogger introductory section for more information.

To change entries in file- or memory-based Dataloggers, please use logRewriteRaw.

 

 

Input:

tag : SINT

The new tag value for the record.

 

value : ARRAY [1..8] OF DINT

The new values for each of the up to 8 separate values logged in each record.

         

Output:

None

 

Declaration:

FUNCTION_BLOCK logRewrite;
VAR_INPUT
  tag   : SINT;               | Tagvalue for the record
  value : ARRAY[1..8] OF DINT; | Upto 8 values for the record
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
VAR
  LogRewriter : logRewrite; // Declare an instance of the LogRewrite functionblock
END_VAR;
 
PROGRAM test;
 
BEGIN
  ...
  // Position readpointer to the first (oldest) record in the Datalogger
  logFirst();
  LogRewriter(tag:=1, value[1]:=10, value[2]:=20); // Change the entry currently pointed to by the readpointer
  ...
END;
END_PROGRAM;