Skip to content

What do you think about Visual Studio Marketplace? We are looking for feedback from developers like you! Take the survey

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

Buhler GCPro Macro Language

Bühler AG

|
65 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).

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

breakpoints

Snippets

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

    sub Snippet

    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

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

    surround-angular-quotes.gif

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: 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.

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 workitem for it and make a Pull Request so we can approve it to merge to master branch and release it to the Market place.

Software Requirements

  • Git
  • Node JS
  • Visual Studio Code

Process

  1. Install globally the VSCE package: npm install --global vsce
  2. Install all required packages: npm install
  3. Build the package: npm run vsce-package
  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

Known Issues

None at the moment.

  • Contact us
  • Jobs
  • Privacy
  • Terms of use
  • Trademarks
© 2023 Microsoft