Syntax check (C9)

1.1 IntroductionPAGEREF _Toc303346279 \h2

1.2 Description 3

1.3 Parameters 3

1.3.1 Overview 3

1.3.2 Description of channel parameters 3

1.4 Interface connection 3

1.4.1 Selection via HMI interface 3

1.4.2 Commands and display via PLC interface 3

More:

button Introduction

button Description

button Parameters

button Interface connection


Introduction

Task

For testing of NC programs, it is often helpful to have the syntax checked by advance decoding without moving axes.

Characteristics

Detected syntax errors of the NC program are displayed and logged and are available to the user for subsequent correction of the program.

NC program decoding is not aborted in the event of a syntax error and, instead, an attempt is made to continue operating with the next NC line.

Axes/drives are not moved during the syntax check.

The interface to the PLC is evaluated or updated only at the decoder level. For example, no synchronisation of M/H functions takes place.

After a syntax error message, defined restarting is possible with wide-ranging avoidance of follow-up errors.

For decoding, the technological commands used in the program (M, H and T functions) must be specified accordingly in the channel parameter list.

Response to resource errors

Stack overflow

The NC line is discarded

Response to syntax errors | Errors within $ and # commands | The NC line is discarded
 | 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 | Repositioning to after allocation
 | Selection of NC commands that are not simultaneously permissible | Continued decoding without repositioning
 | Exceeding/falling short of a limit | Continued decoding without repositioning
 | Programmed value does not make sense | Continued decoding without repositioning
 | Incomplete information | Continued decoding without repositioning


Description

Operation

Operation during the syntax check takes place according to real program execution via the mode interface. That is to say,

q START, STOP, CONTINUE and RESET commands

q ERROR and HOLD display states

can be evaluated.

Display

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

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

Therefore, for display of the file, operation does not have to take any distinction into account.

Programming examples

NC program with syntax errors

The following example contains various syntax errors which permit continued decoding. The program can be run in the syntax check and individual errors are indicated.

( Test syntax check of decoder)

%check_syntax

(-> domain error

N40 G01 X10 F11111111111111111111111111

(-> error

N50 command_unknown

(-> error

N60 V.E.not_present = 1

(-> error

N70 #CALL AX [X2, 11, 0]

(-> semantic error

N80 G00 G01 X100 F1000

N130 M30

Single step/interrupting decoding

During the syntax check, the single step mode automatically takes effect at the decoding level. After every NC line, the program stops, which is indicated by the HOLD mode state. Decoding continues by one NC line when the START transition is commanded to the active mode. Thus, decoding of the NC commands (parameter allocations, branches, loops, etc.) can be executed singly, thus ensuring that the program sequence can be viewed during decoding.

Corresponding to the single step mode, the STOP/RESUME command is also active at the decoder level. That is to say, decoding is interrupted by commanding the STOP transition to the active mode. Decoding can be resumed by means of the RESUME command.


Parameters

Parameter definition

By means of a setting in the channel parameter list [CHAN], the operator can either skip invalid commands in the NC program in steps and can continue decoding interactively, or can check the syntax in one go (without further operator actions).

Reported errors can be logged so that the operator can revise the NC program with reference to the error log, if necessary making it executable.

The settings for program execution in the syntax check are selected before program execution. Changes to the settings are not adopted during the syntax check, i.e. they do not take effect until the program has been started again.

More:

button Overview

button Description of channel parameters


Overview

ID | Parameter | Description
P-CHAN-00019 | fehler_gesamt | Total number of permissible errors
P-CHAN-00020 | fehler_pro_zeile | Errors per line
P-CHAN-00028 | interaktiv | Operating mode


Description of channel parameters

P-CHAN-00019 | Total number of errors
Parameter | syn_chk.fehler_gesamt
Description | This parameter is used to define as from which number of errors decoding of the NC program is aborted. This limit is effective only during the automatic syntax check, i.e. without user actions.
Data type | UNS16
Data range | 0 ≤ P-CHAN-00019 ≤ MAX_UNS16
Default | 20
Remarks | -

P-CHAN-00020 | Errors in each line
Parameter | syn_chk.fehler_pro_zeile
Description | Use P-CHAN-00020 to define as from which number of errors the syntax check jumps to the next program line.
Data type | UNS16
Data range | 0 ≤ P-CHAN-00020 ≤ MAX_UNS16
Default | 2
Remarks | -

P-CHAN-00028

Operating mode

Parameter

syn_chk.interaktiv

Description

0 - Automatic mode

Decoding is continued automatically after an error. The syntax check is aborted only if the set total number of errors (P-CHAN-00019) is reached.

1 - (Interactive) operation

Decoding is stopped after every error. The operator can decide whether the syntax check is to be continued or whether decoding is to be aborted. Decoding is aborted automatically if the set permissible total number of errors (P-CHAN-00019) is reached.

Data type

BOOLEAN

Data range

0 ≤ P-CHAN-00028 ≤ 1

Default

1

Remarks

-


Interface connection

More:

button Selection via HMI interface

button Commands and display via PLC interface


Selection via HMI interface

The operator sets the syntax check as an operating mode before starting the program. This setting is forwarded via a so-called control unit to the PLC, which can permit or refuse it. Thus, the PLC also has a possibility of selecting the syntax check itself without a previous HMI request.

Parameter | Description
mc_command_execution_mode_r, mc_command_execution_mode_w | Selection of the syntax check
mc_active_file_offset_r, mc_active_file_name_r | Display of the current file position during the syntax check at the decoder level
mc_command_single_block_w | By means of this parameter, the decoder single step mode can be selected in the syntax check.

Syntax check via HMI
Description | A user interface can select the syntax check via this interface.
Type | 32-bit
Value range | 0x0000 ISG_STANDARD Normal operation 0x0008 SYNCHK Syntax check simulation
HMI elements | mc_command_execution_mode_r, mc_command_execution_mode_w
Access | Read, write
Index offsetADS | 0x40, 0x3f (IndexGroupADS = 0x000201<ii> where <ii> = channel)


Commands and display via PLC interface

Commands

Channel mode
Description | Selection of a special channel mode such as syntax check or production time calculation
Data type | MCControlSGN32Unit, see description Control Unit
Peculiarities | -
Access | PLC reads Request + State and writes Command + Enable
ST path | pMC[channel_idx]^.addr^.MCControlDecoder_Data.MCControlSGN32Unit_ExecutionMode
Commanded, requested and return values
ST element | .D_Command .D_Request . D_State
Data type | DINT
Value range | 0x0000 ISG_STANDARD Normal operation 0x0008 SYNCHK Syntax check simulation Remark: The following settings are being prepared: 0x0002 SOLLKON Simulation of nominal contour visualisation 0x0004 ON_LINE Simulation of online visualisation 0x0010 PROD_TIME Simulation of production time calculation 0x0020 ONLINE_PROD_TIME Simulation of online production time calculation 0x0040 MACHINE_LOCK Dry run without axis movement 0x0080 TECHNO_FILTER Dry run TECHNO filter 0x0100 KIN_TRAFO_OFF Overwrites automatic enabling for kinematic transformations by a characteristic quantity defined in the channel parameters (sda_mds*.lis).
Diversion
ST element | . X_Enable

Display

Parameter | Description
X_SyntaxCheck | Display: syntax check active
X_WaitAfterError | Display: decoder waiting for enabling to continue
X_SyntaxCheckWaitContinueCleared | Display: decoder waiting for cancellation of enabling to continue

Syntax check active
Description | Decoder is currently in the syntax check
Signal flow | CNC → PLC
ST path | pMC[channel_idx]^.addr^.StateDecoder_Data.X_SyntaxCheck
Data type | BOOL
Value range | [TRUE = decoder operating in the syntax check, FALSE]
Access | PLC reads
Peculiarities | -

Error has occurred during syntax check  waiting for external input
Description | In the syntax check mode, the decoder waits after an error for an external input (continue, abort)
Signal flow | CNC → PLC
ST path | pMC[channel_idx]^.addr^.StateDecoder_Data.X_WaitAfterError
Data type | BOOL
Value range | [TRUE = error has occurred in the syntax check  decoder waits, FALSE]
Access | PLC reads
Peculiarities | -

Syntax check active
Description | Decoder is currently operating in the syntax check and, after an error and enabling, waits until enabling is cancelled again.
Signal flow | CNC → PLC
ST path | pMC[channel_idx]^.addr^.StateDecoder_Data.X_SyntaxCheckReleaseNextBlockCleared
Data type | BOOL
Value range | [TRUE = Decoder waits for deletion of enabling, FALSE]
Access | PLC reads
Peculiarities | -

Figure 1-1: Implicit handshake during interactive syntax check between decoder and Mcm/PLC

Decoding interrupted
Description | Decoding has been interrupted and waits for enabling to continue.
Signal flow | CNC → PLC
ST path | pMC[channel_idx]^.addr^.StateDecoder_Data.X_WaitContinue
Data type | BOOL
Value range | [TRUE = decoder interrupted, FALSE]
Access | PLC reads
Peculiarities | -

Decoding interrupted
Description | Decoding has been interrupted and the decoder waits until enabling is cancelled again before resuming.
Signal flow | CNC → PLC
ST path | pMC[channel_idx]^.addr^.StateDecoder_Data.X_WaitReleaseNextBlockCleared
Data type | BOOL
Value range | [TRUE = decoder waits, FALSE]
Access | PLC reads
Peculiarities | -