Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Buhler GCPro Macro LanguageNew to Visual Studio Code? Get it now.
Buhler GCPro Macro Language

Buhler GCPro Macro Language

Bühler AG

|
422 installs
| (0) | Free
Syntax of Buhler GCPro Macros
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

GCPro Macro Language README

Buhler GCPro is a tool that helps engineers to program PLC with ease and embedded know-how.

GCPro functionalities can be extended by using Macros (gcmac files) which are use during compilation to achieve the expected result.

This Extension is used to help users with the macro syntax and provide a better view of the macro file.

Features

The instructions are tokenized and highlighted as it should be described on GCPro Developer Manual (normally under C:\Program Files (x86)\Gcpro\GCPRO-NET-Developer_MAN_1A_en.pdf).

Diagnostics

The extension also check some typo mistakes such as unclosed or not opened angular quotes, duplicated declaration and warn the user if there is any Breakpoints left on the opened files:

  • Breakpoints:

    breakpoints

  • Declarations:

    Duplicated declarations

Structures check are also made to check missing statement parts:

Structure check

Snippets

  • sub: Create Sub structure with comment out of the title.

    sub Snippet

!!! note "CamelCase and Underscores are replaced by space on description after tab"

  • function: Create function structure
  • if: Create If structure
  • ifelse: Create If Else structure
  • ifelseif: Create If ElseIf structure
  • looptree: Create LOOPTREE structure
  • looptype: Create LOOPTYPE structure
  • loopobj: Create LOOPOBJ structure
  • loops7block: Create LOOPS7BLOCK structure
  • loops7tag: Create LOOPS7TAG structure
  • loopconnectors: Create LOOPCONNECTORS structure
  • with: Create With structure
  • while: Create While structure
  • for: Create For structure
  • foreach: Create ForEach structure

Commands

Commands can be found with a right click on a context of a *.gcmac file or *.scl

  • Surround with Angular Quotes (shortcut: ctrl+shift+g ctrl+shift+a): Add angular quotes to the selected text.

    surround-angular-quotes.gif

!!! important "Important: If there is any at sign (@) inside the selection, it will be removed."

  • Format SCL Code Indentation (shortcut: ctrl+shift+g ctrl+shift+f): Format the correct indentation for all output line that starts with a tab, skipping the other lines.

    format-scl

  • Beta Convert to SCL (shortcut: ctrl+shift+g ctrl+shift+c): Try to convert the selected text from AWL to SCL.

    convert-to-scl-gif

!!! important "Important: Convert to SCL It is a Beta command, that means you always have to double check the converted text. It also only handle the output string, so you may have to arrange the lines to select only output strings."

Formatting

Format gcmac files with the following rules:

  • Indentation of code
  • Remove trailing space from brackets
  • Add space before and after assignment

Hierarchy

gcmac-grammar-relation

Requirements

You need GCPro to run the macros and to debug it you need GCPro Development version.

Additional Visual Studio Code configuration

  • The language is better readable when using either the theme Dark+ or the Light+ Type Ctrl+K and Ctrl+T to open the theme selection and chose the one better suits you (Dark+ or Light+).

    Theme Selection

Contribute

Everyone is really welcome to contribute to the GCPro Macro Language. Only Buhler employers have access to the repository. If you add a feature or solve a bug, please create another branch, add a work item for it and make a Pull Request so we can approve it to merge to master branch and release it to the Marketplace.

Software Requirements

  • Git
  • Node JS
  • Visual Studio Code

Extension Dependencies

  • Code Spell Checker - Increase the code quality helping on typo mistakes.

Process

  1. Install globally the VSCE package: npm install --global vsce
  2. Install all required packages: npm install
  3. Build and watch to debug: npm run watch
  4. Now you are able to run the debugger instance going to the debugger tab of Visual Studio and running the "Run Extension" task.

run-extension.png

Release new version

  • Need to be member of Buhler AG publisher
  • For minor version, just type npm run vsce-publish
  • For major version, change it on package.json and run vsce publish

Pre-release

  • If one feature is needed for testing it is possible to publish a pre release version typing: vsce publish --pre-release

Known Issues

  • Refer to the MacroLanguageTest.gcmac file between the TODO session.
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft