类 MailboxStatistics
java.lang.Object
com.darra.ethercat.abstractions.MailboxStatistics
邮箱统计快照 (对齐 C#
Mailbox statistics snapshot (aligned with C#
MailboxStatistics).
Mailbox statistics snapshot (aligned with C#
MailboxStatistics).
字段全部为 final, 创建后不可变. All fields are final (immutable snapshot).
-
字段概要
字段修饰符和类型字段说明final double平均事务延迟 (微秒) / average transaction latency in microsecondsfinal long最近一次错误码 (协议相关, 0 表示无) / last protocol-level error code (0 = none)final Instant最近一次错误时刻 (UTC); 无错误则为 null / last error time (UTC), null if nonefinal long累计被取消的事务数 / total cancelled transactionsfinal long累计收到邮箱错误帧数 (MBX ERROR / SDO Abort 等) / total mailbox error framesfinal long累计协议错误次数 (类型 / counter / WKC 不匹配) / total protocol errorsfinal long累计收到响应数 (含错误帧) / total received responses (including error frames)final long累计发送事务数 / total sent transactionsfinal long累计超时次数 / total timeouts -
构造器概要
构造器构造器说明MailboxStatistics(long sent, long recv, long timeout, long mbxErr, long protoErr, long cancelled, long lastErr, Instant lastErrTime, double avgLatency) 构造 / Construct. -
方法概要
修饰符和类型方法说明static MailboxStatisticsempty()空快照 (全 0) / empty snapshot (all zero).static MailboxStatisticsfetch(short masterIndex, short slaveIndex, byte protocolType) 经 native EcxMbxGetStats 拉取 per-slave / per-protocol 邮箱统计快照.doublelonglonglonglonglonglonglongstatic voidreset(short masterIndex, short slaveIndex, byte protocolType) 经 native EcxMbxResetStats 重置 per-slave / per-protocol 邮箱统计.
-
字段详细资料
-
totalSent
public final long totalSent累计发送事务数 / total sent transactions -
totalReceived
public final long totalReceived累计收到响应数 (含错误帧) / total received responses (including error frames) -
totalTimeout
public final long totalTimeout累计超时次数 / total timeouts -
totalMailboxError
public final long totalMailboxError累计收到邮箱错误帧数 (MBX ERROR / SDO Abort 等) / total mailbox error frames -
totalProtocolError
public final long totalProtocolError累计协议错误次数 (类型 / counter / WKC 不匹配) / total protocol errors -
totalCancelled
public final long totalCancelled累计被取消的事务数 / total cancelled transactions -
lastErrorCode
public final long lastErrorCode最近一次错误码 (协议相关, 0 表示无) / last protocol-level error code (0 = none) -
lastErrorTime
最近一次错误时刻 (UTC); 无错误则为 null / last error time (UTC), null if none -
averageLatencyUs
public final double averageLatencyUs平均事务延迟 (微秒) / average transaction latency in microseconds
-
-
构造器详细资料
-
MailboxStatistics
public MailboxStatistics(long sent, long recv, long timeout, long mbxErr, long protoErr, long cancelled, long lastErr, Instant lastErrTime, double avgLatency) 构造 / Construct.- 参数:
sent- 累计发送 / total sentrecv- 累计接收 / total receivedtimeout- 累计超时 / total timeoutmbxErr- 累计邮箱错误帧 / total mailbox error framesprotoErr- 累计协议错误 / total protocol errorscancelled- 累计取消 / total cancelledlastErr- 最近错误码 / last error codelastErrTime- 最近错误时刻 (null 表示无) / last error time (null = none)avgLatency- 平均延迟 (微秒) / average latency (microseconds)
-
-
方法详细资料
-
empty
空快照 (全 0) / empty snapshot (all zero). -
fetch
经 native EcxMbxGetStats 拉取 per-slave / per-protocol 邮箱统计快照.[审计补齐 roundSDKSAN2] 此前 6 个协议类的 getStatistics() 一律返回 empty() 占位; 现
DarraCore已绑定 EcxMbxGetStats, 与 C# CoE.Statistics 走 DLL.EcxMbxGetStats 同源. 调用失败 / native 未就绪时 降级返回 empty().- 参数:
protocolType- MBX 协议类型 (CoE=0x03, FoE=0x04, SoE=0x05, AoE=0x01, EoE=0x02, VoE=0x0F, FSoE=0x08; 0=全部累加)- 返回:
- 统计快照; 失败返回
empty()
-
reset
public static void reset(short masterIndex, short slaveIndex, byte protocolType) 经 native EcxMbxResetStats 重置 per-slave / per-protocol 邮箱统计.- 参数:
protocolType- 协议类型; 0=清空所有协议
-
getTotalSent
public long getTotalSent()- 返回:
- 累计发送 / total sent
-
getTotalReceived
public long getTotalReceived()- 返回:
- 累计接收 / total received
-
getTotalTimeout
public long getTotalTimeout()- 返回:
- 累计超时 / total timeout
-
getTotalMailboxError
public long getTotalMailboxError()- 返回:
- 累计邮箱错误 / total mailbox error
-
getTotalProtocolError
public long getTotalProtocolError()- 返回:
- 累计协议错误 / total protocol error
-
getTotalCancelled
public long getTotalCancelled()- 返回:
- 累计取消 / total cancelled
-
getLastErrorCode
public long getLastErrorCode()- 返回:
- 最近错误码 / last error code
-
getLastErrorTime
- 返回:
- 最近错误时刻 / last error time
-
getAverageLatencyUs
public double getAverageLatencyUs()- 返回:
- 平均延迟 (微秒) / average latency in microseconds
-