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".
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.
Entering 'Machine Code Based Simulation' displays the command at the start of the NC Program.
Play the simulation and find that the command "ATAN2" is not recognised which results in a parse error being displayed.
A solution can be achieved by making modifications to the CseOKUMA_Lex.py which is found in MACH\auxiliary\cse.
A new token needs to be added to the file. "ATAN2" must be defined as a token.
The token now needs a function defining within the file.
The simulation will now run without the parse error.
NotesThe 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)