MCV_Trace

This FB can log axis positions and dynamic data cyclically or output diagnostic logs.

The logs for axes and trace data type can be parameterised.

Notice

notice

The FB can only be invoked sequentially, i.e. different trace logs cannot be generated in parallel. The FB can only be re-commanded if it was previously ended with StopTrace = TRUE or if writing of the TraceFile has ended.

Notice

notice

The “Error” output is currently not supported.

Block diagram

FB parameters

VAR_INPUT

Variable name

Data type

Description

StartTrace

BOOL

The trace log starts on the rising edge of this input signal.

StopTrace

BOOL

The trace log stops on the rising edge of this input signal.

StartWriteFile

BOOL

The output to file starts on the rising edge of this input signal.

WriteAsciiHeader

BOOL

When TRUE, the header to describe the logged data is also written to the output file.

FileName

MCV_STRING128

Name of the trace file

TraceType

UDINT

Type of logged data (see Description of “TraceType” input:

ProtocolRate

UDINT

Logging cycle in interpolator cycles.

TraceAxes

MCV_ARRAY_INT

Array with axis selection (see Description of “TraceAxes” input)

TraceData

UDINT

Selection of logged data (see Description of “TraceData” input

VAR_OUTPUT

Variable name

Data type

Description

Active

BOOL

Is TRUE as long as data logging is active.

WriteFile

BOOL

Is TRUE as long as data output is active.

Error

BOOL

Indicates whether an error occurred in an FB (the output pin is currently not supported).

StateString

STRING

Indicates the current state of the FB as a string. The following strings are possible:

IDLE

WRITE_TRACE_PARAMETER

START_TRACE

TRACING

STOP_STOP

TRACE_STOPPED

START_WRITE_TO_FILE

WRITING_TO_FILE

TRACE_FILE_WRITTEN

TRACE_ERROR

State

INT

Indicates the current state of the FB. The possible values for State and their meanings are described below:

Value

Meaning

1

TRACE_IDLE, TRACE_ERROR

2

WRITE_TRACE_PARAMETER

3

START_TRACE

4

TRACING

5

TRACE_STOP

6

TRACE_STOPPED

7

START_WRITE_TO_FILE

8

WRITING_TO_FILE

9

TRACE_FILE_WRITTEN