accLoggerSetConfig (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Firmware version:

2.40 / 1.40.00


This function will initialize a buffer where acceleration vectors are logged.

The logging to the buffer is started with accLoggerStart.

 

Note:

The logging will be suspended when calling the pmWaitEvent function and will resume once the function returns.

 

 

Input:

DownSample  : SINT (0..127, default 0)

Only collects each X sample generation - allowing logging for a longer period at the risk of losing some measurements.

 

Buffer : PTR

Address of buffer that is used to store the logged values.

 

Size : DINT (0,4..2147483647)

Size of buffer area in bytes.

 

WarningLevel : INT (0..999, default 0)

At what level a "Logger level warning" event will be generated in 0.1 percent, if 0 no warning will be generated.

 

WarnIfFull : BOOL (default TRUE)

Generates a "Logger is full" event when the data area is full and data begins to be overwritten.

 

StopOnFull : BOOL (default FALSE)

Stops logger when data area if full.

 

StopOnShock : BOOL (default FALSE)

Stops logging when shock event is detected.

 

StopOnAcc : BOOL (default FALSE)

Stops logging when acceleration event is detected.

 

Returns: INT

0

- OK

-1

- General error.

-2

- Interface not open (see accOpen).

-3

- Invalid argument.

-4

- Logger is running.

 

Declaration

FUNCTION accLoggerSetConfig : INT;
VAR_INPUT
   Buffer      PTR;
   Size        : DINT := 0;
   WarningLevelINT  := 0;
   DownSample  : SINT := 0;
   WarnIfFull  : BOOL := TRUE;
   StopOnFull  : BOOL := FALSE;
   StopOnShock : BOOL := FALSE;
   StopOnAcc   BOOL := FALSE;
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
PROGRAM example;
VAR
   buf : ARRAY [1..500OF DINT
   cfg : accLoggerGetConfig;
END_VAR;
accOpen();
accLoggerSetConfig(buffer := ADDR(buf), size := SIZEOF(buf));
cfg();
...
BEGIN
  ...
END;
END_PROGRAM;