plcopen 0.22.0
载入中...
搜索中...
未找到
error_diag.h
浏览该文件的文档.
1#pragma once
2
3#include "rt/error.h"
4
5namespace plcopen::core::rt
6{
7
9{
11 const char *name = "unknown_error";
12 const char *summary = "unknown error code";
13 const char *hint =
14 "upgrade the producer/consumer pair or inspect the raw error value before retrying";
15};
16
18{
19 switch (code)
20 {
21 case ErrorCode::ok:
22 return {code, "ok", "operation completed successfully",
23 "continue with the next command; no recovery action is required"};
25 return {code, "invalid_argument", "a parameter value is out of its valid domain",
26 "check references, NaN/Inf inputs, and dynamics or buffer-mode combinations"};
28 return {code, "out_of_range", "a value exceeded a fixed bound or configured motion window",
29 "inspect indices, limits, target positions, and table sizes before retrying"};
31 return {
32 code, "capacity_exceeded", "a fixed-size container or queue is full",
33 "wait for the queue to drain or reduce window depth instead of increasing RT storage"};
35 return {code, "infeasible", "the requested motion or solve has no feasible solution",
36 "relax legal dynamics, extend the allowed time, or change the target path"};
38 return {code, "not_converged",
39 "the bounded numerical solve did not meet its convergence gates",
40 "start from a seed closer to the target or use the explicit best-effort result "
41 "for diagnostics"};
43 return {code, "singular_region",
44 "the numerical solve remains ill-conditioned at maximum damping",
45 "change the target or seed to move away from the singular configuration"};
47 return {code, "limit_infeasible",
48 "hard limits prevent the numerical solve from reaching its target",
49 "inspect the joint limits or choose a target reachable inside them"};
51 return {code, "precondition_failed", "the object is not in the required lifecycle state",
52 "read the latest axis/group status and satisfy ownership, power, or standby "
53 "preconditions first"};
55 return {code, "unsupported", "the requested operation is not implemented",
56 "switch to a declared-supported path instead of retrying the same request"};
58 return {code, "bytecode_version_mismatch",
59 "the compiled ST bytecode version does not match the runtime",
60 "recompile the ST program with the current toolchain or upgrade the runtime "
61 "together with the artifact"};
62 }
63 return {code, "unknown_error", "unknown error code",
64 "upgrade the producer/consumer pair or inspect the raw error value before retrying"};
65}
66
67} // namespace plcopen::core::rt
constexpr ErrorDiagnostic diagnose(ErrorCode code)