logRewriteRaw is used to change an entry in the Datalogger. It will change both the tag and the data of the entry currently pointed to by the read pointer.
To change entries in the flash-based Datalogger, please use LogRewrite.
Input:
handle : SYSHANDLE
A handle to the Datalogger to change the entry in.
tag : SINT
The new tag value for the entry.
data : PTR
The new data for the entry.
size : DINT
The size of the new data.
Returns: INT
0
|
- Successful.
|
1
|
- There is not enough memory to rewrite.
|
2
|
- Log empty (no records available).
|
4
|
- Log is not initialized.
|
5
|
- The data is too large for the Datalogger.
|
6
|
- Invalid read position. (log has been cleared)
|
7
|
- The log could not be found. This function is only supported on file- and memory-based Dataloggers.
|
8
|
- The log is not writable.
|
10
|
- Failed to write to the log.
|
Declaration:
FUNCTION logRewriteRaw : INT;
VAR_INPUT
handle : SYSHANDLE;
tag : SINT;
data : PTR;
size : INT;
END_VAR;
Example:
INCLUDE rtcu.inc
PROGRAM test;
VAR
handle : SYSHANDLE;
data : DINT := 42;
END_VAR;
BEGIN
...
logFirst(handle := handle);
logRewriteRaw(handle := handle, tag := 2, data := ADDR(data), size := SIZEOF(data));
...
END;
END_PROGRAM;
|