RT Logger Diagnostics

Scope

The RT logger diagnostics provide two related tools:

  • filtered realtime messages showing what ecmc most recently reported
  • motion diagnostics for determining where an axis command stopped progressing
  • retained log buffers for configuration and runtime warnings/messages

Open RT logger diagnostics from ecmcMain.ui. Open the axis-specific Troubleshooting panel from the axis expert or error/interlock panel.

Retained Log Buffers

ecmc keeps retained log buffers for messages that should remain easy to inspect after startup or during runtime troubleshooting. The buffers are independent of the normal IOC console output:

  • the configuration log buffer keeps messages generated while the IOC is in configuration mode
  • the runtime log buffer keeps messages generated after ecmc has entered runtime

Each buffer stores timestamped messages with severity INFO, WARNING, or ERROR. The buffers have a fixed size of 1024 rows; when a buffer is full, the oldest row in that buffer is overwritten. This avoids unbounded memory growth while preserving the most recent relevant diagnostics.

Use the iocsh command ecmcLogBufferWrite(level,message) to write a manual message. The command writes to the configuration buffer before runtime and to the runtime buffer after runtime has started. Use ecmcLogBufferPrint() and ecmcRtLogBufferPrint() to print the configuration and runtime buffers.

Realtime Messages

Last message is the most recent message accepted by the current level and source filters. Last level is its severity. Count counts accepted messages, while Dropped counts messages that could not be queued.

Enabled Levels

The four buttons select which severities are accepted:

BitLevelNumeric value
0Info1
1Warning2
2Error4
3Debug8

The numeric control value is the sum of enabled bits. For example, Info, Warning, and Error produce 7; all levels produce 15. Normally use Info, Warning, and Error. Enable Debug only while investigating a specific problem.

Source Filter

The source filter has three modes:

ModeBehavior
OffReject all messages.
All sourcesAccept enabled levels from every source. Source mask and index are ignored.
SelectedAccept enabled levels only when the source mask and source index match.

Use All sources for general troubleshooting. Use Selected only when the message rate is high or one axis/object must be isolated.

In Selected mode, source index -1 accepts every index. A non-negative index selects one axis, PLC, EtherCAT source, or other indexed object.

Source Mask

Click source bits in the horizontal controller. The decimal mask is retained for scripts and exact readback.

BitValueSource
01Unknown
12Axis family
24Axis base
38Axis sequencer
416Axis data
532Axis monitor
664Axis encoder
7128Axis drive
8256Axis PID
9512Axis trajectory
101024Axis PVT
112048Motor family
124096Motor-record axis
138192Motor controller
1416384Master/slave state machine
1532768EtherCAT
1665536PLC

Axis-family bit 1 matches every axis subtype. Motor-family bit 11 matches both motor subtypes. Selecting a subtype bit matches only that subtype.

Example: to inspect all axis messages for axis 3, select mode Selected, source bit 1, and source index 3.

Motion Diagnostic Dump

Set Axis to the ecmc axis index. Axis rpt immediately summarizes the axis command, request/execute counters, state, and detected blockers.

Press Dump to request a YAML snapshot. File creation runs in the RT logger worker thread, not in the realtime motion thread. The generated path is reported in File and has this form:

/tmp/ecmc_motion_diag_<pid>_<timestamp>.yaml

DiagLevel controls the amount of information:

LevelContents
0Compact metadata and object counts.
1Metadata, analyzed axis/group/master-slave state, blockers, findings, and both log buffers.
2Level 1 plus a second YAML document containing the complete raw state of all motion objects and their member variables.

Level 2 includes axis internals, encoder, monitor, trajectory, controller, drive, motor-record adapter, axis groups, PVT, and master/slave state machines. Creating that snapshot briefly holds the ecmc realtime mutex while the state is formatted, so use level 2 for diagnostics rather than cyclic acquisition.

Levels 1 and 2 include non-destructive snapshots of the configuration log buffer and the runtime/debug log buffer. Each entry contains its sequence, timestamp, severity, and message. Runtime entries also contain source type and source index. Up to the existing 1024 entries from each buffer are included.

Axis Command Counters

For an axis such as M1, the troubleshooting records use the axis prefix:

PV suffixMeaning
-MtnCmdMrReqCntCommand arrived at the motor-record adapter.
-MtnCmdReqCntAn ecmc axis motion function or momentary control-word command arrived.
-MtnCmdExecCntA real execute attempt reached setExecute(true).
-MtnCmdMrLastTypeLast motor-record command type.
-MtnCmdMrLastRsltAccepted, rejected, ignored, or deferred.
-MtnCmdMrLastRsnDecoded reason for the result.
-MtnCmdMrLastErrAssociated ecmc error code.
-MtnCmdMrLastCycRealtime cycle of the result.
-MtnCmdMrLastTxtCombined human-readable result.
-MtnMsBlkAxis is currently blocked by master/slave ownership.
-MtnMsBlkCntNumber of master/slave block/unblock transitions.
-MtnMsBlkCycCycle of the last master/slave block transition.
-MtnMsBlkTxtHuman-readable master/slave block state.
-MtnCmdClrClear counters and remembered diagnostic fields.

Motor-record STOP and enable commands are excluded from the counters by default because normal motor operation can generate them frequently. Use -MtnCmdCntMrStop and -MtnCmdCntEna when those commands are relevant.

Motion Does Not Start

Clear the counters, issue exactly one command, and compare the three stages:

  1. MtnCmdMrReqCnt did not increase: the command did not reach the motor-record adapter. Check Channel Access, the motor record, and the selected axis.
  2. Motor-record count increased but MtnCmdReqCnt did not: inspect MtnCmdMrLastRslt, MtnCmdMrLastRsn, and MtnCmdMrLastTxt.
  3. Request count increased but MtnCmdExecCnt did not: inspect the axis report for busy state, command blocking, master/slave ownership, trajectory source, auto-enable, limits, and interlocks.
  4. Execute count increased but motion did not start: create a diagnostic dump and inspect axis, group, sequencer, and master/slave state together.

For commands sent directly through the ecmc axis interface, including absolute, relative, homing, and tweak commands, start at MtnCmdReqCnt; no motor-record request is expected.

Main PVs

The general records use the IOC prefix:

$(IOC):MCU-RTLog-Msg
$(IOC):MCU-RTLog-Level
$(IOC):MCU-RTLog-Ctrl
$(IOC):MCU-RTLog-FilterMode
$(IOC):MCU-RTLog-FilterMode-Txt
$(IOC):MCU-RTLog-FilterMask
$(IOC):MCU-RTLog-FilterIndex
$(IOC):MCU-RTLog-DiagAxis
$(IOC):MCU-RTLog-DiagAxisRpt
$(IOC):MCU-RTLog-DiagLevel
$(IOC):MCU-RTLog-DiagDump
$(IOC):MCU-RTLog-DiagBusy
$(IOC):MCU-RTLog-DiagStatus
$(IOC):MCU-RTLog-DiagFile