logRewriteTag (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

ALL

Firmware version:

1.00 / 1.00.00


logRewriteTag is used for changing just the tag value 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.

This function can be used on all types of Dataloggers.

 

Input:

tag : SINT

The new tag value for the record.

 

handle : SYSHANDLE

A handle to the Datalogger to change the tag in. If not provided, it will work on the flash-based log. Only supported on NX32L with firmware 1.50.00 or newer.

 

Returns: INT

0

- Successful.

1

- There is not enough memory to rewrite.

2

- Log empty (no records available).

4

- Log is not initialized.

6

- Invalid read position. (log has been cleared)

7

- The log could not be found.

8

- The log is not writable.

10

- Failed to write to the log.

 

 

Declaration:

FUNCTION logRewriteTag : INT;
VAR_INPUT
  tag   : SINT;
  handle : SYSHANDLE;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
 
BEGIN
  ...
  // Position readpointer to the first (oldest) record in the Datalogger
  logFirst();
  logRewriteTag(tag:=2); // Change the tagvalue for the entry currently pointed to by the readpointer
  ...
END;
END_PROGRAM;