# Description

## Operation

The syntax check is run via the operating mode interface according to real program execution. The following can be evaluated:

- START, STOP, CONTINUE and RESET commands
- ERROR and HOLD display states

## Display

In real program execution, the file position (filename and file offset, mc_active_file_offset_r and mc_active_file_name_r) is displayed synchronously with the real axis motion. It no longer has any timing reference to program decoding.

When the syntax check is active, the file position is automatically displayed synchronously to decoding.

Therefore, the operator need not consider any distinction to display the file.

The table below shows the various error scenarios and the possible error responses in syntax check mode:

Error type | Error category | Error response
Response to resource errors | e.g. stack overflow | Discard the NC line
Response to syntax error | Errors in $ and # commands | Discard the NC line
Unexpected character/term after $ and # commands | Use of information pertaining to the current NC line
Unexpected/invalid characters/terms | Use of information pertaining to the current NC line
Response to semantic errors | Left-handed error in an allocation | Reposition after allocation
| Select NC commands that are not permitted simultaneously | Continued decoding without repositioning
Overshoot/undershoot a limit | Continued decoding without repositioning
Programmed value impractical | Continued decoding without repositioning
Incomplete information | Continued decoding without repositioning

## Programing Example

NC program with syntax errors

The example below contains various syntax errors which can be used for continued decoding. The program can be processed in the syntax check and individual errors are signalled.

;Test syntax check of decoder)

%check_syntax

;⇨ overflow error

N40 G01 X10 F111111111111111

(⇨ syntax error

N50 #COMMAND UNKNOWN [...]

(⇨ syntax error

N60 V.E.not_present = 1

(⇨ syntax error

N70 #CALL AX [X2, 11, 0]

(-> semantic error

N80 G00 G01 X100 F1000

N130 M30

## Stop single step mode/decoding

- If configured accordingly (P-CHAN-00028) acts during the
  syntax check, single-step mode acts at decoder level.
- The program stops at the end of every NC line and this is indicated by the HOLD mode state.
- Decoding continues by one NC line when the START transition is commanded to the active mode. In this way, individual NC commands (parameter allocations, branches, loops, etc.) can be decoded to ensure that the program sequence can be viewed during decoding.
- The STOP / RESUME command also acts at the decoder level in the same way as the single step mode.
- In other words, decoding is interrupted by commanding the stop transition to the active mode.
- Decoding can be resumed with the RESUME command.

## Automatic mode

- If configured accordingly (P-CHAN-00028) acts during the syntax check of theautomatic mode.
- The NC program runs without stopping.
- Errors detected are displayed.

## Syntax check without drives (MACHINE_LOCK)

- The syntax check must always be selected in combination with MACHINE_LOCK. The following properties apply here:
- The NC program is decoded as normal.
- To ensure that the syntax check runs faster, axes and drives are not moved (dry run). Interpolation is limited to the output of the target points of the motion blocks.
- Technology information, spindle commands or waiting times are not executed.
- Certain real-time influences such as feedhold, override or axis-specific feed enables are not considered.
- If MACHINE_LOCK is not set, the message P-ERR-21309 is output. In this case MACHINE_LOCK is set implicitly and syntax check is started.

Syntax check without drives