User-defined error output

The NC command #ERROR allows the 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

Meaning

1...1000

The numerical value determines the customer-specific error number to be output.

RC<expr>

Error class

Valid values

Meaning

 

0

Warning:

No transition to error state. Program execution is continued.

 

2

Error:

Transition to error state. Can be cleared with NC–RESET.

 

7

Fatal error:

Transition to ‘system error’ state. Requires restart of controller-

MID<expr>

Multiple ID. Counter acts 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) specify the significance of the PV parameters more precisely.

Valid values

Meaning

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 number

9

State

10

Transition

11

Sender

12

Class

13

Instance

14

Identification number

15

Status

16

Ring number

17

Block number

18

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) transfer additional information in real format.

For non-programmed parameters, the following default values are valid:

ID

1

RC

0

MID

0

PV1...PV5

0.0

PM1…PM5

1

PIV1...PIV4

0.0

Programing Example

prg_example

User-defined error output

:

#ERROR [ID100 RC0 MID10]

;Warning 100, multiple id 10

:

#ERROR [ID455 RC2 PV1=5 PV2=4.999 PM1=2 PM2=3]

;Error 455 with

;parameters

:

#ERROR [ID455 RC2 MID2 PV1 5 PV2 4.999 PM1 2 PM2 3]

;Error 455

;Multiple id 2

;with parameters

:

#ERROR [ID999 RC7]

;Fatal error 999

: