User-defined error output
The NC-command #ERROR allows output of user-defined error messages, which are further-processed by the higher-level operating system (GUI). Additional parameters offer the option of specifying the error more precisely.
#ERROR [ [ [ID<expr>] [RC<expr>] [MID<expr>] {PV<i><expr>} {PM<i><expr>} {PIV<i><expr>} ] ] (non-modal)
ID<expr> Error number:
Valid values | Significance |
---|---|
1...1000 | The numerical value determines the customer-specific error number to be output. |
RC<expr> Error (response) class:
Valid values | Significance |
0 | Warning: No transition to error state. Program execution is continued. Corresponds to error class ERR_KLASSE_1 of the NC-kernel. |
2 | Serious error: Transition to error state. Can be cleared only with NCRESET. Corresponds to error class ERR_KLASSE_3 of the NC-kernel. |
7 | Fatal user error: Transition to error state. Can be cleared with NCRESET. Corresponds to error class ERR_KLASSE_8 of the NC-kernel. |
MID<expr> Multiple ID. Counter serves as a distinguishing feature if the #ERROR command with the same error number (ID) is used several times in an NC-program. Positive integer.
PV<i><expr> Max. 5 (1 <= i <= 5) customer-specific numerical values (PV1...PV5) in real format can also be output in the error message.
PM<i><expr> The maximum 5 (1 <= i <= 5) PM parameters (PM1...PM5) serve to specifie the significance of the PV parameters more precisely.
Valid values | Significance |
---|---|
0 | IGNORE, value has no significance |
1 | Limit value |
2 | Current value |
3 | Error value |
4 | Expected value |
5 | Corrected value |
6 | Logical axis number |
7 | Drive type |
8 | Logical control element |
9 | State (situation) |
10 | Transition |
11 | Sender |
12 | Class |
13 | Instance |
14 | Identification number |
15 | Status |
16 | Ring number |
17 | Block number |
17 | Lower limit value |
19 | Upper limit value |
20 | Initial value |
21 | Final value |
PIV<i><expr> The maximum 4 (1 <= i <= 4) PIV parameters (PIV1...PIV4) serve to transfer additional information in real format.
For not programmed parameters following default values are valid:
ID | 1 |
---|---|
RC | 0 |
MID | 0 |
PV1...PV5 | 0.0 |
PM1 PM5 | 1 |
PIV1...PIV4 | 0.0 |
Programming example
:
#ERROR Customer specific default(-standard-)error message (Warning).
:
#ERROR [ID455 RC2 PV1=5 PV2=4.999 PM1=2 PM2=3] Fatal error 455 with
additional parameters.
:
#ERROR [ID455 RC2 MID2 PV1 5 PV2 4.999 PM1 2 PM2 3] Fatal error 455 (Multiple-identification 2)
(with additional parameters)
:
#ERROR [ID100 RC0 MID10] Warning 100 (Multiple identification 10)
:
#ERROR [ID999 RC7] System error 999
: