logWrite (Functionblock)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

ALL

Firmware version:

1.00 / 1.00.00


logWrite is used for making entries in the Datalogger. Records logged with the logWrite can automatically be timestamped with the current time.

To write to file- or memory-based Dataloggers, please use logWriteRaw.

 

Input:

tag : SINT

Tag value for the record.

 

value : ARRAY [1..8] OF DINT

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

 

linsec : DINT

Optional timestamp in seconds since 1980-1-1 00:00:00 to use (if -1, the current time is used).

Please note that the function LogGotoLinsec() function will not work correctly if log entries are not written with increasing timestamps.

         

Output:

None

 

Declaration:

FUNCTION_BLOCK logWrite;
VAR_INPUT
  tag   : SINT;               | Tagvalue for the record
  value : ARRAY[1..8] OF DINT; | Up to 8 values for the record
  linsec : DINT := -1;         | Optional timestamp for log-entry. -1 denotes current time.
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
VAR
  LogWriter : logWrite; // Declare an instance of the LogWrite functionblock
END_VAR;
 
PROGRAM test;
 
BEGIN
  ...
  LogWriter(tag:=1, value[1]:=10, value[2]:=20); // Make an entry in the Datalogger
  ...
END;
END_PROGRAM;