You are on page 1of 14

the MILLTURN Edge

Visual Studio Code Post-Processor Debugger

SolidCAM Reference Guide


Post-Processor Debugger
iMachining 2D & 3D | 2.5D Milling | HSS | HSM | Indexial Multi-Sided | Simultaneous 5-Axis | Turning & Mill-Turn | Solid Probe

SolidCAM + SOLIDWORKS
The Complete Integrated Manufacturing Solution
About this document
This documentation is designed to provide you with an overview of how to setup
SolidCAM Post-Processor debugger in Microsoft Visual Studio Code. There will be
also explanations on how to use specific features and improve the debugging of
post-processors code.

Using the Adobe Reader


It is highly recommended to use Adobe Reader when viewing the PDF version of this
booklet. If you do not already have Adobe Reader, it is a free PDF viewer that can be
downloaded from Adobe’s website via this link – https://get.adobe.com/reader/.
By default, Adobe Reader allows the launching of external files and connecting
to URLs, which is required for the interactive features to function properly. If you
prefer using a different PDF viewer, it is important to make sure that your preferred
Reader allows the executing of external commands.
To see many more Professor videos that cover all the features and uses of SolidCAM,
visit our website at www.solidcam.com/professor.

ii
SolidCAM + SOLIDWORKS = The Complete Integrated Manufacturing Solution
The Leaders in Integrated CAM

Table of Contents
Visual Studio Code Overview . . . . . . . . . . . . . . . . . . . . . . 1
Installation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
GPP Editor Toolkit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
GPP Language extension. . . . . . . . . . . . . . . . . . . . . . . . . . 9

iii
www.solidcam.com
Visual Studio Code Overview

SolidCAM Post-Processor Debugger solution

Visual Studio Code (VS Code) is a lightweight but powerful free code editor with
support for development operations like debugging, version control and have
open-source API for various extensions (Plug-In) development of various tools.

SolidCAM Debugger consists of Visual Studio Code as a code editor and three
extensions within it:
• GPP Debugger (SolidCAM Extension for Debugger)
• GPP Editor Toolkit (Includes the Function list and editor tools for GPP language)
• GPP Language (Syntax highlighting for GPP files)

1
SolidCAM + SOLIDWORKS = The Complete Integrated Manufacturing Solution
Installation
The Leaders in Integrated CAM

This section will go over the VS Code and


extensions installation
1. Download and install Microsoft Visual Studio Code:
https://code.visualstudio.com/docs/?dv=win

2. Download SolidCAM latest extensions:


https://solidcam.box.com/s/l8vex20fzh7fu8eomvzgmxhvx80dmiri

3. Open VS Code, navigate to extension list and install downloaded extensions from
VSIX.

4. Restart VS Code. The extension list should look like the image below.

2
www.solidcam.com
Debugging

Getting Started

One of the key features of VS Code is its great debugging support. VS Code’s built-in
debugger helps accelerate your edit and debug loop of Post-Processors.
Debuggers can run in different modes and configurations, therefore the settings
for its behavior must be defined before using it. VS Code keeps debugging
configuration information in a launch.json file located in a .vscode folder in your
workspace (project root folder) or in your user settings or workspace settings.
1. To create a launch.json file, open your project folder in VS Code (File > Open
Folder). The folder can be located in your Post-Processor working directory or
anywhere else on your PC.

2. Select the Configure gear icon on the Debug view top bar.

3
SolidCAM + SOLIDWORKS = The Complete Integrated Manufacturing Solution
The Leaders in Integrated CAM

Here is the launch configuration launch.json file inside .vscide folder generated for
debugging.

3. Start SolidCAM and before G-code generation press a green triangle or F5 button
in VC Code. As soon as a debugging session starts, the DEBUG CONSOLE panel is
displayed and shows debugging output, and the Status Bar changes color (orange
for default color themes).

Debug actions
Once a debug session starts, the Debug toolbar will appear on the top of the
editor. The debug process is controlled through it.

4
www.solidcam.com
• Continue / Pause F5 (Run the G-code process until the breakpoint)
• Step Over F10 (Single-step mode with ignoring the call procedures)
• Step Into F11 (Single-step mode)
• Step Out Shift+F11 (going out of the calling procedure)
• Restart Ctrl+Shift+F5 (restart the Debugger)
• Stop Shift+F5 (stop the Debugger)

Breakpoints
Breakpoints can be toggled by clicking on the editor margin or using F9 on the
current line. Finer breakpoint control can be done in the Debug view’s BREAKPOINTS
section.

A powerful VS Code debugging feature is the ability to set conditional breakpoints


based on expressions. The breakpoint will be hit whenever the expression evaluates
to true.

5
SolidCAM + SOLIDWORKS = The Complete Integrated Manufacturing Solution
The Leaders in Integrated CAM

There is also a possibility to define function breakpoint, which will be hit whenever
it matches the text search expression.

Note: The hit will happen only after the text matching.

Data inspection
Variables can be inspected in the VARIABLES section of the Debug view or by
hovering over their source in the editor. Variable values can be modified with
the Set Value action from the variable’s context menu. There are three groups of
variables filtered in each debugging procedure: Local user; Global user; Global
system.

6
www.solidcam.com
Variables can also be evaluated and watched in the Debug view’s WATCH section.
by doing a right-click in the WATCH section or right-click on the variable itself.

Procedure nesting can be analyzed in the Debug view’s CALL STACK section.

Note: In the CALL STACK section you may jump from one procedure to another and
analyze variables value changes in VARIABLES and WATCH sections.

7
SolidCAM + SOLIDWORKS = The Complete Integrated Manufacturing Solution
GPP Editor Toolkit
The Leaders in Integrated CAM

Navigate and format code faster


GPP Editor Toolkit extension includes features for faster navigation through code
and its formating. Ones installed it will include the Procedure list (icon on the
sidebar) and format options in the right-click pop-up menu for the selected text.

Procedure List allows you to jump to the selected procedure. Procedures can be
grouped by using ;#region region_name and ;#endregion in the .GPP code.

Selecting the variable or procedure, Go to Definition will jump to its position


where they were declared.
Convert to Output Block/Line will convert selected text to blocks of code for hard-
coded string output.

Format Document fix indentation of selected text according to the convention of


Post-Processor writing.

8
www.solidcam.com
GPP Language extension

Customize GPP Syntax Highlighting

To customize syntax highlighting, the GPP Language extension is used.


Customization can be done on pre-defined scopes that are defined in settings.json
file in Preferences Settings. A list of pre-defined scopes can be found in the details
of the extension itself.

You can download pre-defined settings.json file from from the link and customize
if necessary:
https://solidcam.box.com/s/l8vex20fzh7fu8eomvzgmxhvx80dmiri

Note: If any of the given links don’t work please don’t hesitate to contact SolidCAM
Support Team.
9
SolidCAM + SOLIDWORKS = The Complete Integrated Manufacturing Solution
The Leaders in Integrated CAM

10
www.solidcam.com
SolidCAM Reference Guide
Post-Processor Debugger
the MILLTURN Edge

iMachining 2D 2.5D Milling HSS (High-Speed Surface Machining)

iMachining 3D Indexial Multi-Sided Machining HSM (High-Speed Machining)

Sim. 5-Axis Machining Turning & Advanced Mill-Turn Solid Probe

youtube.com/SolidCAMProfessor facebook.com/SolidCAM solidcam.com/successes/imachining-successes


youtube.com/SolidCAMiMachining facebook.com/iMachining

www.solidcam.com

You might also like