accLoggerRead (Functionblock)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Firmware version:

2.40 / 1.40.00


This function will read the oldest value stored in the logger.

 

 

Input:

None.

 

Output:

X : DINT

Buffered x-axis reading.

 

Y : DINT

Buffered y-axis reading.

 

Z : DINT

Buffered z-axis reading.

 

Ready : BOOL

Has data been collected

 

Declaration:

FUNCTION_BLOCK accLoggerRead;
VAR_OUTPUT
   X     : DINT;
   Y     : DINT;
   Z     : DINT;
   Ready : BOOL;
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
PROGRAM example;
VAR
   buf    : ARRAY [1..500OF DINT;
   reader : accLoggerRead;
END_VAR;
accOpen();
accLoggerSetConfig(buffer := ADDR(buf), size := SIZEOF(buf));
accLoggerStart();
BEGIN
  IF accLoggerLevel() > 800 THEN
     REPEAT
       reader();
       IF reader.ready THEN
          ...
       END_IF;
     UNTIL NOT reader.ready
     END_REPEAT;
  END_IF;
END;
END_PROGRAM;