NX Parse Error in Machine Simulation

2023-07-11T13:17:46Z
NX for Manufacturing

Summary


Details

A parse error can occur in 'Machine Code Based' or 'External Program' simulation when using particular text or commands in the NC program. This can be because the common simulation engine (CSE) does not recognise the commands. 

In this example, the sim05 sample machine with Okuma controller is used. The command being attempted is "ATAN2".

Figure 1 - sim05 Sample Machine

The command was written into an 'Insert/Instruction' user defined event (UDE) in the 'ROUGHING' Program Group and appears at the start of the program. 

Figure 2 - Insert UDE

Entering 'Machine Code Based Simulation' displays the command at the start of the NC Program.

Figure 3 - NC Program

Play the simulation and find that the command "ATAN2" is not recognised which results in a parse error being displayed.

Figure 4 - Parse Error

Solution

A solution can be achieved by making modifications to the CseOKUMA_Lex.py which is found in MACH\auxiliary\cse. 

Figure 5 - CseOKUMA_Lex.py 

A new token needs to be added to the file. "ATAN2" must be defined as a token. 

Figure 6 - Declare the token

The token now needs a function defining within the file. 

Figure 7 - Function Definition

The simulation will now run without the parse error. 

Notes

The MACH\auxiliary\cse folder location contains controller specific files. This example used the Okuma controller files but the solution will also work for other controller files within this folder. 

CseOKUMA_Lex.zip (1.5 KB)

KB Article ID# PL8683155

Contents

SummaryDetails

Associated Components

Manufacturing General