msLoggerStop (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

NX-200, LX2

Firmware version:

1.50.00


Stop collection of data with the specified logger.

 

Input:

Logger : SYSHANDLE

A user provided handle to uniquely identify the logger. See SYSHANDLE page. This field is mandatory.

 

SwitchTo : SYSHANDLE

Handle to another logger to switch to. Disabled if not specified.

 

Reset : BOOL (Default TRUE)

Reset the new logger when switched in.

 

Returns: INT

1

- Success.

0

- This function is not supported.

-1

- Interface is not open. Call msOpen first.

-2

- Generic error.

-3

- Invalid switch logger handle.

-5

- The logger to stop is not present.

-10

- The specified logger is not running. Call msLoggerStart first.

-17

- Switch-logger sensor setup is invalid.

 

 

Declaration

FUNCTION msLoggerStop : INT;
VAR_INPUT
  Logger     : MANDATORY SYSHANDLE;

  SwitchTo   : SYSHANDLE;

  Reset      : BOOL := TRUE;
END_VAR;
 

Example:

INCLUDE rtcu.inc
 
VAR
  logger       : ARRAY[1..2] OF SYSHANDLE;
END_VAR;
 
PROGRAM test;
VAR
  rc           : INT;
  buf1         : ARRAY[1..10000] OF DINT;
  buf2         : ARRAY[1..10000] OF DINT;
END_VAR;
rc := msOpen();
DebugFmt(message:="msOpen (rc=\1)", v1:=rc);
...
rc := msLoggerCreate(logger:=logger[1], buffer:=ADDR(buf1), size:=SIZEOF(buf1), stoponfull:=TRUE);
DebugFmt(message:="msLoggerCreate (rc=\1) buffer_size=\4, stoponfull=TRUE", v1:=rc, v4:=SIZEOF(buf1));
rc := msLoggerCreate(logger:=logger[2], buffer:=ADDR(buf2), size:=SIZEOF(buf2), stoponfull:=TRUE);
DebugFmt(message:="msLoggerCreate (rc=\1) buffer_size=\4, stoponfull=TRUE", v1:=rc, v4:=SIZEOF(buf1));
...
rc := msLoggerAddAcc(logger:=logger[1], downsample:=0, lowres:=FALSE);
DebugFmt(message:="msLoggerAddAcc (rc=\1) downsample=0, lowres=FALSE", v1:=rc);
...
rc := msLoggerStart(logger:=logger[1], reset:=TRUE);
DebugFmt(message:="msLoggerStart (rc=\1) reset=TRUE", v1:=rc);
...
rc := msLoggerStop(logger:=logger[1], switchto:= logger[2], reset:=TRUE);
...
BEGIN
  ...
END;
END_PROGRAM;