canLoggerStart (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Firmware version:

2.50 / 1.00.00


This function will start (or resume) the logging.

The logger must first have been configured with the canLoggerSetup function.

 

Restarting the logging will not remove any logged CAN messages if present.

 

Note that only filtered messages are logged.

 

 

Input:

port : SINT (1/2) (default 1)

The port of the logger.

 

 

Returns: INT

0

- Success.

1

- Logger is not configured.

2

- Logger is already started.

3

- Illegal logger index.

 

Declaration:

FUNCTION canLoggerStart : INT;

VAR_INPUT
   port : SINT := 1;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM CANExample;
VAR_INPUT
   LogBuf : ARRAY [1..1300] OF SINT;
END_VAR;
 
// Open can
canOpen(baud := 250);
canLoggerSetup(buffer := ADDR(LogBuf), size := SIZEOF(LogBuf));
...
 
BEGIN
   ...
   canLoggerStart();
   ...
END;
END_PROGRAM;